답변이 인용한 문서에, 그리고 요청한 버전에 근거하는지 확인하기

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

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

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

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

이 장을 마치면 답변의 인용이 그 답변의 내용을 뒷받침하는지, 답변의 모든 주장이 어시스턴트에게 주어진 절에 근거하는지, 답변이 독자가 물은 버전에 맞는지, 그리고 그 과정에서 검색이 올바른 절에 도달했는지를 셀 수 있다.

정답이 곧 좋은 답변은 아니다. 이 책의 어시스턴트는 sablefile에 관한 질문에 문서를 근거로 답하며, 질문이 묻는 버전의 기준 답변과 일치하면 그 응답은 통과한다. 그러나 응답은 이 시험을 통과하고도, 문장이 말하는 내용을 담고 있지 않은 절을 인용하거나, 어느 절에도 없는 세부 사항을 덧붙이거나, 다른 버전의 문서에서 사실을 가져올 수 있다. 통과율은 이 가운데 어느 것도 보지 못한다. 주장 옆의 인용을 확인하는 독자는 볼 수 있으며, 어시스턴트에게 인용을 요구하는 까닭이 여기에 있다.

통과율 옆에는 네 가지 검사가 놓이고, 각 검사는 자기만의 분모에 대한 자기만의 집계를 가진다. 인용 정확도는 각 인용이 항목이 뒷받침하는 절로 나열한 절을 가리키는지 묻는다. 충실도는 각 주장이 어시스턴트에게 보여 준 절 안에 있는지 묻는다. 버전 정확성은 답변이 요청한 버전에 맞는지 묻는다. 경로 대비 결과는 통과한 응답이 해당 절을 손에 쥐고 있었는지, 실패한 응답에도 그 절이 있었는지 묻는다. 인용 정확도와 충실도는 거절을 제외하는데, 거절에는 확인할 주장이 없기 때문이다. 버전 정확성과 검색 표는 통과율과 마찬가지로 거절을 포함하며, 각각 거절이 몇 건 들어 있는지를 함께 출력한다.

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

What grounded means here

An answer is grounded when a reader who follows its citations finds the claim where the citation says it is, in the version they asked about. Three things have to hold for that. The citation must exist in that version and support the sentence it is attached to. Every claim in the answer must follow from the sections the assistant read. And the answer must be right for that version, not merely right for some other version that uses the same words.

Take a reader who asks how long a remote fetch waits before it gives up. Suppose the reply gives a plausible answer and cites the section on fetching remote templates, but that section never says how long the wait is. A reader would take the reply as grounded, and the citation looks right. The reader who opens the section finds nothing to support the number. A pass rate would count that reply as correct if the number happened to match the reference. Faithfulness is the check that reads the sections, through a judge. The citation check reads only IDs, and says so.

These failures are different, and each needs its own count. A reply can have a supporting citation and still state a detail the section leaves out, so citation accuracy does not show faithfulness. A reply can be faithful to a section of one version and wrong for another, so faithfulness does not show version-correctness. And a reply can be right and well cited while the retrieval step never reached the section it leans on. Outcome against path exists to find that case.

Working rule: Give each check its own count over its own denominator, and treat a pass as the start of the reading, not the end of it.

인용 정확도

인용은 문서에 대한 주장이다. 이 버전의 이 절이, 인용이 붙은 문장을 뒷받침한다는 주장이다. 다른 주장과 마찬가지로 인용도 틀릴 수 있다. 절이 존재하더라도 다른 내용을 말하고 있을 수 있다. 다른 버전에 속한 절일 수도 있다. 또는 답변이 항목이 나열하지 않은 절을 인용할 수도 있다. Primer는 문장 수준의 점검인 인용된 항목이 무엇을 뒷받침하는지 확인하기와, 모델에 주어진 맥락을 다루는 맥락에 비추어 인용 점검하기를 다룬다. 이 책의 점검은 더 단순하며, 4장의 인용 점검이 그 네 가지 결과를 제시한다. 이 점검은 인용된 각 ID를, 질문받은 버전에 대한 항목의 뒷받침 절 목록과 대조한다. 절을 읽지는 않으므로, 문장에 대해서는 아무것도 말해 주지 않는다.

코드는 같은 답변에서 두 가지 수치를 출력한다. 인용률은 답변된 항목에 있는 모든 인용 중 뒷받침되는 인용을 센다. 항목률은 답변된 항목에서 인용 중 하나라도 뒷받침되면 그 항목을 한 번 센다. 따라서 올바른 인용 하나가 항목 전체를 지탱한다. 질문받은 버전의 절을 인용했지만 항목이 나열하지 않은 경우는 미등재로 출력된다. 그 절이 옳을 수도 있으므로 점검은 이를 틀렸다고 판정하지 않으며, 확인하려고 절을 열어 보지도 않는다. 미등재 인용을 읽는 일은 사람이 판단할 몫이다. 절이 문장을 뒷받침한다면 항목의 뒷받침 절 목록이 불완전한 것이므로 테스트 세트의 소유자가 이를 추가해야 한다. 뒷받침하지 않는다면 인용이 틀린 것이므로 그 답변은 인용에 실패한 것으로 읽어야 한다.

두 분할 모두에서 실행하고, 인용 줄보다 항목 줄을 먼저 읽는다.

