逐日AI
第 1 周 · D3约 4 小时

让模型当裁判,再把裁判本身考一遍

能用代码判的绝不该交给模型,但开放式质量确实只能让模型来判。这一天写出评分量表与成对比较,用位置交换实测出裁判的三种系统性偏好,再用一致性系数而不是准确率来决定这个裁判能不能用。

今日目标 0/3

登录后可以勾选并保存进度。

今日目标

  1. 能判断一条判据该用代码型、模型型还是人工型评分器,并说出选错的具体代价
  2. 能设计一次位置交换实验,测出裁判的位置偏好比例,并说明为什么翻转的结论要判平局
  3. 能解释在标签极不均衡时准确率为什么会骗人,并用一致性系数替代它做裁判的准入判定

小白版讲解

两位评委打分,该关心的是什么

一场比赛请了两位评委。你最想知道的是什么?

多数人的第一反应是「他们判得准不准」。但你很快会发现这个问题没法回答——如果有一份标准答案能判断谁准,你就不需要评委了。评委存在的前提,恰恰是这件事没有标准答案。

所以真正能问、也真正有用的问题是另一个:这两位评委判得一不一致。

一致性是可以测的。把同一批选手分别给两位评委看,数一数他们给出相同结论的比例。一致性高,说明这套评分标准是可执行的,换个人来也是这个结果;一致性低,说明打分在很大程度上取决于是谁在打,那么把分数写进报告就是在写一个人的主观印象。

今天要做的事情,就是把这套逻辑搬到模型身上。我们会让一个模型去给 Agent 的回复打分——这叫模型型评分器,也就是通常说的「模型当裁判」。然后立刻做一件更重要的事:把这个裁判本身拉去考一遍,量出它有多大的系统性偏好,再用一致性决定它到底能不能上岗。

评分器三选一:能用代码就用代码

在写任何量表之前,先过一遍选型。评分器只有三类,优先级是死的。

类型怎么判一次的代价什么时候用
代码型查结果态、比字段、跑断言几乎为零默认选项。只要判据能落到一个确定的事实上
模型型让另一个模型读,按量表打分一次调用的钱与延迟判据确实是开放式的:讲清楚了没有、语气合不合适
人工型人读最贵,而且不可规模化给前两类做校准,以及裁定它们判不了的争议

选错的代价是不对称的,值得分别说清楚。

该用代码却用了模型,代价是你花钱买了一个更差的判定。退款有没有发生是一行数据库记录,代码判它是确定的、免费的、瞬时的;让模型读一句「已为您办理退款」来判,你得到的是一个会抖、要花钱、还会被漂亮话骗过去的答案。D1 的自检里那个 liar 靶子就是这么一个反例:它什么工具都不调,只会说漂亮话。

该用模型却用了代码,代价更隐蔽。为了让代码判得了,你会不自觉地把判据改成能用关键词匹配的样子——比如要求回复里必须出现「工作日」三个字。于是评分器开始考的是措辞而不是质量,而 Agent 会朝着这个方向被优化,最后你得到一个句句踩关键词、但没人看得懂的客服。

人工型永远省着用。它不是拿来跑全量的,它的正确用法只有一个:当裁判的裁判。今天下半场的校准集就是人工型评分器的产物,三十条,够了。

评分量表:把「回答得好」拆开

模型型评分器的输入不只是一段文本,还有一份评分量表——你要告诉裁判,按什么标准打分。

直接问「这个回复好不好」,你会得到一个每次都不一样的分数。原因不难理解:这个问题本身就没有被定义。量表要做的,是把一个模糊的整体判断拆成几条互不重叠、可判定的小问题。

以本课靶子那个客服退款 Agent 的回复为例,实验里的量表拆成了三条:

  1. 说清最终处理结果:这次到底退了、没退、还是转了人工
  2. 给出依据:适用的退款政策与关键事实,比如下单距今多少天
  3. 给出下一步:到账时间、转人工路径或者替代方案

三条判据有三个共同点,每一条都是有原因的。

互不重叠。 两条判据不能因为同一个事实同时成立,否则它是在给同一件事记两次分。如果你把第一条拆成「说清结果」和「结论明确」,它们会同生同灭,量表就退化成两条判据的样子、一条判据的信息量。

