depth-gap-readme · ea70ad926f42
Browse filesFiles changed (12)
- README.md+70
- docs/assets/study.json+155
- docs/usage.md+2
- reports/amendments.md+4
- reports/paper.pdf+2-2
- reports/reviews/depth-diagnosis.mdAdded+40
- reports/summary.md+2
- results/calibrated/diagnostics/depth-transcripts-17.jsonAdded+21
- src/study/depth_review.pyAdded+328
- src/study/depth_transcripts.pyAdded+69
- src/study/report.py+22-1
- tests/test_depth_review.pyAdded+45
8 unmodified lines9101112131431 unmodified lines4647484950518 unmodified linesFor 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.<!-- RESULTS:START -->31 unmodified lines| learn-oracle-17 | solver | 128 | — | 0 | — | 0 || learn-shuffle-17 | solver | 128 | — | 0 | — | 0 |**Benchmark difficulty.** The frozen-model screen selected two-add with demonstrated prompts. On 16 screening problems it produced a mix of correct and incorrect answers on 2 problems. [All difficulty levels](reports/learnability.md).**Solver learning.** Exact-reward training changed complete-trace accuracy on 256 fresh problems by +36.3 percentage points relative to the starting solver (paired 95% interval +30.1 to +42.6). [Shuffled control and arithmetic corrections](reports/learnability.md).8 unmodified lines91011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818231 unmodified lines1141151161171181191201218 unmodified linesFor 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.<!-- RESULTS:START -->## Why did the two-judge and three-judge solvers diverge?**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). 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.The same evaluation gave 20/32 for the starting solver, 21/32 for one judge, 24/32 for three independent votes, 32/32 for the exact checker, 31/32 for the third judge gated by the exact checker, 5/32 for shuffled three-judge rewards.### What happens if we stop at Judge 2 on the same answers?The three-judge-trained solver still solved **3/32**. Its written answers were already fixed before grading. On those answers, Judge 3 changed 2 of Judge 2’s verdicts. It corrected 1 and wrongly overturned 1.| Stopping point on the fixed answers | Answers approved | Verdicts agreeing with the checker || --- | --- | --- || Judge 2 | 21/32 | 12/32 || Judge 3 | 21/32 | 12/32 |Every changed development verdict appears here.| Problem | Submitted steps | Correct steps | Judge 2 | Judge 3 || --- | --- | --- | --- | --- || (36 - 7) + 7 | 8,15 | 29,36 | Accepted | Rejected || (1 + 6) - 6 | -5,-1 | 7,1 | Rejected (invalid audit flag -1) | Accepted |On `(39 + 12) - 5`, the two-judge-trained solver wrote `51,46`. The three-judge-trained solver wrote `16,11`, and all three judges approved it in the replay.### What changed during training?On the same 1,024 training answers sampled by the three-judge solver, Judge 3 fixed 58 of Judge 2’s verdicts and spoiled 44. Substituting Judge 2’s reward would have changed the relative credits in **81/256 optimizer updates**. Each GRPO update compares four answers to one question. When gradings change early on, the solvers can learn different answers and receive different training data at subsequent updates. [GRPO advantage calculation](https://huggingface.co/docs/trl/grpo_trainer#computing-the-advantage)Judge 3 rewarded **569/880 incorrect answers (64.7%)** and **88/144 correct answers (61.1%)**.| Within the same training question | Correct answer ranks higher | Tied | Wrong answer ranks higher || --- | --- | --- | --- || Judge 2 on those answers | 28 | 81 | 25 || Judge 3 on those answers | 22 | 84 | 28 |In its first quarter of training, the three-judge solver produced 80 correct answers per 256 samples and received 173 positive rewards. In the last quarter it produced 15 correct answers and received 171 positive rewards.The two-judge solver gave the correct first value on 32/32 development problems. The three-judge solver gave a wrong first value on 28 and a malformed answer on 1. In 20 cases it applied the second operation correctly to its own wrong intermediate value. Judge 3 rewarded 357/508 training answers with that error pattern.### Could a code bug or a training seed explain it?The audit independently regraded 2,048 training answers and 64 development answers, checked the effective solution-verdict field against each assigned reward, and matched every group mean to TRL’s optimizer log. Prompts and outputs matched the training records for all 7,168 calls, including the solver answer and preceding reports shown to each judge. Both evaluated adapter hashes matched the saved weights. [Transcript and weight checks](results/calibrated/diagnostics/depth-transcripts-17.json)These checks support a training-signal explanation. The three-judge reward frequently approved incorrect arithmetic and gave little preference to correct answers within a question. The checker-gated control shows that this solver can learn with the same three judge calls when incorrect solutions receive zero reward. The depth analysis is exploratory. The contribution of a particular stochastic update cannot be identified from these trajectories.### Did Judge 3 actually audit the preceding review?On a separate replay of the starting solver’s 32 development responses, Judges 1, 2 and 3 agreed with the arithmetic checker on 19, 19 and 17 verdicts, respectively. Three independent first-order votes agreed on 22. On these fixed starting responses Judge 3 repaired 0 earlier verdicts and overturned 2 correct ones.The paired audit changes a numerical claim in Judge 2’s report while preserving the verdict on the solver. To pass a pair, Judge 3 must endorse the sound report and reject the altered one with the correct location, replacement and solution verdict.| Judge 3 | Cohort | Correct solver verdict | Altered review located and repaired | Whole pairs correct | Whole pairs with evidence masked || --- | --- | --- | --- | --- | --- || Frozen | Development | 14/16 | 0/8 | 0/8 | 0/8 || Trained on exact labels | Development | 15/16 | 0/8 | 0/8 | 0/8 || Alternating, exact route | Development | 16/16 | 0/8 | 0/8 | 0/8 |A separate experiment keeps **all three judge calls** and varies which reviewers had already been trained before a fresh solver learned. These development scores are exact solver solutions.| Judge supervision | Only Judge 1 trained | Judges 1 and 2 trained | All three trained || --- | --- | --- | --- || Exact verdict and evidence | 24/32 | 4/32 | 25/32 || Top-down learned supervision | 2/32 | 31/32 | 28/32 |The preregistered three-seed comparison on 2,048 unseen problems is pending. [Raw training and development audit](reports/reviews/depth-diagnosis.md) · [Preregistration and decision rule](reports/preregistration.md)## Study results31 unmodified lines| learn-oracle-17 | solver | 128 | — | 0 | — | 0 || learn-shuffle-17 | solver | 128 | — | 0 | — | 0 |[How the third judge changed actual training rewards and worked examples](https://github.com/BurnyCoder/verifying-verifier-of-verifier-llm-reinforcement-learning/blob/main/reports/reviews/depth-diagnosis.md).**Benchmark difficulty.** The frozen-model screen selected two-add with demonstrated prompts. On 16 screening problems it produced a mix of correct and incorrect answers on 2 problems. [All difficulty levels](reports/learnability.md).**Solver learning.** Exact-reward training changed complete-trace accuracy on 256 fresh problems by +36.3 percentage points relative to the starting solver (paired 95% interval +30.1 to +42.6). [Shuffled control and arithmetic corrections](reports/learnability.md).
194972 unmodified lines194973194974194975194976194977194978194972 unmodified lines},"sealed": false,"completed": false,"learning_review": {"training": 128,"validation": 256,194972 unmodified lines194973194974194975194976194977194978194979194980194981194982194983194984194985194986194987194988194989194990194991194992194993194994194995194996194997194998194999195000195001195002195003195004195005195006195007195008195009195010195011195012195013195014195015195016195017195018195019195020195021195022195023195024195025195026195027195028195029195030195031195032195033195034195035195036195037195038195039195040195041195042195043195044195045195046195047195048195049195050195051195052195053195054195055195056195057195058195059195060195061195062195063195064195065195066195067195068195069195070195071195072195073195074195075195076195077195078195079195080195081195082195083195084195085195086195087195088195089195090195091195092195093195094195095195096195097195098195099195100195101195102195103195104195105195106195107195108195109195110195111195112195113195114195115195116195117195118195119195120195121195122195123195124195125195126195127195128195129195130195131195132195133194972 unmodified lines},"sealed": false,"completed": false,"depth_review": [{"seed": 17,"n": 1024,"groups": 256,"dev_n": 32,"two": {"training": {"first wrong, second consistent": 167,"first wrong, second inconsistent": 42,"correct": 648,"second wrong": 116,"format": 51},"rewarded": {"first wrong, second consistent": 117,"first wrong, second inconsistent": 26,"correct": 490,"second wrong": 88,"format": 30},"dev": {"correct": 25,"second wrong": 7},"first_quarter": [105,186],"last_quarter": [186,189]},"three": {"training": {"first wrong, second consistent": 508,"first wrong, second inconsistent": 261,"correct": 144,"second wrong": 18,"format": 93},"rewarded": {"first wrong, second consistent": 357,"first wrong, second inconsistent": 160,"correct": 88,"second wrong": 3,"format": 49},"dev": {"format": 1,"first wrong, second consistent": 20,"correct": 3,"first wrong, second inconsistent": 8},"first_quarter": [80,173],"last_quarter": [15,171]},"paired": {"two only": 23,"both": 2,"neither": 6,"three only": 1},"accepted": [21,21],"agreement": [12,12],"transitions": [{"expression": "(36 - 7) + 7","output": "8,15","truth": [29,36],"bits": [1,0],"reports": ["1,0,15,1,0,15","1,0,15,0,1,15"],"correct": 0},{"expression": "(1 + 6) - 6","output": "-5,-1","truth": [7,1],"bits": [0,1],"reports": ["-1,-1,-5,1,0,-5","1,0,-5,1,0,-5"],"correct": 0}],"shared_error": {"expression": "(39 + 12) - 5","right": "51,46","wrong": "16,11"},"transcript_audit": {"seed": 17,"arms": {"d2-17": {"adapter_sha256": "f3d3a8a1c3daff34a0dd4ed80d3bd7aeb7237da74c13910130cc80a5b0441ead","journals_sha256": {"2026-11-26T15-49-28.492+00-00.jsonl": "155189ca74d2f801bae123ee444cee1e7c18a00a9d0fb4cbe16184ec3698c565"},"training_answers": 1024,"matched_calls": 3072},"d3-17": {"adapter_sha256": "5edb1e200ef85840a81a9304de7056aacaf0bc32d9314009c6cd8fe708d96115","journals_sha256": {"2026-11-26T15-00-21.870+00-00.jsonl": "166cc3f9775ff1b225755bdd31002ab7d534d98a7a5cd566a8345f773cc868e6"},"training_answers": 1024,"matched_calls": 4096}}},"fixes": 58,"harms": 44,"changed_groups": 81,"j2_pairs": [28,81,25],"j3_pairs": [22,84,28]}],"learning_review": {"training": 128,"validation": 256,
7 unmodified lines89101112137 unmodified lines- `uv run study dashboard` serves the live explorer on the loopback interface. The browser refreshes its observations every 15 seconds. The public Pages explorer reads the last published milestone.- `uv run study report` regenerates the paper, README score table, progress report, figures, per-experiment notes and website data from raw results.Model inputs, token chunks and full outputs are printed and saved in timestamped JSONL under `logs`. Raw training and evaluation records live in `results`. Each row includes an expression identity. Training outputs include their assigned reward and independently computed complete-record label. Natural replay keeps all three reports and the three flat ballots on the identical solution. Twin interventions keep observed and expected records in both conditions.The explorer shows every completed optimizer group for the selected run and the latest greedy development probe. Counts under each replay rule distinguish verdict agreement from whole-record evidence accuracy. Generation cost counts non-padding input and output tokens. CUDA-event durations measure elapsed device time around a batched generation call, including gaps between kernels. The pretrained judges share the pinned Qwen backbone. A frozen-adapter checksum with no input tensors means the run loaded no fitted judge adapters.7 unmodified lines891011121314157 unmodified lines- `uv run study dashboard` serves the live explorer on the loopback interface. The browser refreshes its observations every 15 seconds. The public Pages explorer reads the last published milestone.- `uv run study report` regenerates the paper, README score table, progress report, figures, per-experiment notes and website data from raw results.The README’s depth diagnosis regrades training and development records each time the report builds. With the full local journals and saved adapters, `uv run python -m study.depth_transcripts --seed 17` also verifies each generated prompt, response and checkpoint hash. The compact verification receipts travel with the published results. [Depth diagnosis](../reports/reviews/depth-diagnosis.md)Model inputs, token chunks and full outputs are printed and saved in timestamped JSONL under `logs`. Raw training and evaluation records live in `results`. Each row includes an expression identity. Training outputs include their assigned reward and independently computed complete-record label. Natural replay keeps all three reports and the three flat ballots on the identical solution. Twin interventions keep observed and expected records in both conditions.The explorer shows every completed optimizer group for the selected run and the latest greedy development probe. Counts under each replay rule distinguish verdict agreement from whole-record evidence accuracy. Generation cost counts non-padding input and output tokens. CUDA-event durations measure elapsed device time around a batched generation call, including gaps between kernels. The pretrained judges share the pinned Qwen backbone. A frozen-adapter checksum with no input tensors means the run loaded no fitted judge adapters.
14 unmodified lines15161718192014 unmodified linesBefore any transfer evaluation, an invariant test on development fixtures showed that simple negation preserved absolute magnitude. The transfer implementation now reverses the sign and adds three to the absolute magnitude. Zero maps to minus three and is an explicit exception to sign reversal. For the same fixed problem IDs, cross the familiar and novel error with familiar and reserved layouts. These descriptive controls separate the two shifts. Method-level evidence results with the identical frozen Judge 3, input cohort and greedy decoder reuse a single observation set and name its source.The field-level breakdown counts syntactically complete reports, correct solver bits, correct audit bits and altered reviews correctly rejected with the exact field and replacement. All reports remain in their corresponding denominator, including malformed output. These counts describe the registered whole-pair failures after inspection of the frozen development examples. They leave the whole-pair success criterion intact.## Recovery of the first solver's development replayA mathematical minus sign interrupted the Windows redirected terminal while a replay batch was generating. The original prompt and partial output are present in its UTF-8 journal. The restarted evaluation reuses completed problem IDs, the same checkpoint, batch ordering and seeds. Terminal output now uses UTF-8 as well. Reported generation cost includes every completed call across attempts, including repeated work. Each unfinished batch is counted separately because its complete time and output-token count are unavailable. [Recovery tests](../tests/test_storage.py) · [Evaluation implementation](../src/study/evaluate.py)14 unmodified lines1516171819202122232414 unmodified linesBefore any transfer evaluation, an invariant test on development fixtures showed that simple negation preserved absolute magnitude. The transfer implementation now reverses the sign and adds three to the absolute magnitude. Zero maps to minus three and is an explicit exception to sign reversal. For the same fixed problem IDs, cross the familiar and novel error with familiar and reserved layouts. These descriptive controls separate the two shifts. Method-level evidence results with the identical frozen Judge 3, input cohort and greedy decoder reuse a single observation set and name its source.The field-level breakdown counts syntactically complete reports, correct solver bits, correct audit bits and altered reviews correctly rejected with the exact field and replacement. All reports remain in their corresponding denominator, including malformed output. These counts describe the registered whole-pair failures after inspection of the frozen development examples. They leave the whole-pair success criterion intact.## 27 November 2026 · exploratory diagnosis of the solver depth gapThe seed-17 solver development results prompted a question about whether the third judge had directly changed the verdict on many already-written answers. Before subsequent solver seeds or held-out evaluations, we specified repeating the same diagnostic for each available matched depth-two and depth-three seed. Regrade saved responses by executing their numbered arithmetic and compare each reconstructed reward with the trainer’s group mean. Count verdict changes on identical three-judge solver responses, within-question preferences when completions differ in correctness, and groups whose normalized advantages would change if rewarded at depth two. Classify arithmetic errors by whether the second operation correctly follows the solver’s own incorrect intermediate number. Compare first and last training quarters descriptively. These measurements condition on the sampled trajectories. [Diagnostic implementation](../src/study/depth_review.py) · [TRL advantages](https://huggingface.co/docs/trl/grpo_trainer#computing-the-advantage)## Recovery of the first solver's development replayA mathematical minus sign interrupted the Windows redirected terminal while a replay batch was generating. The original prompt and partial output are present in its UTF-8 journal. The restarted evaluation reuses completed problem IDs, the same checkpoint, batch ordering and seeds. Terminal output now uses UTF-8 as well. Reported generation cost includes every completed call across attempts, including repeated work. Each unfinished batch is counted separately because its complete time and output-token count are unavailable. [Recovery tests](../tests/test_storage.py) · [Evaluation implementation](../src/study/evaluate.py)
123version https://git-lfs.github.com/spec/v1oid sha256:6cb4718db16bdc579f3c35f806534506715b0155ce8be3a6b73f2a241b0f2025size 732127123version https://git-lfs.github.com/spec/v1oid sha256:a18108bcf0b9cc2a7a2402a6fe7acd9c8fdaba166a7896d3234484721b6329b0size 733148
12345678910111213141516171819202122232425262728293031323334353637383940# What changed when the solver trained with a third judge?
This exploratory analysis began after observing the seed-17 development gap. The arithmetic grader executes the numbered operations. The routing check reconstructs the solver verdict from the raw fourth field of each final report and checks each group against TRL’s own optimizer log. A nonbinary audit flag or an unparseable report yields a rejection. [Analysis code](../../src/study/depth_review.py) · [GRPO group advantages](https://huggingface.co/docs/trl/grpo_trainer#computing-the-advantage)
## Seed 17
On 32 matched development problems the two-judge solver alone was correct on 23, the three-judge solver alone on 1, both on 2, and neither on 6. Holding the three-judge solver's outputs fixed, Judge 2 accepted 21 and Judge 3 accepted 21.
| Three-judge solver error | Development answers | Training answers | Training answers rewarded || --- | --- | --- | --- || correct | 3 | 144 | 88 || first wrong, second consistent | 20 | 508 | 357 || first wrong, second inconsistent | 8 | 261 | 160 || second wrong | 0 | 18 | 3 || format | 1 | 93 | 49 |
On the same 1024 training answers, Judge 3 fixed 58 effective Judge 2 verdicts and spoiled 44. Its decision changed the within-group advantages in 81/256 optimizer updates. Each row below compares correct and incorrect completions of the same question. Pairs within and across rows share observations.
| Reward applied to these answers | Correct ranks higher | Tied | Incorrect ranks higher || --- | --- | --- | --- || Judge 2 | 28 | 81 | 25 || Judge 3 | 22 | 84 | 28 |
| Training run and window | Correct | Rewarded | Sampled || --- | --- | --- | --- || Two judges / first quarter | 105 | 186 | 256 || Two judges / last quarter | 186 | 189 | 256 || Three judges / first quarter | 80 | 173 | 256 || Three judges / last quarter | 15 | 171 | 256 |
Every development verdict change on the three-judge solver’s fixed responses is shown below.
| Expression | Solver | Exact values | Judge 2 report | Judge 3 report | Verdict change || --- | --- | --- | --- | --- | --- || (36 - 7) + 7 | 8,15 | 29,36 | 1,0,15,1,0,15 | 1,0,15,0,1,15 | Fixed || (1 + 6) - 6 | -5,-1 | 7,1 | -1,-1,-5,1,0,-5 | 1,0,-5,1,0,-5 | Introduced error |
[Two-judge records](../../results/calibrated/d2-17) · [Three-judge records](../../results/calibrated/d3-17)
These comparisons distinguish a change of verdict on an already written answer from a change to the solver learned over successive updates. Replacing the reward in an archived group reveals which relative credits would change on those samples. A separately trained solver generates its own subsequent samples. The checker-gated and shuffled arms test sensitivity to reward quality. The registered effectiveness claim uses unseen problems and multiple training seeds. [Protocol](../preregistration.md) · [All training arms](../summary.md)28 unmodified lines29303132333428 unmodified lines| learn-oracle-17 | solver | 128 | — | 0 | — | 0 || learn-shuffle-17 | solver | 128 | — | 0 | — | 0 |**Benchmark difficulty.** The frozen-model screen selected two-add with demonstrated prompts. On 16 screening problems it produced a mix of correct and incorrect answers on 2 problems. [All difficulty levels](learnability.md).**Solver learning.** Exact-reward training changed complete-trace accuracy on 256 fresh problems by +36.3 percentage points relative to the starting solver (paired 95% interval +30.1 to +42.6). [Shuffled control and arithmetic corrections](learnability.md).28 unmodified lines293031323334353628 unmodified lines| learn-oracle-17 | solver | 128 | — | 0 | — | 0 || learn-shuffle-17 | solver | 128 | — | 0 | — | 0 |[How the third judge changed actual training rewards and worked examples](https://github.com/BurnyCoder/verifying-verifier-of-verifier-llm-reinforcement-learning/blob/main/reports/reviews/depth-diagnosis.md).**Benchmark difficulty.** The frozen-model screen selected two-add with demonstrated prompts. On 16 screening problems it produced a mix of correct and incorrect answers on 2 problems. [All difficulty levels](learnability.md).**Solver learning.** Exact-reward training changed complete-trace accuracy on 256 fresh problems by +36.3 percentage points relative to the starting solver (paired 95% interval +30.1 to +42.6). [Shuffled control and arithmetic corrections](learnability.md).
123456789101112131415161718192021{ "seed": 17, "arms": { "d2-17": { "adapter_sha256": "f3d3a8a1c3daff34a0dd4ed80d3bd7aeb7237da74c13910130cc80a5b0441ead", "journals_sha256": { "2026-11-26T15-49-28.492+00-00.jsonl": "155189ca74d2f801bae123ee444cee1e7c18a00a9d0fb4cbe16184ec3698c565" }, "training_answers": 1024, "matched_calls": 3072 }, "d3-17": { "adapter_sha256": "5edb1e200ef85840a81a9304de7056aacaf0bc32d9314009c6cd8fe708d96115", "journals_sha256": { "2026-11-26T15-00-21.870+00-00.jsonl": "166cc3f9775ff1b225755bdd31002ab7d534d98a7a5cd566a8345f773cc868e6" }, "training_answers": 1024, "matched_calls": 4096 } }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328"""Audit the observed depth gap on training and development data, independently of the reward callback."""
import operatorimport refrom collections import Counterfrom itertools import batched, combinations
from .design import SEEDSfrom .domain import Problemfrom .learning_review import execute_stepsfrom .storage import read_json, rowsfrom .tables import markdown
def numbers(text, width): """Reconstruct the registered output grammar by checking each field separately.""" text = text.strip() if text.startswith("[") and text.endswith("]"): text = text[1:-1].strip() fields = [part.strip() for part in text.split(",")] if len(text) <= 1024 and len(fields) == width and all(re.fullmatch(r"[+-]?[0-9]{1,14}", part) for part in fields): return tuple(map(int, fields)) return None
def effective_bit(text): """Higher-order reports give the solver credit through field four when the audit flag is binary.""" record = numbers(text, 6) return int(record is not None and record[0] in (0, 1) and record[3] == 1)
def trace_error(problem, answer): """For the calibrated two-add family, test step two against the solver's own first value.""" truth = execute_steps(problem) proposed = numbers(answer, 2) if proposed is None: return "format" if proposed == truth: return "correct" if proposed[0] == truth[0]: return "second wrong" _, _, left, sign, right = problem.steps[1].split() if left != "s1" or sign not in ("+", "-"): raise ValueError("This diagnostic requires the registered two-add layout") implied = {"+": operator.add, "-": operator.sub}[sign](proposed[0], int(right)) return "first wrong, second consistent" if proposed[1] == implied else "first wrong, second inconsistent"
def group_evidence(deep): """Replay both reward rules on identical samples, preserving the four-way GRPO groups.""" fixes = harms = changed = 0 preferences = [Counter(), Counter()] for group in batched(deep, 4): if len(group) != 4: raise ValueError("A comparison requires four samples per group") labels = [r["label"] for r in group] second, third = [[effective_bit(r["reports"][index]) for r in group] for index in (1, 2)] fixes += sum(a != y and b == y for a, b, y in zip(second, third, labels, strict=True)) harms += sum(a == y and b != y for a, b, y in zip(second, third, labels, strict=True)) # Centered binary returns induce the same normalized advantages if both vectors are constant. changed += second != third and (len(set(second)) > 1 or len(set(third)) > 1) for i, j in combinations(range(4), 2): if labels[i] == labels[j]: continue good, bad = (i, j) if labels[i] else (j, i) for counts, votes in zip(preferences, (second, third), strict=True): counts[votes[good] - votes[bad]] += 1 return dict(fixes=fixes, harms=harms, changed_groups=changed, j2_pairs=[preferences[0][i] for i in (1, 0, -1)], j3_pairs=[preferences[1][i] for i in (1, 0, -1)])
def audit_arm(directory, depth): """Cross-check actual responses, arithmetic, effective rewards, grouping and TRL's optimizer telemetry.""" training = list(rows(directory/"rollouts.jsonl")) dev = list(rows(directory/"replay.jsonl")) updates = read_json(directory/"trained.json")["updates"] logs = {r["step"]: r["rewards/registered_reward/mean"] for r in rows(directory/"metrics.jsonl") if "rewards/registered_reward/mean" in r} if len(training) != 4*updates or set(logs) != set(range(1, updates+1)): raise ValueError(f"Incomplete optimizer observations in {directory.name}") parts, paid, cases = Counter(), Counter(), Counter() for step, group in enumerate(batched(training, 4)): if (len({r["key"] for r in group}) != 1 or [(r["step"], r["sample"]) for r in group] != [(step, s) for s in range(4)]): raise ValueError(f"Unexpected training order in {directory.name}") p = Problem.from_expression(group[0]["expression"]) for r in group: kind = trace_error(p, r["answer"]) if (r["key"] != p.key or r["expression"] != p.expression or len(r["reports"]) != depth or r["label"] != (kind == "correct") or r["reward"] != effective_bit(r["reports"][-1])): raise ValueError(f"Training grade or routing mismatch in {directory.name}") parts[kind] += 1 paid[kind] += r["reward"] if sum(r["reward"] for r in group)/4 != logs[step+1]: raise ValueError(f"Trainer mean reward mismatch at {directory.name} update {step+1}") for r in dev: p = Problem.from_expression(r["expression"]) kind = trace_error(p, r["trace"]) if (r["key"] != p.key or list(p.steps) != r["problem"] or list(execute_steps(p)) != r["expected_values"] or r["correct"] != (kind == "correct") or r["malformed"] != (kind == "format")): raise ValueError(f"Development arithmetic or parse mismatch in {directory.name}") cases[kind] += 1 windows = [[sum(r[k] for r in quarter) for k in ("label", "reward")] for quarter in (training[:updates], training[-updates:])] return training, dev, dict(training=parts, rewarded=paid, dev=cases, first_quarter=windows[0], last_quarter=windows[1])
def audited_seed(directory, seed): """Read both completed reward treatments. No held-out record is used by this diagnostic.""" paths = [directory/f"d{depth}-{seed}" for depth in (2, 3)] if not all((path/"development.json").is_file() for path in paths): return None shallow, dev2, stats2 = audit_arm(paths[0], 2) deep, dev3, stats3 = audit_arm(paths[1], 3) if ([r["key"] for r in shallow] != [r["key"] for r in deep] or [r["key"] for r in dev2] != [r["key"] for r in dev3] or len({r["key"] for r in dev3}) != len(dev3)): raise ValueError("The depth comparison requires the same problems in the same order") transitions = [] accepted, agreement = [0, 0], [0, 0] shared_error = None paired = Counter() for a, b in zip(dev2, dev3, strict=True): verdicts = [effective_bit(b["reports"][i]) for i in (1, 2)] if verdicts != b["verdicts"][1:]: raise ValueError("The fixed-answer replay disagrees with the logged verdicts") for i, bit in enumerate(verdicts): accepted[i] += bit agreement[i] += bit == b["correct"] outcome = "both" if a["correct"] and b["correct"] else "two only" if a["correct"] else "three only" if b["correct"] else "neither" paired[outcome] += 1 if verdicts[0] != verdicts[1]: transitions.append(dict(expression=b["expression"], output=b["trace"], truth=b["expected_values"], bits=verdicts, reports=b["reports"][1:], correct=b["correct"])) if shared_error is None and a["correct"] and not b["correct"] and not b["malformed"] and b["verdicts"] == [1,1,1]: shared_error = dict(expression=b["expression"], right=a["trace"], wrong=b["trace"]) return dict(seed=seed, n=len(deep), groups=len(deep)//4, dev_n=len(dev3), two=stats2, three=stats3, paired=paired, accepted=accepted, agreement=agreement, transitions=transitions, shared_error=shared_error, transcript_audit=read_json(directory/"diagnostics"/f"depth-transcripts-{seed}.json"), **group_evidence(deep))
def readme_depth(data): """Keep the original seed's worked examples visible as later replications arrive.""" reviews = data["depth_review"] if not reviews: return "" r = reviews[0] seed, n, deep = r["seed"], r["dev_n"], r["three"] correct, two_correct = deep["dev"]["correct"], r["two"]["dev"]["correct"] paired = r["paired"] measured = {row["name"]: row for row in data["runs"] if row["completed_development"]} def dev_score(key): x = measured[key] return f"{x['dev_correct_n']}/{x['dev_n']}" sections = ["## Why did the two-judge and three-judge solvers diverge?", f"**With seed {seed}, training the solver with two frozen judges gave {two_correct}/{n} correct " f"solutions ({100*two_correct/n:.1f}%). Training it with three gave {correct}/{n} ({100*correct/n:.1f}%).** " f"The gap was {abs(correct-two_correct)} complete solutions ({100*(correct-two_correct)/n:+.2f} percentage points, three minus two). " f"Both solvers started from the same model and saw the same problems in the same order. An integer program " f"graded every intermediate step. On the paired problems, only the two-judge solver was correct on " f"{paired['two only']}, only the three-judge solver on {paired['three only']}, both on {paired['both']}, " f"and neither on {paired['neither']}. These are development results on the calibrated arithmetic benchmark."] reference = [(key, label) for key, label in (("base","the starting solver"),(f"d1-{seed}","one judge"), (f"flat-{seed}","three independent votes"),(f"oracle-{seed}","the exact checker"), (f"hybrid-{seed}","the third judge gated by the exact checker"),(f"shuffle-{seed}","shuffled three-judge rewards")) if key in measured] if reference: sections.append("The same evaluation gave "+", ".join(f"{dev_score(key)} for {label}" for key,label in reference)+".") fixed = sum(e["bits"][1] == e["correct"] for e in r["transitions"]) sections += ["### What happens if we stop at Judge 2 on the same answers?", f"The three-judge-trained solver still solved **{correct}/{n}**. Its written answers were already fixed " f"before grading. On those answers, Judge 3 changed {len(r['transitions'])} of Judge 2’s verdicts. " f"It corrected {fixed} and wrongly overturned {len(r['transitions'])-fixed}.", markdown(["Stopping point on the fixed answers", "Answers approved", "Verdicts agreeing with the checker"], [[f"Judge {i+2}",f"{r['accepted'][i]}/{n}",f"{r['agreement'][i]}/{n}"] for i in range(2)])] if r["transitions"]: example_rows = [] for e in r["transitions"]: decisions = [] for bit, report in zip(e["bits"],e["reports"],strict=True): record = numbers(report,6) detail = "" if record and record[0] not in (0,1): detail = f" (invalid audit flag {record[0]})" decisions.append(("Accepted" if bit else "Rejected")+detail) example_rows.append([e["expression"],e["output"].replace("\n"," "),",".join(map(str,e["truth"])),*decisions]) sections += ["Every changed development verdict appears here.", markdown(["Problem","Submitted steps","Correct steps","Judge 2","Judge 3"],example_rows)] if r["shared_error"]: e = r["shared_error"] sections.append(f"On `{e['expression']}`, the two-judge-trained solver wrote `{e['right']}`. The three-judge-trained " f"solver wrote `{e['wrong']}`, and all three judges approved it in the replay.") valid = deep["training"]["correct"] wrong = r["n"]-valid valid_paid = deep["rewarded"]["correct"] wrong_paid = sum(deep["rewarded"].values())-valid_paid sections += ["### What changed during training?", f"On the same {r['n']:,} training answers sampled by the three-judge solver, Judge 3 fixed {r['fixes']} " f"of Judge 2’s verdicts and spoiled {r['harms']}. Substituting Judge 2’s reward would have changed the " f"relative credits in **{r['changed_groups']}/{r['groups']} optimizer updates**. " "Each GRPO update compares four answers to one question. When gradings change early on, the solvers can " "learn different answers and receive different training data at subsequent updates. " "[GRPO advantage calculation](https://huggingface.co/docs/trl/grpo_trainer#computing-the-advantage)", f"Judge 3 rewarded **{wrong_paid}/{wrong} incorrect answers ({100*wrong_paid/wrong:.1f}%)** and " f"**{valid_paid}/{valid} correct answers ({100*valid_paid/valid:.1f}%)**." if valid and wrong else f"Judge 3 rewarded {wrong_paid}/{wrong} incorrect and {valid_paid}/{valid} correct answers.", markdown(["Within the same training question", "Correct answer ranks higher", "Tied", "Wrong answer ranks higher"], [["Judge 2 on those answers",*r["j2_pairs"]],["Judge 3 on those answers",*r["j3_pairs"]]]), f"In its first quarter of training, the three-judge solver produced {deep['first_quarter'][0]} correct " f"answers per {r['groups']} samples and received {deep['first_quarter'][1]} positive rewards. In the last " f"quarter it produced {deep['last_quarter'][0]} correct answers and received {deep['last_quarter'][1]} positive rewards."] local = "first wrong, second consistent" bad_first = deep["dev"][local]+deep["dev"]["first wrong, second inconsistent"] sections.append(f"The two-judge solver gave the correct first value on {two_correct+r['two']['dev']['second wrong']}/{n} " f"development problems. The three-judge solver gave a wrong first value on {bad_first} and a malformed " f"answer on {deep['dev']['format']}. In {deep['dev'][local]} cases it applied the second operation " f"correctly to its own wrong intermediate value. Judge 3 rewarded {deep['rewarded'][local]}/{deep['training'][local]} " "training answers with that error pattern.") verified = r["transcript_audit"] checks = (f"The audit independently regraded {2*r['n']:,} training answers and {2*n} development answers, checked " "the effective solution-verdict field against each assigned reward, and matched every group mean to TRL’s " "optimizer log.") if verified: calls = sum(s["matched_calls"] for s in verified["arms"].values()) checks += (f" Prompts and outputs matched the training records for all {calls:,} calls, including the " f"solver answer and preceding reports shown to each judge. Both evaluated adapter hashes matched the saved weights. " f"[Transcript and weight checks](results/calibrated/diagnostics/depth-transcripts-{seed}.json)") sections += ["### Could a code bug or a training seed explain it?", checks, "These checks support a training-signal explanation. The three-judge reward frequently approved " "incorrect arithmetic and gave little preference to correct answers within a question. The checker-gated " "control shows that this solver can learn with the same three judge calls when incorrect solutions receive " "zero reward. The depth analysis is exploratory. The contribution of a particular stochastic update " "cannot be identified from these trajectories."] if len(reviews)>1: sections += ["The same development diagnostic applied to subsequent matched seeds gave these results.", markdown(["Seed", "Two-judge solver exact", "Three-judge solver exact", "J3 fixes on training answers", "J3 harms"], [[e["seed"],f"{e['two']['dev']['correct']}/{e['dev_n']}",f"{e['three']['dev']['correct']}/{e['dev_n']}", e["fixes"],e["harms"]] for e in reviews])] base = measured.get("base") if base and base["replay"] and base["dev_n"]: methods = base["replay"] agreements = [m["n"]-m["false_accept"]-m["false_reject"] for m in methods] sections += ["### Did Judge 3 actually audit the preceding review?", f"On a separate replay of the starting solver’s {base['dev_n']} development responses, Judges 1, 2 and 3 " f"agreed with the arithmetic checker on {agreements[0]}, {agreements[1]} and {agreements[2]} verdicts, " f"respectively. Three independent first-order votes agreed on {agreements[3]}. On these fixed starting " f"responses Judge 3 repaired {base['fixed']} earlier verdicts and overturned {base['harmed']} correct ones."] tests = [] for label,key in (("Frozen","base"),("Trained on exact labels","exact-j3"), ("Alternating, exact route","alt-exact-j3"),("Alternating, top-down route","alt-top-j3")): row = measured.get(key) if row and row["twins_n"]: v = row["evidence_fields"]["visible"] split = "Development" if row["twin_split"] == "dev" else "Held out" tests.append([label,split,f"{v['solution_bit']}/{v['reports']}", f"{v['localized_and_repaired']}/{v['faults']}", f"{round(row['twins']*row['twins_n'])}/{row['twins_n']}", f"{round(row['masked']*row['twins_n'])}/{row['twins_n']}"]) if tests: sections += ["The paired audit changes a numerical claim in Judge 2’s report while preserving the verdict " "on the solver. To pass a pair, Judge 3 must endorse the sound report and reject the altered " "one with the correct location, replacement and solution verdict.", markdown(["Judge 3","Cohort","Correct solver verdict","Altered review located and repaired", "Whole pairs correct","Whole pairs with evidence masked"],tests)] prefixes = [] for route,label in (("exact","Exact verdict and evidence"),("top","Top-down learned supervision")): arms = [f"{route}-prefix{i}" for i in (1,2,3)] if all(a in measured for a in arms): prefixes.append([label,*map(dev_score,arms)]) if prefixes: sections += ["A separate experiment keeps **all three judge calls** and varies which reviewers had already " "been trained before a fresh solver learned. These development scores are exact solver solutions.", markdown(["Judge supervision","Only Judge 1 trained","Judges 1 and 2 trained","All three trained"],prefixes)] primary = data["primary"] inference = ("The preregistered three-seed comparison on 2,048 unseen problems is pending." if "delta" not in primary else f"The registered held-out difference (three minus two) was {100*primary['delta']:+.2f} percentage " f"points, with a paired 95% interval from {100*primary['ci'][0]:+.2f} to {100*primary['ci'][1]:+.2f} " "conditional on these checkpoints.") sections.append(inference+" [Raw training and development audit](reports/reviews/depth-diagnosis.md) · " "[Preregistration and decision rule](reports/preregistration.md)") return "\n\n".join(sections)+"\n\n"
def collect_depth_review(directory, profile): if profile.get("family") != "two-add": return [] return [result for seed in SEEDS if (result := audited_seed(directory, seed))]
def review_text(reviews): """Make the causal distinction explicit and label the observed-sample analysis as exploratory.""" sections = ["# What changed when the solver trained with a third judge?", "This exploratory analysis began after observing the seed-17 development gap. The arithmetic grader " "executes the numbered operations. The routing check reconstructs the solver verdict from the raw " "fourth field of each final report and checks each group against TRL’s own optimizer log. " "A nonbinary audit flag or an unparseable report yields a rejection. " "[Analysis code](../../src/study/depth_review.py) · [GRPO group advantages](https://huggingface.co/docs/trl/grpo_trainer#computing-the-advantage)"] for r in reviews: seed, deep = r["seed"], r["three"] sections.extend([f"## Seed {seed}", f"On {r['dev_n']} matched development problems the two-judge solver alone was correct on " f"{r['paired']['two only']}, the three-judge solver alone on {r['paired']['three only']}, both on " f"{r['paired']['both']}, and neither on {r['paired']['neither']}. Holding the three-judge solver's outputs " f"fixed, Judge 2 accepted {r['accepted'][0]} and Judge 3 accepted {r['accepted'][1]}.", markdown(["Three-judge solver error", "Development answers", "Training answers", "Training answers rewarded"], [[k,deep["dev"][k],deep["training"][k],deep["rewarded"][k]] for k in ("correct","first wrong, second consistent","first wrong, second inconsistent","second wrong","format")]), f"On the same {r['n']} training answers, Judge 3 fixed {r['fixes']} effective Judge 2 verdicts and " f"spoiled {r['harms']}. Its decision changed the within-group advantages in {r['changed_groups']}/{r['groups']} " "optimizer updates. Each row below compares correct and incorrect completions of the same question. " "Pairs within and across rows share observations.", markdown(["Reward applied to these answers", "Correct ranks higher", "Tied", "Incorrect ranks higher"], [["Judge 2",*r["j2_pairs"]],["Judge 3",*r["j3_pairs"]]]), markdown(["Training run and window", "Correct", "Rewarded", "Sampled"], [[role+" / "+label, *r[key][window], r["groups"]] for role,key in (("Two judges","two"),("Three judges","three")) for label,window in (("first quarter","first_quarter"),("last quarter","last_quarter"))])]) if r["transitions"]: sections.extend(["Every development verdict change on the three-judge solver’s fixed responses is shown below.", markdown(["Expression", "Solver", "Exact values", "Judge 2 report", "Judge 3 report", "Verdict change"], [[e["expression"],e["output"].replace("\n"," "),",".join(map(str,e["truth"])), *e["reports"], "Fixed" if e["bits"][1] == e["correct"] else "Introduced error"] for e in r["transitions"]])]) sections.append(f"[Two-judge records](../../results/calibrated/d2-{seed}) · [Three-judge records](../../results/calibrated/d3-{seed})") sections.append("These comparisons distinguish a change of verdict on an already written answer from a change " "to the solver learned over successive updates. Replacing the reward in an archived group reveals " "which relative credits would change on those samples. A separately trained solver generates its " "own subsequent samples. The checker-gated and shuffled arms test sensitivity to reward quality. " "The registered effectiveness claim uses unseen problems and multiple training seeds. " "[Protocol](../preregistration.md) · [All training arms](../summary.md)") return "\n\n".join(sections)+"\n"123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869"""Verify the role prompts, sampled outputs and actually evaluated weights from the full local journals."""
import argparseimport hashlibfrom pathlib import Path
from .domain import Problemfrom .storage import ORIGINAL_STATE, ROOT, read_json, rows, write_json
def verify_arm(project, state, depth, seed): """Reconcile the raw tokenizer stream with each solver and reviewer row in optimizer order.""" name = f"d{depth}-{seed}" target = project/"results/calibrated"/name with (state/"calibrated/runs"/name/"adapter/adapter_model.safetensors").open("rb") as file: weights = hashlib.file_digest(file,"sha256").hexdigest() if read_json(target/"development.json")["weights"] != weights: raise ValueError(f"{name} development used different adapter bytes") training = list(rows(target/"rollouts.jsonl")) roles = ["solver",*[f"j{i}" for i in range(1,depth+1)]] journal = {(event,role): [] for role in roles for event in ("prompts","outputs")} sources = {} for path in sorted((project/"logs/calibrated"/name).glob("*.jsonl")): with path.open("rb") as file: sources[path.name] = hashlib.file_digest(file,"sha256").hexdigest() for event in rows(path): if event["event"] == "training_start": # Resume discards uncheckpointed rollouts in the training table and starts those groups again. for values in journal.values(): del values[4*event["completed"]:] key = (event["event"],event.get("role")) if key in journal: journal[key].extend(event["text"]) if not sources or not training: raise ValueError(f"Missing local journals or training rows for {name}") for index, role in enumerate(roles): prompts, outputs = (journal[key,role] for key in ("prompts","outputs")) for prompt, output, r in zip(prompts,outputs,training,strict=True): question = Problem.from_expression(r["expression"]).question answer = r["answer"] if index == 0 else r["reports"][index-1] actual = output.replace("<|im_end|>","").replace("<|endoftext|>","") last_turn = prompt.split("<|im_start|>user\n")[-1] if actual != answer or not last_turn.startswith(question+"\n"): raise ValueError(f"{name}/{role} response or question mismatch at step {r['step']}") if index: submitted = question+"\nSolver response: "+r["answer"] for prior in range(index-1): submitted += f"\nJudge {prior+1}: {r['reports'][prior]}" if not last_turn.startswith(submitted+f"\nYour Judge {index} record:"): raise ValueError(f"{name}/{role} input history mismatch at step {r['step']}") return dict(adapter_sha256=weights, journals_sha256=sources, training_answers=len(training), matched_calls=len(training)*len(roles))
def main(): parser = argparse.ArgumentParser(description=__doc__) parser.add_argument("--seed",type=int,required=True) parser.add_argument("--project",type=Path,default=ROOT) parser.add_argument("--state",type=Path,default=ORIGINAL_STATE) parser.add_argument("--output",type=Path) args = parser.parse_args() arms = {f"d{depth}-{args.seed}": verify_arm(args.project,args.state,depth,args.seed) for depth in (2,3)} out = args.output or args.project/f"results/calibrated/diagnostics/depth-transcripts-{args.seed}.json" write_json(out,dict(seed=args.seed,arms=arms)) print(out)
if __name__ == "__main__": main()6 unmodified lines789101112321 unmodified lines334335336337338339112 unmodified lines45245345445545645715 unmodified lines47347447547647747847 unmodified lines5265275285295305315326 unmodified linesfrom zoneinfo import ZoneInfofrom .analysis import evidence_fields, paired_comparison, paired_primary, replay_metricsfrom .design import GITHUB, PAGES, PILOTS, Run, matrixfrom .learnability_report import collect_learnability, learnability_text, learning_figurefrom .learning_review import check_release, review_text321 unmodified lines[[r["name"],r["role"],str(r["updates"] or "—"),str(r["dev_n"]),percent(r["dev"]),str(r["test_n"]),percent(r["test"])] for r in data["runs"]])else:line("No model observations have been recorded at the protocol milestone.")learning=data["learnability"]if learning["screen"]:line("Attainable benchmark amendment","Heading2")112 unmodified linesdef build():data = collect()data["learning_review"] = check_release(ORIGINAL_RESULTS)review_file = REPORTS/"reviews/learning-control.md"if data["learning_review"]:15 unmodified linesif "delta" in primary:status += f" Difference {100*primary['delta']:.2f} percentage points, conditional 95% interval [{100*primary['ci'][0]:.2f}, {100*primary['ci'][1]:.2f}]."summary = status+"\n\n"+scorelearning = data["learnability"]if learning["screen"]:chosen = learning["screen"]["selected"]47 unmodified linesfor label, done in milestones:marker="- [x] " if done else "- [ ] "post=post.replace("- [ ] "+label,marker+label).replace("- [x] "+label,marker+label)atomic(ROOT/"README.md",pre+"<!-- RESULTS:START -->\n"+assets+summary+f"\n\n[Interactive results explorer]({PAGES}) · [Paper](reports/paper.pdf)\n<!-- RESULTS:END -->"+post)experiments=REPORTS/"experiments"notes=[]methods=[]6 unmodified lines78910111213321 unmodified lines335336337338339340341342343344345346347348112 unmodified lines46146246346446546646746846947047147247315 unmodified lines48949049149249349449549647 unmodified lines5445455465475485495505515525536 unmodified linesfrom zoneinfo import ZoneInfofrom .analysis import evidence_fields, paired_comparison, paired_primary, replay_metricsfrom .depth_review import collect_depth_review, readme_depth, review_text as depth_review_textfrom .design import GITHUB, PAGES, PILOTS, Run, matrixfrom .learnability_report import collect_learnability, learnability_text, learning_figurefrom .learning_review import check_release, review_text321 unmodified lines[[r["name"],r["role"],str(r["updates"] or "—"),str(r["dev_n"]),percent(r["dev"]),str(r["test_n"]),percent(r["test"])] for r in data["runs"]])else:line("No model observations have been recorded at the protocol milestone.")if data["depth_review"]:line("How did the third verdict change the training signal?", "Heading2")line("This exploratory diagnostic compares Judge 2 and Judge 3 on the identical answers already sampled by the three-judge solver. Each changed group has a different vector of within-question GRPO advantages after substituting Judge 2’s verdict. Re-training changes the answers subsequently sampled by the solver.")table(["Seed","Training answers","J3 fixes","J3 harms","Changed groups","Dev. exact D2","Dev. exact D3"],[[r["seed"],r["n"],r["fixes"],r["harms"],f"{r['changed_groups']}/{r['groups']}",f"{r['two']['dev']['correct']}/{r['dev_n']}",f"{r['three']['dev']['correct']}/{r['dev_n']}"]for r in data["depth_review"]])line(f"Per-problem verdict changes, reward rates by arithmetic error and within-group preferences are in the <link href='{GITHUB}/blob/main/reports/reviews/depth-diagnosis.md'>depth analysis</link>. It was specified after seeing the first development contrast.")learning=data["learnability"]if learning["screen"]:line("Attainable benchmark amendment","Heading2")112 unmodified linesdef build():data = collect()scoped = ORIGINAL_RESULTS / ("calibrated" if data["profile"] else "")data["depth_review"] = collect_depth_review(scoped, data["profile"])depth_file = REPORTS/"reviews/depth-diagnosis.md"if data["depth_review"]:atomic(depth_file,depth_review_text(data["depth_review"]))else:depth_file.unlink(missing_ok=True)data["learning_review"] = check_release(ORIGINAL_RESULTS)review_file = REPORTS/"reviews/learning-control.md"if data["learning_review"]:15 unmodified linesif "delta" in primary:status += f" Difference {100*primary['delta']:.2f} percentage points, conditional 95% interval [{100*primary['ci'][0]:.2f}, {100*primary['ci'][1]:.2f}]."summary = status+"\n\n"+scoreif data["depth_review"]:summary += f"\n\n[How the third judge changed actual training rewards and worked examples]({GITHUB}/blob/main/reports/reviews/depth-diagnosis.md)."learning = data["learnability"]if learning["screen"]:chosen = learning["screen"]["selected"]47 unmodified linesfor label, done in milestones:marker="- [x] " if done else "- [ ] "post=post.replace("- [ ] "+label,marker+label).replace("- [x] "+label,marker+label)diagnostic = readme_depth(data)if diagnostic:diagnostic += "## Study results\n\n"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)experiments=REPORTS/"experiments"notes=[]methods=[]
123456789101112131415161718192021222324252627282930313233343536373839404142434445"""Check adjudication, group-relative credit and locally consistent arithmetic on toy traces."""
import pytest
from study.domain import Problem
def test_an_endorsed_rejection_and_an_invalid_audit_flag_both_reward_zero(): from study.depth_review import effective_bit
assert effective_bit("1,0,7,0,1,7") == 0 assert effective_bit("-1,0,7,1,0,7") == 0 assert effective_bit("0,2,7,1,0,7") == 1 assert effective_bit("1,0,7,0,1") == 0
def test_arithmetic_diagnostic_separates_propagated_error_from_correct_final(): from study.depth_review import trace_error
p = Problem.from_expression("(39 + 12) - 5") assert trace_error(p, "51,46") == "correct" assert trace_error(p, "16,11") == "first wrong, second consistent" assert trace_error(p, "16,46") == "first wrong, second inconsistent" assert trace_error(p, "51,40") == "second wrong" assert trace_error(p, "46") == "format"
def test_earlier_judge_can_grade_same_group_better_while_aggregate_agreement_ties(): from study.depth_review import group_evidence
reports = lambda bit: f"1,0,7,{bit},0,7" deep = [dict(label=label, reports=["1,0,7", reports(second), reports(third)]) for label, second, third in [(1,1,0), (0,0,1), (0,1,0), (0,1,0)]] result = group_evidence(deep) assert result["fixes"] == result["harms"] == 2 assert result["changed_groups"] == 1 assert result["j2_pairs"] == [1,2,0] assert result["j3_pairs"] == [0,2,1]
def test_group_evidence_rejects_an_incomplete_training_group(): from study.depth_review import group_evidence
with pytest.raises(ValueError, match="four"): group_evidence([{}])README.md+70
docs/assets/study.json+155
docs/usage.md+2
reports/amendments.md+4
reports/paper.pdf+2-2
reports/reviews/depth-diagnosis.mdAdded+40
reports/summary.md+2
results/calibrated/diagnostics/depth-transcripts-17.jsonAdded+21
src/study/depth_review.pyAdded+328
src/study/depth_transcripts.pyAdded+69
src/study/report.py+22-1
tests/test_depth_review.pyAdded+45