citation-accuracy-counts.py Python 3.12.15 · numpy 2.5.5 · pydantic 2.14.3 · typing-extensions 4.16.0 통과
"""Counts the baseline's answered items that cite a supporting section of the asked version, dev and held-out apart.An item counts once, and only if one of its citations is supported; its other citations sit in the citation lines. A declineis not an answer, so it is left out of every count. The check matches each cited ID against the item's listed supportingsection IDs for its asked version. It never reads the section's text, so it does not check what the sentence says.The first line of each split is the point: the item rate."""import lib  # first: fixes the thread counts and seeds before anything else loadsfrom lib.contract import citation_outcomes, parse_reply, section_ids_by_versionfrom lib.prompts import P1_SHA256from lib.replay import ReplayModelfrom lib.stats import pctfrom lib.testset import load_itemsids = section_ids_by_version()  # every version's section IDs, read from the docs, for telling wrong-version from missingmodel = ReplayModel("assistant-baseline", P1_SHA256)  # the baseline's replies, sample 0, made from prompt P1def supporting_ids(item):    """The item's supporting section IDs in its asked version. Another version's listed sections are not counted here."""    return frozenset(s.section_id for s in item.supporting_sections if s.version == item.version)for split in ("dev", "held-out"):    declined = 0    results = {}  # item id -> its citation outcomes, for each answered item    for item in load_items(split=split):        reply = parse_reply(model.reply(item.id, 0))        if reply.declined:            declined += 1        else:            results[item.id] = citation_outcomes(reply, item.version, supporting_ids(item), ids)    # An answer to an unanswerable item lists no section of its asked version, so it can never count as supported here.    outcomes = [outcome for found in results.values() for outcome in found]  # every citation, in item order    with_support = [item_id for item_id, found in results.items() if "supported" in found]    no_support = sorted(set(results) - set(with_support))    print(f"{split} declined items, left out: {declined}")    print(f"{split} answered items: {len(results)}")    print(f"{split} answered items citing a supporting section of the asked version: {pct(len(with_support), len(results))}")    print(f"{split} answered items with no supported citation: {len(no_support)}")    print("  " + (", ".join(no_support) or "none"))    print(f"{split} citations: {len(outcomes)}")    print(f"{split} citations that are supported: {pct(outcomes.count('supported'), len(outcomes))}")    print(f"{split} citations that are unlisted: {pct(outcomes.count('unlisted'), len(outcomes))}")    print(f"{split} citations that are wrong-version or missing: "          f"{pct(outcomes.count('wrong-version') + outcomes.count('missing'), len(outcomes))}")
출력python citation-accuracy-counts.py
dev declined items, left out: 23
dev answered items: 57
dev answered items citing a supporting section of the asked version: 94.7% (54 of 57)
dev answered items with no supported citation: 3
  q-0005, q-0057, q-0058
dev citations: 60
dev citations that are supported: 93.3% (56 of 60)
dev citations that are unlisted: 6.7% (4 of 60)
dev citations that are wrong-version or missing: 0.0% (0 of 60)
held-out declined items, left out: 15
held-out answered items: 25
held-out answered items citing a supporting section of the asked version: 96.0% (24 of 25)
held-out answered items with no supported citation: 1
  q-0090
held-out citations: 33
held-out citations that are supported: 93.9% (31 of 33)
held-out citations that are unlisted: 6.1% (2 of 33)
held-out citations that are wrong-version or missing: 0.0% (0 of 33)

dev에서 항목률은 94.7% (54 of 57)이다.

dev에서 뒷받침되는 인용이 없는 답변된 항목은 3개이며, 출력은 그 항목들의 이름을 알려 준다. held-out에서는 그 수가 1이다.

dev의 인용률은 93.3% (56 of 60)이다. dev의 미등재 인용은 6.7% (4 of 60)이며, 출력은 이를 보고할 뿐 오류로 세지 않는다.

held-out에서 항목률은 96.0% (24 of 25)이고 인용률은 93.9% (31 of 33)이다. held-out의 답변된 항목은 25개뿐이므로, 항목 하나가 비율을 크게 움직인다. 분할 간의 차이를 누군가 실제 차이라고 부르려면 먼저 구간이 있어야 하며, 구간과 표본 크기가 구간을 구하는 방법을 설명한다.

버전이 틀렸거나 누락된 인용은 점검이 이유를 짚어 낼 수 있는 방식으로 틀린 인용이다. dev에서는 0.0% (0 of 60)이고, held-out에서는 0.0% (0 of 33)이다. 따라서 인용률이 100%에 못 미치는 것은 미등재 인용 때문이며, 이는 사람이 읽어야 한다.

두 비율이 어긋나는 데에는 단순한 이유가 있다. 뒷받침되는 인용 하나와 미등재 인용 하나를 가진 항목은 항목률에는 포함되고 인용률은 낮춘다. 두 수치를 함께 읽으면, 빗나간 인용이 항목 전체에 있는지, 아니면 그 밖에는 견고한 항목 안의 개별 인용에 있는지 알 수 있다.

이 점검의 바탕이 되는 발상은 이 책 밖에서도 연구되었다. Gao와 동료들(2023)은 EMNLP 2023에서, 그리고 arXiv에서, 생성된 답변의 인용에 대한 벤치마크를 만들었고, 강력한 모델의 답변 중 상당수가 인용한 구절로 온전히 뒷받침되지 않았다고 보고했다. 그들의 설정은 이 책의 설정과 달랐으므로 그들의 수치는 가져오지 않는다. 이 논문은 발상 때문에 인용한 것이다.

작업 규칙: 항목률과 인용률을 함께 읽고, 프롬프트를 바꾸기 전에 미등재 인용을 각각 읽는다. 미등재 인용은 문서에 던지는 질문이지, 세어 넣을 오류가 아니다.

충실성

인용 정확도는 모델 없이 실행되지만, 그 수치는 인용 중 몇 개가 목록에 있는 절을 가리키는지를 알려 줄 뿐 각 문장이 성립하는지는 알려 주지 않는다. 다음으로 물어야 할 것이 충실성이며, 인용이 전혀 없는 주장을 잡아내는 것도 충실성이다.

