변경이 더 나은지 판단하고, 질문이 몇 개나 필요한지 가늠하기

읽는 데 약 33분분 걸린다, 6절에 5개 예제이(가) 있음.

2026.11.3판 예제 통과 2026년 11월 21 54개 예제 중 54개 통과 변경 사항

AI로 번역함. 영어 원문을 사람이 검증함. 우리가 책을 만드는 방식

영어판 2026.11.3판을 번역한 것이다. 원문 읽기

이 장을 마치면 짝지은 비교에서 구간을 사용해, 어시스턴트의 두 버전 사이의 차이가 잡음 이상인지 말할 수 있다. 또한 주어진 크기의 차이를 검정이 보여 주려면 질문이 몇 개나 필요한지 계산할 수 있다.

1장에서는 어시스턴트를 한 번 측정해 통과율에 구간을 붙였다. 그런 다음 항목 스무 개로 두 프롬프트를 비교했다. 두 프롬프트의 차이에 대한 구간의 폭은 30.0 points였고, 그 장은 약속 하나로 끝났다. 차이를 보여 주려면 항목이 몇 개나 필요한지는 이후의 장에서 계산하겠다는 약속이었다. 이 장이 그 약속을 지킨다. 프롬프트를 바꾸는 팀에게는 세 가지 답이 필요하다. 통과율이 움직인 데에는 검정에 내재한 우연을 넘어서는 이유가 있는가? 그 비교는 애초에 차이를 보여 줄 수 있었는가? 그리고 팀이 중요하게 여기는 차이를 보여 주려면 질문이 몇 개나 필요한가?

여기에 나오는 모든 수치는 하나의 어시스턴트 모델 Qwen3-4B-Instruct-2507과 하나의 판정자에서 나온 것이다. 판정자는 같은 모델을 온도 0으로 실행한 것이다. 구간은 항목을 뽑는 데서 생기는 변동을 포괄한다. 첫 번째 절에서는 구간 없이, 응답을 표집하는 데서 생기는 변동을 측정한다. 구간은 판정자의 편향은 포괄하지 않으며, 이는 7장에서 검증한다. 각 결과를 이 점을 염두에 두고 읽어야 한다.

한 항목 안의 분산

같은 질문을 두 번 던지면 모델은 다르게 답할 수 있다. 이 장의 비교는 항목과 프롬프트마다 기록된 응답 하나를 사용하므로, 각 판정은 응답 하나에 의존한다. 온도를 높이면 모델은 표본을 추출하며, 한 항목의 판정은 표본마다 달라질 수 있다. 이는 비교에서 중요한 문제다. 두 프롬프트 사이의 차이가 표본마다 생기는 변동보다 작다면 그것은 차이라고 할 수 없고, 한 번의 실행에서 읽은 비율은 그 변동을 가린다.

분산 세트에는 각 개발 항목에 대한 어시스턴트의 응답 표본이 다섯 개씩 들어 있으며, 온도 0.7에서 추출한 것이다. 판정자는 모든 응답을 온도 0에서 읽는다. 한 항목의 판정 다섯 개가 모두 같지 않으면 그 항목은 뒤집힌 것이다. 뒤집힌 항목을 세면, 아무것도 바꾸기 전에 판정이 표본마다 얼마나 움직이는지 알 수 있다.

flip-rate.py Python 3.12.15 · numpy 2.5.5 · pydantic 2.14.3 · typing-extensions 4.16.0 통과
"""The flip rate over the dev variance set: the share of items whose judge verdict differs across their five samples. Theprinted line 'flip rate' rests on the per-item PASS counts, which are printed with it: how many items passed 0, 1, 2, 3, 4or 5 of 5 samples, and the mean pass rate. The temperature-0 baseline's pass rate over the same items is printed forcomparison. An item with an unreadable verdict is printed by id and left out, never counted as FAIL."""import lib  # first: fixes the thread counts and seeds before anything else loadsfrom lib.calibration import readable_verdictsfrom lib.judging import passedfrom lib.prompts import REF_SHA256from lib.stats import pctfrom lib.testset import load_itemsfrom lib.variance import VARIANCE_SAMPLES, item_pass_countsVARIANCE = "judge-answers-variance"BASELINE = "judge-answers-baseline"SAMPLES = len(VARIANCE_SAMPLES)items = [item.id for item in load_items(split="dev")]  # eighty dev items, sorted by idcounts = item_pass_counts(VARIANCE, items)excluded = [row for row in counts if not row.complete]kept = [row for row in counts if row.complete]for row in excluded:    samples = ", ".join(str(sample) for sample in row.unreadable)    print(f"unreadable, {row.item_id}: samples {samples} (left out, not counted as FAIL)")print(f"left out of the flip rate (unreadable verdict): {len(excluded)}")n = len(kept)print(f"variance items compared (n): {n}")print(f"flip rate: {pct(sum(1 for row in kept if row.flaky), n)}")spread = [sum(1 for row in kept if row.passes == passes) for passes in range(SAMPLES + 1)]assert sum(spread) == n  # every kept item falls in exactly one PASS countfor passes, count in enumerate(spread):    print(f"items with {passes} of {SAMPLES} PASS: {count}")print(f"mean per-item pass rate across samples: {pct(sum(row.passes for row in kept), n * SAMPLES)}")found, baseline_unreadable = readable_verdicts(BASELINE, [row.item_id for row in kept], REF_SHA256)assert not baseline_unreadable  # q-0043 is already left out above, so no kept item is unreadable under the baselinebaseline = passed(found)print(f"baseline pass rate, same items (temperature 0): {pct(int(baseline.sum()), len(baseline))}")
출력python flip-rate.py
unreadable, q-0043: samples 1, 4 (left out, not counted as FAIL)
left out of the flip rate (unreadable verdict): 1
variance items compared (n): 79
flip rate: 2.5% (2 of 79)
items with 0 of 5 PASS: 16
items with 1 of 5 PASS: 1
items with 2 of 5 PASS: 0
items with 3 of 5 PASS: 0
items with 4 of 5 PASS: 1
items with 5 of 5 PASS: 61
mean per-item pass rate across samples: 78.5% (310 of 395)
baseline pass rate, same items (temperature 0): 78.5% (62 of 79)

