Training-recipe advice

This section walks the code that produced the evidence. The surface a candidate may change is one file, analyze.py, and one line of it: CELL["n_train"]. The training protocol (lib/protocol.py) and the fit arithmetic (lib/scaling.py) sit outside the mutable surface, so no cell can quietly change how it trains. The source below is included by reference to the run that executed it, not the file left on disk (the notary restores analyze.py after every run on a registered track). Each listing opens as a collapsed disclosure.

A development cell: E0006 (N = 16,000)

E0006 is the representative cell. Read the file top to bottom in four moves. (1) Partitions come from the contract through load_items, which prints the split_fingerprint the notary compares with the one frozen at the DATA gate, so a cell cannot silently score the wrong rows. (2) draw_subsample takes N images from one permutation seeded by the seed, which makes subsamples nested within a seed, and holds out 10 percent as an inner validation set. (3) protocol.train keeps the best inner-validation checkpoint and returns its step. (4) The cell pins tables/cell_<run>_s<seed>.tsv, a name the fit collects, while the sealed run writes sealed_<run>_s<seed>.tsv, a name no fit can ever pick up.



The fit: E0007

The exponent track runs the same file with KLEIN_TRACK=exponent, which calls run_exponent. It collects only cell tables whose run is a measured primary development run, whose path is pinned in its manifest, and whose bytes still hash to the pin; a table that fails that is not evidence. The arithmetic lives in lib/scaling.py: OLS on the log-log seed means, R² in log space, and a within-N bootstrap that the file itself labels descriptive.




The sealed cell: E0008

Under --final-test the fit pool is train plus development, N is all of it (59,992), and the pinned law is read before training starts: a missing or altered fit table stops the run in seconds, not after the whole 8437-step budget. The relative error is computed per seed against the pinned law, and the notary averages it, which is the registered definition that erratum E1 spells out.




There is no declared verifier on this study: the evaluator kleinlib.eval_multiclass computes the cross-entropy and the notary reads the printed block, so the training script does not grade itself on a number it chose. The step rule is the single line to look at, because it produced the shared budget:

def steps_for(n: int) -> int:
    """max(400, ceil(20 epochs * 0.9N / 128)), capped at 12,000."""
    n_fit = n - inner_size(n)
    epochs_steps = -(-EPOCHS * n_fit // BATCH_SIZE)  # integer ceil
    return min(MAX_STEPS, max(MIN_STEPS, epochs_steps))

Pitfalls and war stories that bit this study

  1. A minimum step count is a hidden compute confound. The max(400, …) floor gave N=500, 1,000 and 2,000 the same 400 steps (113.8, 56.9 and 28.4 epochs) while every cell from N=4000 up trained 20 epochs, and every best checkpoint landed in the last 5 percent of its budget (C6). Whether this shaped the flat left end is the untested hypothesis C9. The recipe advice that follows from the measured part is C13: make the step budget grow with N across the whole range and check that no best checkpoint sits at the end of its budget.

  2. A good in-range fit is not a forecast. R² failed here, but even a fit that passed could not have said which way it would miss. Hold the law to a sealed extrapolation point (C14). The signed miss of −0.2802 and the post-hoc best case of −0.0745 show that the sign you expect from theory can be the wrong one (C17).

  3. Nested subsamples narrow the bootstrap. Resampling seeds within each N ignores the pairing along a seed's curve, so the printed bootstrap width (0.0230) was 2.33 times narrower than the per-seed-slope t-interval (0.0536). Report both (C15). An early docstring claimed the bootstrap “errs wide”; the METHOD-gate synthetic checks withdrew that before any cell ran.

  4. Score the fit and the extrapolation on the same distribution. Here the fit cells used the development lane and the sealed cell the test set (C16). A control that trains at a large N and scores the development lane would split the miss into law and partition parts.

  5. A tooling false positive nearly blocked the study. A 64-bit hash audit flagged most held-out silhouettes as duplicates; an exact pixel-space criterion cleared it and removed the 8 and 5 genuine near-copies (section 3).

  6. Rehearse the sealed run. The sealed access can be spent once per track. The sealed dry run, which trains 60 steps on development data and spends nothing, exists so that a crash in the path cannot burn the only access; this study ran it twice before the real run.

  7. Detached cells are attested, not observed. Run a re-execution of the cell you care about under observation; here that was done for E0005 within the claims' evidence.

  8. Do not let the notebook outrun the claim. Three early program.md entries read the compute-limited mechanism as fact. The claim C9 was kept at “hypothesis, untested” and the notebook was annotated, not rewritten.

Hardware and cost

4-CPU x86_64 Linux VM, no GPU, torch CPU path, one thread. The sealed 3-seed array took 1883.8 s of wall time. Wall time is informational, not a budget; the budget is steps.