인용 정확도는 인용이 달린 문장만 검사한다. 인용 없이 내놓은 주장은 이 검사를 벗어나며, 인용된 절이 일부만 뒷받침하는 주장도 마찬가지다. 충실성은 더 넓은 질문을 던진다. 답변의 모든 주장이 어시스턴트에게 제시된 절에서 도출되는가?

Ragas(Es 외, 2023, 이 역시 사전 공개 논문)는 충실성을 답변의 진술 중 맥락이 뒷받침하는 진술의 비율로 계산한다. 답변을 진술 단위로 나누어 각각을 확인한다. 이 책은 대신 답변마다 질문 하나를 던진다. lib/prompts.py의 충실성 프롬프트는 판정자에게 절과 답변을 준다. 판정자는 답변을 주장 하나씩 읽고, 모든 주장이 성립할 때만 첫 줄에 VERDICT: SUPPORTED를 쓴다. 그렇지 않으면 VERDICT: UNSUPPORTED를 쓰고 이유를 한 문장으로 덧붙인다.

인용 정확도와의 차이는 답변의 중간에서 드러난다. 답변이 두 문장이라고 하자. 첫 문장에는 이를 뒷받침하는 절에 대한 인용이 달려 있고, 둘째 문장에는 절에 없는 세부 사항을 덧붙였기 때문에 인용이 없다. 인용 정확도는 첫 문장만 채점하고 둘째 문장에 대해서는 아무것도 말하지 않는다. 충실성은 답변 전체를 읽으므로 둘째 문장만으로도 그 답변을 뒷받침되지 않는 것으로 표시할 수 있다. 어느 검사도 다른 쪽을 대체하지 못하므로 둘 다 유지한다.

이 판정자의 판정을 사람의 판정과 대조해 본 적이 없으므로, 여기의 모든 충실성 비율은 보정되지 않은 값이다. 판정자는 어시스턴트 자신의 모델인 Qwen3-4B-Instruct-2507이기도 하므로, 그 모델이 쓴 답변을 스스로 채점한다. 이것이 왜 문제가 되는지, 그리고 이 책이 왜 그것을 검증할 수 없는지는 자기 선호에서 설명한다. 판정자를 보정하려면 이 답변들에 대한 사람의 평가가 필요한데, 이 책에는 그것이 없다. 판정자 보정하기는 판정자를 손으로 매긴 평가와 비교하는 방법을 설명한다. 이 비율들은 보정되지 않았으므로 전이 가정이 옮겨 줄 것이 없고, 어디서 멈출 것인가의 한계가 이 비율들에 그대로 적용된다.

faithfulness-rate.py Python 3.12.15 · numpy 2.5.5 · pydantic 2.14.3 · typing-extensions 4.16.0 통과
"""The faithfulness rate of assistant-baseline's answered items, as judged in judge-faithfulness-baseline, dev and held-out apart.An answered item is one the baseline did not decline and whose reply is not empty; a decline is left out. The judge writesSUPPORTED or UNSUPPORTED on its first line. A reply that is neither is printed by item ID and left out of the denominator,never counted as UNSUPPORTED. The judge is uncalibrated: this book has no human ratings for it, so the rates are notcorrected for its errors and are not a calibrated measure. When every readable verdict is the same, the percentilebootstrap cannot vary, so the example says so and prints the exact binomial bound for n of n instead."""import lib  # first: fixes the thread counts and seeds before anything else loadsfrom lib.contract import parse_replyfrom lib.judging import parse_support_verdictfrom lib.prompts import FAITH_SHA256, P1_SHA256from lib.replay import ReplayModelfrom lib.stats import bootstrap_mean, interval_pct, pctfrom lib.testset import load_itemsanswers = ReplayModel("assistant-baseline", P1_SHA256)  # the baseline's replies, sample 0, made from prompt P1judge = ReplayModel("judge-faithfulness-baseline", FAITH_SHA256)  # the judge's replies, made from the faithfulness promptprint("judge: judge-4b, uncalibrated (no human ratings in this book)")for split in ("dev", "held-out"):    answered = []    for item in load_items(split=split):        reply = parse_reply(answers.reply(item.id, 0))        if not reply.declined and reply.text:            answered.append(item.id)    readable = {}  # item id -> 1.0 for SUPPORTED, 0.0 for UNSUPPORTED    for item_id in answered:        raw = judge.reply(item_id, 0)        verdict = parse_support_verdict(raw)        if verdict is None:            line = next((ln.strip().strip("*`").strip() for ln in raw.splitlines() if ln.strip()), "")            print(f'{split} unreadable verdict, left out: {item_id} ("{line}")')        else:            readable[item_id] = 1.0 if verdict == "SUPPORTED" else 0.0    scores = list(readable.values())    lo, hi = bootstrap_mean(scores)  # level 0.95; seed SEED, 2,000 resamples    print(f"{split} answered items: {len(answered)}")    print(f"{split} unreadable verdicts: {len(answered) - len(readable)}")    print(f"{split} faithfulness rate: {pct(int(sum(scores)), len(scores))}")    print(f"{split} 95% interval of the faithfulness rate: {interval_pct(lo, hi)}")    if len(set(scores)) == 1:  # every readable verdict is the same, so resampling cannot vary        print(f"{split} bootstrap interval is degenerate: all {len(scores)} readable verdicts are the same")        if sum(scores) == len(scores):            print(f"{split} exact 95% lower bound for {len(scores)} of {len(scores)}: {100 * 0.025 ** (1 / len(scores)):.1f}%")    if split == "dev":        unfaithful = sorted(item_id for item_id, score in readable.items() if score == 0.0)        print(f"dev unfaithful items, first five: {', '.join(unfaithful[:5])}")
출력python faithfulness-rate.py
judge: judge-4b, uncalibrated (no human ratings in this book)
dev answered items: 57
dev unreadable verdicts: 0
dev faithfulness rate: 94.7% (54 of 57)
dev 95% interval of the faithfulness rate: [87.7%, 100.0%]
dev unfaithful items, first five: q-0013, q-0029, q-0055
held-out answered items: 25
held-out unreadable verdicts: 0
held-out faithfulness rate: 100.0% (25 of 25)
held-out 95% interval of the faithfulness rate: [100.0%, 100.0%]
held-out bootstrap interval is degenerate: all 25 readable verdicts are the same
held-out exact 95% lower bound for 25 of 25: 86.3%