코드는 항목별로 다섯 표본 중 판정자가 통과시킨 표본이 몇 개인지 센다. 판정을 읽을 수 없는 항목은 실패로 세지 않고 제외하며, 출력에는 제외한 항목이 표시된다.

대부분의 항목은 움직이지 않는다. 61개 항목은 다섯 표본을 모두 통과하고, 16개 항목은 다섯 표본을 모두 실패한다. 뒤집힌 항목 가운데 1개는 표본 하나만 통과하고 1개는 표본 네 개를 통과한다.

뒤집힘 비율은 2.5% (2 of 79)이다.

모든 표본에 걸친 평균 통과율은 78.5% (310 of 395)이다. 항목마다 온도 0에서 응답 하나를 사용한 기준선의 통과율은 78.5% (62 of 79)이다. 두 값은 같으며, 뒤집힌 두 항목은 서로 반대 방향으로 작용한다. 이는 분산 세트가 사용하는 프롬프트인 P1에 대해서만 성립하고, 다른 프롬프트는 덜 안정적일 수 있다.

이는 좁은 범위의 결과다. 경계에 놓인 질문이 더 많은 세트라면 더 많이 뒤집힐 것이고, 뒤집힘 비율은 항목 수를 세는 값이어서 자체 구간이 없다. 이처럼 뒤집힌 항목의 수가 적으면 다음 변경이 얼마나 자주 뒤집힐지는 거의 알 수 없다.

뒤집힘 비율은 항목을 고정한 상태에서 이 어시스턴트의 응답을 표본 추출할 때 생기는 퍼짐만을 측정한다. 두 프롬프트의 비교는 각 프롬프트가 맞히는 항목에 따라서도 달라진다. 마지막 절에서는 이 표본 추출의 퍼짐을 하한으로 사용하며, 응답을 표본 추출하는 비교에서만 그렇게 한다. 차이를 확인하는 데 필요한 질문 수.

작업 규칙: 한 번의 실행에서 얻은 비율을 신뢰하기 전에, 실제로 배포할 온도에서 분산 세트를 실행하고 뒤집힘 비율을 평균 통과율과 함께 읽어라. 뒤집힘 비율은 표본 추출이 한 프롬프트의 판정을 얼마나 움직이는지 알려 준다. 이 값이 비교의 한계가 되는 것은 그 비교도 응답을 표본 추출할 때뿐이다.

이 부분은 아직 번역되지 않았으므로 영어로 표시된다.

The bootstrap over items

마지막으로 변경된 판: 2026.11.3판

Chapter 1 showed an interval on a pass rate and used it to read a small set. This section explains the method, because the rest of the chapter uses it three ways: on a rate, on a paired difference, and on a difference that has to clear a stricter level.

The method is the percentile bootstrap. The items in a set are one sample of the questions a team could have written, so a different set would give a somewhat different rate. To estimate how much, draw items from the set with replacement, as many as the set holds, so that some items come up twice and some not at all. Compute the statistic for that draw, repeat the draw many times, and keep the middle 95% of the results. The bootstrap adds no data. It reuses the items the set already has, and it shows how far the statistic would move if the set had been another draw of the same kind.

The unit of resampling is the item, and that is the rule to keep. For a rate, each item contributes its verdict. For a paired difference, each item contributes one number: the verdict of prompt B minus the verdict of the baseline, which is plus one, zero or minus one. For the variance set, the five samples of an item are kept together, because they answer one question. Drawing them apart would make them look like five independent questions, and the interval would come out too narrow. Miller (2024) makes the same point for questions that come in related groups. That paper is a preprint and a practitioner's note, not a reviewed method, so this book uses it for the reason and not as proof.

The book fixes the settings so that a number can be reproduced. The method draws 2,000 resamples with a seed of zero, and it creates a fresh random generator inside each call. The same data therefore gives the same interval, whatever ran before it. The seed is a choice, not a property of the data. A different seed moves the endpoints a little, which is why the settings are written down.

The method also depends on the set being a fair sample of the questions, which Chapter 1 argued and no interval can check. A small set gives a rough interval. The endpoints of a percentile interval on a set of this size are a first estimate, and they should be read as approximate.

Working rule: Resample items, never runs within an item, and keep an item's samples together. Fix the resample count and the seed in the code, so the same data gives the same interval. When the set holds few items, call the interval rough and say so beside it.

이 부분은 아직 번역되지 않았으므로 영어로 표시된다.

Paired comparisons

마지막으로 변경된 판: 2026.11.3판

Two prompts answer the same questions, so their results are paired. A paired comparison subtracts, for each item, the verdict of the baseline from the verdict of prompt B, and averages the differences over the set. Its interval comes from the bootstrap over items.