可判定。 每条都能落到「文本里有没有这件事」,而不是「写得好不好」。判据本身如果还需要一次主观判断,你只是把主观性推迟了一层。

条数要少。 三到五条。条数一多,裁判的注意力被摊薄,分数反而更不稳——这一点和让人打分是一样的。

三种系统性偏差

裁判会犯的错分两类。一类是随机的,多跑几次就摊平了;另一类是系统性的,跑再多次也不会消失,只会让你更确信那个错误答案。后一类有三种,全课统一用这三个名字。

名字表现消除办法
位置偏好成对比较时偏向排在前面的那个答案交换位置各评一次,翻转的一律判平
长度偏好同样的信息量,写得长的更容易拿高分在量表里显式声明简洁不扣分;或做长度惩罚
自评偏好给自家模型的输出打分会系统性偏高换一家模型当裁判,换完重新校准一次

这三个名字后面五天还会用到,值得记牢。接下来两节把前两个量出来,第三个在实验里有一段专门的演示。

位置交换:只有两次都赢才算赢

成对比较是最常用的打分形态:把两个答案摆在裁判面前,问哪个更好。它比逐条打绝对分稳,因为裁判不需要把「好」映射成一个数字,只需要比大小。

代价是它对位置极度敏感。同样两个答案,换个顺序再问一遍,裁判可能改主意。

实验做的事情很简单:同一对答案,正反各评一次,然后按一条硬规则合并。

  • 两轮都判 A 赢,A 赢
  • 两轮都判 B 赢,B 赢
  • 两轮结论矛盾,判平
  • 任意一轮判平,判平

关键是第三条。翻转说明这条结论由位置而不是由质量决定,它携带的信息量是零。这时候有个很自然的冲动:随机取一轮的结果,至少还能有个结论。千万别。 随机取一个等于把噪声写进了报告,而且它有一半的概率碰巧和你的预期一致,于是你更加相信它。判平不是认输,判平是如实报告「这一对分不出来」。

实验里那个离线裁判带着可配置的偏差,跑出来的数字是这样的:

TextText
—— 2. 位置交换实验 ——
  12 对答案,每对正反各评一次
  前排胜率:70.8% (没有位置偏好时应该是 50.0%)
  结论翻转率:41.7%
  合并后:7 条有效结论,5 条判平
  ⚠️ 只评一轮的话,这 12 对会给出 12 条「有效」结论,其中 5 条是位置决定的

前排胜率是位置偏好最直观的证据:在所有分出胜负的单轮判决里,赢家恰好被摆在前面的比例。没有位置偏好时它应该是 50%,这里是 70.8%。

而 41.7% 的翻转率意味着:如果你只评一轮就把结论写进报告,十二条结论里有五条是位置决定的,而报告不会告诉你是哪五条

为什么不用准确率

裁判校准好了,最后一步是判定它能不能上岗。做法是拿一批人工标注过的样本,看裁判和人工判得一不一致。

最自然的想法是算准确率:三十条里判对了几条。这个想法在这里是错的,而且错得很隐蔽。

原因在于线上样本的分布。你送去人工标注的那一批,绝大多数是正常的——实验里的校准集是三十条中二十七条合格,这个比例很接近真实情况。

现在考虑一个什么都不看、一律判通过的裁判。它的准确率是多少?二十七除以三十,90%

一个零信息量的裁判拿到了 90% 的准确率。而这不是极端构造,标签越不均衡,这个数字越高:九十九比一的数据上,它能拿到 99%。

解法是 Cohen's kappa。它的定义只有一行:

TextText
po    = 两人结论一致的比例(这就是准确率)
pe    = 各自的标签分布下,随机也能一致的比例
kappa = (po - pe) / (1 - pe)

pe 是关键。它问的是:如果两人都只是按各自的标签比例瞎猜,能蒙对多少?把这部分从准确率里扣掉,剩下的才是真正来自判断力的一致性。那个一律判通过的裁判,po 是 0.9,pe 也是 0.9,kappa 正好是 0

实验跑出来的对照更说明问题:

TextText
—— 4. 与人工标注的一致性 ——
  校准集:30 条,其中人工判合格 27 条
 
  本裁判    准确率 86.7% kappa 0.259
  无脑全判通过 准确率 90.0% kappa 0.000

那个什么都不看的裁判,准确率比真裁判还高 3.3 个百分点。 如果你的准入标准是准确率,你会选中它——你会淘汰掉唯一一个带信息的裁判,换上一个常量。

kappa 的分辨率也高得多。实验里把三个偏差系数调成 0 之后,准确率从 86.7% 升到 93.3%,涨了 6.6 个百分点;而 kappa 从 0.259 跳到 0.714,从「几乎没用」直接跨过了准入线。同一个改进,两个指标的反应差了一个数量级。

经验阈值可以记一下:0.2 以下几乎没用,0.4 到 0.6 勉强,0.6 到 0.8 可以进流水线,0.8 以上很好。本课的准入线取 0.6。

源码导读

今天的主材料是那篇研究模型裁判的论文(arXiv 2306.05685)。它是最早把「模型当裁判」这件事系统量化的工作之一,今天用到的三种偏差都出自它。

读的时候重点看两处。第一处是它测量位置偏好的方法——交换顺序再评一次,统计结论一致的比例,今天实验里的交换实验就是这个做法的最小实现。第二处是它把裁判与人工标注的一致性和人与人之间的一致性放在一起比:人类标注者彼此之间也不是 100% 一致,所以裁判的目标从来不是完美,而是达到人与人之间那个水平。这个参照系很重要,没有它你会给裁判定一个连人都做不到的门槛。

Anthropic 那篇评估方法的文章补上选型那一半:评分器三类、优先级是「能用代码就用代码」。它没有展开讲怎么校准裁判,那正是今天填上的空。

有一件事今天没讲,但值得知道:kappa 是为两个标注者设计的。标注者多于两人时要换成 Fleiss' kappa,形式不同但思路一样——都是把「随机也能一致」的部分扣掉。

动手实验

🧪 D3:模型裁判与它的校准

代码位置:labs/agent-evals-7days/day-03-llm-judge

今天给 evalkit 加两个模块:graders/judge.ts 是模型型评分器,graders/calibration.ts 是交换实验与 kappa。

先说一个设计决定:实验里的裁判是离线的,而且带着可配置的偏差。

这不是为了省 API key,而是因为今天要做的是对照实验。把偏差调成 0 之后那个数字应该回到多少——这是验证实验代码本身有没有写对的唯一办法,而真实模型给不了你这个对照组:你调不动它的偏差,它的偏差每次还都在变。所以实验写了一个真的会偏向前排、真的会偏向长答案、真的会偏袒自家署名的裁判,三个系数写在一处。接真实网关时只要把打分函数换成一次模型调用,量表、交换实验、kappa 计算、准入阈值全都原样可用。

量表打分的主干长这样:

judge.js
// 分数 = 量表基础分 + 长度偏好 + 自评偏好
// 三项分开返回:报告要能说清「这 0.58 分里有 0.25 是长度送的」
export function scoreByRubric(answer, rubric, cfg) {
  const met = []
  const missed = []
  for (const c of rubric) {
    if (c.markers.some((m) => answer.text.includes(m))) met.push(c.id)
    else missed.push(c.id)
  }
  const base = rubric.length === 0 ? 0 : met.length / rubric.length
  const lengthBonus = cfg.lengthBias * Math.min(1, answer.text.length / 200)
  const selfBonus = answer.author === cfg.family ? cfg.selfBias : 0
  return { base, lengthBonus, selfBonus, total: Math.min(1, base + lengthBonus + selfBonus), met, missed }
}

交换实验里最容易写错的是第二轮。参数顺序换了,所以返回的「第一个赢」指的是 B 赢而不是 A 赢:

calibration.js
const forward = judgePair(pair.a, pair.b, rubric, cfg)
const backward = judgePair(pair.b, pair.a, rubric, cfg)
 
// ⚠️ 第二轮的 first 是 b 赢。写反了翻转率会变成 0,而且不会报错
const firstRound = forward === 'tie' ? 'tie' : forward === 'first' ? 'a' : 'b'
const secondRound = backward === 'tie' ? 'tie' : backward === 'first' ? 'b' : 'a'
 