이 예제는 기준선이 답한 항목을 가져와 거절한 항목을 제외하고, 항목마다 판정자에게 묻는다. 읽을 수 있는 판정에 대해서만 비율을 출력한다. SUPPORTED도 UNSUPPORTED도 아닌 답변은 항목별로 출력하되 분모에서는 뺀다. 판정 먼저에서 설명하듯이 그런 답변을 실패로 세는 일은 없다.

dev에서 보정되지 않은 충실성 비율은 94.7% (54 of 57)이다. 그 구간은 [87.7%, 100.0%]이다. 부트스트랩은 비율 척도의 상한 너머로 재표집할 수 없으므로 이 구간의 상단은 그 상한에 놓인다. 그래도 구간은 여전히 넓은데, 답한 항목이 57개라는 점을 생각하면 이것이 정직한 해석이다.

held-out에서 보정되지 않은 충실성 비율은 100.0% (25 of 25)이다. 출력된 구간은 [100.0%, 100.0%]이지만 이것은 구간이 아니다. 출력은 부트스트랩이 퇴화했다고 알린다: all 25 readable verdicts are the same. 모두 통과한 항목들을 재표집하면 같은 비율만 나올 수 있으므로, 부트스트랩은 비율이 어디에 놓이는지에 대해 아무것도 알려 주지 않는다.

정확한 95% 하한은 86.3%이다. 참 비율이 그 값 아래라면 held-out 답변이 모두 통과하는 일은 2.5% 미만의 확률로 일어난다. 이 하한은 0.025의 n분의 1제곱이다. 이것은 판정자가 이 답변들을 통과시켰다는 사실을 보여 줄 뿐, 분할이 너무 작아 비율이 어디에 놓이는지는 보여 주지 못한다. held-out 수치를 어시스턴트가 충실하다는 발견으로 읽어서는 안 된다.

두 검사는 각자의 목록을 출력한다. 인용 출력은 뒷받침되는 인용이 없는 항목을 이름으로 알려 주고, 충실성 출력은 충실하지 않은 처음 몇 개의 dev 항목을 알려 준다. 이 장은 두 목록이 같은 항목을 가리킨다고 가정하지 않으므로 두 목록을 나란히 놓고 읽는다.

작업 규칙: 모든 충실성 비율 옆에 "보정되지 않음"을 적고, 비율을 신뢰하기 전에 충실하지 않다고 판정된 처음 몇 개의 항목을 읽는다. 충실성 검사는 판정자가 어떤 주장을 뒷받침되지 않는다고 말하는 지점을 보여 줄 뿐, 판정자가 옳다는 것을 보여 주지는 않는다.

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

Version-correctness

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

sablefile has three versions of its docs, 1.0, 1.1 and 2.0, and some questions have different answers in each. A reply can be grounded in a section of 1.1 and still be wrong for a reader on 2.0. The book calls these version-dependent items. Each has a reference answer for the version the reader asked about, and its check asks whether the reply matches that reference. There are 17 of them on dev and 8 on held-out.

Version-dependent items count in the pass rate with every other item, and they also get their own count, beside it. A reply to one of them is judged against the reference for the asked version, so a correct answer for another version fails. That miss would look like a weak assistant if it were only mixed into the general rate. The judged-correct rate is the count for version-dependent items alone, so a version miss shows on its own line, and a team can see whether a change to retrieval moved it. Declines stay in that denominator, as they do in the pass rate, and each split prints how many it holds.

A wrong-version citation is a separate count. It is a citation to a section that exists only in another version. A reply can be right for the asked version and still cite another version's section, and a reader who copies that citation lands in the wrong docs.

This check sees only what the ID tells it. A citation carries an ID, not a version. Most IDs repeat across versions, so a section ID that appears in 1.0, 1.1 and 2.0 looks the same in each. An ID that appears in every version can never be flagged as wrong-version, whichever version the reader asked about. The check can flag a citation only when the asked version lacks its ID and another version has it. The index matters too. A citation to another version is possible only when that version's sections are in the index the reply was built from, so the count has to be read again when the index changes, and a zero from an old index says nothing about a new one.

Two variants are read here. The baseline retrieves from the index of the asked version only. The unfiltered variant retrieves from the indexes of every version together, and shows each section's version in its header, so the model can see where a section comes from. The unfiltered variant is the one that could cite another version, since it is shown them.