Pairing matters because most items agree. An item that both prompts pass, or both fail, contributes nothing to the difference, whatever the question's difficulty. The comparison's spread comes from the items on which the two prompts split. An unpaired comparison takes two separate pass rates and sets them side by side. It carries the variation between questions on every item, including the ones that agree, and that variation can hide a real difference. The paired version cancels the part the two prompts share. The argument for paired differences in Miller (2024) says the same: the variance of a paired difference falls as long as the two models' scores on each item are positively correlated.

paired-prompt-b.py Python 3.12.15 · numpy 2.5.5 · pydantic 2.14.3 · typing-extensions 4.16.0 통과
"""Compares prompt-b (P2) with the baseline prompt (P1) on the eighty dev items: each pass rate, the paired difference withits 95% interval, and how the items split between the two prompts. 'Better' is used only when the whole interval is abovezero (plan section 6.4); the interval here includes zero, so the reading is no difference detected."""import lib  # first: fixes the thread counts and seeds before anything else loadsfrom lib.calibration import readable_verdictsfrom lib.judging import passedfrom lib.prompts import REF_SHA256from lib.stats import bootstrap_mean, interval_points, pctfrom lib.testset import load_itemsBASELINE = "judge-answers-baseline"PROMPT_B = "judge-answers-prompt-b"items = [item.id for item in load_items(split="dev")]  # eighty dev items, sorted by idp1_found, p1_unreadable = readable_verdicts(BASELINE, items, REF_SHA256)p2_found, p2_unreadable = readable_verdicts(PROMPT_B, items, REF_SHA256)for label, unreadable in (("P1 (baseline)", p1_unreadable), ("P2 (prompt-b)", p2_unreadable)):    details = "".join(f' ({item_id}, "{first}")' for item_id, first in unreadable)    print(f"unreadable verdicts, {label}: {len(unreadable)}{details}")# An item without a readable verdict under either prompt is dropped from both sides: a paired difference needs the same items.excluded = {item_id for item_id, _ in p1_unreadable + p2_unreadable}kept = [item_id for item_id in items if item_id not in excluded]first = passed({item_id: p1_found[item_id] for item_id in kept})  # 1.0 or 0.0 per item, in id ordersecond = passed({item_id: p2_found[item_id] for item_id in kept})n = len(kept)lo, hi = bootstrap_mean(second - first)  # 95%, one comparison: the default levelprint(f"P1 (baseline) pass rate: {pct(int(first.sum()), n)}")print(f"P2 (prompt-b) pass rate: {pct(int(second.sum()), n)}")print(f"difference, P2 minus P1: {100 * float((second - first).mean()):+.1f} points")print(f"95% interval of the difference: {interval_points(lo, hi)}")print(f"paired items (n): {n}")print(f"items only P1 passes: {int(((first == 1) & (second == 0)).sum())}")print(f"items only P2 passes: {int(((first == 0) & (second == 1)).sum())}")print(f"items both pass: {int(((first == 1) & (second == 1)).sum())}")print(f"items neither passes: {int(((first == 0) & (second == 0)).sum())}")if lo > 0:    print(f"reading: P2 is better at n = {n}")elif hi < 0:    print(f"reading: P2 is worse at n = {n}")else:    print(f"reading: no difference detected at n = {n}")
출력python paired-prompt-b.py
unreadable verdicts, P1 (baseline): 1 (q-0043, "VERDICT: PARTIAL")
unreadable verdicts, P2 (prompt-b): 0
P1 (baseline) pass rate: 78.5% (62 of 79)
P2 (prompt-b) pass rate: 81.0% (64 of 79)
difference, P2 minus P1: +2.5 points
95% interval of the difference: [-3.8, +10.1] points
paired items (n): 79
items only P1 passes: 3
items only P2 passes: 5
items both pass: 59
items neither passes: 12
reading: no difference detected at n = 79

Here prompt B runs against the baseline on the dev items. An item with a verdict that can't be read under either prompt is left out of both sides, because a paired difference needs the same items on both sides. The printed lines give each pass rate, the difference, its interval and the number of paired items.

The baseline passes 78.5% (62 of 79). Prompt B passes 81.0% (64 of 79). The difference, prompt B minus the baseline, is +2.5 points, with a 95% interval of [-3.8, +10.1] points.

The split shows where the difference lives. 59 items pass under both prompts, and 12 fail under both. Only the items that split move the difference: 5 pass only under prompt B, and 3 pass only under the baseline.

The interval includes zero, so the reading is no difference detected at n = 79. The interval runs from a drop to a rise, and this set can't say which end is nearer. No difference detected is a finding about a set at its size. It is not a claim that the prompts are equal, and the text shouldn't say they are.

Working rule: Compare variants on the same items, paired, and report the difference with its interval and n. Call one variant better only when the whole interval sits above zero, and worse only when the whole interval sits below it. When the interval includes zero, report no difference detected at that n, and say how many items the difference would need, as How many questions a difference needs works out.

이 부분은 아직 번역되지 않았으므로 영어로 표시된다.

Held-out, once

마지막으로 변경된 판: 2026.11.3판

Dev items are for building. A team may tune a prompt on them, read the failures and change the next version. The dev results can't then prove that a change works, because the change was shaped by them. The held-out set is the check that isn't tuned. A comparison on held-out is run once, against rules fixed before the run: the variants, the level and the reading. Run it again after a change of mind, or choose the level after seeing the number, and the interval no longer means what it says.

