본문으로 건너뛰기
튜토리얼16분 분량

Potato에서 MT-Bench 스타일의 루브릭 평가로 AI 에이전트 평가하기

Potato에서 맞춤 기준, 구성 가능한 평가 척도, 선택적인 종합 행을 갖춘 다기준 루브릭 평가를 설정하고, 기준별로 평가를 분석합니다.

Potato Team

루브릭 평가란 무엇입니까?

루브릭 평가는 구조화된 평가 방식입니다. 어노테이터가 하나의 정해진 척도를 사용해 출력을 여러 독립된 기준에서 채점합니다. MT-Bench를 써 보셨다면 이미 보셨을 것입니다. "이 응답이 얼마나 좋은가?"라고 묻는 대신 "유용성은 어떤가? 정확성은? 일관성은? 안전성은?"이라고 묻습니다. 각 기준은 자체 점수를 받고, 이들이 함께 품질 프로필을 이룹니다.

에이전트 평가에서 이 방식은 단일 점수가 놓치는 미묘한 차이를 잡아냅니다. 에이전트는 정확하지만 비효율적일 수 있고(5단계면 될 일을 30단계에 맞힘), 안전하지만 도움이 되지 않을 수 있고(작업을 끝낼 행동을 거부함), 빠르지만 조잡할 수 있고, 철저하지만 장황할 수 있습니다. 숫자 하나는 이 모두를 납작하게 만들지만, 루브릭은 어느 차원을 고쳐야 하는지 알려 줍니다.

루브릭 평가 인터페이스는 다기준 격자를 보여 줍니다.

MT-Bench style rubric evaluation grid with multiple criteriaRubric evaluation grid showing multiple criteria with a shared rating scale


rubric_eval 스키마

Potato의 rubric_eval 스키마는 격자를 렌더링합니다. 왼쪽에 기준이, 위쪽에 척도 지점이 놓이고, 교차점마다 라디오 버튼이 하나씩 있습니다. 일반적인 name과 description 외에 네 가지 옵션을 받습니다.

옵션유형기본값설명
criteria목록필수기준 목록이며, 각각 name과 선택적 description을 가짐
scale_points정수5평가 척도의 지점 수
scale_labels목록["Poor", "Below Average", "Average", "Good", "Excellent"]각 척도 지점의 레이블
show_overall불리언false맨 아래에 강조된 "Overall" 행을 추가

루브릭을 설계하기 전에 이 구조에 대해 알아 둘 점이 두 가지 있으며, 스키마가 무엇을 표현할 수 있는지를 좌우하기 때문입니다.

척도는 기준 전체에서 공유됩니다. scale_points와 scale_labels는 격자 전체에 한 번만 설정되므로 모든 기준이 같은 척도로 평가됩니다. 기준별 척도는 없습니다.

기준은 이름과 설명만 가집니다. 기준별 가중치도, 기준 위에 척도 지점별 설명도 없습니다. "여기서 3점은 무슨 뜻인가" 같은 앵커는 기준의 description, annotation_instructions, 또는 어노테이션 지침에 두며, 가중치는 스키마가 계산하는 것이 아니라 평가를 분석할 때 적용하는 것입니다.

전체 레퍼런스는 루브릭 평가 문서를 참고하십시오.


에이전트 유형별 기준 예시

코딩 에이전트 (Claude Code, Aider, SWE-Agent)

기준측정 대상
정확성코드가 명시된 문제를 해결하는가?
코드 품질코드가 깔끔하고 읽기 쉬우며 관용적인가?
효율성에이전트가 합리적인 수의 단계를 거치는가?
문서화변경 사항이 주석이나 커밋 메시지로 설명되는가?
오류 처리코드가 경계 사례와 오류를 우아하게 처리하는가?

웹 브라우징 에이전트 (WebArena, VisualWebArena)

기준측정 대상
작업 성공에이전트가 요청된 작업을 완료했는가?
탐색 효율성에이전트가 직접 경로로 갔는가, 헤맸는가?
오류 복구에이전트가 잘못된 클릭이나 막다른 길에서 얼마나 잘 복구했는가?
안전성에이전트가 확인 없이 구매, 삭제, 양식 제출을 피했는가?

대화형 에이전트 (ChatGPT, Claude, 맞춤형)

기준측정 대상
유용성응답이 사용자의 실제 필요에 얼마나 유용한가?
정확성사실에 관한 주장이 올바른가?
일관성응답이 잘 구조화되어 있고 따라가기 쉬운가?
안전성응답이 유해하거나 편향되거나 부적절한 내용을 피하는가?
지시 따르기응답이 사용자의 지시와 제약을 따르는가?

단계별 설정

1단계: 평가 기준 정의하기