version-correct-answers.py Python 3.12.15 · numpy 2.5.5 · pydantic 2.14.3 · typing-extensions 4.16.0 통과
"""Reads the 25 version-dependent items for two variants: whether the judge passed the answer for the asked version, and whether acitation names a section that exists only in another version.The judge's verdict for each variant is read from its own recording, and an unreadable verdict is printed and left out of thepass rate, never counted as a fail. A declined reply has a verdict like any other reply, so it stays in the denominator; itscount is printed beside each rate. A wrong-version citation is counted per item, over every item, so a zero shows as 0 of 25.The last lines list the items where the two variants disagree, to read item by item."""import lib  # first: fixes the thread counts and seeds before anything else loadsfrom lib.calibration import readable_verdictsfrom lib.contract import citation_outcomes, parse_reply, section_ids_by_versionfrom lib.prompts import P1_SHA256, REF_SHA256from lib.replay import ReplayModelfrom lib.stats import pctfrom lib.testset import load_itemsids = section_ids_by_version()  # every version's section IDs, so a section of another version is known as one# label, the assistant's recording, the judge's recording of that assistant's repliesVARIANTS = (("baseline", "assistant-baseline", "judge-answers-baseline"), ("unfiltered", "assistant-unfiltered", "judge-answers-unfiltered"))items = [item for item in load_items() if item.kind == "version-dependent"]item_ids = [item.id for item in items]listed = {item.id: frozenset(s.section_id for s in item.supporting_sections if s.version == item.version) for item in items}verdict, wrong = {}, {}  # label -> {item id: PASS or FAIL, readable only}; label -> item ids with a wrong-version citationfor label, assistant, judge in VARIANTS:    verdict[label], unreadable = readable_verdicts(judge, item_ids, REF_SHA256)    for item_id, first in unreadable:        print(f'{label} unreadable verdict, left out: {item_id} ("{first}")')    replies = ReplayModel(assistant, P1_SHA256)    wrong[label] = {item.id for item in items                    if "wrong-version" in citation_outcomes(parse_reply(replies.reply(item.id, 0)), item.version, listed[item.id], ids)}    for split in ("dev", "held-out"):        split_items = [item for item in items if item.split == split]        readable = [item.id for item in split_items if item.id in verdict[label]]        passed = sum(verdict[label][item_id] == "PASS" for item_id in readable)        print(f"{label} {split} version-dependent items: {len(split_items)}")        print(f"{label} {split} declined replies, counted in the denominator: "              f"{sum(parse_reply(replies.reply(item.id, 0)).declined for item in split_items)}")        print(f"{label} {split} judged correct for the asked version: {pct(passed, len(readable))}")        print(f"{label} {split} citing a wrong-version section: "              f"{pct(sum(item.id in wrong[label] for item in split_items), len(split_items))}")    print(f"{label} all version-dependent items citing a wrong-version section: {pct(len(wrong[label]), len(items))}")both = [item_id for item_id in item_ids if item_id in verdict["baseline"] and item_id in verdict["unfiltered"]]print(f"items with a readable verdict in both variants: {len(both)}")differ = [i for i in both if verdict["baseline"][i] != verdict["unfiltered"][i]]print(f"items where the verdicts differ: {len(differ)}")print("  " + (", ".join(differ) or "none"))flag_differ = [i for i in item_ids if (i in wrong["baseline"]) != (i in wrong["unfiltered"])]print(f"items where the wrong-version flag differs: {len(flag_differ)}")print("  " + (", ".join(flag_differ) or "none"))
출력python version-correct-answers.py
baseline dev version-dependent items: 17
baseline dev declined replies, counted in the denominator: 4
baseline dev judged correct for the asked version: 64.7% (11 of 17)
baseline dev citing a wrong-version section: 0.0% (0 of 17)
baseline held-out version-dependent items: 8
baseline held-out declined replies, counted in the denominator: 2
baseline held-out judged correct for the asked version: 75.0% (6 of 8)
baseline held-out citing a wrong-version section: 0.0% (0 of 8)
baseline all version-dependent items citing a wrong-version section: 0.0% (0 of 25)
unfiltered dev version-dependent items: 17
unfiltered dev declined replies, counted in the denominator: 5
unfiltered dev judged correct for the asked version: 52.9% (9 of 17)
unfiltered dev citing a wrong-version section: 0.0% (0 of 17)
unfiltered held-out version-dependent items: 8
unfiltered held-out declined replies, counted in the denominator: 2
unfiltered held-out judged correct for the asked version: 75.0% (6 of 8)
unfiltered held-out citing a wrong-version section: 0.0% (0 of 8)
unfiltered all version-dependent items citing a wrong-version section: 0.0% (0 of 25)
items with a readable verdict in both variants: 25
items where the verdicts differ: 6
  q-0003, q-0021, q-0022, q-0033, q-0082, q-0085
items where the wrong-version flag differs: 0
  none

Across every version-dependent item, the wrong-version share is 0.0% (0 of 25) for the baseline and 0.0% (0 of 25) for the unfiltered variant. A zero says only that the check flagged no ID. The next example shows how few IDs it could have flagged.

version-check-detail.py Python 3.12.15 · numpy 2.5.5 · pydantic 2.14.3 · typing-extensions 4.16.0 통과
"""The two counts behind the version check, and the version-dependent items where the variants' verdicts differ, by split.A wrong-version citation is one whose ID exists only in another version, so an ID that several versions share cannot beattributed to one of them. This prints how many section IDs are found in one version only, then how many citations to theversion-dependent items name a shared ID, for each variant. The last lines list the items where the verdicts differ, by split."""import lib  # first: fixes the thread counts and seeds before anything else loadsfrom collections import Counterfrom lib.calibration import readable_verdictsfrom lib.contract import parse_reply, section_ids_by_versionfrom lib.prompts import P1_SHA256, REF_SHA256from lib.replay import ReplayModelfrom lib.stats import pctfrom lib.testset import load_itemsids = section_ids_by_version()shared = Counter(i for found in ids.values() for i in found)  # how many versions each section ID appears inprint("section IDs found in one version only, by version: "      + ", ".join(f"{v} {sum(shared[i] == 1 for i in found)}" for v, found in ids.items()))items = [item for item in load_items() if item.kind == "version-dependent"]split_of = {item.id: item.split for item in items}verdict = {}  # label -> {item id: PASS or FAIL}, readable onlyfor label, assistant, judge in (("baseline", "assistant-baseline", "judge-answers-baseline"),                                ("unfiltered", "assistant-unfiltered", "judge-answers-unfiltered")):    replies = ReplayModel(assistant, P1_SHA256)    cited = [cid for item in items for cid in parse_reply(replies.reply(item.id, 0)).citations]    print(f"{label} citations to a section ID found in more than one version: "          f"{pct(sum(shared[cid] > 1 for cid in cited), len(cited))}")    verdict[label], _ = readable_verdicts(judge, list(split_of), REF_SHA256)differ = [i for i in verdict["baseline"] if i in verdict["unfiltered"] and verdict["baseline"][i] != verdict["unfiltered"][i]]for split in ("dev", "held-out"):    part = [i for i in differ if split_of[i] == split]    print(f"{split} items where the verdicts differ: {len(part)}")    print("  " + (", ".join(part) or "none"))
출력python version-check-detail.py
section IDs found in one version only, by version: 1.0 0, 1.1 0, 2.0 4
baseline citations to a section ID found in more than one version: 87.0% (20 of 23)
unfiltered citations to a section ID found in more than one version: 63.2% (12 of 19)
dev items where the verdicts differ: 4
  q-0003, q-0021, q-0022, q-0033