This section runs three comparisons on the held-out set, each variant against the baseline. Prompt B is the one from Paired comparisons. The variant k5 retrieves five sections instead of three. The variant unfiltered retrieves from every version of the docs at once, with three sections, instead of only the asked version.

held-out-variants.py Python 3.12.15 · numpy 2.5.5 · pydantic 2.14.3 · typing-extensions 4.16.0 통과
"""Compares prompt-b, k5 and unfiltered with the baseline on the held-out items, each variant once, at the level theBonferroni rule gives for three comparisons (98.33%). Each variant gets its paired difference, interval, n and a reading byplan section 6.4. Nothing was chosen with these numbers: the variants, the level and the reading rule were fixed beforethis run, and the run happens once."""import lib  # first: fixes the thread counts and seeds before anything else loadsfrom lib.calibration import readable_verdictsfrom lib.judging import passedfrom lib.prompts import REF_SHA256from lib.stats import RESAMPLES, bootstrap_mean, interval_pointsfrom lib.testset import load_itemsBASELINE = "baseline"VARIANTS = ("prompt-b", "k5", "unfiltered")M = len(VARIANTS)  # one comparison per variant, each against the baselineLEVEL = 1 - 0.05 / M  # Bonferroni: 1 - 0.05/m, which is 98.33% for m = 3 (plan section 6.3)items = [item.id for item in load_items(split="held-out")]  # sorted by idprint(f"comparisons (m): {M}")print(f"share of the 5% for each comparison, 0.05 / m: {0.05 / M:.4f}")print(f"level of each interval, 1 - 0.05 / m: {100 * LEVEL:.2f}%")print(f"resamples beyond each end of an interval: {RESAMPLES * (1 - LEVEL) / 2:.1f}")base_found, base_unreadable = readable_verdicts(f"judge-answers-{BASELINE}", items, REF_SHA256)details = "".join(f' ({item_id}, "{first}")' for item_id, first in base_unreadable)print(f"unreadable verdicts, baseline: {len(base_unreadable)}{details}")for name in VARIANTS:    found, unreadable = readable_verdicts(f"judge-answers-{name}", items, REF_SHA256)    details = "".join(f' ({item_id}, "{first}")' for item_id, first in unreadable)    print(f"unreadable verdicts, {name}: {len(unreadable)}{details}")    # An item unreadable under the baseline or this variant is dropped from both sides of this pair only.    excluded = {item_id for item_id, _ in base_unreadable + unreadable}    kept = [item_id for item_id in items if item_id not in excluded]    first = passed({item_id: base_found[item_id] for item_id in kept})    second = passed({item_id: found[item_id] for item_id in kept})    n = len(kept)    lo, hi = bootstrap_mean(second - first, level=LEVEL)    if name == "prompt-b":  # the chapter says this lower end is exactly zero, so the run must show it        assert lo == 0.0, "the prompt-b lower bound must be exactly zero"    print(f"{name} minus baseline, difference: {100 * float((second - first).mean()):+.1f} points")    print(f"{name} minus baseline, {100 * LEVEL:.2f}% interval: {interval_points(lo, hi)}")    print(f"{name} minus baseline, n: {n}")    if lo > 0:        print(f"{name} minus baseline, reading: better at n = {n}")    elif hi < 0:        print(f"{name} minus baseline, reading: worse at n = {n}")    else:        print(f"{name} minus baseline, reading: no difference detected at n = {n}")
출력python held-out-variants.py
comparisons (m): 3
share of the 5% for each comparison, 0.05 / m: 0.0167
level of each interval, 1 - 0.05 / m: 98.33%
resamples beyond each end of an interval: 16.7
unreadable verdicts, baseline: 0
unreadable verdicts, prompt-b: 0
prompt-b minus baseline, difference: +10.0 points
prompt-b minus baseline, 98.33% interval: [+0.0, +22.5] points
prompt-b minus baseline, n: 40
prompt-b minus baseline, reading: no difference detected at n = 40
unreadable verdicts, k5: 0
k5 minus baseline, difference: +2.5 points
k5 minus baseline, 98.33% interval: [-12.5, +18.4] points
k5 minus baseline, n: 40
k5 minus baseline, reading: no difference detected at n = 40
unreadable verdicts, unfiltered: 0
unfiltered minus baseline, difference: -10.0 points
unfiltered minus baseline, 98.33% interval: [-27.5, +8.4] points
unfiltered minus baseline, n: 40
unfiltered minus baseline, reading: no difference detected at n = 40

Three comparisons share one held-out set, so each interval is set at a higher level than 95%, and Many comparisons explains why. The level is 98.33%. Each variant gets a difference, an interval, a count of paired items and a reading, all printed.

Held-out has 40 items, against 79 on dev. So its intervals are wider for the same difference, and a result on it can only be as sharp as its item count allows. The split keeps a result honest, and its cost is fewer items to spend.

The difference for prompt B is +10.0 points, with an interval of [+0.0, +22.5] points. The comparison has 40 paired items.

The k5 difference is +2.5 points, with an interval of [-12.5, +18.4] points. The unfiltered difference is -10.0 points, with an interval of [-27.5, +8.4] points.

Dev gave +2.5 points for the same prompt, and the two point estimates differ. The 40 held-out items can't tell which is nearer the truth. The smallest difference that they detect, at 98.33% confidence and 80% power, is 16.2 points, so both point estimates sit below what this set can detect. How many questions a difference needs works out the arithmetic.

By the rule, all three read as no difference detected. For prompt B the printed reading is no difference detected at n = 40. For k5 it is no difference detected at n = 40, and for unfiltered no difference detected at n = 40.