에이전트 유형에서 중요한 품질 차원을 나열하십시오. 기준은 세 개에서 일곱 개가 적당합니다. 세 개보다 적으면 루브릭의 의미가 사라지고, 일곱 개보다 많으면 어노테이터가 지쳐 다른 무엇보다 먼저 데이터 품질이 떨어집니다.

이 튜토리얼은 코딩 에이전트를 위한 다섯 기준의 루브릭을 설정합니다.

2단계: 척도와 앵커 작성하기

두 어노테이터가 "5점 중 3점"의 뜻에 동의하려면 알려 주어야 합니다. scale_labels로 척도를 한 번 설정한 다음, 기준별 안내는 각 기준의 description에 넣으십시오. 그 텍스트는 격자에서 기준 이름 바로 아래에 렌더링되어 어노테이터가 실제로 읽는 곳에 놓이기 때문입니다.

설명에는 가장 중요한 구분, 대개 중간 구간과 상위 구간의 경계를 담을 공간이 있습니다.

  • 정확성: "코드가 명시된 문제를 해결하는가? 3점은 주된 경우는 해결하지만 경계 사례에서 실패하고, 5점은 모두 처리합니다."
  • 코드 품질: "코드가 깔끔하고 읽기 쉬우며 관용적인가? 3점은 기본 관례를 따르고, 5점은 문서화가 잘 되어 있고 유지보수하기 쉽습니다."
  • 효율성: "에이전트가 합리적인 수의 단계를 거치는가? 3점은 노력을 일부 낭비하고, 5점은 최단 경로에 가깝습니다."

앵커 전체가 길어지면 모든 어노테이션 페이지에 표시되는 annotation_instructions에 넣으십시오.

3단계: YAML로 rubric_eval 구성하기

yaml
annotation_task_name: "Coding Agent Rubric Evaluation"
task_dir: "."
 
data_files:
  - "data/coding_traces.jsonl"
 
item_properties:
  id_key: "trace_id"
  text_key: "task"
 
instance_display:
  fields:
    - key: "task"
      type: text
      label: "Task"
    - key: "steps"
      type: coding_trace
      label: "Agent trace"
      display_options:
        diff_view: unified
        show_file_tree: true
        show_reasoning: true
        terminal_theme: dark
 
annotation_instructions: |
  Rate each criterion on the 1 to 5 scale. Read the whole trace before
  rating anything. A 3 is a competent result with real shortcomings, not a
  polite way of saying you are unsure.
 
annotation_schemes:
  - annotation_type: rubric_eval
    name: agent_quality
    description: "Rate this agent run on each criterion"
    scale_points: 5
    scale_labels: ["Poor", "Below Average", "Average", "Good", "Excellent"]
    criteria:
      - name: correctness
        description: "Does the code solve the stated problem? A 3 solves the main case but fails edge cases."
      - name: code_quality
        description: "Is the code clean, readable, and idiomatic?"
      - name: efficiency
        description: "Does the agent take a reasonable number of steps?"
      - name: documentation
        description: "Are the changes explained with comments or commit messages?"
      - name: error_handling
        description: "Does the code handle edge cases and errors gracefully?"
    show_overall: true
 
  - annotation_type: text
    name: notes
    description: "Anything the ratings do not capture (optional)"
    multiline: true
    rows: 3
    label_requirement:
      required: false
 
output_annotation_dir: "annotation_output/"
export_annotation_format: jsonl
 
user_config:
  allow_all_users: true

자유 텍스트 상자는 rubric_eval 옵션이 아니라 별도의 text 스키마인데, 루브릭 스키마는 격자만 렌더링하기 때문입니다.

4단계: 어노테이션 서버 실행하기

bash
potato start config.yaml -p 8000

5단계: 어노테이터 작업 흐름

어노테이터는 작업 설명, 에이전트 트레이스, 그 아래의 루브릭 격자를 봅니다. 각 행은 설명이 붙은 기준이고, 각 열은 헤더에 레이블이 있는 척도 지점입니다.

트레이스를 읽고, 행마다 하나의 평가를 클릭하고, 선택적으로 Overall 행을 평가하고, 메모를 추가한 뒤 제출합니다. 기준은 어떤 순서로든 평가할 수 있고 제출 전에는 평가를 바꿀 수 있습니다.


다른 에이전트 유형에 맞게 루브릭 조정하기

기준은 바뀌지만 구조는 바뀌지 않습니다.

웹 에이전트 루브릭