held-out items where the verdicts differ: 2
  q-0082, q-0085

The section IDs found in only one version, counted by version, are 1.0 0, 1.1 0, 2.0 4. An ID found in more than one version can still be flagged, but only for a reader on a version that lacks it. For the baseline, the share of citations to version-dependent items that name a shared ID is 87.0% (20 of 23). For the unfiltered variant it is 63.2% (12 of 19).

The judged-correct rates differ, though each is read on a small split. On dev, the baseline is judged correct on 64.7% (11 of 17).

The unfiltered variant is judged correct on 52.9% (9 of 17). On these items, the unfiltered variant passes fewer.

On held-out, the baseline is judged correct on 75.0% (6 of 8). The unfiltered variant has the same rate, but it passes different items. The verdicts go in opposite directions on q-0082 and q-0085, and the other held-out items agree.

Across both variants, the verdicts differ on 6 items, out of 25 with a readable verdict in each. On dev, 4 of them differ, and on held-out, 2. The output lists them by split.

No interval is computed for these differences, and a dev split of this size is small. So this chapter reports the counts and does not call either variant better or worse. The counts say three things: on these items the unfiltered variant passed fewer, no citation was flagged as wrong-version on either variant, and the differing verdicts are the place to read first.

Working rule: Read each citation's ID with the version of the answer beside it. A zero from this check means no flagged ID, not no wrong-version citation. Keep version-dependent items in their own count beside the pass rate, so a version miss shows up on its own line.

결과와 경로

결과는 응답이 통과했는지 여부다. 경로는 응답 이전의 단계들이 무엇에 도달했는지를 말한다. 이 책에서 경로는 짧다. 한 번의 검색 뒤에 한 번의 응답이 나온다. 두 가지 조합은 결과 집계와 경로 집계를 모두 봐야 알 수 있다. 근거가 되는 절이 모델에 도달하지 않았는데 통과한 응답은 다른 곳에서 나온 것이다. 모델 자신의 지식일 수도 있으며, 판정이 맞더라도 이는 경고 신호다. 절을 검색했는데도 실패한 경우는 나머지 검사들이 그 원인을 설명하려고 존재하는 바로 그 사례다.

여러 단계로 이루어진 실행은 경로가 더 길다. Agent Harnesses는 경로를 통해 작업을 집계하며, 그 내용은 해당 책에서 다룬다. 이 장은 어시스턴트가 가진 단 하나의 단계를 채점한다.

검색 단계

검색은 질문이 가리키는 버전의 절들에 대해 BM25를 적용한다. 이 과정은 결정적이다. 같은 질문에는 매번 같은 상위 절이 나온다. 따라서 이 단계에는 기록이 필요 없다. 코드는 색인에서 각 항목의 상위 절을 계산하고, 이를 심사자가 기준선의 응답에 내린 판정과 대조한다.

질문이 가리키는 버전에 뒷받침하는 절이 없는 개발 항목은 표에서 제외한다. 이들은 답할 수 없는 항목이다. 질문이 가리키는 버전의 절이 존재하지 않아, 검색이 찾아낼 대상이 없기 때문이다. 이 항목의 수는 13이다.