Prompt B is the close case. Its interval is [+0.0, +22.5] points, and its lower end is exactly zero. The reading rule says better only when the whole interval sits above zero, and this one reaches zero without clearing it, so by the rule the reading is no difference detected. Beyond each end of the interval lie 16.7 of the 2,000 resamples, so the call sits on the line. The seed was fixed before the run for that reason. A reader could argue that a point estimate of that size should count for something, and this section doesn't make that argument. The rule was set before the run, the comparison runs once, and nobody gets to look at these three again with a lower level or a different reading. If prompt B is to be tested further, it needs a fresh held-out set, sized by How many questions a difference needs and fixed before anyone sees its results, read on its own. Adding items to the 40 already read, and rereading the pool, would be a second look at a result already seen.

Working rule: Fix the variants, the level and the reading rule before you open the held-out set, and run each comparison once. An interval that reaches zero is no difference detected at that n. Don't rerun the comparison, lower the level or change the reading to get a different answer. Add held-out items only before they are scored.

다중 비교

비교 하나하나가 우연에 속을 수 있는 기회다. 실제 차이가 없는 비교에서도 95% 구간은 운이 따르면 스무 번에 한 번꼴로 0을 벗어난다. 이런 비교를 세 번 실행하고 각각 95%로 보고하면, 그중 적어도 하나가 차이로 읽힐 확률은 100분의 5를 넘어선다. 한 장이 보고하는 비교가 많을수록 그중 하나가 우연한 결과일 가능성은 커진다.

일반적인 해결책은 본페로니 보정이다. 이 방법은 오류 허용량을 비교들 사이에 나누어 갖게 한다. 하나의 지표에 대한 비교가 m개이면 각 구간의 수준을 1에서 0.05를 m으로 나눈 값을 뺀 값으로 정한다. 비교가 세 개이면 0.05를 3으로 나눈 값이 0.0167이므로 각 구간의 수준은 98.33%이며, 이는 held-out 절에서 사용한 수준이다. 0.05는 각 구간의 양쪽 꼬리에 나뉘므로 꼬리 하나가 갖는 몫은 0.05를 m의 두 배로 나눈 값이다. 이 계산은 비교들이 서로 무엇을 공유하든 성립한다. 그중 어느 하나라도 거짓 차이를 보일 확률은 각 비교의 개별 확률을 합한 값을 넘을 수 없고, 그 합은 5%다.

코드는 m으로부터 수준을 계산해 출력하므로 독자는 이를 비교의 개수와 대조해 확인할 수 있다. 대가는 구간의 폭이다. 이 수준에서 각 구간은 95% 구간보다 넓으므로, 구간이 0을 벗어나려면 차이가 더 커야 한다. 개별 확률의 합은 어느 하나라도 거짓 차이일 확률의 상한이므로, 비교들의 거짓 결과가 서로 겹칠 때마다 이 보정은 보수적이다. 이 책이 이 방법을 쓰는 까닭은 규칙을 서술하고 검증하기가 간단하며, 독자가 비교의 개수로부터 직접 다시 계산할 수 있기 때문이다.

어떤 비교들이 개수에 들어가는가? 이 장에서 짝지은 비교를 다룬 절의 dev 비교는 단독으로 다루며, 튜닝 데이터로 보인 풀이 예제이므로 95%로 보고한다. held-out 비교 세 개는 하나의 묶음을 이루며 보정된 수준으로 보고한다. 두 가지를 모두 보는 독자는 dev 구간을 held-out 결과로 읽어서는 안 되며, 이 장이 근거로 삼는 것은 held-out 결과다.

비교의 개수는 설계의 일부다. 한 지표에 대해 이 장이 보고할 비교의 개수를, 어느 하나라도 실행하기 전에 센다. 결과가 나온 뒤에 추가한 비교는 그 묶음과 따로 탐색적 비교로 보고하며, 그 자체의 개수를 가진다. 묶음의 구간은 실행했을 때의 값 그대로 둔다. 결과가 나온 뒤에 구간을 다시 정하면 실행이 따르기로 한 규칙이 바뀌기 때문이다.

작업 규칙: 한 지표에 대한 비교의 개수를 실행하기 전에 세고, 각 구간의 수준을 1에서 0.05를 그 개수로 나눈 값을 뺀 값으로 정한다. 모든 구간 옆에 그 수준을 표시한다. 결과가 나온 뒤에 추가한 비교는 탐색적 비교로 따로 보고하며, 묶음의 구간은 다시 정하지 않는다.

차이를 확인하려면 몇 개의 문항이 필요한가

비교에 앞서 던져야 할 질문은, 팀이 중요하게 여기는 크기의 차이를 보이려면 항목이 몇 개 필요한가이다. 답은 하나의 양에 달려 있다. 두 변형이 항목별로 얼마나 서로 다르게 판정하는가이다. 몇 개의 항목에서만 판정이 갈리는 두 프롬프트는 적은 항목으로도 작은 차이를 보인다. 쌍체 공식을 쓰면 이를 구체적으로 계산할 수 있다. z신뢰는 신뢰수준에 해당하는 양측 정규분포 값이고, z검정력은 검정력에 해당하는 값이다. 그러면 n = (z신뢰 + z검정력)² · 분산(d) / δ²이다. 여기서 분산(d)는 한 항목의 쌍체 차이의 분산이고, δ는 검출하려는 차이이다. 이 분산은 두 변형의 판정이 갈리는 항목의 비율에서 평균 차이의 제곱을 뺀 값이다. 따라서 추정치를 좌우하는 것은 통과율 자체가 아니라 판정이 갈리는 정도이다. 이 절에서는 95% 신뢰수준과 80% 검정력을 사용한다.

