評価をCIに組み込み、トラフィック上でバリアントを比較する
読了まで約36 分分、5 節 節の 4 例 例。
この章を終えると、変更が測定可能な形で悪化している場合にのみその変更をブロックするゲートに、評価を組み込めるようになる。また、2つのバリアントをライブで比較したときに何が示せて何が示せないかを説明できるようになる。
sablefileアシスタントはツールのドキュメントに基づいて回答する。チームは、プロンプト、検索、モデルのいずれかを週ごとに変更する。チームは、変更がマージされる前に、アシスタントが悪化したかどうかを知りたい。合格率が少しでも下がれば失敗とするゲートは、安全な選択に見えるが、実際にはそうではない。開発用の項目が80件であれば、1項目で合格率はおよそ1.3ポイント動くため、生の合格率を基準にしたゲートは、1項目か2項目の差でブロックしてしまう。ノイズでブロックされるチームは、しばしばゲートを上書きすることを覚え、そうなるとゲートは何も守らなくなる。
第1章では、テストセット、チェック、ジャッジ、再生された回答という評価全体を初めて実行した。この章では、その実行をそのまま維持する。ここでは3つの部分を順に扱う。区間を尊重するゲート、サンプルごとに判定が変わる項目、そして評価自身のコードに対するテストである。続いて、同じ部分を評価フレームワークの用語に対応づけ、最後に、ライブトラフィック上でのバリアントの比較が何を示せて何を示せないかを述べる。
区間を尊重するゲート
ゲートとは、変更のマージを止めるルールである。本書では、このルールは1つの数値に基づく。同じ dev 項目に対する、候補とベースラインの合格率の対応のある差である。この比較は、第8章が定義するとおり対応のある比較である。項目ごとに、候補の判定からベースラインの判定を引き、それを項目全体で平均し、区間は項目についてブートストラップで求める。両方の実行が同じ問いに答えるため、両者が一致する項目は差の中で打ち消し合う。
ゲートのルールは1つだけである。区間の上限が、しきい値の符号を反転した値(マイナスのしきい値)を下回るときに限り、ゲートは不合格となる。上限は、データがなお許す最も負の度合いが小さい読み方であり、したがってデータを最も楽観的に読んでもしきい値より大きな低下が示されるときに、ゲートは不合格となる。単純なゲートであれば、差の点推定値がマイナスのしきい値を下回るたびに不合格とするだろうが、それではノイズで不合格になってしまう。本書のルールの代償は、データがまだ証明できない実際の低下を一部見逃して合格させることにある。そのため、合格は区間の幅とあわせて読む。これについては次の段落以降で説明する。
しきい値は5ポイントである。例のコメントにあるとおり、これは本書での選択であり、標準ではない。dev セットがこの大きさのとき、1項目はおよそ1.3ポイントに当たるため、5ポイントは正味で4項目に相当する。
最初の実行は、この判定器の測定では大きな低下である。2つ目のモデルである Qwen3-0.6B は4Bのベースラインより小さく、同じ dev 項目に答えている。判定器は Qwen3-4B-Instruct-2507、すなわちベースライン自身のモデルであるため、この差からは、アシスタントが弱いことと自己選好とを切り分けられない。本書がそれを検証できない理由は自己選好で説明する。判定は区間から導かれるものなので、最後に読む。
1"""Runs the gate on second-model against the baseline over the eighty dev items: both pass rates with their counts, the paired2difference, its interval, the threshold and the decision. The gate fails only when the upper bound of the interval is below3minus the threshold, so a drop that the interval cannot rule out below the threshold does not fail it."""4import lib # first: fixes the thread counts and seeds before anything else loads56from lib.calibration import readable_verdicts7from lib.gate import FAIL, gate8from lib.judging import passed9from lib.prompts import REF_SHA25610from lib.stats import interval_points, pct11from lib.testset import load_items1213BASELINE = "judge-answers-baseline"14CANDIDATE = "judge-answers-second-model"15# Five points is this gate's threshold, chosen for the book, not a standard. With eighty dev items one item moves a rate16# by 1.25 points, so five points is four items net: a smaller threshold would ask the gate to see drops the interval17# cannot resolve at this size.18THRESHOLD_POINTS = 5.01920items = [item.id for item in load_items(split="dev")] # eighty dev items, sorted by id21baseline_found, baseline_unreadable = readable_verdicts(BASELINE, items, REF_SHA256)22candidate_found, candidate_unreadable = readable_verdicts(CANDIDATE, items, REF_SHA256)23for label, unreadable in (("baseline", baseline_unreadable), ("second-model", candidate_unreadable)):24 details = "".join(f' ({item_id}, "{first}")' for item_id, first in unreadable)25 print(f"unreadable verdicts, {label}: {len(unreadable)}{details}")26# An item the judge did not give a readable verdict on, under either run, is left out of both sides: a paired27# difference needs the same items under both runs.28excluded = {item_id for item_id, _ in baseline_unreadable + candidate_unreadable}29kept = [item_id for item_id in items if item_id not in excluded]30first = passed({item_id: baseline_found[item_id] for item_id in kept}) # 1.0 or 0.0 per item, in id order31second = passed({item_id: candidate_found[item_id] for item_id in kept})3233result = gate(first, second, threshold_points=THRESHOLD_POINTS)34print(f"dev items compared (n): {result.n}")35print(f"baseline pass rate: {pct(int(first.sum()), result.n)}")36print(f"second-model pass rate: {pct(int(second.sum()), result.n)}")37print(f"difference, second-model minus baseline: {100 * result.difference:+.1f} points")38print(f"{100 * result.level:.0f}% interval of the difference: {interval_points(result.lo, result.hi)}")39print(f"upper bound of the interval: {100 * result.hi:+.1f} points")40print(f"threshold: {THRESHOLD_POINTS:.1f} points")41if result.decision == FAIL:42 print(f"decision: fail, since the upper bound {100 * result.hi:+.1f} is below {-THRESHOLD_POINTS:+.1f}")43else:44 print(f"decision: pass, since the upper bound {100 * result.hi:+.1f} is not below {-THRESHOLD_POINTS:+.1f}")
python gate-real-drop.pyunreadable verdicts, baseline: 1 (q-0043, "VERDICT: PARTIAL")
unreadable verdicts, second-model: 0
dev items compared (n): 79
baseline pass rate: 78.5% (62 of 79)
second-model pass rate: 40.5% (32 of 79)
difference, second-model minus baseline: -38.0 points
95% interval of the difference: [-48.1, -26.6] points
upper bound of the interval: -26.6 points
threshold: 5.0 points
decision: fail, since the upper bound -26.6 is below -5.0
ゲートは不合格となる。その理由は点推定値ではなく区間にある。ベースラインの合格率は 78.5% (62 of 79) である。2つ目のモデルの合格率は 40.5% (32 of 79) である。
比較の対象は dev 項目の全部ではなく 79 項目である。ベースラインの判定が読み取れなかった項目は、両方の実行から除外されるためである。対応のある差には、両方で同じ項目が必要となる。差(2つ目のモデルからベースラインを引いた値)は -38.0 points であり、その95%区間は [-48.1, -26.6] points である。
上限は -26.6 points で、しきい値は 5.0 points である。上限でさえ、マイナスのしきい値を大きく下回っている。この低下は区間では説明しきれないものであり、ゲートはこの判定器の測定でこの種の低下に対して不合格となるように作られている。判定は次のとおりである: fail, since the upper bound -26.6 is below -5.0。
変更が小さければ、結果は異なる。変更による合格率の低下がもっと小さいか、セットが小さくて区間が広がり、上限がマイナス5ポイントを超えたとする。するとゲートは合格となる。しきい値を超える低下は見つからなかったが、候補がベースラインと同等に優れていることが示されたわけではない。区間が広い合格は弱い合格であり、だからこそ判定だけでなく区間の幅も読む必要がある。ある大きさで区間がどこまで広がるか、そして小さな対応のある差が識別可能になるまでに何項目必要かは、第8章で詳しく扱う。
ゲートの限界はその大きさにある。79 項目では、ゲートが不合格となるために上限がマイナスのしきい値をかなり下回る必要があり、小さな低下は合格してしまう。第8章は、想定した不一致の水準のもとで、検出力80%で10ポイントの差を示すには 79 項目で足り、5ポイントの差には 316 項目が必要だと見積もっている。ゲートはこの検出力計算より厳しい検定であるため、実際に10ポイントの低下があっても合格することがありうる。しきい値とセットの大きさは、あわせて選ぶ必要がある。
ゲートによっては複数の指標を検査する。指標が増えるたびに、ノイズが低下に見える機会も増える。そのためゲートは比較の回数を考慮する。指標が m 個のとき、各区間は水準 1 − 0.05/m で求める。2指標なら97.5%、3指標ならおよそ98.3%である。これらの検査を合わせて、誤って不合格とする確率を5パーセント以下に保つ。調整後の水準は第8章が示すものであり、ゲートも同じものを用いる。リサンプル回数は2,000のまま、シードも固定のままとするので、再実行すれば同じ区間が得られる。
ゲートは変更のたびに dev 項目で実行する。ゲートは毎回実行しなければならず、チームがそれらの項目に合わせて調整している可能性があるためである。ホールドアウトは、実行前に固定したルールに照らして、リリースの判断ごとに1回だけ実行する。これはホールドアウトは1回だけで説明するとおりである。その後は、新しいホールドアウトセットが必要になる。
ゲートを CI に組み込むには、ジョブが候補の記録に対してゲートを計算し、判定が不合格であればビルドを失敗させる。ゲートは項目ごとの値だけを読むので、ジョブにほかの状態は要らない。実行に失敗したジョブは、ゲートの不合格として数える。ゲートが飛ばされると合格のように見えてしまうからである。ゲート自体のテストは、上記のルールを検査する。これらは、評価自体のテストで、評価のほかのテストとともに実行される。
実践ルール: 対応のある差はすべて、区間と n とともに報告し、判定は上限から導くこと。点推定値だけで変更を良い、悪いと呼んではならず、区間が広い合格を、候補がベースラインと同等である証拠と読んではならない。
この部分はまだ翻訳されていないため、英語で表示している。
Flag flaky items, never edit them
An item flips when its sampled replies get different verdicts. Each dev item has five verdicts from the variance set, and an item is flaky when they are not all the same. The variance set and the flip rate, the share of items that flip, are introduced in Variance within one item. A team watches the flip rate to see how far the verdicts move when the assistant's replies do.
Each flagged item comes with its PASS count out of five, in id order, and the rule it is held to is printed beside the list.
1"""The dev items flagged as flaky: the judge's verdict differs across their five variance samples. Each flagged item prints its2PASS count out of five, sorted by id, and the count matches the flip rate in flip-rate.py, since both read the same per-item3counts. A flagged item is kept as it is, so the rule printed last is the whole policy: flagged, never edited or deleted."""4import lib # first: fixes the thread counts and seeds before anything else loads56from lib.testset import load_items7from lib.variance import VARIANCE_SAMPLES, item_pass_counts89VARIANCE = "judge-answers-variance"10SAMPLES = len(VARIANCE_SAMPLES)1112items = [item.id for item in load_items(split="dev")] # eighty dev items, sorted by id13counts = item_pass_counts(VARIANCE, items)14for row in counts:15 if not row.complete: # an unreadable sample is not a FAIL: the item is named here and not flagged16 samples = ", ".join(str(sample) for sample in row.unreadable)17 print(f"left out, unreadable verdict, {row.item_id}: samples {samples}")18flagged = [row for row in counts if row.flaky]19for row in flagged:20 print(f"{row.item_id}: {row.passes} of {SAMPLES} PASS")21print(f"flagged items: {len(flagged)}")22print(f"dev items compared (n): {sum(1 for row in counts if row.complete)}")23print("rule: flagged, never edited or deleted")
python flaky-items.pyleft out, unreadable verdict, q-0043: samples 1, 4
q-0047: 4 of 5 PASS
q-0058: 1 of 5 PASS
flagged items: 2
dev items compared (n): 79
rule: flagged, never edited or deleted
Few items flip on this set. The flagged items come to 2 of the 79 dev items compared. Both flagged items are worth reading.
On q-0047, the verdicts across its five replies are 4 of 5 PASS, so most of its replies passed. On q-0058, the verdicts are 1 of 5 PASS, so most of its replies failed.
One item is set aside rather than used. The item q-0043 is left out, since its verdict was unreadable in samples 1, 4. An unreadable sample is not a fail. It is a sample the example cannot read, so the item is neither flagged nor counted on that basis.
The rule is that a flagged item stays flagged, never edited or deleted. It stays in the set with the verdicts the judge gave. Editing it until the judge agrees more often would hide the very signal the flag exists to show. Deleting it would shrink the set and make the pass rate look steadier than it is. The flag does its work when someone reads it. A flagged item with one PASS in five is a question about the item, the rubric, the judge or the assistant's replies, and it should be looked at before the next change is judged on it.
The count is small, and it describes this assistant, this judge and these dev items. It shows that few items flip in this set. It does not show that other assistants, sampling settings or judges flip as rarely. A team that changes any of them should run the variance set again before it trusts a low flip rate.
A flagged item can also move a paired difference from one run to the next. When a gate fails on a difference that depends on a flagged item, read the flag before the change.
Working rule: Flag an item whose verdicts differ across its samples, print its count beside the flag, and leave the item as it is. Report the flip rate with its denominator, and say that a low rate holds for this assistant, this judge and this set only.
評価自体のテスト
評価はコードであり、そのコードには、結果のように見える形で誤りが入り込むことがある。ブートストラップ、判定結果の読み取り処理、対応のある差の計算にバグがあれば、アシスタントに変更があった場合と同じように数値が動く。そこで評価には独自のテストを用意し、本書のライブラリ内の tests フォルダに置く。本書が追加する各モジュールは、それぞれのテストを伴う。これらのテストが検査するのは採点コードであり、アシスタントではない。テストに通ったことは、コードが数えると称するものを正しく数えていることを示す。アシスタントがうまく答えているかどうかについては、何も示さない。
これらのテストは1つのプロセスで実行し、結果はモジュールごとに集計する。続いて、この例は pytest の終了コードを出力する。pytest のバージョンは 9.2.0 である。終了コードのリファレンスでは、0 は収集したすべてのテストが通ったことを、5 はテストが1つも収集されなかったことを表す。したがって、何もテストしない実行は、黙って成功したことにはならず、5 として現れる。
1"""Runs the book's own tests, lib/tests, in this process and prints how many passed and failed in each module, then pytest's2exit code. Exit code 0 means every test was collected and passed. Exit code 5 means nothing was collected, so the example3prints the code it got rather than a silent pass. No paths and no timings are printed: they vary from run to run."""4import lib # first: fixes the thread counts and seeds before anything else loads56from collections import Counter7from pathlib import Path89import pytest1011TESTS = Path(lib.__file__).resolve().parent / "tests" # read here, never printed121314class Outcomes:15 """Counts each test's outcome by module. A failed setup or teardown counts as a failure of its test."""1617 def __init__(self) -> None:18 self.passed = Counter()19 self.failed = Counter()2021 def pytest_runtest_logreport(self, report) -> None:22 # The node id starts with the file's path; keep only the module's name, so no path is printed.23 module = Path(report.nodeid.split("::")[0]).stem24 if report.when == "call" and report.passed:25 self.passed[module] += 126 elif report.failed:27 self.failed[module] += 1282930collector = Outcomes()31# -p no:terminal turns off pytest's own printing, which carries timings. That also removes the -q option, which belongs to32# the terminal reporter, so it is not passed. -p no:cacheprovider keeps .pytest_cache out of the working copy.33exit_code = pytest.main(34 [str(TESTS), "-p", "no:terminal", "-p", "no:cacheprovider"],35 plugins=[collector],36)3738modules = sorted(path.stem for path in TESTS.glob("test_*.py")) # every module, even one with no failures39print("tests by module (passed, failed):")40for module in modules:41 print(f" {module}: {collector.passed[module]} passed, {collector.failed[module]} failed")42print(f"total: {sum(collector.passed.values())} passed, {sum(collector.failed.values())} failed")43print(f"pytest exit code: {int(exit_code)}")
python own-tests-run.pytests by module (passed, failed):
test_bench: 11 passed, 0 failed
test_bias: 14 passed, 0 failed
test_both_orders: 14 passed, 0 failed
test_calibration: 9 passed, 0 failed
test_calibration_bootstrap: 8 passed, 0 failed
test_contract: 5 passed, 0 failed
test_gate: 11 passed, 0 failed
test_guard: 4 passed, 0 failed
test_judging: 3 passed, 0 failed
test_stats: 10 passed, 0 failed
test_support_verdict: 5 passed, 0 failed
test_testset: 5 passed, 0 failed
test_variance: 15 passed, 0 failed
total: 114 passed, 0 failed
pytest exit code: 0
表に、モジュールごとの結果と、そのモジュールが検査する内容を示す。
| モジュール | 検査する内容 | 結果 |
|---|---|---|
| test_bench | ベンチマークのローダーと採点器 | 11 passed, 0 failed |
| test_bias | 長さの区分、読み取れない判定結果、反転の向き、区分間の差 | 14 passed, 0 failed |
| test_both_orders | 対比較の読み取り処理と両方の順序:応答への対応付けの戻しと、4つの種類 | 14 passed, 0 failed |
| test_calibration | 判定者と人間の比較の件数、一致率、カッパ、TPR、TNR、補正後の合格率 | 9 passed, 0 failed |
| test_calibration_bootstrap | 交差点と、補正後の合格率のブートストラップ区間 | 8 passed, 0 failed |
| test_contract | 判定者とアシスタントが守るべき応答形式と判定結果の形式 | 5 passed, 0 failed |
| test_gate | ゲートの規則:上限が閾値の符号を反転した値を下回る場合にのみ不合格とする | 11 passed, 0 failed |
| test_guard | 辞退ガードの規則とその閾値を、手作りの行で検査する | 4 passed, 0 failed |
| test_judging | 判定者の判定結果の読み取りと、対応のある差の型 | 3 passed, 0 failed |
| test_stats | 出力用の補助関数と、シード付きのブートストラップ | 10 passed, 0 failed |
| test_support_verdict | 忠実性の判定結果の読み取り処理:1行目の SUPPORTED または UNSUPPORTED | 5 passed, 0 failed |
| test_testset | テストセットの読み込みと、項目をまたいで検査する規則 | 5 passed, 0 failed |
| test_variance | 分散検証用セットにおける項目ごとの判定結果の件数 | 15 passed, 0 failed |
最後に合計を示す。114 passed, 0 failed であり、終了コードは 0 である。これは、収集したすべてのテストが通った実行を表すコードである。
この表は、アシスタントの検査ではなく、計測器の検査として読む。ゲートのジョブでは、まずこれらのテストを実行する。そうすれば、壊れた採点器は、合格率を読む前にジョブを止める。実行ごとに変わるものは何も出力しない。所要時間もパスも出力しない。読者はコードを再実行し、出力を1行ずつ比較できる。
実践ルール: 数値を読むどの実行よりも前に、評価自体のテストを実行する。終了コード 5 は成功ではなく失敗として扱う。採点コードのテストが失敗しているなら、数値が何を示していようと、その数値はまだ信頼できない。
フレームワークのタスクとして実行する
評価フレームワークをすでに使っているチームは、本書の各部分をそのフレームワークの用語に対応づけて読むことができる。その対応は一度確認しておくと役に立つ。2026年11月17日付の変更履歴にある Inspect AI 0.3.291 では、タスクとは評価のレシピであり、最小限でもデータセット、ソルバー、スコアラーから成る。これはそのバージョンのフレームワークのドキュメントが述べているとおりである。この読み方に従えば、テストセットはデータセットにあたり、項目ごとに1つのサンプルを持つ。アシスタントが検索してから回答するという経路はソルバーにあたり、チェックと判定器がスコアラーを構成する。本書はこの対応づけを実行せず、実行したと主張もしない。その代わりに、本書は1つの例の環境を保つ。すなわち、すべての章の例が読み込む1組のファイルであり、同じバージョンに固定されている。そのため、再生モデル、チェック、ゲートはどの章でも同じコードである。この章では、各部分をどこに置くことになるかを説明する。これにより、フレームワークを使う読者は、本書の例をそのままにして各部分を移し替えることができる。
実践ルール: 評価をフレームワークに対応づけるときは、フレームワークのバージョンと、そのドキュメントの日付を明記する。テストセット、チェック、再生モデルは、本書の例が実行するファイルのまま保ち、実際に誰かが実行するまでは、この対応づけをドキュメントの読み方として扱う。
この部分はまだ翻訳されていないため、英語で表示している。
Variants on traffic
Offline, the test set and the replayed answers can say which variant is better on the items the team wrote. Once the assistant is live, a team may want to compare two variants on real questions, such as two prompts or two models, each sent to a share of users. That is a comparison, and it is only as good as the way users were assigned to the variants. If the people who see one variant are the ones who ask harder questions, the difference reflects them and not the variant. Random assignment, and an interval read the way the rest of this chapter reads one, are what turn a live comparison into a test. Kohavi and colleagues' guide, which chapter 10 cites, recommends deciding the power and the effect to detect, and estimating the variability, before the test starts. Without that, a live comparison is a list of who saw which variant.
The feedback table in this section is not traffic. Its rows are generated. Each dev item's vote is drawn from a stated model with a fixed seed. An answer is right with probability 0.85. A user who sees a wrong answer gives a thumbs-down with probability 0.5 and a thumbs-up with 0.05. A user who sees a right answer gives a thumbs-down with 0.03 and a thumbs-up with 0.15. Most items get no vote at all. Whether each answer was right is drawn and then dropped, as it would be in a real log, so the table holds only the votes. It is a teaching device, and its figures are what the stated model produces. They say nothing about this assistant.
1"""A generated table of thumbs-up and thumbs-down rows over the eighty dev items, with what such a table can show and what it2can't. The rows are generated from a stated model with a fixed seed, not taken from users, so the table is a teaching3device only.45The model: an answer is right with probability 0.85. A user who sees a wrong answer gives thumbs-down with probability 0.5 and6thumbs-up with 0.05; one who sees a right answer gives thumbs-down with 0.03 and thumbs-up with 0.15. Most items get no vote.7The table keeps the votes only: whether each answer was right is drawn and then dropped, as it would be in a real log."""8import lib # first: fixes the thread counts and seeds before anything else loads910import numpy as np1112from lib import SEED13from lib.stats import pct14from lib.testset import load_items1516P_RIGHT = 0.8517P_DOWN_WRONG, P_UP_WRONG = 0.50, 0.0518P_DOWN_RIGHT, P_UP_RIGHT = 0.03, 0.151920rng = np.random.default_rng(SEED) # one generator for the whole table, so the same seed gives the same rows21items = [item.id for item in load_items(split="dev")]22rows = [] # (item id, vote) for each item that got a vote23for item_id in items:24 right = rng.random() < P_RIGHT # hidden: the table has no column for it25 draw = rng.random()26 down, up = (P_DOWN_RIGHT, P_UP_RIGHT) if right else (P_DOWN_WRONG, P_UP_WRONG)27 if draw < down:28 rows.append((item_id, "thumbs-down"))29 elif draw < down + up:30 rows.append((item_id, "thumbs-up"))3132print("generated rows from a stated model, not user feedback (seed 0)")33print("item vote")34for item_id, vote in rows:35 print(f"{item_id} {vote}")3637ups = sum(vote == "thumbs-up" for _, vote in rows)38downs = sum(vote == "thumbs-down" for _, vote in rows)39voted = len({item_id for item_id, _ in rows})40print(f"dev items: {len(items)}")41print(f"items with a vote: {voted}")42print(f"items nobody voted on: {len(items) - voted}")43print(f"thumbs-down among those who voted: {pct(downs, ups + downs)}")44print(f"thumbs-up among those who voted: {pct(ups, ups + downs)}")45print("what the table can show: the share of each kind of vote, among the votes cast, with its n.")46print("what it can't show: anything about the items nobody voted on; whether a thumbs-up answer was right.")
python feedback-table.pygenerated rows from a stated model, not user feedback (seed 0)
item vote
q-0002 thumbs-down
q-0006 thumbs-down
q-0007 thumbs-down
q-0008 thumbs-up
q-0009 thumbs-up
q-0011 thumbs-up
q-0020 thumbs-down
q-0027 thumbs-down
q-0028 thumbs-up
q-0030 thumbs-up
q-0035 thumbs-up
q-0040 thumbs-down
q-0056 thumbs-down
q-0057 thumbs-down
q-0059 thumbs-down
q-0060 thumbs-up
q-0064 thumbs-down
q-0070 thumbs-down
q-0072 thumbs-up
q-0079 thumbs-down
q-0080 thumbs-down
dev items: 80
items with a vote: 21
items nobody voted on: 59
thumbs-down among those who voted: 61.9% (13 of 21)
thumbs-up among those who voted: 38.1% (8 of 21)
what the table can show: the share of each kind of vote, among the votes cast, with its n.
what it can't show: anything about the items nobody voted on; whether a thumbs-up answer was right.
Under the stated model, only 21 of the 80 dev items get a vote, and 59 get none. So the table says little about the other items.
A vote is not a correctness label, and this table shows why. Under the stated model, answers are right 85% of the time, yet most votes are thumbs-down, because a wrong answer draws a vote far more often. Among the votes cast, thumbs-down is 61.9% (13 of 21). Thumbs-up is 38.1% (8 of 21).
A table of votes can show the share of each kind of vote, among the votes cast, with the count beside it, and the example's last lines say exactly that. It cannot show whether a thumbs-up answer was right, since the table has no column for correctness. It says nothing about the items nobody voted on, and a vote comes from someone who chose to vote on what they chose to read.
Joachims and colleagues studied clicks on search results in 2005 and found them informative but biased, so a click is not an absolute judgment of relevance. They report that relative preferences derived from clicks are reasonably accurate on average, in their paper on interpreting clickthrough data. This book uses that finding as an analogy only, and it is the book's own reading. A thumbs-up is a vote, not a label. A right answer can still draw a thumbs-down, and the table has no way to tell which votes those are.
Two groups of users are compared differently from the paired items above. Each user sees one variant, so the two groups are separate, and the interval for their difference is a different calculation from the paired one this chapter uses. Chapter 8 covers the paired comparison this chapter uses. It does not cover an interval for two separate groups.
A vote table also cannot compare variants unless each vote is tied to the variant the user saw. This table has no variant column, so it cannot compare anything. A live comparison would need that column, the random assignment above, and an interval. If few items get a vote, as in this generated table, the interval would be wide, and most items would have no vote to compare.
Before a real vote table could be trusted, it would need three things. Each vote would need to be tied to the variant the user saw. The share of items that get a vote would need to be reported with its count, since a table of votes speaks only to the items that were voted on. And a sample of its votes would need checking against correctness, so that a thumbs-up or a thumbs-down can be read against what it is meant to measure.
The book's parts add up to an evaluation for a feature of your own. A labelled test set comes first (chapter 3), then checks in code (chapter 4). A judge with a rubric and a measured error follows (chapter 5, chapter 6). A comparison reports its interval and n (chapter 8), and the gate in CI reads all of it. Chapter 7 says where the judge stops being reliable. Chapter 9 and chapter 10 apply the same counts to grounding and declining.
The book leaves three subjects to others. A Primer on Search Relevance covers ranking metrics. Agent Harnesses covers tasks that take several steps. Observability for LLM Applications covers tracing one request through retrieval and the model, and counting what each request costs. It is planned, so it is named here and not linked.
Working rule: Don't compare variants from traffic without random assignment and the variant recorded beside each vote or reply. Read a vote table as a share of the votes cast, with its count, and never as a measure of correctness.
この版における本章
第2026.11.3版2026年11月21日時点で例が通過この章の4 例件のうち4件が合格
英語版の書籍(版2026.11.3)から翻訳した。