learning-control-audit · a61dd348182a
Browse filesFiles changed (8)
9692 unmodified lines969396949695969696979692 unmodified lines"time": "2026-11-26T12:13:18.581+00:00"},"sealed": false,"completed": false}9692 unmodified lines969396949695969696979698969997009701970297039704970597069692 unmodified lines"time": "2026-11-26T12:13:18.581+00:00"},"sealed": false,"completed": false,"learning_review": {"training": 128,"validation": 256,"scored": 768,"overlap": 0,"exposure_hash": "e92fcd4a7337f53b79ecebfc388677456f3274d6ae28527bbb5d975aa7421357","fixed": 96,"harmed": 3}}
100 unmodified lines101102103100 unmodified lines14,20Exact-trained14,19</pre>100 unmodified lines101102103104105100 unmodified lines14,20Exact-trained14,19</pre>[Independent arithmetic replay, paired estimates and realized split checks](reviews/learning-control.md).
123version https://git-lfs.github.com/spec/v1oid sha256:f03ee73468f1ff5b135e03d2080f14704313f5267b1dde299b94bf4fd16affa7size 245170123version https://git-lfs.github.com/spec/v1oid sha256:471bb7b37e2f6ddfc0cf6f7a128bfc45b1135050c7403dd0b83a3958dd3d4739size 245335
1234567# Scientific review of the learnability control
The exact and shuffled policies saw the same 128 unique training problems in the same optimizer-update order, in four-completion groups. Their ordered exposure SHA-256 is `e92fcd4a7337f53b79ecebfc388677456f3274d6ae28527bbb5d975aa7421357`. Across observed training, difficulty screening, confirmation and learning validation there were 0 repeated canonical IDs between partitions.
All 768 responses from the three checkpoints were rescored on the same 256 validation problems by executing the numbered operations. Every grade, parse flag, checkpoint summary, paired estimate and interval agreed with the published observations. Exact-reward training fixed 96 previously incorrect traces and lost 3 correct traces.
The population was selected on development data. The learning interval conditions on one training seed and these checkpoints. It addresses whether this solver learns arithmetic with an informative reward. The separate depth comparison uses fresh solvers, multiple seeds and a sealed evaluation. [Registered decision rule](../learnability-preregistration.md) · [Outcomes and examples](../learnability.md) · [Validation records](../../results/learnability/evaluations) · [Verification code](../../src/study/learning_review.py)109 unmodified lines110111112113109 unmodified linestext = (f"Problem {ex['expression']}\nExpected {reference}\nComparator\n{ex['comparator']}"f"\nExact-trained\n{ex['trained']}")out.append(f"{ex['stratum']} · {ex['change']}\n\n<pre>{escape(text)}</pre>")return "\n\n".join(out)+"\n"109 unmodified lines110111112113114109 unmodified linestext = (f"Problem {ex['expression']}\nExpected {reference}\nComparator\n{ex['comparator']}"f"\nExact-trained\n{ex['trained']}")out.append(f"{ex['stratum']} · {ex['change']}\n\n<pre>{escape(text)}</pre>")out.append("[Independent arithmetic replay, paired estimates and realized split checks](reviews/learning-control.md).")return "\n\n".join(out)+"\n"
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495"""Verify the positive control against its published prompts, checkpoints' outputs and split IDs."""
import operator
from .curriculum import curriculum_problemsfrom .design import PILOTS, Runfrom .domain import Problemfrom .exposures import check_exposuresfrom .learnability_analysis import learning_resultfrom .records import parsefrom .storage import read_json, rows
def execute_steps(problem): """Interpret the numbered operations directly, independently of the generator's numeric values.""" variables = {} operations = {"+":operator.add, "-":operator.sub, "*":operator.mul} for line in problem.steps: target, _, left, sign, right = line.split() operands = [variables[t] if t.startswith("s") else int(t) for t in (left,right)] variables[target] = operations[sign](*operands) return tuple(variables.values())
def check_release(results): calibration = results/"learnability" published = read_json(calibration/"learning.json") if not published: return None c = read_json(calibration/"screen.json")["selected"] family, style = c["family"], c["style"] controls = [Run(name, family=family, prompt_style=style) for name in PILOTS] exposure = check_exposures(results, controls) for spec in controls: trained = read_json(results/spec.name/"trained.json") settings = trained["run"] if (trained["updates"],settings["seed"],settings["family"],settings["prompt_style"]) != (128,17,family,style): raise ValueError(f"Unmatched training configuration in {spec.name}")
# Check realized exposures against the registered assignment, then check them against one another. seen = {r["key"] for r in rows(results/PILOTS[0]/"rollouts.jsonl")} def expected_ids(phase,n): return {p.key for p in curriculum_problems(family,phase,n)} if seen != expected_ids("train",128): raise ValueError("Unexpected learning-control training problems") validation = expected_ids("validation",256) partitions = [seen,validation] for phase,n in (("screen",16),("confirm",48)): ids = [r["key"] for r in rows(calibration/phase/(family+"-"+style+".jsonl"))] if len(ids)!=n or set(ids)!=expected_ids(phase,n): raise ValueError(f"Unexpected {phase} problems") partitions.append(set(ids)) overlap = sum(map(len,partitions))-len(set.union(*partitions)) if overlap: raise ValueError("The realized calibration partitions overlap")
samples = [] for name in ("base",*PILOTS): labels = {} parsed = 0 for r in rows(calibration/"evaluations"/(name+".jsonl")): p = Problem.from_expression(r["expression"]) values = execute_steps(p) answer = parse(r["trace"],len(values)) if (r["key"]!=p.key or p.key in labels or tuple(r["expected_values"])!=values or r["parsed"]!=(answer is not None) or r["correct"]!=(answer==values)): raise ValueError(f"Invalid problem or grade in {name}") labels[p.key] = int(answer==values) parsed += answer is not None marker = read_json(calibration/"evaluations"/(name+".json")) if labels.keys()!=validation or (marker["n"],marker["correct"],marker["parsed"])!=(len(labels),sum(labels.values()),parsed): raise ValueError(f"Validation cohort or summary mismatch for {name}") samples.append(labels) recalculated = learning_result(*samples) if any(published.get(field)!=value for field,value in recalculated.items()): raise ValueError("The published paired result differs from the raw validation outcomes") return dict(training=len(seen),validation=len(validation),scored=sum(map(len,samples)),overlap=overlap, exposure_hash=exposure[PILOTS[0]],fixed=published["over_base"]["fixed"],harmed=published["over_base"]["harmed"])
def review_text(check): return (f"# Scientific review of the learnability control\n\n" f"The exact and shuffled policies saw the same {check['training']} unique training problems in the same " f"optimizer-update order, in four-completion groups. Their ordered exposure SHA-256 is `{check['exposure_hash']}`. " f"Across observed training, difficulty screening, confirmation and learning validation there were " f"{check['overlap']} repeated canonical IDs between partitions.\n\n" f"All {check['scored']} responses from the three checkpoints were rescored on the same {check['validation']} " f"validation problems by executing the numbered operations. Every grade, parse flag, checkpoint summary, " f"paired estimate and interval agreed with the published observations. Exact-reward training fixed " f"{check['fixed']} previously incorrect traces and lost {check['harmed']} correct traces.\n\n" "The population was selected on development data. The learning interval conditions on one training seed " "and these checkpoints. It addresses whether this solver learns arithmetic with an informative reward. " "The separate depth comparison uses fresh solvers, multiple seeds and a sealed evaluation. " "[Registered decision rule](../learnability-preregistration.md) · [Outcomes and examples](../learnability.md) " "· [Validation records](../../results/learnability/evaluations) · [Verification code](../../src/study/learning_review.py)\n")8 unmodified lines91011121314336 unmodified lines35135235335435535691 unmodified lines4484494504514524538 unmodified linesfrom .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 .records import named_valuesfrom .storage import ORIGINAL_RESULTS, ROOT, atomic, read_json, rows, write_jsonfrom .tables import contrast_rows, markdown, rate as percent, run_evidence, training_method336 unmodified linestable(["Formatting on the same problem","Problems","Gains","Losses"],[[g["stratum"],g["n"],g["gains"],g["losses"]] for g in groups])line("A gain when both responses already parse requires a corrected arithmetic trace. A gain in a newly parseable response can combine arithmetic and formatting changes.")primary = data["primary"]if "delta" in primary:line(f"The equally weighted paired difference is {primary['delta']*100:.2f} percentage points. The conditional 95% problem-bootstrap interval is [{primary['ci'][0]*100:.2f}, {primary['ci'][1]*100:.2f}] points. The registered decision is {primary['status']}.")91 unmodified linesdef build():data = collect()date = datetime.now(ZoneInfo("Europe/Berlin")).date().isoformat()figures(data)write_json(DOCS/"assets/study.json", data)8 unmodified lines9101112131415336 unmodified lines35235335435535635735835936091 unmodified lines4524534544554564574584594604614624638 unmodified linesfrom .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_textfrom .records import named_valuesfrom .storage import ORIGINAL_RESULTS, ROOT, atomic, read_json, rows, write_jsonfrom .tables import contrast_rows, markdown, rate as percent, run_evidence, training_method336 unmodified linestable(["Formatting on the same problem","Problems","Gains","Losses"],[[g["stratum"],g["n"],g["gains"],g["losses"]] for g in groups])line("A gain when both responses already parse requires a corrected arithmetic trace. A gain in a newly parseable response can combine arithmetic and formatting changes.")if data.get("learning_review"):audit=data["learning_review"]line(f"The replay audit reproduced all {audit['scored']} response grades and both paired intervals. The two training arms shared {audit['training']} unique prompts in identical order. The training, screening, confirmation and validation partitions had {audit['overlap']} shared canonical problem IDs.")primary = data["primary"]if "delta" in primary:line(f"The equally weighted paired difference is {primary['delta']*100:.2f} percentage points. The conditional 95% problem-bootstrap interval is [{primary['ci'][0]*100:.2f}, {primary['ci'][1]*100:.2f}] points. The registered decision is {primary['status']}.")91 unmodified linesdef build():data = collect()data["learning_review"] = check_release(ORIGINAL_RESULTS)review_file = REPORTS/"reviews/learning-control.md"if data["learning_review"]:atomic(review_file,review_text(data["learning_review"]))else:review_file.unlink(missing_ok=True)date = datetime.now(ZoneInfo("Europe/Berlin")).date().isoformat()figures(data)write_json(DOCS/"assets/study.json", data)
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647"""Reproduce the learnability review on synthetic answers with real partition assignments."""
import pytest
from study.curriculum import curriculum_problemsfrom study.design import PILOTSfrom study.learnability_analysis import learning_resultfrom study.records import renderfrom study.storage import append, read_json, write_json
def test_review_checks_actual_training_order_splits_and_every_validation_grade(tmp_path): from study.learning_review import check_release
root = tmp_path/"learnability" assert check_release(tmp_path) is None config = {"family":"two-add", "style":"demonstrated"} write_json(root/"screen.json",{"selected":config}) for phase,count in (("screen",16),("confirm",48)): for p in curriculum_problems("two-add",phase,count): append(root/phase/"two-add-demonstrated.jsonl",{"key":p.key}) for name in PILOTS: write_json(tmp_path/name/"trained.json",{"updates":128,"run":{"seed":17,"family":"two-add","prompt_style":"demonstrated"}}) for step,p in enumerate(curriculum_problems("two-add","train",128)): for sample in range(4): append(tmp_path/name/"rollouts.jsonl",dict(key=p.key,step=step,sample=sample,role="solver",trace="",prior=[])) samples = [] for name in ("base",*PILOTS): labels = {} for p in curriculum_problems("two-add","validation",256): values=list(p.values) if name!=PILOTS[0]: values[0]+=1 labels[p.key]=int(name==PILOTS[0]) append(root/"evaluations"/(name+".jsonl"),dict(key=p.key,expression=p.expression,expected_values=p.values, trace=render(values),correct=labels[p.key],parsed=True)) write_json(root/"evaluations"/(name+".json"),dict(n=256,correct=sum(labels.values()),parsed=256)) samples.append(labels) write_json(root/"learning.json",learning_result(*samples)) verified=check_release(tmp_path) assert verified["scored"]==768 and verified["validation"]==256 and verified["training"]==128 assert verified["overlap"]==0 and len(verified["exposure_hash"])==64 learning = read_json(root/"learning.json") learning["over_base"]["fixed"] -= 1 write_json(root/"learning.json",learning) with pytest.raises(ValueError,match="paired result"): check_release(tmp_path)docs/assets/study.json+10-1
reports/learnability.md+2
reports/paper.pdf+2-2
reports/reviews/learning-control.mdAdded+7
src/study/learnability_report.py+1
src/study/learning_review.pyAdded+95
src/study/report.py+10
tests/test_learning_review.pyAdded+47