sample-size.py Python 3.12.15 · bm25s 0.3.16 · numpy 2.5.5 · pydantic 2.14.3 · typing-extensions 4.16.0 통과
"""How many items a paired comparison needs to detect a difference of 5 and of 10 points, with 95% confidence and 80% power.The main estimate reads the paired differences that prompt-b and the baseline show on the dev items: each item's d is+1, 0 or -1 (P2 minus P1), and the items on which they disagree set the variance. The floor uses only the judge'swithin-item sampling noise over five samples; it leaves the disagreement between variants out, so it is a lower bound."""import lib  # first: fixes the thread counts and seeds before anything else loadsfrom lib import variancefrom lib.answers import chapter_itemsfrom lib.calibration import readable_verdictsfrom lib.judging import paired, passedfrom lib.prompts import REF_SHA256from lib.stats import pctfrom lib.testset import load_items# n = (z_alpha + z_beta)^2 * var_d / delta^2, rounded up (variance.items_needed). var_d = p_discordant - mean(d)^2.# Smallest difference that n items detect: (z_alpha + z_beta) * sqrt(var_d / n) (variance.smallest_difference_points).BASELINE, PROMPT_B = "judge-answers-baseline", "judge-answers-prompt-b"CHAPTER_ONE_ITEMS = 20  # the chapter 1 set, read below the way twenty-cannot-tell reads ititems = [item.id for item in load_items(split="dev")]  # eighty dev items, sorted by idp1_found, p1_unreadable = readable_verdicts(BASELINE, items, REF_SHA256)p2_found, p2_unreadable = readable_verdicts(PROMPT_B, items, REF_SHA256)kept = [item_id for item_id in items if item_id not in {i for i, _ in p1_unreadable + p2_unreadable}]first = passed({item_id: p1_found[item_id] for item_id in kept})  # 1.0 or 0.0 per itemsecond = passed({item_id: p2_found[item_id] for item_id in kept})var_d = variance.paired_difference_variance(first, second)print(f"share of discordant items, P2 and P1 disagree: {pct(int((first != second).sum()), len(kept))}")print(f"assumption, the next change disagrees with the baseline on about as many items as prompt-b did "      f"({100 * (first != second).mean():.1f}% of items)")# Floor: five samples of a 0/1 verdict with k PASS give the unbiased within-item variance k(5 - k) / (5 * 4).rows = [row for row in variance.item_pass_counts("judge-answers-variance", items) if row.complete]noise = sum(row.passes * (5 - row.passes) / 20 for row in rows) / len(rows)print(f"floor, sampling noise only: dev items with five readable verdicts (n): {len(rows)}")print(f"floor, sampling noise only: mean within-item variance of one verdict: {noise:.4f}")# Two variants judged separately: their two noises add and the item's difficulty cancels, so the floor is 2 * noise.for label, var in (("main estimate", var_d), ("floor, sampling noise only", 2 * noise)):    print(f"{label}, variance of one item's paired difference: {var:.4f}")    for delta in (5.0, 10.0):        print(f"{label}, items needed for a {delta:.0f}-point difference: {variance.items_needed(var, delta)}")    print(f"{label}, smallest difference that {CHAPTER_ONE_ITEMS} items detect, 80% power and 95% confidence: "          f"{variance.smallest_difference_points(var, CHAPTER_ONE_ITEMS):.1f} points")# The chapter 1 set, read as twenty-cannot-tell reads it: its share of discordant items and its interval width.chapter_one = paired(BASELINE, PROMPT_B, [item.id for item in chapter_items()])width_20 = variance.interval_width_points(var_d, CHAPTER_ONE_ITEMS)print(f"chapter 1 set, share of items where the two verdicts differ: "      f"{pct(int((chapter_one.first != chapter_one.second).sum()), chapter_one.n)}")print(f"chapter 1 set, 95% interval width: {100 * (chapter_one.diff_hi - chapter_one.diff_lo):.1f} points")print(f"main estimate, 95% width at {CHAPTER_ONE_ITEMS} items: {width_20:.1f} points")print(f"reading: with {CHAPTER_ONE_ITEMS} items and a change that disagrees with the baseline on "      f"{100 * (first != second).mean():.1f}% of items, as prompt-b did, the smallest difference detected with 80% power "      f"at 95% confidence is {variance.smallest_difference_points(var_d, CHAPTER_ONE_ITEMS):.1f} points")
출력python sample-size.py
share of discordant items, P2 and P1 disagree: 10.1% (8 of 79)
assumption, the next change disagrees with the baseline on about as many items as prompt-b did (10.1% of items)
floor, sampling noise only: dev items with five readable verdicts (n): 79
floor, sampling noise only: mean within-item variance of one verdict: 0.0051
main estimate, variance of one item's paired difference: 0.1006
main estimate, items needed for a 5-point difference: 316
main estimate, items needed for a 10-point difference: 79
main estimate, smallest difference that 20 items detect, 80% power and 95% confidence: 19.9 points
floor, sampling noise only, variance of one item's paired difference: 0.0101
floor, sampling noise only, items needed for a 5-point difference: 32
floor, sampling noise only, items needed for a 10-point difference: 8
floor, sampling noise only, smallest difference that 20 items detect, 80% power and 95% confidence: 6.3 points
chapter 1 set, share of items where the two verdicts differ: 10.0% (2 of 20)
chapter 1 set, 95% interval width: 30.0 points
main estimate, 95% width at 20 items: 27.8 points
reading: with 20 items and a change that disagrees with the baseline on 10.1% of items, as prompt-b did, the smallest difference detected with 80% power at 95% confidence is 19.9 points

