BurnyCoder commited on
Commit
0aa6bb2
·
verified ·
1 Parent(s): 0338b09

matched-depth-registration · 1b58b085a16b

Browse files
README.md CHANGED
@@ -9,6 +9,34 @@ A small language model solves numbered arithmetic problems. A second call judges
9
  For example, a solver can give the right final answer to (4 + 3) × 2 while recording 8 in the first step. A reviewer can endorse the correct rejection and still give the wrong correction. The study distinguishes both mistakes.
10
 
11
  <!-- RESULTS:START -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  ## Why did the two-judge and three-judge solvers diverge?
13
 
14
  **With seed 17, training the solver with two frozen judges gave 25/32 correct solutions (78.1%). Training it with three gave 3/32 (9.4%).** The gap was 22 complete solutions (-68.75 percentage points, three minus two). Only the solver adapter learned. All judging used the frozen, original Qwen instruction model. Both solvers started from the same model and saw the same problems in the same order. An integer program graded every intermediate step. On the paired problems, only the two-judge solver was correct on 23, only the three-judge solver on 1, both on 2, and neither on 6. These are development results on the calibrated arithmetic benchmark.
 
9
  For example, a solver can give the right final answer to (4 + 3) × 2 while recording 8 in the first step. A reviewer can endorse the correct rejection and still give the wrong correction. The study distinguishes both mistakes.
10
 
11
  <!-- RESULTS:START -->
12
+ ## Matched accuracy by judge depth
13
+
14
+ Each column adds one review of the preceding judge. Judge 1 checks the solver, Judge 2 checks Judge 1, and Judge 3 checks Judge 2. Across a solver-training row only the depth of its reward changes. All solver comparisons here use seed 17.
15
+
16
+ ### Development solver accuracy
17
+
18
+ Every solver answers the same 32 questions. A solution is correct when every intermediate value is correct. Fitted judges stay frozen during solver updates.
19
+
20
+ | Training condition | One judge · J1 | Two judges · J2 checks J1 | Three judges · J3 checks J2 |
21
+ | --- | --- | --- | --- |
22
+ | Only solver trained · original judges | 21/32 (65.6%) | 25/32 (78.1%) | 3/32 (9.4%) |
23
+ | Exact-trained judges, then solver | Pending | Pending | 25/32 (78.1%) |
24
+ | Top-down-trained judges, then solver | Pending | Pending | 28/32 (87.5%) |
25
+
26
+ ### Development judge verdict accuracy
27
+
28
+ Every judge grades the same 32 saved responses from the starting solver. A verdict is correct when it agrees with the arithmetic checker. In all judge-only conditions the solver itself stays at 20/32 (62.5%) on the 32 solver-evaluation questions.
29
+
30
+ | Training condition | One judge · J1 | Two judges · J2 checks J1 | Three judges · J3 checks J2 |
31
+ | --- | --- | --- | --- |
32
+ | Original frozen judges | 19/32 (59.4%) | 19/32 (59.4%) | 17/32 (53.1%) |
33
+ | Exact labels · only final judge trained | 20/32 (62.5%) | 19/32 (59.4%) | 18/32 (56.2%) |
34
+ | Exact labels · all participating judges trained | 20/32 (62.5%) | Pending | Pending |
35
+ | Top-down supervision · only final judge trained | 20/32 (62.5%) | 19/32 (59.4%) | 18/32 (56.2%) |
36
+ | Top-down supervision · all participating judges trained | 20/32 (62.5%) | Pending | Pending |
37
+
38
+ “Only final judge trained” fits the judge used for that column’s terminal decision and uses original judges for preceding calls. “All participating judges trained” uses fitted adapters at every depth. Top-down training uses the shared exact-trained Judge 3. Pending cells have no completed matched measurement. [Matched comparison protocol](reports/matched-depth-protocol.md)
39
+
40
  ## Why did the two-judge and three-judge solvers diverge?
41
 
42
  **With seed 17, training the solver with two frozen judges gave 25/32 correct solutions (78.1%). Training it with three gave 3/32 (9.4%).** The gap was 22 complete solutions (-68.75 percentage points, three minus two). Only the solver adapter learned. All judging used the frozen, original Qwen instruction model. Both solvers started from the same model and saw the same problems in the same order. An integer program graded every intermediate step. On the paired problems, only the two-judge solver was correct on 23, only the three-judge solver on 1, both on 2, and neither on 6. These are development results on the calibrated arithmetic benchmark.
docs/assets/study.json CHANGED
@@ -203388,6 +203388,66 @@
203388
  "completed_development": false