// 两轮一致才采纳,翻转一律判平
const flipped = firstRound !== 'tie' && secondRound !== 'tie' && firstRound !== secondRound
const verdict = firstRound === secondRound ? firstRound : 'tie'

kappa 本体只有四行,但两个退化分支必须处理:

kappa.js
const po = (truePass + trueFail) / n
const judgeRate = (truePass + falsePass) / n
const humanRate = (truePass + falseFail) / n
const pe = judgeRate * humanRate + (1 - judgeRate) * (1 - humanRate)
// 1 - pe 逼近 0 时 kappa 无定义。报 0 而不是报满分
const kappa = 1 - pe < 1e-9 ? 0 : (po - pe) / (1 - pe)

README 的手动验收清单里有八条,请逐条看一遍。自检全绿不代表你看懂了那两组数字,而那两组数字才是今天的全部收获。

面试题

今天的四道题围绕四个点:评分器的选型顺序、位置偏好的实验设计、准确率骗人的场景、以及翻转数据的处理方式。

第三道题是高频题,也是区分度最大的一道。多数人能说出「用 kappa 不用准确率」,但说不出准确率具体在什么条件下会骗人、骗到什么程度。把「九成样本都是通过时,无脑全判通过也有九成准确率」这句话讲清楚,再补一句「而它的 kappa 是 0」,这道题就满分了。

检查清单与明日预告

今天结束时,你应该能做到:

  • 说出评分器三类的优先级,并分别讲清「该用代码却用了模型」和「该用模型却用了代码」的代价
  • 把一条模糊的质量要求拆成三到五条互不重叠、可判定的量表判据
  • 说出三种系统性偏差的名字与各自的消除办法
  • 设计一次位置交换实验,并解释为什么翻转的结论要判平而不是随机取一个
  • 说清标签不均衡时准确率为什么会骗人,并用 kappa 替代它做准入判定
  • MOCK=1 pnpm selftest 十项全绿
  • 亲眼比较有偏与无偏两次运行:前排胜率 70.8% 对 50.0%,kappa 0.259 对 0.714

明天是 D4《轨迹评估:它到了终点,但一路上撞了几次》。今天和 D1 评的都是最终结果——答案对不对、回复好不好。但有一整类故障在结果上完全看不出来:它答对了,可是绕了七步、多花了十倍的钱、还调了一个本不该碰的工具。明天给轨迹本身写评分器,做工具序列判定、循环检测与步数预算,并回答一个很容易走偏的问题:规定得太死会惩罚更聪明的解法,那到底该判到什么程度。