retrieval-path.py Python 3.12.15 · bm25s 0.3.16 · numpy 2.5.5 · pydantic 2.14.3 · typing-extensions 4.16.0 통과
"""Sets the baseline's judge verdict against whether a supporting section reached the top k, for each dev item that has one.Retrieval is BM25 over the asked version, so it is the same on every run and needs no recording; k is the baseline's, read fromits manifest. The two diagonal cells are the expected pairs. The two off-diagonal cells are the ones to read: a pass without theright section retrieved, and a fail with it retrieved. Unanswerable items are left out, since they have no section of their askedversion to retrieve; their count is printed. An unreadable verdict is printed and left out, never counted as a fail. A declined reply is counted in its cell like anyother reply; the count of declines is printed. The FAIL cell is split into declines and answers in fail-with-section."""import lib  # first: fixes the thread counts and seeds before anything else loadsfrom lib.answers import Assistantfrom lib.calibration import readable_verdictsfrom lib.contract import parse_replyfrom lib.prompts import P1_SHA256, P1_SYSTEM, REF_SHA256from lib.replay import ReplayModelfrom lib.testset import load_itemsRECORDING = "assistant-baseline"k = ReplayModel(RECORDING, P1_SHA256).manifest["k"]  # the top k the baseline's prompt was built from, read from its manifestassistant = Assistant(RECORDING, P1_SYSTEM, P1_SHA256, k=k)  # its retriever only; the recording is not read herereplies = ReplayModel(RECORDING, P1_SHA256)  # the baseline's replies, sample 0, made from prompt P1, for the decline checkdev = load_items(split="dev")has_support = [item for item in dev if any(s.version == item.version for s in item.supporting_sections)]print(f"top k: {k}")print(f"dev items: {len(dev)}")print(f"dev items with no supporting section of the asked version, left out: {len(dev) - len(has_support)}")verdicts, unreadable = readable_verdicts("judge-answers-baseline", [item.id for item in has_support], REF_SHA256)for item_id, first in unreadable:    print(f'unreadable verdict, left out: {item_id} ("{first}")')# Keyed by (retrieved, passed): the four cells of the 2 by 2 table, each a list of item ids in sorted order.cells = {(True, True): [], (True, False): [], (False, True): [], (False, False): []}declined = set()  # item ids whose reply is a decline; they sit in their cells like any other replyfor item in has_support:    if item.id not in verdicts:        continue    listed = {s.section_id for s in item.supporting_sections if s.version == item.version}    top = {section.section_id for section in assistant.sections(item)}  # the top k sections, by BM25 rank    cells[(bool(listed & top), verdicts[item.id] == "PASS")].append(item.id)    if parse_reply(replies.reply(item.id, 0)).declined:        declined.add(item.id)print(f"items in the table: {sum(len(ids) for ids in cells.values())}")print(f"declined items in the table, counted in their cells: {len(declined)}")print(f"right section in the top {k}, PASS: {len(cells[(True, True)])}")print(f"right section in the top {k}, FAIL: {len(cells[(True, False)])}")print(f"right section not in the top {k}, PASS: {len(cells[(False, True)])}")print(f"right section not in the top {k}, FAIL: {len(cells[(False, False)])}")print("passed without the right section retrieved: " + (", ".join(cells[(False, True)]) or "none"))print("failed with the right section retrieved: " + (", ".join(cells[(True, False)]) or "none"))
출력python retrieval-path.py
top k: 3
dev items: 80
dev items with no supporting section of the asked version, left out: 13
unreadable verdict, left out: q-0043 ("VERDICT: PARTIAL")
items in the table: 66
declined items in the table, counted in their cells: 10
right section in the top 3, PASS: 49
right section in the top 3, FAIL: 10
right section not in the top 3, PASS: 0
right section not in the top 3, FAIL: 7
passed without the right section retrieved: none
failed with the right section retrieved: q-0019, q-0023, q-0025, q-0029, q-0033, q-0045, q-0046, q-0048, q-0063, q-0074

상위 k는 3이며, 기준선의 매니페스트에서 읽은 값이다. 표에는 66개 항목이 있고, 그중 10개는 답변 거절이다. 심사자가 판정을 내렸으므로, 답변 거절도 다른 응답과 마찬가지로 해당 칸에 들어간다. 각 칸은 판정과, 뒷받침하는 절이 상위 k에 들었는지 여부를 짝지은 것이다.

판정 뒷받침하는 절이 상위 k에 있음 뒷받침하는 절이 상위 k에 없음
PASS 49 0
FAIL 10 7

PASS 행부터 읽는다. 절이 상위 k에 든 통과의 칸에는 49건이, 들지 않은 통과의 칸에는 0건이 들어 있다. 이는 통과가 문서에서 비롯되었다는 해석과 모순되지 않는다. 그러나 실제로 그랬음을 보여 주지는 않는다. 표는 두 사건이 함께 일어나는 빈도를 세는 것이지, 어느 쪽이 다른 쪽의 원인인지를 말해 주지 않기 때문이다. 통과의 수는 참조 답안에 대한 점검이기도 하다. 절이 검색되지 않았는데도 통과한 경우는, 흔한 사실을 되풀이하는 응답이나 독자가 짐작할 수 있는 참조 답안에서 나올 수 있으며, 표만으로는 어느 쪽인지 알 수 없다. 해당 항목을 직접 읽으면 알 수 있다.

나머지 점검은 FAIL 행에서 작동한다. 절이 상위 k에 든 실패 가운데 5건은 답변 거절이고, 나머지는 답을 한 경우이다. 문서에 답이 없을 때의 답변 거절은 문서에 답이 있는데도 답변을 거절했을 때 그것이 무엇을 뜻하는지 다룬다. 아래 예제는 이 칸을 나누어 보여 준다.