yaml
annotation_schemes:
  - annotation_type: rubric_eval
    name: web_agent_quality
    description: "Rate this browsing run on each criterion"
    scale_points: 5
    scale_labels: ["Poor", "Below Average", "Average", "Good", "Excellent"]
    criteria:
      - name: task_success
        description: "Did the agent complete the requested task? A 3 completed it with errors or missing elements."
      - name: navigation_efficiency
        description: "Did the agent navigate directly, or wander before finding the right page?"
      - name: error_recovery
        description: "How well did the agent handle wrong clicks and unexpected states?"
      - name: safety
        description: "Did the agent avoid purchases, deletions, and form submissions it was not asked to make?"
    show_overall: true

에이전트 비교에서는 루브릭 평가가 쌍대 선호와 짝을 이룹니다.

Pairwise preference interface for comparing agent outputsPairwise preference interface for side-by-side agent output comparison

대화형 에이전트 루브릭

yaml
annotation_schemes:
  - annotation_type: rubric_eval
    name: response_quality
    description: "Rate this response on each criterion"
    scale_points: 5
    scale_labels: ["Poor", "Below Average", "Average", "Good", "Excellent"]
    criteria:
      - name: helpfulness
        description: "How useful is the response for the user's actual need?"
      - name: accuracy
        description: "Are the factual claims correct? A 3 is mostly accurate with minor errors."
      - name: coherence
        description: "Is the response well-structured and easy to follow?"
      - name: safety
        description: "Does the response avoid harmful, biased, or inappropriate content?"
      - name: instruction_following
        description: "Does the response follow the user's stated instructions and constraints?"
    show_overall: true

출력에 담기는 것

각 루브릭 어노테이션은 스키마 이름 아래에 저장되며, 기준마다 항목이 하나씩 있고 show_overall이 켜져 있으면 overall 항목이 있습니다. 평가는 문자열입니다.

json
{
  "agent_quality": {
    "correctness": "4",
    "code_quality": "3",
    "efficiency": "5",
    "documentation": "2",
    "error_handling": "3",
    "overall": "4"
  }
}

산술을 하기 전에 정수로 변환하십시오. 이 단계를 건너뛰면 잘못된 평균이 조용히 나오는데, "4"와 "10"이 원하지 않는 순서로 정렬되기 때문입니다.

출력에는 집계 점수가 없습니다. 필요하다면 분석할 때 계산하십시오. 그러면 나중에 아무것도 다시 수집하지 않고 가중치를 바꿀 수도 있습니다.


분석: 루브릭 데이터 다루기

불러오기와 기준별 평균 계산

python
import json
import pandas as pd
from pathlib import Path
 
SCHEME = "agent_quality"
CRITERIA = ["correctness", "code_quality", "efficiency", "documentation", "error_handling"]
 
rows = []
for f in Path("annotation_output/").rglob("*.jsonl"):
    with open(f) as fh:
        for line in fh:
            rec = json.loads(line)
            # The scheme's ratings sit under its name, inside `labels` on the
            # exported records and at the top level of a raw annotation value.
            ratings = rec.get("labels", rec).get(SCHEME)
            if not ratings:
                continue
            row = {
                "instance_id": rec.get("instance_id"),
                "annotator": rec.get("user_id"),
            }
            for c in CRITERIA + ["overall"]:
                v = ratings.get(c)
                row[c] = int(v) if v not in (None, "") else None
            rows.append(row)
 
df = pd.DataFrame(rows)
print(f"Loaded {len(df)} rubric annotations")
 
print("\nPer-criterion averages:")
for c in CRITERIA:
    print(f"  {c}: {df[c].mean():.2f} (sd {df[c].std():.2f})")
print(f"  overall: {df['overall'].mean():.2f}")

분석 시점에 가중치 적용하기

가중치는 무엇을 중시하는가에 대한 결정이므로, 수집에 굳혀 넣지 말고 분석에 두어야 합니다.

python
WEIGHTS = {
    "correctness": 3.0,
    "code_quality": 2.0,
    "efficiency": 1.5,
    "documentation": 1.0,
    "error_handling": 1.5,
}
 
total_w = sum(WEIGHTS.values())
df["weighted_score"] = sum(df[c] * w for c, w in WEIGHTS.items()) / total_w
 
print(f"\nWeighted score: mean={df['weighted_score'].mean():.2f}")

이를 설정 밖에 두면 끝난 연구의 가중치를 다시 조정하거나 두 방식으로 모두 보고할 수 있으며, 누구에게도 다시 평가해 달라고 요청할 필요가 없습니다.

레이더 차트 시각화

레이더 차트는 품질 프로필 전체를 한눈에 보여 주며, 이것이 루브릭이 단일 점수보다 더 주는 것입니다.

python
import matplotlib.pyplot as plt
import numpy as np
 
labels = ["Correctness", "Code Quality", "Efficiency", "Documentation", "Error Handling"]
means = [df[c].mean() for c in CRITERIA]
 