面试题库

  • 什么情况下你会拒绝用模型当裁判,改用代码或人工?说出你的判断顺序。When would you refuse to use a model as the judge and reach for code or a human instead? State your decision order.
    国内高频海外高频进阶#evaluation#graders#llm-as-judge

    分析过程 · 先想清楚再作答

    1. 这题考的是选型纪律,不是模型知识。上来就聊提示词怎么写的,方向已经偏了——面试官想听的是你在什么时候**不**用它。
    2. 判断顺序只有一条:**能用代码判的绝不交给模型**。判据只要能落到一个确定的事实上,就该用代码。退款有没有发生是一行数据库记录,文件有没有生成是一次 stat,接口返回码对不对是一次比较,这些一律代码判——确定、免费、瞬时。
    3. 只有当判据本身是开放式的,才轮到模型:讲清楚了没有、语气合不合适、有没有编造材料里没有的内容。这类判据没有可查的事实,代码判不了。
    4. 人工型是最后一档,而且**不是拿来跑全量的**。它的正确用法只有一个:当裁判的裁判。用几十条人工标注去校准模型裁判,然后让模型裁判去跑全量。反过来做就是把最贵的资源浪费在最不需要判断力的地方。
    5. 两个方向的代价要分别说清楚,这是区分度所在。**该用代码却用了模型**:你花钱买了一个会抖、会被漂亮话骗过去的判定——一个什么工具都不调、只会说「已为您办理退款」的 Agent,在模型裁判下可能拿高分。**该用模型却用了代码**:为了让代码判得了,你会把判据改成关键词匹配,于是评分器考的是措辞而不是质量,Agent 会朝这个方向被优化,最后你得到一个句句踩关键词、没人看得懂的系统。
    6. 可预期的追问是「开放式输出里有一半能用代码判怎么办」。答案是**分层而不是二选一**:能落到结果态的部分交给代码(引用的链接解不解析得开、必须覆盖的要点在不在),剩下真正主观的部分才交给模型。同一个任务上挂两个评分器,各管各的那一半。

    How to reason about it · think before answering

    1. This tests selection discipline, not model knowledge. Jumping straight to prompt design misses the point: the interviewer wants to hear when you would NOT use a model judge.
    2. There is one ordering rule: if code can decide it, never hand it to a model. Whenever the criterion reduces to a settled fact, use code. Whether a refund happened is one database row; whether a file exists is one stat call; whether a status code matches is one comparison. Deterministic, free, instant.
    3. Only genuinely open-ended criteria reach the model tier: was it explained clearly, is the tone right, did it invent material that was not in the source. There is no fact to look up, so code cannot decide it.
    4. Human grading is the last tier, and it is not for running the full suite. Its one correct use is judging the judge: a few dozen human labels calibrate the model judge, and the model judge then runs at scale. Doing it the other way round spends the most expensive resource on the cases that need judgment least.
    5. State the cost in both directions - that is where candidates separate. Using a model where code would do buys you a noisy verdict that well-phrased lies can pass: an agent that calls no tool and merely says 'your refund has been processed' can score highly. Using code where a model is needed forces you to rewrite the criterion as keyword matching, so the grader starts measuring wording instead of quality, and the agent gets optimized toward hitting keywords nobody can read.
    6. Expected follow-up: what if half of an open-ended output is machine-checkable? Layer it rather than choosing. Whatever reduces to state goes to code (do the cited links resolve, are the required points present) and only the subjective remainder goes to the model. Attach both graders to the same task, each owning its half.

    答题要点

    • 顺序是固定的:能用代码判的绝不交给模型,人工只用来校准前两者。
    • 判据能落到确定事实上就用代码:结果态、字段、返回码,确定且免费。
    • 该用代码却用模型:判定会抖、会花钱、会被不干活只说漂亮话的 Agent 骗过。
    • 该用模型却用代码:判据被迫退化成关键词匹配,评分器开始考措辞而不是质量。
    • 开放式输出要分层,不是二选一:可查的部分给代码,主观的剩余部分给模型。

    Key points

    • The order is fixed: never give a model what code can decide; humans only calibrate the other two.
    • If the criterion reduces to a settled fact, use code: outcome state, fields, status codes - deterministic and free.
    • Model where code would do: a noisy, paid verdict that an agent producing only nice words can pass.
    • Code where a model is needed: the criterion degrades into keyword matching and the grader measures wording, not quality.
    • Layer open-ended output instead of choosing: checkable parts to code, subjective remainder to the model.
  • 你怎么证明自己的模型裁判没有位置偏好?请描述一个可执行的实验。How would you prove your model judge has no position bias? Describe an experiment someone could actually run.
    国内高频海外高频深入#evaluation#llm-as-judge#bias

    分析过程 · 先想清楚再作答

    1. 这题问的是「可执行的实验」,所以答「我会注意顺序的影响」是零分。必须给出数据怎么造、判决怎么跑、统计什么数字、判据是什么。
    2. 实验设计:取一批成对的答案,每一对**正反各评一次**。第一轮把 A 放前面,第二轮把 B 放前面,其余条件完全相同。一对答案得到两条判决,N 对得到 2N 条。
    3. 要统计的核心数字是**前排胜率**:在所有分出胜负的单轮判决里,赢家恰好被摆在前面的比例。没有位置偏好时它应该是 50%。显著高于 50% 就是位置偏好,显著低于 50% 也是(少数模型会偏向后一个,同样是系统性偏差)。
    4. 第二个数字是**结论翻转率**:两轮结论互相矛盾的对数占比。它的用途不是检测,而是估算损失——翻转率是 40% 就意味着,只评一轮的话你的结论里有四成是位置决定的,而报告不会告诉你是哪四成。
    5. 样本怎么造是有讲究的:**要故意包含一批势均力敌的答案对**。位置偏好只在质量接近时发作,全拿一优一劣的对子去测,偏差被质量差距盖住,你会测出一个漂亮的 50% 并得出错误结论。这也是这个实验最容易做假的地方。
    6. 最后要说判据与对照。判据用统计检验而不是眼看:前排胜率对 50% 做二项检验,样本量不够时区间会宽到什么都说明不了。对照组的做法是拿一个**已知无偏**的裁判跑同一批数据,确认实验代码本身会输出 50%——不做这一步,你无法区分「量出了偏差」和「实验代码恒定报告有偏差」。
    7. 可预期的追问是「测出来有偏差之后怎么办」。顺序是:先换成逐条独立打分绕开成对比较;必须成对时用交换实验并把翻转的判平;两者都不行才考虑换裁判模型。

    How to reason about it · think before answering

    1. The question asks for a runnable experiment, so 'I would watch out for ordering effects' scores zero. Specify the data, the judging runs, the statistics, and the decision rule.
    2. Design: take a set of answer pairs and judge each pair twice, once with A first and once with B first, everything else identical. One pair yields two verdicts; N pairs yield 2N.
    3. The core statistic is the front-slot win rate: among all decisive single rounds, the fraction where the winner happened to be presented first. With no position bias it should sit at 50%. Significantly above is position bias, and significantly below is too - some models favor the second option, which is equally systematic.
    4. The second statistic is the flip rate: the fraction of pairs whose two rounds contradict each other. It is not a detector but a loss estimate - a 40% flip rate means that judging once leaves 40% of your conclusions determined by position, and the report will not say which ones.
    5. Sampling matters: deliberately include evenly matched pairs. Position bias only shows up when quality is close; a set of lopsided pairs buries the bias under the quality gap and you will measure a comforting 50%. This is the easiest place for the experiment to lie to you.
    6. Close with the decision rule and the control. Use a statistical test rather than eyeballing: a binomial test of the front-slot rate against 50%, noting that a small sample gives an interval too wide to conclude anything. For the control, run the same data through a judge known to be unbiased and confirm the harness reports 50% - without that step you cannot distinguish 'measured a real bias' from 'the harness always reports bias'.
    7. Expected follow-up: what do you do once bias is confirmed? In order: switch to independent per-item scoring to avoid pairwise entirely; if pairwise is required, run the swap and call flips ties; only then consider changing the judge model.

    答题要点

    • 同一对答案正反各评一次,N 对得到 2N 条判决,其余条件完全相同。
    • 主指标是前排胜率:赢家恰好排在前面的比例,无偏时应为 50%。
    • 辅指标是翻转率,用来估算「只评一轮」会让多少结论由位置决定。
    • 样本必须故意包含势均力敌的对子,否则质量差距会把偏差盖住。
    • 判据用二项检验,并拿一个已知无偏的裁判做对照,确认实验本身会输出 50%。

    Key points

    • Judge each pair twice with the order swapped; N pairs give 2N verdicts under otherwise identical conditions.
    • Primary metric: front-slot win rate, which should be 50% for an unbiased judge.
    • Secondary metric: flip rate, estimating how many single-round conclusions position would have decided.
    • Deliberately include evenly matched pairs, or the quality gap masks the bias.
    • Decide with a binomial test, and run a known-unbiased judge as a control to confirm the harness reports 50%.
  • 为什么评估裁判质量要用一致性系数而不是准确率?举一个准确率会骗人的场景。Why measure judge quality with an agreement coefficient rather than accuracy? Give a scenario where accuracy lies.
    国内高频海外高频深入#evaluation#metrics#kappa

    分析过程 · 先想清楚再作答

    1. 这题的区分度不在「知不知道 kappa」,而在能不能把准确率骗人的**条件与幅度**说具体。只说「数据不均衡时准确率不可靠」,答的是常识。
    2. 先把场景摆出来,越具体越好:你送了三十条样本去人工标注,人工判定二十七条合格、三条不合格。这个比例接近真实——线上送去标注的样本本来就大多数是正常的。现在拿一个**什么都不看、一律判通过**的裁判来比:它判对了二十七条,准确率 90%。**一个零信息量的常量,拿到了 90% 的准确率。**
    3. 而且这不是极端构造。标签越不均衡,这个数字越高:九十九比一的数据上,同一个常量裁判能报出 99%。准确率在不均衡数据上是一个**系统性乐观**的指标,不是偶尔失灵。
    4. kappa 的修正只有一步:先算出「随机也能一致」的比例 pe,再从观察一致率 po 里扣掉它,公式是 (po - pe) 除以 (1 - pe)。那个常量裁判的 po 是 0.9,pe 也是 0.9,kappa 正好是 0。**kappa 为 0 的含义是「这个裁判等价于按标签分布瞎猜」,与它的准确率有多高完全无关。**
    5. 更能说明问题的是分辨率。实测过一组对照:同一个裁判修掉长度偏好之后,准确率从 86.7% 升到 93.3%、涨了 6.6 个点,而 kappa 从 0.259 跳到 0.714——从「几乎没用」直接跨过准入线。同一个改进,两个指标的反应差了一个数量级。而在修之前,那个一律判通过的常量裁判准确率是 90%,**比真裁判还高**。用准确率做准入,你会淘汰掉唯一一个带信息的裁判。
    6. 最后给阈值与边界:经验上 0.2 以下几乎没用,0.4 到 0.6 勉强,0.6 到 0.8 可以进流水线。两个边界情形要提:两人都把所有样本判成同一类时 kappa 无定义,实现里必须返回 0 而不是 1;标注者多于两人时换 Fleiss' kappa,思路一样。

    How to reason about it · think before answering

    1. The discriminator is not whether you know kappa, but whether you can state the conditions and the magnitude by which accuracy lies. 'Accuracy is unreliable on imbalanced data' is common knowledge, not an answer.
    2. Lead with a concrete scenario. You send thirty samples for human labeling; humans mark twenty-seven acceptable and three not. That ratio is realistic - most production samples sent for labeling are fine. Now compare a judge that looks at nothing and always says pass: it is right twenty-seven times, for 90% accuracy. A zero-information constant scores 90%.
    3. And this is not a contrived extreme. The more imbalanced the labels, the higher it goes: on ninety-nine to one data the same constant reports 99%. On imbalanced data accuracy is systematically optimistic, not occasionally wrong.
    4. Kappa applies one correction: compute pe, the agreement two labelers would reach by chance given their own label distributions, and subtract it from the observed agreement po, as (po - pe) over (1 - pe). For the constant judge po is 0.9 and pe is also 0.9, so kappa is exactly 0. Kappa of zero means the judge is equivalent to guessing from the label distribution, regardless of how high its accuracy looks.
    5. Resolution makes the case even better. In a measured comparison, removing a judge's length bias moved accuracy from 86.7% to 93.3%, about six and a half points, while kappa jumped from 0.259 to 0.714 - from nearly useless to over the admission line. The same improvement, an order of magnitude apart in signal. And before the fix, the always-pass constant scored 90%, higher than the real judge. Gate on accuracy and you eliminate the only judge carrying information.
    6. Close with thresholds and edge cases. Rules of thumb: below 0.2 is nearly useless, 0.4 to 0.6 is marginal, 0.6 to 0.8 is pipeline-grade. Two edges are worth naming: when both labelers assign every sample to one class kappa is undefined and the implementation must return 0 rather than 1; and with more than two labelers you switch to Fleiss' kappa, same idea.

    答题要点

    • 场景:三十条里二十七条合格时,一律判通过的常量裁判准确率就有 90%。
    • 标签越不均衡这个数字越高,所以准确率是系统性乐观,不是偶尔失灵。
    • kappa 把「随机也能一致」的 pe 扣掉,那个常量裁判的 kappa 正好是 0。
    • kappa 的分辨率高得多:同一次修复准确率涨 6.6 个点,kappa 从 0.259 到 0.714。
    • 阈值 0.6 起可进流水线;两人同判一类时 kappa 无定义必须返回 0,多人换 Fleiss。

    Key points

    • Scenario: with twenty-seven of thirty acceptable, an always-pass constant already scores 90% accuracy.
    • The more imbalanced the labels, the higher it climbs - accuracy is systematically optimistic here.
    • Kappa subtracts pe, the chance agreement, and the constant judge lands at exactly 0.
    • Kappa resolves far better: one fix moved accuracy 6.6 points but kappa from 0.259 to 0.714.
    • 0.6 and up is pipeline-grade; kappa is undefined when both labelers pick one class and must return 0; use Fleiss for more labelers.
  • 成对比较时两轮结论不一致,你会怎么处理这条数据?为什么不是随机取一个?In a pairwise comparison the two rounds disagree. How do you handle that data point, and why not just pick one at random?
    国内高频海外高频进阶#evaluation#llm-as-judge#pairwise

    分析过程 · 先想清楚再作答

    1. 这题看着是个细节,实际上考的是「会不会把噪声当成信号写进报告」。答「取第一轮的结果,因为它更接近真实使用顺序」的,已经掉进坑里了。
    2. 正确处理是**判平局**。翻转的含义很明确:这条结论是由位置决定的,不是由质量决定的。它携带的信息量是零,而平局恰恰是「分不出来」的如实表达。平局不是认输,是一个有内容的结论。
    3. 为什么不能随机取一个:随机取等于把噪声写进了报告,而且它有一半的概率碰巧和你的预期一致。碰巧一致的那一半会让你更相信这个裁判,于是错误被固化。**把噪声当成信号的代价,不是少了一条数据,而是多了一条假数据。**
    4. 为什么也不能固定取第一轮:那等于把位置偏好整个吞了下去。你测这个实验的全部目的就是消除位置的影响,最后却按位置取结论,等于没做。
    5. 顺带要说清楚平局的下游处理。平局不能当成失败,也不能当成通过,它应该单独成一档进报告:多少条有效结论、多少条判平。平局比例过高本身就是一个结论——它说明这批答案在你的量表下分不出差别,要么量表太粗,要么这两个系统确实旗鼓相当。
    6. 可预期的追问是「平局太多导致样本量不够怎么办」。答案不是放宽合并规则,而是从数据侧解决:加样本量、或者把判据拆细让量表分得动。放宽合并规则等于用降低结论质量来换结论数量,方向反了。

    How to reason about it · think before answering

    1. This looks like a detail but tests whether you will write noise into a report as if it were signal. Answering 'take the first round because it matches real usage order' has already fallen in.
    2. The correct handling is to call it a tie. A flip means precisely one thing: that conclusion was decided by position, not by quality. Its information content is zero, and a tie is the honest way to say 'these two cannot be separated'. A tie is not a failure to conclude; it is a conclusion.
    3. Why not pick at random: that writes noise into the report, and half the time it will coincidentally match your expectation. The coincidental half increases your confidence in the judge, so the error gets locked in. The cost of treating noise as signal is not one missing data point but one fabricated one.
    4. Why not always take the first round either: that swallows the position bias wholesale. The entire purpose of the swap was to remove positional influence, so resolving by position undoes the experiment.
    5. Also specify what happens downstream. A tie is neither a pass nor a fail; it belongs in its own bucket in the report, alongside the count of decisive conclusions. A high tie rate is itself a finding - it says your rubric cannot separate these answers, either because it is too coarse or because the two systems really are comparable.
    6. Expected follow-up: what if ties leave too few data points? Fix it on the data side - more samples, or finer criteria so the rubric can discriminate - not by relaxing the merge rule. Relaxing it trades conclusion quality for conclusion count, which is backwards.

    答题要点

    • 翻转的结论一律判平:它由位置而不是由质量决定,信息量是零。
    • 随机取一个是把噪声写进报告,还会有一半概率碰巧印证你的预期,固化错误。
    • 固定取第一轮等于吞掉位置偏好,交换实验白做。
    • 平局单独成一档进报告,不能算失败也不能算通过。
    • 平局过多要从数据侧解决:加样本、拆细判据,而不是放宽合并规则。

    Key points

    • Call every flipped pair a tie: it was decided by position, not quality, and carries zero information.
    • Picking at random writes noise into the report and half the time appears to confirm your expectation, locking in the error.
    • Always taking the first round swallows the position bias and wastes the swap entirely.
    • Report ties as their own bucket - neither a pass nor a fail.
    • Too many ties is a data-side problem: more samples or finer criteria, not a looser merge rule.

评论