GOCLAWAGENT EVALUATION
GoClaw 首页

13. LLM-as-a-Judge:强大,但必须被校准

Evaluator 技术 · 3~5 小时

学习目标

  1. 掌握 Pointwise、Pairwise、Reference-based Judge
  2. 理解位置、长度、自偏好等 Judge Bias
  3. 建立 Judge 校准和人工复核策略

前置知识

本章产物: 构建一个带 Rubric 的 Judge,并用人工标签校准。

13.1 为什么需要 Judge

开放任务无法总靠 Exact Match:

这时 LLM Judge 可以显著降低人工成本。

13.2 三种常见协议

Pointwise

对单个输出评分:

1–5
pass/fail
rubric dimensions

Pairwise

A 与 B 谁更好。

适合版本对比,但要警惕位置偏差。

Reference-based

给 Judge 参考答案、关键事实或 rubric。

通常比无参考的自由打分可控。

13.3 Judge Prompt 必须明确证据

推荐:

Task
Expected Criteria
Candidate Output
Relevant State / Trace
Rubric
Scoring Rules

不要给 Judge 不相关的数万 token Trace。

13.4 常见 Bias

研究中长期讨论:

所以不要把单一 Judge 看成 Truth Oracle。

13.5 校准

准备一批人工 Golden Labels:

100 examples
human expert labels
        ↓
judge predictions
        ↓
agreement
false positive
false negative
confusion matrix

每次更换 Judge Model / Prompt / Rubric,都重新校准。

13.6 Judge Ensemble

高风险 Case 可:

Rule
 + State
 + Judge A
 + Judge B
 + Human escalation

而不是所有任务都用昂贵 Ensemble。

13.7 Pairwise 的位置交换

运行:

A vs B
B vs A

如果结论大幅变化,Judge 稳定性不足。

13.8 不要让 Judge 评价它看不到的事实

如果 Judge 没有 DB 状态,就不能准确判断“退款是否真的执行”。

这类事实应由 State Scorer 提供。

13.9 验收问题


本章依据

  1. Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena — Zheng et al., 2023
  2. Agent-as-a-Judge: Evaluate Agents with Agents — Zhuge et al., 2024