fail-with-section.py Python 3.12.15 · bm25s 0.3.16 · numpy 2.5.5 · pydantic 2.14.3 · typing-extensions 4.16.0 통과
"""The dev items the baseline failed although a listed section of the asked version was in its top k, split into declines and answers.For each answer it prints whether the reply cites a listed section, and the faithfulness judge's verdict on it. A decline has nofaithfulness verdict, because the judge reads only answers. An unreadable verdict is printed and left out, never counted as a fail."""import lib  # first: fixes the thread counts and seeds before anything else loadsimport refrom lib.answers import Assistantfrom lib.calibration import readable_verdictsfrom lib.contract import citation_outcomes, parse_reply, section_ids_by_versionfrom lib.prompts import FAITH_SHA256, P1_SHA256, P1_SYSTEM, REF_SHA256from lib.replay import ReplayModelfrom lib.testset import load_itemsRECORDING = "assistant-baseline"k = ReplayModel(RECORDING, P1_SHA256).manifest["k"]  # the baseline's top k, as in retrieval-pathassistant = Assistant(RECORDING, P1_SYSTEM, P1_SHA256, k=k)  # its retriever onlyreplies = ReplayModel(RECORDING, P1_SHA256)  # the baseline's replies, sample 0, made from prompt P1faith = ReplayModel("judge-faithfulness-baseline", FAITH_SHA256)ids = section_ids_by_version()VERDICT = re.compile(r"^VERDICT:\s*(SUPPORTED|UNSUPPORTED)$")def listed(item):    """The item's supporting section IDs in its asked version."""    return frozenset(s.section_id for s in item.supporting_sections if s.version == item.version)dev = load_items(split="dev")verdicts, unreadable = readable_verdicts("judge-answers-baseline", [item.id for item in dev], REF_SHA256)for item_id, first in unreadable:    print(f'unreadable verdict, left out: {item_id} ("{first}")')fails = [item for item in dev if verdicts.get(item.id) == "FAIL" and listed(item) & {s.section_id for s in assistant.sections(item)}]declined = [item for item in fails if parse_reply(replies.reply(item.id, 0)).declined]answered = [item for item in fails if item not in declined]print(f"right section in the top {k}, FAIL, declined: {len(declined)}")print(f"right section in the top {k}, FAIL, answered: {len(answered)}")print(f"answered FAIL with the section, citing a listed section: "      f"{sum('supported' in citation_outcomes(parse_reply(replies.reply(item.id, 0)), item.version, listed(item), ids) for item in answered)}")judged = {}  # item id -> SUPPORTED, UNSUPPORTED or unreadable, for each answered failfor item in answered:    line = next((ln.strip().strip("*`").strip() for ln in faith.reply(item.id, 0).splitlines() if ln.strip()), "")    match = VERDICT.match(line)    judged[item.id] = match.group(1) if match else "unreadable"print(f"answered FAIL with the section, faithfulness SUPPORTED: {sum(v == 'SUPPORTED' for v in judged.values())}")print(f"answered FAIL with the section, faithfulness UNSUPPORTED: {sum(v == 'UNSUPPORTED' for v in judged.values())}")print("  " + (", ".join(i for i, v in judged.items() if v == "UNSUPPORTED") or "none"))print(f"answered FAIL with the section, faithfulness unreadable: {sum(v == 'unreadable' for v in judged.values())}")
출력python fail-with-section.py
unreadable verdict, left out: q-0043 ("VERDICT: PARTIAL")
right section in the top 3, FAIL, declined: 5
right section in the top 3, FAIL, answered: 5
answered FAIL with the section, citing a listed section: 5
answered FAIL with the section, faithfulness SUPPORTED: 4
answered FAIL with the section, faithfulness UNSUPPORTED: 1
  q-0029
answered FAIL with the section, faithfulness unreadable: 0

답을 한 실패 가운데 5건은 항목이 열거한 절을 인용한다. 충실성 심사자는 그중 4건을 통과시키고 1건을 근거 없음으로 표시하는데, 이것이 q-0029이다. 이 수치만으로는 나머지가 잘못된 답변 거절, 버전 오류, 답안 심사자의 오류 중 무엇 때문인지 알 수 없다. 응답을 직접 읽으면 알 수 있다.

판정이 PASS도 FAIL도 아닌 PARTIAL로 나온 항목이 하나 있다. q-0043에 대한 심사자의 판정이 PARTIAL이므로, 표는 이 항목을 제외한다. 읽을 수 없는 판정은 실패로 세지 않는다.

작업 규칙: 검색은 통과에 대한 관문으로, 실패에 대한 단서로 다룬다. 뒷받침하는 절이 없는 통과에는 설명이 필요하고, 절이 있는 실패는 응답 자체를 가리킨다.

에이전트 하니스가 이어받는 지점

작업이 여러 단계로 이루어지면 각 단계는 도구를 호출할 수 있고, 그 호출은 다음 단계가 보게 되는 내용을 바꾼다. 중간 단계에서 문제가 생겼어도 최종 결과는 통과할 수 있으므로, 횟수는 경로 전체에 걸쳐 세어야 한다. 이 책은 검색 한 번과 응답 한 번을 채점하므로, 경로 횟수는 항목마다 예 또는 아니요로 정해진다. 경로를 따라 센 작업을 다루는 절은 Agent Harnesses에 있으며, 이런 종류의 실행을 채점하는 방법도 그곳에서 다룬다. 이 장에서는 이를 반복하지 않는다.

작업 규칙: 이 책에서 경로는 검색 한 번과 응답 한 번이므로, 항목마다 검색 횟수를 판정 결과와 함께 읽는다.

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

Retrieval quality belongs to another book

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

How well retrieval orders the sections, and how much of the context it fills, is a question about ranking, and it belongs to A Primer on Search Relevance. Its choosing a ranking metric section covers recall at k, mean reciprocal rank and nDCG, and how to choose among them. Measuring the context covers the context a model is given. Read both before you pick a metric for this assistant.

The retrieval-path count asks one question of each item: is a supporting section of the asked version in the top k? It returns yes or no, so it is not a ranking metric. It cannot say how far down the list that section sits, and that is what a ranking metric is for. Its k is read from the baseline's manifest and is not chosen in this chapter, so a change to k moves the table, and the table has to be read again.

Taken together, the four checks say that a pass rate on this assistant hides three different ways of being wrong. The reply can cite the wrong thing, state what no section says, or answer for the wrong version. Each one needs its own count, its own denominator and its own word for what it found. The decisions that follow from the results are these:

  • Each reply is checked for citations, faithfulness and version, and each check keeps its own count.
  • Every faithfulness rate is printed as uncalibrated until someone checks the judge against people.
  • Version-dependent items keep their own count beside the pass rate, and their own version check.
  • Retrieval is a gate on passes and a lead on fails. A pass whose section was not retrieved is read before it is counted as grounded.

Working rule: Before you call a reply grounded, read its citation, its claims and its version, and read the retrieval that came before it.

이 판의 이 장

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

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

이 절 인용

형식

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

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

이 페이지의 내용

11장 중 9장: 답변이 인용한 문서에, 그리고 요청한 버전에 근거하는지 확인하기

  1. What grounded means here
  2. 인용 정확도
  3. 충실성
  4. Version-correctness
  5. 결과와 경로
  6. 검색 단계
  7. 에이전트 하니스가 이어받는 지점
  8. Retrieval quality belongs to another book

맨 위로 돌아가기전체 장