여기서 코드는 개발용 항목에서 프롬프트 B와 기준선 사이의 불일치를 읽는다. 이 코드의 가정이 출력되며, 확인해야 할 것도 이 가정이다. 다음 변경도 기준선과 판정이 갈리는 항목의 수가 프롬프트 B와 비슷하다는 것이다. 여기서 판정이 갈리는 항목의 비율은 10.1% (8 of 79)이다.

sample-size-limits.py Python 3.12.15 · numpy 2.5.5 · pydantic 2.14.3 · typing-extensions 4.16.0 통과
"""The arithmetic behind the five-point figure in sample-size, and the limits of its inputs: the interval on the share ofdiscordant items (a percentile bootstrap over items, as lib.stats computes every interval), the held-out level of 98.33%,and the difference that the 40 held-out items can detect. The disagreement is the dev items' paired run, as in sample-size."""import lib  # first: fixes the thread counts and seeds before anything else loadsfrom lib import variancefrom lib.calibration import readable_verdictsfrom lib.judging import passedfrom lib.prompts import REF_SHA256from lib.stats import bootstrap_mean, interval_pctfrom lib.testset import load_itemsBASELINE = "judge-answers-baseline"PROMPT_B = "judge-answers-prompt-b"ALPHA_HELD_OUT = 0.05 / 3  # two-sided alpha for each of the three held-out comparisons (Bonferroni)HELD_OUT_LEVEL = 1 - ALPHA_HELD_OUTitems = [item.id for item in load_items(split="dev")]  # eighty dev items, sorted by idp1_found, p1_unreadable = readable_verdicts(BASELINE, items, REF_SHA256)p2_found, p2_unreadable = readable_verdicts(PROMPT_B, items, REF_SHA256)kept = [item_id for item_id in items if item_id not in {i for i, _ in p1_unreadable + p2_unreadable}]first = passed({item_id: p1_found[item_id] for item_id in kept})second = passed({item_id: p2_found[item_id] for item_id in kept})discordant = (first != second).astype(float)  # 1 where the two prompts disagree on an item, else 0var_d = variance.paired_difference_variance(first, second)mean_d = float((second - first).mean())# The five-point figure, worked: n = (z_alpha + z_beta)^2 * var(d) / delta^2z2, delta2 = variance.z_sum() ** 2, 0.05 ** 2print(f"z sum squared, 95% confidence and 80% power: {z2:.2f}")print(f"var(d), variance of one item paired difference: {var_d:.4f}")print(f"delta squared, a five-point difference: {delta2:.4f}")print(f"n for five points: {z2:.2f} x {var_d:.4f} / {delta2:.4f} = {z2 * var_d / delta2:.1f}, "      f"rounded up to {variance.items_needed(var_d, 5.0)}")# The share rests on the discordant items alone, so its 95% interval is a range for the answer.share_lo, share_hi = bootstrap_mean(discordant)print(f"discordant share, 95% interval: {interval_pct(share_lo, share_hi)}")for end, share in (("low", share_lo), ("high", share_hi)):    # mean(d) stays at its observed value; only the share moves    print(f"items needed for 5 points, {end} end of the share: {variance.items_needed(share - mean_d ** 2, 5.0)}")print(f"items needed for 5 points at {100 * HELD_OUT_LEVEL:.2f}% confidence: "      f"{variance.items_needed_at(var_d, 5.0, ALPHA_HELD_OUT)}")# Only the count is read here: no held-out verdict is opened by this example.held_out_n = len(load_items(split="held-out"))print(f"held-out items (n): {held_out_n}")print(f"smallest difference {held_out_n} held-out items detect at {100 * HELD_OUT_LEVEL:.2f}% and 80% power: "      f"{variance.smallest_difference_at(var_d, held_out_n, ALPHA_HELD_OUT):.1f} points")
출력python sample-size-limits.py
z sum squared, 95% confidence and 80% power: 7.85
var(d), variance of one item paired difference: 0.1006
delta squared, a five-point difference: 0.0025
n for five points: 7.85 x 0.1006 / 0.0025 = 315.9, rounded up to 316
discordant share, 95% interval: [3.8%, 17.7%]
items needed for 5 points, low end of the share: 118
items needed for 5 points, high end of the share: 555
items needed for 5 points at 98.33% confidence: 422
held-out items (n): 40
smallest difference 40 held-out items detect at 98.33% and 80% power: 16.2 points

5점 차이에 대한 계산 과정은 이 예제에서 실행된다. 두 z 값의 합의 제곱은 7.85이다. 한 항목의 쌍체 차이의 분산은 0.1006이다. 5점 차이의 제곱은 0.0025이다. 따라서 n은 7.85 x 0.1006 / 0.0025 = 315.9, rounded up to 316이다.

Miller(2024)는 쌍체 공식을 항목 내부의 잡음을 나타내는 항까지 포함한 더 일반적인 형태로 제시한다. 여기서 쓴 공식은 항목당 응답을 하나만 두어 항목 내부 항을 없앤 형태이다. 그 논문의 입력값으로 푼 예는 약 969개 항목이 된다. 이 입력값은 다른 실험을 설명하는 것이므로, 이 책의 수치는 출력된 실행 결과에서만 가져온다.