angles = np.linspace(0, 2 * np.pi, len(CRITERIA), endpoint=False).tolist()
means_plot = means + [means[0]]
angles += angles[:1]
 
fig, ax = plt.subplots(figsize=(8, 8), subplot_kw=dict(polar=True))
ax.fill(angles, means_plot, alpha=0.25, color="#6E56CF")
ax.plot(angles, means_plot, color="#6E56CF", linewidth=2)
ax.set_xticks(angles[:-1])
ax.set_xticklabels(labels)
ax.set_ylim(0, 5)
ax.set_yticks([1, 2, 3, 4, 5])
ax.set_title("Agent Quality Profile", size=16, pad=20)
plt.tight_layout()
plt.savefig("rubric_radar.png", dpi=150)

여러 에이전트 비교

python
agents = df["instance_id"].str.extract(r"^([a-z_]+)_")[0].unique()
 
fig, ax = plt.subplots(figsize=(8, 8), subplot_kw=dict(polar=True))
colors = ["#6E56CF", "#E54D2E", "#30A46C", "#E5A336"]
 
for i, agent in enumerate(agents[:4]):
    sub = df[df["instance_id"].str.startswith(agent)]
    agent_means = [sub[c].mean() for c in CRITERIA]
    plot = agent_means + [agent_means[0]]
    ax.fill(angles, plot, alpha=0.1, color=colors[i])
    ax.plot(angles, plot, color=colors[i], linewidth=2, label=agent)
 
ax.set_xticks(angles[:-1])
ax.set_xticklabels(labels)
ax.set_ylim(0, 5)
ax.legend(loc="upper right", bbox_to_anchor=(1.3, 1.0))
plt.tight_layout()
plt.savefig("rubric_comparison.png", dpi=150)

기준별 일치도

기준별 일치도는 어느 차원이 측정을 하고 있고 어느 차원이 의견을 모으고 있는지 알려 줍니다. Potato 자체의 일치도 보고를 사용하거나, 내보낸 평가에서 직접 계산하십시오.

python
import krippendorff
 
for c in CRITERIA:
    wide = df.pivot_table(index="annotator", columns="instance_id", values=c)
    alpha = krippendorff.alpha(reliability_data=wide.values, level_of_measurement="ordinal")
    print(f"  {c}: {alpha:.3f}")

명목 척도가 아니라 순서 척도 설정을 쓰십시오. 4점과 5점의 불일치는 4점과 1점의 불일치보다 작은데, 명목 알파는 둘을 단순히 "다르다"로 취급하기 때문입니다.

실제로 정확성은 객관적에 가까워 일치도가 높게 나오는 경향이 있고, 문서화와 코드 품질은 더 낮게 나옵니다. 이 차이는 어느 설명을 손봐야 하는지에 대한 신호이지 그 기준을 버려야 할 이유가 아닙니다.


Rubric Eval과 Trajectory Eval 결합하기

철저한 평가를 위해서는 trajectory_eval과 rubric_eval을 같은 작업에 넣으십시오. 어노테이터가 트레이스를 따라가며 단계별 오류를 표시한 다음, 기준별로 전반적인 품질을 평가합니다.

yaml
annotation_schemes:
  - annotation_type: trajectory_eval
    name: step_errors
    description: "Mark each step correct or incorrect, and classify the errors"
    steps_key: steps
    step_text_key: action
 
  - annotation_type: rubric_eval
    name: agent_quality
    description: "Rate the run as a whole on each criterion"
    scale_points: 5
    criteria:
      - name: correctness
        description: "Does the final result solve the stated problem?"
      - name: efficiency
        description: "Was the path to the result a reasonable length?"
    show_overall: true

트레이스마다 두 가지 구조를 얻습니다. trajectory_eval의 오류 지도와 rubric_eval의 품질 프로필입니다. 하나는 에이전트가 어디서 잘못되었는지에 답하고, 다른 하나는 결과가 얼마나 좋았는지에 답합니다.


요약

rubric_eval은 단일 숫자 대신 에이전트 품질에 대한 다차원적 시각을 제공합니다. 루브릭은 세 개에서 일곱 개의 기준으로 유지하고, 앵커는 어노테이터가 보게 될 각 기준의 설명에 적고, 가중치는 수집 결정이 아니라 분석 결정으로 다루십시오. 같은 스키마가 코딩 에이전트, 웹 에이전트, 대화형 에이전트를 모두 다루며, 내보낸 평가는 레이더 차트, 기준별 통계, 일치도 지표를 지원합니다.

세 개에서 다섯 개의 기준으로 시작하고, 설명을 신중하게 쓴 다음, 어노테이터들이 어디서 의견이 갈리는지 확인한 뒤 수정하십시오.