13. LLM-as-a-Judge:强大,但必须被校准
Evaluator 技术 · 3~5 小时
学习目标
- 掌握 Pointwise、Pairwise、Reference-based Judge
- 理解位置、长度、自偏好等 Judge Bias
- 建立 Judge 校准和人工复核策略
前置知识
- 第 9~12 章
- 基本 Prompt 设计
本章产物: 构建一个带 Rubric 的 Judge,并用人工标签校准。
13.1 为什么需要 Judge
开放任务无法总靠 Exact Match:
- 报告完整性;
- 研究质量;
- 回答是否真正解决用户目标;
- 解释是否充分;
- 复杂 Artifact 的语义质量。
这时 LLM Judge 可以显著降低人工成本。
13.2 三种常见协议
Pointwise
对单个输出评分:
1–5
pass/fail
rubric dimensionsPairwise
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
研究中长期讨论:
- Position bias;
- Verbosity bias;
- Style bias;
- Self-preference;
- Judge reasoning limitation。
所以不要把单一 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 验收问题
- LLM Judge 最适合解决什么类型的问题?
- 为什么要有人工 Golden Set?
- 怎样发现 Position Bias?