검정력은 반대 방향으로도 작용한다. 검정력이 80%이면, 실제 차이에 맞춰 크기를 정한 세트도 그 차이를 다섯 번에 한 번꼴로 놓친다. 이것은 문항 수에 고정된 예산이 치르는 대가이며, 이를 감당할 수 없는 팀은 목표로 삼는 차이를 더 크게 받아들이거나 실행 전에 세트를 늘려야 한다.

평균 차이가 작을 때 필요한 항목 수는 그 비율에 비례하므로, 판정이 갈리는 항목이 두 배인 변경에는 문항도 약 두 배 필요하다. 팀은 개발용 데이터의 쌍체 실행으로 이 비율을 추정해 명시하고, 변경이 측정에 쓴 변경보다 클 때는 다시 확인해야 한다.

주된 추정치에 따르면 5점 차이에는 316개 항목이, 10점 차이에는 79개 항목이 필요하다. 하한은 각 항목 내부의 표집 잡음만 사용하며, 각각 32과 8이라고 말한다. 하한은 필요한 수의 아래쪽 경계로 읽어야 하며, 계획으로 읽어서는 안 된다. 하한은 변형 사이의 불일치를 빼 놓는데, 그 불일치는 실제로 존재한다. 두 프롬프트는 어시스턴트가 얼마나 일정하게 말하는가뿐 아니라 무엇을 말하는가도 바꾼다. 하한이 성립하는 경우는 온도 0.7에서 항목당 응답 하나를 표집하고, 변형이 P1처럼 일정한 비교뿐이다. 잡음에 더해지는 항목은 둘뿐이므로 하한은 아주 적은 항목에 근거한다. 하한으로 세운 계획은 변경이 표집만으로 설명되는 것보다 더 크게 갈릴 때마다 부족해진다.

같은 추정으로 1장 세트에 대한 질문에도 답할 수 있다. 항목이 20개일 때, 위에서 가정한 불일치 아래에서 80% 검정력과 95% 신뢰수준으로 검정이 검출하는 가장 작은 차이는 19.9 points이다.

1장의 세트는 항목의 10.0% (2 of 20)에서 판정이 갈렸다.

그 세트의 구간 폭은 30.0 points였다. 같은 불일치에서 공식은 27.8 points를 준다. 이는 가깝다. 20개 항목 예제가 그 세트를 보여 준다. 이 정도의 불일치에서는 항목 20개로는 10점 차이도 대개 놓치며, 5점 차이를 보고 싶은 팀에는 수십 개가 아니라 수백 개의 항목이 필요하다.

이 추정은 판정이 갈린 항목만을 근거로 하므로 정확한 개수가 아니라 대략적인 규모를 알려 주는 값이다. 그 비율의 95% 구간은 [3.8%, 17.7%]이다. 그 구간 전체에 걸쳐 5점 차이에는 낮은 끝에서 118개, 높은 끝에서 555개의 항목이 필요하다. 이 공식은 정규 근사이고 해석 규칙은 부트스트랩을 쓰므로, 판정이 갈리는 항목이 적을 때 둘은 대략적으로만 일치한다. 홀드아웃 수준인 98.33%에서는 같은 입력으로 5점 차이에 422개 항목이 필요하다.

운영 환경에서 흔한 실수는 감으로 세트 크기를 정한 다음 그 결과를 결정으로 읽는 것이다. 5점 향상을 바라면서 수십 개 항목만 실행한 팀은 대개 검출된 차이가 없다는 결과를 얻고, 이를 변경이 효과가 없다는 판결로 받아들일 수 있다. 실행 전에 불일치 가정과 함께 크기를 적어 두고, 결과를 그에 맞춰 보고한다. 명시된 n에서 검출된 차이가 없다는 것은 그 세트에 대한 발견이며, 실패한 변경이 아니다.

작업 규칙: 비교에 앞서 개발용 데이터에서 쌍체 비교를 실행해 두 변형의 판정이 얼마나 자주 갈리는지 추정하고, 그 비율을 가정으로 명시한다. 관심 있는 차이에 필요한 항목 수를 비교 결과를 읽을 수준(신뢰수준)에서 계산하고, 그 비율의 구간으로 범위를 함께 제시한다. 세트가 그보다 작으면 그 크기의 차이를 검출할 수 없다고 보고하며, 검출된 차이가 없다는 결과를 변경에 불리한 판정으로 읽지 않는다. 하한은 아래쪽 경계로만, 그리고 응답을 표집하는 비교에만 사용한다.

이 판의 이 장

2026.11.3판예제 통과 2026년 11월 21이 장에서 5개 예제개 중 5개가 통과한다

영어판 2026.11.3판을 번역한 것이다.

이 절 인용

형식

각 형식은 이 번역이 따르는 영문 원서를 출처로 표기한다.

모든 형식은 이 판을 명시한다. 링크는 현재 판을 열며, 여기서 절의 제목은 본문이 마지막으로 바뀐 시점을 알려 준다. 접근 날짜와 검색 날짜는 이 자료를 여는 날짜다.

이 페이지의 내용

11장 중 8장: 변경이 더 나은지 판단하고, 질문이 몇 개나 필요한지 가늠하기

  1. 한 항목 안의 분산
  2. The bootstrap over items
  3. Paired comparisons
  4. Held-out, once
  5. 다중 비교
  6. 차이를 확인하려면 몇 개의 문항이 필요한가

맨 위로 돌아가기전체 장