203389
  }
203390
  ],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
203391
  "primary": {
203392
  "status": "pending",
203393
  "reason": "Incomplete matched final checkpoints or IDs",
 
203388
  "completed_development": false
203389
  }
203390
  ],
203391
+ "matched_depth": [
203392
+ {
203393
+ "phase": "development",
203394
+ "solver": [
203395
+ [
203396
+ "Only solver trained · original judges",
203397
+ "21/32 (65.6%)",
203398
+ "25/32 (78.1%)",
203399
+ "3/32 (9.4%)"
203400
+ ],
203401
+ [
203402
+ "Exact-trained judges, then solver",
203403
+ "Pending",
203404
+ "Pending",
203405
+ "25/32 (78.1%)"
203406
+ ],
203407
+ [
203408
+ "Top-down-trained judges, then solver",
203409
+ "Pending",
203410
+ "Pending",
203411
+ "28/32 (87.5%)"
203412
+ ]
203413
+ ],
203414
+ "judge": [
203415
+ [
203416
+ "Original frozen judges",
203417
+ "19/32 (59.4%)",
203418
+ "19/32 (59.4%)",
203419
+ "17/32 (53.1%)"
203420
+ ],
203421
+ [
203422
+ "Exact labels · only final judge trained",
203423
+ "20/32 (62.5%)",
203424
+ "19/32 (59.4%)",
203425
+ "18/32 (56.2%)"
203426
+ ],
203427
+ [
203428
+ "Exact labels · all participating judges trained",
203429
+ "20/32 (62.5%)",
203430
+ "Pending",
203431
+ "Pending"
203432
+ ],
203433
+ [
203434
+ "Top-down supervision · only final judge trained",
203435
+ "20/32 (62.5%)",
203436
+ "19/32 (59.4%)",
203437
+ "18/32 (56.2%)"
203438
+ ],
203439
+ [
203440
+ "Top-down supervision · all participating judges trained",
203441
+ "20/32 (62.5%)",
203442
+ "Pending",
203443
+ "Pending"
203444
+ ]
203445
+ ],
203446
+ "solver_n": 32,
203447
+ "judge_n": 32,
203448
+ "frozen_solver": "20/32 (62.5%)"
203449
+ }
203450
+ ],
203451
  "primary": {
203452
  "status": "pending",
203453
  "reason": "Incomplete matched final checkpoints or IDs",
docs/explorer.js CHANGED
@@ -56,6 +56,27 @@ function exampleCard(title, lines, error) {
56
  card.append(heading, record);
57
  return card;
58
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  function showRun() {
60
  const r = study?.runs.find(item => item.name === byId("run").value);
61
  for(const name of ["examples","evidence","curve","replay"]) byId(name).replaceChildren();
@@ -99,6 +120,7 @@ async function update() {
99
  byId("primary").textContent=p.delta == null ? "Awaiting matched final checkpoints for all registered seeds." : "Three judges minus two: "+(p.delta*100).toFixed(2)+" points. 95% interval "+p.ci.map(x=>(100*x).toFixed(2)).join(" to ")+". Decision: "+p.status+".";
100
  byId("progress").textContent=study.runs.filter(r=>r.updates != null && !r.diagnostic).length+" of "+study.planned+" registered training blocks completed. "+(study.sealed?"Checkpoint manifest sealed.":"Final test sealed during development.");
101
  if (study.profile?.family) byId("progress").textContent += " Amended benchmark · "+study.profile.family+" arithmetic with "+study.profile.style+" prompts.";
 
102
  const cal=study.learnability;
103
  byId("calibration").replaceChildren();
104
  byId("readiness").textContent=cal?.screen?.selected ? "Selected "+cal.screen.selected.family+" with "+cal.screen.selected.style+" prompts." :
 
56
  card.append(heading, record);
57
  return card;
58
  }
59
+ function showMatched(grids) {
60
+ const section=byId("matched-section"), target=byId("matched-tables");
61
+ target.replaceChildren();
62
+ section.hidden=grids.length===0;
63
+ for (const grid of [...grids].reverse()) {
64
+ const split=grid.phase==="development" ? "Development" : "Held-out";
65
+ for (const [label,records] of [["solver accuracy",grid.solver],["judge verdict accuracy",grid.judge]]) {
66
+ const wrapper=document.createElement("div"), table=document.createElement("table");
67
+ wrapper.className="scroll";
68
+ table.createCaption().textContent=split+" "+label+" · seed 17";
69
+ const header=table.createTHead().insertRow();
70
+ for (const label of ["Training condition","One judge","Two · J2 checks J1","Three · J3 checks J2"]) {
71
+ const cell=document.createElement("th");
72
+ cell.scope="col"; cell.textContent=label; header.append(cell);
73
+ }
74
+ const body=table.createTBody();
75
+ for (const fields of records) row(body,fields);
76
+ wrapper.append(table); target.append(wrapper);
77
+ }
78
+ }
79
+ }
80
  function showRun() {
81
  const r = study?.runs.find(item => item.name === byId("run").value);
82
  for(const name of ["examples","evidence","curve","replay"]) byId(name).replaceChildren();
 
120
  byId("primary").textContent=p.delta == null ? "Awaiting matched final checkpoints for all registered seeds." : "Three judges minus two: "+(p.delta*100).toFixed(2)+" points. 95% interval "+p.ci.map(x=>(100*x).toFixed(2)).join(" to ")+". Decision: "+p.status+".";
121
  byId("progress").textContent=study.runs.filter(r=>r.updates != null && !r.diagnostic).length+" of "+study.planned+" registered training blocks completed. "+(study.sealed?"Checkpoint manifest sealed.":"Final test sealed during development.");
122
  if (study.profile?.family) byId("progress").textContent += " Amended benchmark · "+study.profile.family+" arithmetic with "+study.profile.style+" prompts.";
123
+ showMatched(study.matched_depth ?? []);
124
  const cal=study.learnability;
125
  byId("calibration").replaceChildren();
126
  byId("readiness").textContent=cal?.screen?.selected ? "Selected "+cal.screen.selected.family+" with "+cal.screen.selected.style+" prompts." :
docs/index.html CHANGED
@@ -2,6 +2,7 @@
2
  <html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>Recursive judge study</title><link rel="stylesheet" href="style.css"></head>
3
  <body><main>
4
  <header><div><h1>Does a third judge help?</h1><p>Recursive LLM judgments as rewards for an arithmetic solver trained with GRPO.</p></div><nav><a href="https://github.com/BurnyCoder/verifying-verifier-of-verifier-llm-reinforcement-learning/blob/main/reports/preregistration.md">Protocol</a><a href="https://github.com/BurnyCoder/verifying-verifier-of-verifier-llm-reinforcement-learning/blob/main/reports/paper.pdf">Paper</a></nav></header>
 
5
  <section aria-labelledby="outcome"><h2 id="outcome">Primary comparison</h2><p id="primary" aria-live="polite">Loading observations…</p><p id="progress"></p></section>
6
  <section><h2>Benchmark learnability</h2><p id="readiness"></p><div class="scroll"><table><thead><tr><th>Family</th><th>Prompt</th><th>Parsed</th><th>Sample exact</th><th>Greedy exact</th><th>Mixed groups</th></tr></thead><tbody id="calibration"></tbody></table></div><p id="learned"></p><img id="validation-chart" hidden alt="Complete-trace accuracy on the same fresh problems and available paired contrasts"></section>
7
  <section><h2>Run results</h2><div class="scroll"><table><thead><tr><th>Run</th><th>Role</th><th>Updates</th><th>Dev. exact</th><th>Dev. size</th><th>Held-out exact</th><th>Held-out size</th></tr></thead><tbody id="results"></tbody></table></div><p>Solver scores require the complete calculation. Judge scores require the complete evidence record.</p></section>
 
2
  <html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>Recursive judge study</title><link rel="stylesheet" href="style.css"></head>
3
  <body><main>
4
  <header><div><h1>Does a third judge help?</h1><p>Recursive LLM judgments as rewards for an arithmetic solver trained with GRPO.</p></div><nav><a href="https://github.com/BurnyCoder/verifying-verifier-of-verifier-llm-reinforcement-learning/blob/main/reports/preregistration.md">Protocol</a><a href="https://github.com/BurnyCoder/verifying-verifier-of-verifier-llm-reinforcement-learning/blob/main/reports/paper.pdf">Paper</a></nav></header>
5
+ <section id="matched-section" hidden><h2>Matched accuracy by judge depth</h2><p>Each solver answers the same questions. Each judge grades the same saved starting-solver answers. Counts show successes out of all observations in that cohort.</p><div id="matched-tables"></div></section>
6
  <section aria-labelledby="outcome"><h2 id="outcome">Primary comparison</h2><p id="primary" aria-live="polite">Loading observations…</p><p id="progress"></p></section>
7
  <section><h2>Benchmark learnability</h2><p id="readiness"></p><div class="scroll"><table><thead><tr><th>Family</th><th>Prompt</th><th>Parsed</th><th>Sample exact</th><th>Greedy exact</th><th>Mixed groups</th></tr></thead><tbody id="calibration"></tbody></table></div><p id="learned"></p><img id="validation-chart" hidden alt="Complete-trace accuracy on the same fresh problems and available paired contrasts"></section>
8
  <section><h2>Run results</h2><div class="scroll"><table><thead><tr><th>Run</th><th>Role</th><th>Updates</th><th>Dev. exact</th><th>Dev. size</th><th>Held-out exact</th><th>Held-out size</th></tr></thead><tbody id="results"></tbody></table></div><p>Solver scores require the complete calculation. Judge scores require the complete evidence record.</p></section>
reports/matched-depth-protocol.md ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Matched comparisons of solver training and judge training
2
+
3
+ 27 November 2026. This extension follows a request to compare one, two, and three judging calls under the same conditions. The first seed's original and calibrated development outcomes, including the direct alternating solver, were already visible. The additional shallow solvers, complete trained-stack replays and sealed test outcomes were unseen when this protocol was written. These comparisons are descriptive. The original three-seed primary decision rule remains in the [preregistration](preregistration.md).
4
+
5
+ ## Solver accuracy
6
+
7
+ Cross three reward depths with three sources of judges. Use the original frozen Qwen judges, the existing exact-label-trained judge adapters, or the existing top-down-trained judge adapters. A depth-one solver receives Judge 1's solution verdict. Depth two adds Judge 2's review of Judge 1. Depth three adds Judge 3's review of Judge 2. A positive review of a sound rejection gives the solver zero.
8
+
9
+ Reuse the existing frozen-judge solvers and both fully pretrained depth-three solvers. Train four fresh solvers named `exact-depth1`, `exact-depth2`, `top-depth1` and `top-depth2`. Fix seed 17, the calibrated task and worked examples, solver initialization, example order, group size four, learning rate, optimizer updates, response budgets, stopping rules and greedy evaluation. All fitted judge adapters stay frozen during each solver run. The two routes share the exact-trained Judge 3. Count every intermediate step. Compare the same 32 development and 2,048 sealed problems. Audit the realized training order and seal all four additional checkpoint digests before held-out evaluation.
10
+
11
+ ## Judge accuracy
12
+
13
+ Hold the starting solver's saved answers fixed, including every space and formatting error. Measure whether the final verdict at each depth agrees with the exact checker. Reuse the same 32 development answers and the same 128 held-out answers used in the registered natural-review replay. Keep the question order, grouping, evaluation seeds and judgment sampling settings identical. The untrained and individually trained judge conditions already have these observations. For each of the two complete trained judge stacks, replay the full chain once and score all three prefixes. A one-call cell can reuse the same Judge 1 checkpoint and the same answers from its isolated evaluation. Record and compare the actual source traces and lower reports.
14
+
15
+ The individually trained condition changes only the judge at the depth being scored. The complete-stack condition uses fitted adapters for every participating role. Each solver-trained row measures new solutions to common questions. Each judge-trained row measures judgments on identical previously written answers. Keeping the solver frozen fixes its own arithmetic accuracy in every judge-only condition. [Run matrix](planned-runs.md) · [Registered evaluator](../src/study/evaluate.py)
reports/paper.pdf CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:ee7e0ecb37200b0889ed962d84083dd9f54ce0ffffc896c4370041f46d4df907
3
- size 746716
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fd12b87687d87e2ea4a014613d6f1817863d979d8b1558a07302eb70e92359a4
3
+ size 748232
reports/planned-runs.md CHANGED
@@ -17,6 +17,8 @@ Each solver row starts from the same untrained solver adapter for its seed excep
17
 
18
  On the natural replay set report J2→J3 fixes and harms on identical traces. For the evidence intervention, generate twins from the same arithmetic instance and score responses against exact records. Report both the visible and masked conditions. Report actual model tokens, timing, zero-variance groups, malformed outputs and judge/oracle disagreement. Never fill a missing result with an assumed zero.
19
 
 
 
20
  ## Learnability amendment
21
 
22
  | Phase | Model and trainable roles | Data and budget | Decision |
 
17
 
18
  On the natural replay set report J2→J3 fixes and harms on identical traces. For the evidence intervention, generate twins from the same arithmetic instance and score responses against exact records. Report both the visible and masked conditions. Report actual model tokens, timing, zero-variance groups, malformed outputs and judge/oracle disagreement. Never fill a missing result with an assumed zero.
19
 
20
+ The [matched-depth extension](matched-depth-protocol.md) adds four fresh shallow solvers with pretrained reviewers and replays the two complete trained judge stacks on fixed starting-solver traces. It reuses the measured three-call solvers and preserves the original primary cohort.
21
+
22
  ## Learnability amendment
23
 
24
  | Phase | Model and trainable roles | Data and budget | Decision |
reports/summary.md CHANGED
@@ -1,5 +1,33 @@
1
  # Study summary
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  Amended primary comparison is pending. Every arm uses two-add problems and demonstrated prompts.
4
 
5
  | Run | Updated role | Updates | Development exact | Development n | Held-out exact | Held-out n |
 
1
  # Study summary
2
 
3
+ ## Matched accuracy by judge depth
4
+
5
+ Each column adds one review of the preceding judge. Judge 1 checks the solver, Judge 2 checks Judge 1, and Judge 3 checks Judge 2. Across a solver-training row only the depth of its reward changes. All solver comparisons here use seed 17.
6
+
7
+ ### Development solver accuracy
8
+
9
+ Every solver answers the same 32 questions. A solution is correct when every intermediate value is correct. Fitted judges stay frozen during solver updates.
10
+
11
+ | Training condition | One judge · J1 | Two judges · J2 checks J1 | Three judges · J3 checks J2 |
12
+ | --- | --- | --- | --- |
13
+ | Only solver trained · original judges | 21/32 (65.6%) | 25/32 (78.1%) | 3/32 (9.4%) |
14
+ | Exact-trained judges, then solver | Pending | Pending | 25/32 (78.1%) |
15
+ | Top-down-trained judges, then solver | Pending | Pending | 28/32 (87.5%) |
16
+
17
+ ### Development judge verdict accuracy
18
+
19
+ Every judge grades the same 32 saved responses from the starting solver. A verdict is correct when it agrees with the arithmetic checker. In all judge-only conditions the solver itself stays at 20/32 (62.5%) on the 32 solver-evaluation questions.
20
+
21
+ | Training condition | One judge · J1 | Two judges · J2 checks J1 | Three judges · J3 checks J2 |
22
+ | --- | --- | --- | --- |
23
+ | Original frozen judges | 19/32 (59.4%) | 19/32 (59.4%) | 17/32 (53.1%) |
24
+ | Exact labels · only final judge trained | 20/32 (62.5%) | 19/32 (59.4%) | 18/32 (56.2%) |
25
+ | Exact labels · all participating judges trained | 20/32 (62.5%) | Pending | Pending |
26
+ | Top-down supervision · only final judge trained | 20/32 (62.5%) | 19/32 (59.4%) | 18/32 (56.2%) |
27
+ | Top-down supervision · all participating judges trained | 20/32 (62.5%) | Pending | Pending |
28
+
29
+ “Only final judge trained” fits the judge used for that column’s terminal decision and uses original judges for preceding calls. “All participating judges trained” uses fitted adapters at every depth. Top-down training uses the shared exact-trained Judge 3. Pending cells have no completed matched measurement. [Matched comparison protocol](matched-depth-protocol.md)
30
+
31
  Amended primary comparison is pending. Every arm uses two-add problems and demonstrated prompts.
32
 
33
  | Run | Updated role | Updates | Development exact | Development n | Held-out exact | Held-out n |
src/study/matched_tables.py ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Compare judge depths only when the arithmetic questions or saved solver answers are identical."""
2
+
3
+ from .storage import read_json, rows
4
+ from .tables import markdown
5
+
6
+
7
+ HEADERS = ["Training condition","One judge · J1","Two judges · J2 checks J1","Three judges · J3 checks J2"]
8
+ ROUTES = {"exact":("exact-j1","exact-j2","exact-j3"), "top":("top-j1","top-j2","exact-j3")}
9
+ PENDING = "Pending"
10
+
11
+
12
+ def solver_arms(route):
13
+ if route=="frozen":
14
+ return ("d1-17","d2-17","d3-17")
15
+ return (route+"-depth1",route+"-depth2",route+"-prefix3")
16
+
17
+
18
+ def cell(correct,n):
19
+ return f"{correct}/{n} ({100*correct/n:.1f}%)"
20
+
21
+
22
+ def read_cohort(path,reference,judge=False):
23
+ """The report fails on duplicate, missing, reordered or mismatched comparison units."""
24
+ data = list(rows(path))
25
+ fields = ("key","expression","trace","correct") if judge else ("key","expression")
26
+ if (len(data)!=len(reference) or len({r["key"] for r in data})!=len(data) or
27
+ any(any(a[k]!=b[k] for k in fields) for a,b in zip(reference,data,strict=True))):
28
+ raise ValueError(f"Unmatched {'solver responses' if judge else 'questions'} in {path}")
29
+ return data
30
+
31
+
32
+ def accuracy_grid(root,profile):
33
+ if not profile:
34
+ return []
35
+ grids = []
36
+ for phase in ("development","final"):
37
+ if not (root/"base"/(phase+".json")).is_file():
38
+ continue
39
+ is_dev = phase=="development"
40
+ solver_file = "replay.jsonl" if is_dev else "test.jsonl"
41
+ judge_file = "replay.jsonl" if is_dev else "judge-test.jsonl"
42
+ base = list(rows(root/"base"/solver_file))
43
+ shared = base if is_dev else list(rows(root/"base"/judge_file))
44
+ if (len(base),len(shared)) != ((32,32) if is_dev else (2048,128)):
45
+ raise ValueError(f"Incomplete base cohort for the {phase} tables")
46
+ solver_table,judge_table = [],[]
47
+ route_labels = {"frozen":"Only solver trained · original judges","exact":"Exact-trained judges, then solver",
48
+ "top":"Top-down-trained judges, then solver"}
49
+ for route,label in route_labels.items():
50
+ values = []
51
+ for name in solver_arms(route):
52
+ if (root/name/(phase+".json")).is_file():
53
+ records = read_cohort(root/name/solver_file,base)
54
+ values.append(cell(sum(r["correct"] for r in records),len(records)))
55
+ else:
56
+ values.append(PENDING)
57
+ solver_table.append([label,*values])
58
+ def score(records,level):
59
+ return cell(sum(row["verdicts"][level]==row["correct"] for row in records),len(records))
60
+ judge_table.append(["Original frozen judges",*[score(shared,i) for i in range(3)]])
61
+ for route,label in (("exact","Exact labels"),("top","Top-down supervision")):
62
+ isolated = []
63
+ for i,name in enumerate(ROUTES[route]):
64
+ block = root/name
65
+ if not (block/(phase+".json")).is_file():
66
+ isolated.append(PENDING)
67
+ continue
68
+ records = read_cohort(block/judge_file,shared,judge=True)
69
+ if any(a["reports"][:i]!=b["reports"][:i] for a,b in zip(records,shared,strict=True)):
70
+ raise ValueError(f"Preceding reports changed for the isolated {name} comparison")
71
+ isolated.append(score(records,i))
72
+ judge_table.append([label+" · only final judge trained",*isolated])
73
+ fitted = [isolated[0],PENDING,PENDING]
74
+ replay = root/"matched-depth"/f"{route}-{phase}"
75
+ if replay.with_suffix(".json").is_file():
76
+ records = read_cohort(replay.with_suffix(".jsonl"),shared,judge=True)
77
+ fitted = [score(records,i) for i in range(3)]
78
+ if fitted[0] != isolated[0]:
79
+ raise ValueError(f"Identical trained Judge 1 differs across {route} conditions")
80
+ judge_table.append([label+" · all participating judges trained",*fitted])
81
+ grids.append(dict(phase=phase,solver=solver_table,judge=judge_table,solver_n=len(base),judge_n=len(shared),
82
+ frozen_solver=cell(sum(r["correct"] for r in base),len(base))))
83
+ return grids
84
+
85
+
86
+ def grid_markdown(grids):
87
+ if not grids:
88
+ return ""
89
+ sections = ["## Matched accuracy by judge depth",
90
+ "Each column adds one review of the preceding judge. Judge 1 checks the solver, Judge 2 checks Judge 1, "
91
+ "and Judge 3 checks Judge 2. Across a solver-training row only the depth of its reward changes. "
92
+ "All solver comparisons here use seed 17."]
93
+ for grid in reversed(grids):
94
+ split = "Development" if grid["phase"]=="development" else "Held-out"
95
+ sections += [f"### {split} solver accuracy",f"Every solver answers the same {grid['solver_n']:,} questions. "
96
+ "A solution is correct when every intermediate value is correct. Fitted judges stay frozen during solver updates.",
97
+ markdown(HEADERS,grid["solver"]),f"### {split} judge verdict accuracy",
98
+ f"Every judge grades the same {grid['judge_n']} saved responses from the starting solver. A verdict is correct "
99
+ f"when it agrees with the arithmetic checker. In all judge-only conditions the solver itself stays at {grid['frozen_solver']} "
100
+ f"on the {grid['solver_n']:,} solver-evaluation questions.",markdown(HEADERS,grid["judge"])]
101
+ sections.append("“Only final judge trained” fits the judge used for that column’s terminal decision and uses original "
102
+ "judges for preceding calls. “All participating judges trained” uses fitted adapters at every depth. "
103
+ "Top-down training uses the shared exact-trained Judge 3. Pending cells have no completed matched measurement. "
104
+ "[Matched comparison protocol](reports/matched-depth-protocol.md)")
105
+ return "\n\n".join(sections)+"\n\n"
src/study/report.py CHANGED
@@ -12,6 +12,7 @@ from .design import GITHUB, PAGES, PILOTS, Run, matrix
12
  from .final_review import review_completed, review_text as final_review_text
13
  from .learnability_report import collect_learnability, learnability_text, learning_figure
14
  from .learning_review import check_release, review_text
 
15
  from .records import named_values
16
  from .storage import ORIGINAL_RESULTS, ROOT, atomic, read_json, rows, write_json
17
  from .tables import contrast_rows, markdown, rate as percent, run_evidence, training_method
@@ -130,7 +131,8 @@ def collect():
130
  if (target/"development.json").exists():
131
  sample = list(rows(target/"replay.jsonl"))
132
  archive.append(dict(name=name, correct=sum(r["correct"] for r in sample), n=len(sample)))
133
- return dict(runs=runs, primary=paired_primary(outcomes), flat=paired_comparison(outcomes,"flat"), planned=registered,
 
134
  learnability=learning, profile=profile, original_development=archive,
135
  budget=read_json(source/"budget.json"), sealed=(source/"seal.json").is_file(),
136
  completed=(source/"completed.json").is_file())
@@ -330,6 +332,14 @@ def paper(data, date):
330
  table(["Original development","Correct complete trace","Problems"],
331
  [[r["name"],r["correct"],r["n"]] for r in data["original_development"]])
332
  line("Results and interpretation","Heading1")
 
 
 
 
 
 
 
 
333
  line("Development accuracy for a solver requires every arithmetic step to be correct. For a judge it requires its whole record to match the executable audit. Held-out solver accuracy uses one response per problem. A dash denotes a pending measurement.")
334
  if data["runs"]:
335
  table(["Run","Role","Updates","Dev. n","Dev. exact","Test n","Test exact"],
@@ -528,7 +538,9 @@ def build():
528
  if comparisons:
529
  summary += "\n\n" + markdown(["Contrast", "Seed", "Difference (pp)", "95% lower", "95% upper"], comparisons)
530
  explanation = "Solver scores require every intermediate value. Judge scores require all fields of the evidence record. Intervals condition on the trained checkpoints."
531
- atomic(REPORTS/"summary.md","# Study summary\n\n"+summary.replace("(reports/learnability.md)","(learnability.md)")+"\n\n"+explanation+" [Preregistration](preregistration.md).\n")
 
 
532
  readme = (ROOT/"README.md").read_text(encoding="utf-8")
533
  pre, tail = readme.split("<!-- RESULTS:START -->",1)
534
  _, post = tail.split("<!-- RESULTS:END -->",1)
@@ -556,7 +568,7 @@ def build():
556
  diagnostic = readme_depth(data)
557
  if diagnostic:
558
  diagnostic += "## Study results\n\n"
559
- atomic(ROOT/"README.md",pre+"<!-- RESULTS:START -->\n"+diagnostic+assets+summary+f"\n\n[Interactive results explorer]({PAGES}) · [Paper](reports/paper.pdf)\n<!-- RESULTS:END -->"+post)
560
  experiments=REPORTS/"experiments"
561
  notes=[]
562
  methods=[]
 
12
  from .final_review import review_completed, review_text as final_review_text
13
  from .learnability_report import collect_learnability, learnability_text, learning_figure
14
  from .learning_review import check_release, review_text
15
+ from .matched_tables import accuracy_grid, grid_markdown
16
  from .records import named_values
17
  from .storage import ORIGINAL_RESULTS, ROOT, atomic, read_json, rows, write_json
18
  from .tables import contrast_rows, markdown, rate as percent, run_evidence, training_method
 
131
  if (target/"development.json").exists():
132
  sample = list(rows(target/"replay.jsonl"))
133
  archive.append(dict(name=name, correct=sum(r["correct"] for r in sample), n=len(sample)))
134
+ return dict(runs=runs, matched_depth=accuracy_grid(source,profile),
135
+ primary=paired_primary(outcomes), flat=paired_comparison(outcomes,"flat"), planned=registered,
136
  learnability=learning, profile=profile, original_development=archive,
137
  budget=read_json(source/"budget.json"), sealed=(source/"seal.json").is_file(),
138
  completed=(source/"completed.json").is_file())
 
332
  table(["Original development","Correct complete trace","Problems"],
333
  [[r["name"],r["correct"],r["n"]] for r in data["original_development"]])
334
  line("Results and interpretation","Heading1")
335
+ for grid in reversed(data["matched_depth"]):
336
+ split = "Development" if grid["phase"]=="development" else "Held-out"
337
+ line(f"{split} accuracy by actual judge depth","Heading2")
338
+ line(f"Solver scores require the complete calculation on {grid['solver_n']} common problems. Judge scores use "
339
+ f"verdict agreement with the checker on {grid['judge_n']} identical saved base-solver responses. Each extra call "
340
+ "reviews its predecessor. Fitted judges stay frozen during solver optimization.")
341
+ table(["Solver training","One judge","Two judges","Three judges"],grid["solver"])
342
+ table(["Judge training","One judge","Two judges","Three judges"],grid["judge"])
343
  line("Development accuracy for a solver requires every arithmetic step to be correct. For a judge it requires its whole record to match the executable audit. Held-out solver accuracy uses one response per problem. A dash denotes a pending measurement.")
344
  if data["runs"]:
345
  table(["Run","Role","Updates","Dev. n","Dev. exact","Test n","Test exact"],
 
538
  if comparisons:
539
  summary += "\n\n" + markdown(["Contrast", "Seed", "Difference (pp)", "95% lower", "95% upper"], comparisons)
540
  explanation = "Solver scores require every intermediate value. Judge scores require all fields of the evidence record. Intervals condition on the trained checkpoints."
541
+ grid_text = grid_markdown(data["matched_depth"])
542
+ atomic(REPORTS/"summary.md","# Study summary\n\n"+grid_text.replace("(reports/matched-depth-protocol.md)","(matched-depth-protocol.md)")+
543
+ summary.replace("(reports/learnability.md)","(learnability.md)")+"\n\n"+explanation+" [Preregistration](preregistration.md).\n")
544
  readme = (ROOT/"README.md").read_text(encoding="utf-8")
545
  pre, tail = readme.split("<!-- RESULTS:START -->",1)
546
  _, post = tail.split("<!-- RESULTS:END -->",1)
 
568
  diagnostic = readme_depth(data)
569
  if diagnostic:
570
  diagnostic += "## Study results\n\n"
571
+ atomic(ROOT/"README.md",pre+"<!-- RESULTS:START -->\n"+grid_text+diagnostic+assets+summary+f"\n\n[Interactive results explorer]({PAGES}) · [Paper](reports/paper.pdf)\n<!-- RESULTS:END -->"+post)
572
  experiments=REPORTS/"experiments"
573
  notes=[]
574
  methods=[]
tests/test_matched_tables.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Verify that actual review depth, identical solver inputs and pending cells are preserved."""
2
+
3
+ import json
4
+
5
+ import pytest
6
+
7
+ from study.matched_tables import accuracy_grid, grid_markdown
8
+ from study.storage import write_json
9
+
10
+
11
+ def test_fitted_adapter_count_does_not_substitute_for_fewer_judge_calls(tmp_path):
12
+ examples = [dict(key=str(i),expression=str(i),trace=str(i),correct=i%2,verdicts=[1,0,i%2],reports=["a","b","c"])
13
+ for i in range(32)]
14
+ def save(name,example_rows):
15
+ target = tmp_path/name
16
+ write_json(target/"development.json",{"phase":"development"})
17
+ (target/"replay.jsonl").write_text("".join(json.dumps(r)+"\n" for r in example_rows),encoding="utf-8")
18
+ for name in ("base","d1-17","d2-17","d3-17","exact-prefix1","exact-prefix2","exact-prefix3","exact-j1"):
19
+ save(name,examples)
20
+ grid, = accuracy_grid(tmp_path,{"family":"two-add"})
21
+ assert grid["solver"][1][1:]==["Pending","Pending","16/32 (50.0%)"]
22
+ assert grid["judge"][0][1:]==["16/32 (50.0%)","16/32 (50.0%)","32/32 (100.0%)"]
23
+ assert "Three judges · J3 checks J2" in grid_markdown([grid])
24
+ save("exact-j1",[dict(r,trace="a different solution") for r in examples])
25
+ with pytest.raises(ValueError,match="Unmatched solver responses"):
26
+ accuracy_grid(tmp_path,{"family":"two-add"})