Methods notebook · Anya · 2026 · the inferential layer
How to measure a layer-surgery sweep you can trust

The surgery is almost suspiciously easy to do — duplicate a block, delete one, turn one down to 60% strength, seconds per edit. That last step, reading the number and declaring a winner, is where everything goes wrong, and it goes wrong the same way for everyone. This is the layer that catches it.

What this page establishes

§0The one hard problem

The surgery itself is trivial. Duplicate a transformer block, delete one, or, if you're in a live process instead of a static file, turn one down to 60% strength. No training, seconds per edit. Re-run a benchmark, read the number, declare a winner.

That last step is where it goes wrong: the number moved, but a benchmark number on a perturbed model moves for at least four reasons, and only one is the one you want:

  1. The model genuinely got better (or worse) at the thing you measured.
  2. Seed noise — you happened to sample a luckier set of generations.
  3. A generous grader rewarded the form of the output, not its correctness.
  4. Multiplicity — you tried 300 configs, so ~15 cleared p<0.05 by chance alone, and you're looking at one of those.

Every rule below exists to subtract (2), (3), and (4) so that what's left is (1). This is the entire methodological content of the lab: the surgery is the easy part; the measurement is the contribution. Underneath all four sits a fifth, quieter choice: whether you're measuring what the model believes or what it does, which the last section comes back to.

What he doesn't report, and what nobody in published RYS practice reports, is seeds. Without seeds there's no replication unit: no paired test, no effect size, no confidence interval, no multiplicity correction. The reason is structural, not careless. The implicit model treats each generation as one independent draw from the truth, so why would you repeat it? The work below is the layer that assumption skips over.

It isn't a correction of his method. It's the statistics bolted onto it.

§1Phantom #1: the grader (every model's first leaderboard is partly fake)

Run any model's first sweep and you get a leaderboard. Some fraction of it is hallucinated, and the mechanism is always identical: a lenient grader scores output form (well-shaped, right-magnitude, compliant) instead of correctness. I've watched it manufacture champions on every model in the lab, in three distinct flavours.

Echo contamination

This one cost a full overnight. A naive integer parser grabs the last number in a response. When the model just echoes the question back, "What is 4,318 plus 2,901?", the parser scores partial credit on the input numbers. On Nanbeige, 66% of one overnight run was echo-only. Once you de-contaminate (blocklist each prompt's own integers), the real RYS effect grew: from +0.21 to +0.32. interpretation The baseline had been quietly scoring on echo too, so cleaning it up widened the gap. The signal was hiding under the baseline's own cheating.

Partial-credit inflation

A digit-overlap or magnitude-plausibility scorer gives a close-but-wrong tidy number ~0.99. On Gemma-E4B, combo_2_36_39 scored +6.11 on partial credit and −0.82 on strict (paired t vs baseline): a top-of-board "champion" that was, in fact, slightly worse than baseline once you demanded the right answer. A simpler config on the same model, prune_16, did the same, +3.45 on partial, a flat strict-zero: every "win" was magnitude-plausible garbage, not one exactly-right answer. The fix is a strict-equality regrade, and the diagnostic is the partial-minus-strict gap: sort the configs by that gap, and the biggest gappers are exactly your phantoms.

Compliance, not capability

Pruning a layer can unclog a stalled output valve: the model that was looping "Answer: Answer:" or stuck on a dangling colon finally emits one clean token. A partial grader reads that as a win. Whether it is a win depends entirely on whether the knowledge was already there: on multiple-choice factual recall, unclogging the valve surfaces a real answer the model knew (genuine gain); on 16-digit arithmetic it knew no answer to, unclogging just produces confident, well-formatted garbage (the strict phantom). Same mechanism, opposite verdict, decided by whether the capability was latent.

A landmine in the regrade itself — it bites both directions

The right integer to extract is the first non-operand one for blurt-first prompts, but the last one for narrate-last prompts. Regrade an old sweep with the wrong convention and you manufacture a new phantom while removing the old one. The robust fix is operand-aware any-match: drop the operand integers, score 1.0 if the correct answer appears anywhere in the response. It sidesteps the direction problem entirely. Use it everywhere.

Honest configurations and the phantom cloud A scatter of every configuration, partial-credit score against strict score, with the equality diagonal drawn. Honest configurations cluster near the diagonal while a cloud of phantom configurations sits far below it — high partial-credit scores paired with strict scores near or below zero, the labelled champion combo_2_36_39 at the bottom right. The phantom-mover plot Gemma-E4B · 246 configs · partial-credit t vs strict t (both vs baseline) strict up (14) phantom (64) No config's strict t clears +2: every phantom sits far below the diagonal. strict = partial · honest combo_2_36_39 · 6.11 / −0.82 prune_16 · 3.45 / −2.03 -4 -2 0 2 4 6 -2 0 2 partial-credit t (form looks right) strict t (actually correct)
Honest configurations and the phantom cloud A scatter of every configuration, partial-credit score against strict score, with the equality diagonal drawn. Honest configurations cluster near the diagonal while a cloud of phantom configurations sits far below it — high partial-credit scores paired with strict scores near or below zero, the labelled champion combo_2_36_39 at the bottom right. The phantom-mover plot Gemma-E4B · 246 configs · partial vs strict t strict up (14) phantom (64) Every phantom sits far below the diagonal — strict t never clears +2. strict = partial combo_2_36_39 · 6.11 / −0.82 prune_16 · 3.45 / −2.03 -4 -2 0 2 4 6 -2 0 2 partial-credit t (form looks right) strict t (actually correct)
Fig 1 — a scatter of configurations, partial-credit score against strict score, with the equality diagonal drawn. Honest configurations cluster near the diagonal; a cloud of phantom configurations sits far below it — high partial-credit scores with strict scores near or below zero. The labelled champion combo_2_36_39 sits at the bottom right. (E4B; every config carries both axes in one already-materialized file.)
source gemma/results/regrade_strict.jsonl (partial_t × strict_exact_t)type data-grounded — all 246 configs plotted (partial_t × strict_exact_t); 14 strict-up, 64 phantom, 168 dead; anchors combo_2_36_39 6.11/−0.82, prune_16 3.45/−2.03safety honest vs phantom by marker shape, not colour

§2Phantom #2: the single draw (greedy n=1 fabricates results)

A champion scored 0/3 on the retest, worse than baseline, on a config an overnight sweep had crowned with a beautiful, theoretically-motivated story. That's the most seductive failure mode: the fake result is clean.

The lab has it written up as a cautionary tale: the HRM specimen. An overnight sweep, scored greedily and once per item, produced a gorgeous champion ("duplicate the renderer module and multi-hop reasoning improves"), corroborated by an elegant geometric metric. Then the verification pass sampled at temperature, three draws per item instead of one, and put the champion at 0/3, showing the base model already solved the puzzle ~70% of the time on its own. observation The greedy sweep had been measuring which single draw got lucky, not capability. The corroborating geometry turned out to be decoupled from the outcome it seemed to confirm.

The rule that fell out is absolute: greedy / temperature-0 / n=1 fabricates false positives on this entire research line. HRM, Gemma, and Nanbeige were all bitten. Use a fixed, low-variance sampling sampler (temp ~0.3 plus engine defaults), seed-controlled, and average over many seeds. Greedy is fine for characterizing a baseline, where there's no knife-edge config comparison, and nowhere else. This is why the seed is the unit of replication, and why everything statistical below is built on seeds. No seeds, no test.

§3Pairing: why "the ranges overlap" is not "it's noise"

The most common way a careful person still gets it wrong: you compute a config's mean score, the baseline's mean score, you notice their ranges overlap, and you conclude the difference is noise. That conclusion is unjustified, and seeing why is the whole game.

Every config is scored against the baseline on the same seeds. Think of each seed as a fixed exam paper handed to both students. If seed 7 is a hard paper, it's hard for the config and the baseline — so the gap between them on seed 7 has that shared difficulty subtracted out. The marginal spread of either score is dominated by which papers got drawn; the thing you actually care about is how the config did relative to baseline on the same paper:

paired Cohen's d  =  mean(per-seed diffs) / std(per-seed diffs)

d is seed-count-independent: an effect size, not a test statistic. The test statistic t ≈ d·√n grows with the number of seeds; d doesn't. So a real-but-underpowered config shows up as high d, low t (worth spending more seeds on, not yet proven), and you rank your retest queue by exactly that signature. A second number tells you whether to trust d over the eyeball test: the ratio of the paired-difference noise to the baseline's own seed noise:

r  =  std(per-seed Δ) / std(baseline seed-noise)

And this gives a budgeting rule that's the opposite of the naive one. You don't spend seeds where the variance is highest: you spend them on the seed-independent channel, the high-r one, because that's where pairing can't already cancel the noise for you. Empirically, no-CoT math is the high-r channel (so it eats the seed budget and needs sign-consistency checks, since a high-d config with scattered diff signs is a magnitude mirage, drop it); multiple-choice and EQ are low-r. interpretation Seeds are precision; probes are coverage; they're orthogonal, and bulking seeds on a thin battery just makes it precisely narrow.

Pairing cancels seed difficulty Left: two broad, heavily overlapping score distributions for a configuration and the baseline, visually indistinguishable. Right: the same comparison as per-seed differences, where nearly every seed shows the configuration above baseline by a consistent margin — the left-hand overlap is common-mode seed difficulty that the pairing cancels out. Pairing cancels common-mode noise minicpm5 · sa1_S100_k2 vs baseline · 16 seeds, math · left: marginal spread · right: paired Δ looks like noise ranges overlap 0.4 0.5 0.6 mean score → config baseline the actual test 0 0.04 0.08 0.12 seed index · every Δ > 0 (16/16) r = 0.45 < 1 d 0.19 · t 6.1 Overlapping ranges (left) are common-mode seed difficulty; the per-seed difference (right) is decisive.
Pairing cancels seed difficulty Left: two broad, heavily overlapping score distributions for a configuration and the baseline, visually indistinguishable. Right: the same comparison as per-seed differences, where nearly every seed shows the configuration above baseline by a consistent margin — the left-hand overlap is common-mode seed difficulty that the pairing cancels out. Pairing cancels common-mode noise sa1_S100_k2 vs baseline · 16 seeds, math looks like noise ranges overlap 0.4 0.5 0.6 score → config baseline the actual test 0 0.04 0.08 0.12 seed index · every Δ > 0 (16/16) r = 0.45 < 1 d 0.19 · t 6.1 Ranges overlap (left); the per-seed Δ (right) is decisive.
Fig 2 — left, two broad, heavily overlapping score distributions for a config and the baseline — visually indistinguishable. Right, the same comparison as per-seed differences, where nearly every seed shows the config above baseline by a consistent margin in a tight band. The overlap on the left is common-mode seed difficulty that the pairing on the right cancels out.
source shared/monitor.py _paired_d / _pair_ratio · minicpm5 finescan (r<1 config)type data-grounded — config sa1_S100_k2 vs baseline, 16 seeds, math; paired d 0.19 / t 6.1 / r 0.45 via monitor.py _paired_d/_pair_ratio; marginal ranges overlap ~46% yet all 16 per-seed Δ > 0safety baseline vs config by line-style; Δ sign reads off position

§4Phantom #3: the multiplicity budget

A sweep is a multiple-comparisons machine. The intuition is the lottery: buy 300 tickets and one of them winning tells you nothing about your skill at picking numbers, somebody had to win. Run ~150–500 config×channel tests and you should expect ~25 false positives at p<0.05 by chance alone. So a lone discovery sitting at t ≈ 1.7–2.3 is not a finding: it's exactly at the look-elsewhere floor, indistinguishable from the noise you expect a sweep that size to throw up.

A result clears the bar only if it (a) beats the multiplicity budget outright, or (b) is corroborated on an independent axis — a second channel, a second seed batch, a mechanistic prediction that came true. A single t in the 2s, standing alone, is a candidate, not a conclusion. The discipline is cheap to state and expensive to hold to, because the seductive result is always the lone one: the config nothing else corroborates is the config you most want to be real.

This is why the lab's structure is two-tier. A cheap, narrow battery (the no-CoT delta-detector, 2–3 seeds) ranks all configs — explicitly not ground truth, just an intuition delta-detector. Then a richer, slower eval (more probes plus a real generation task, ≥5 seeds, with the wide-variance configs re-run) runs on the winner shortlist only. Round-1 sorts; round-2 confirms. Never make a public claim off the thin battery. (xpressai learned this the hard way and said so: their small internal probe reported a RYS config had lower EQ; their larger held-out probe said higher. "Small-probe variance was misleading us." Same lesson, paid for independently.)

§5Read the baseline before you trust any config

First, profile what the baseline leaves room to measure

A channel can only measure what its baseline leaves room to measure, so you profile the baseline's per-channel saturation and per-seed variance first. Picture each channel as a ruler with a usable middle and two dead ends: push the baseline against either end and there's no room for a config to register. The recurring profile across dense models at aggressive quant:

A related subtlety: no-CoT math is not binary. On Gemma-31B (n=4896), strict was 0.44 and partial 0.76: 43.6% both-correct, 48.7% a smooth near-miss continuum, only 7.7% outright junk. The partial scorer is capturing a real second axis, magnitude/shape closeness, so a config can tighten sub-threshold near-misses without moving strict at all. That's why partial stays an annotation on the strict leaders, never folded into the headline: it's real information about a different capability, and it's also the exact thing that inflates phantoms. Both, at once.

Then calibrate the channel before you spend compute

The usable middle of the ruler is 40–70% baseline pass. Above ~80% is ceilinged (no variance to move); below ~20% is floored (can't detect improvement). If a channel is out of band, recenter the probes (smaller operands, not new problem types) to land the baseline mid-band before you reseed. Reseeding a ceilinged or floored or bimodal channel just measures the artifact at higher resolution: wasted compute. The sequencing rule, in order: fix the probe / grader / suffix first, reseed second.

The usable band across evaluation channels Each evaluation channel's baseline pass-rate against a shaded usable band from 0.4 to 0.7: strict math at the floor, multiple-choice at the ceiling, and emotional-intelligence in the middle with a large variance bar. Only the mid-difficulty middle region lets a configuration's effect show; the channel positions are illustrative, though the emotional-intelligence variance band is the real measured value. The baseline saturation map A channel can only measure what its baseline leaves room to measure usable band 0.4–0.7 math-strict 0.04 · floored — dead multiple-choice 0.97 · ceilinged — damage only EQ σ=0.277 · live but dirtiest easy-math 0.48 · the usable channel 0.0 0.5 1.0 baseline pass-rate Only EQ & easy-math sit where a score can move — strict is floored, MC ceilinged.
The usable band across evaluation channels Each evaluation channel's baseline pass-rate against a shaded usable band from 0.4 to 0.7: strict math at the floor, multiple-choice at the ceiling, and emotional-intelligence in the middle with a large variance bar. Only the mid-difficulty middle region lets a configuration's effect show; the channel positions are illustrative, though the emotional-intelligence variance band is the real measured value. The baseline saturation map A channel can only measure what its baseline leaves room to measure usable band 0.4–0.7 math-strict 0.04 · floored — dead multiple-choice 0.97 · ceilinged — damage only EQ σ=0.277 · live, but dirtiest easy-math 0.48 · the usable channel 0.0 0.5 1.0 baseline pass-rate Only EQ & easy-math sit where a score can move, strict is floored, MC ceilinged.
Fig 3 — each evaluation channel's baseline pass-rate against a shaded usable band from 0.4 to 0.7. Strict math sits at the floor near zero, multiple-choice at the ceiling near one, and emotional-intelligence in the middle but with a very large variance bar. Only the middle, mid-difficulty region lets a configuration's effect show up at all.
source gemma_31b_v2_base baseline row · monitor.py _null_stats / eq_null_seed_band / mc_distributiontype representative — channel positions illustrative; EQ σ=0.277 is the real measured bandsafety regime by marker outline + position, not colour

§6The metrics that earned their place across models

Four measurement habits generalized off specific models and are now run by default.

Degeneration rate (from MiniCPM5 and Granite): a zero-compute count over already-stored responses, how often a generation derails (special-token leaks (<|fim_prefix|>), name:number line-loops, digit repetition). It's monotone in both surgery knobs (copy count and cumulative-α), and it turns out to be the real cost axis. Throw out only the derailed responses and score the clean ones, and the surgery improves content quality on every channel: the only thing it costs is derailment probability. That reframes a lot of apparent "EQ craters" as a single mechanism, channel divergence ≈ exposure divergence. A short channel (~16-token math) barely gives a low per-token derailment risk room to fire; a long channel (~96-token EQ) rolls the dice five times as often. The "EQ crater" isn't lost competence: it's the same small risk, exposed longer. Put a degen-% column on every report.

The fine-α grid is mandatory; the 3-point map lies. A prune(α=0)/baseline(α=1)/dup(α=2) skeleton is invisible to any layer with a U-shaped α-response — Granite's L6 peaks at α≈0.7 while both prune and dup collapse it. Any per-layer sensitivity claim needs the dense single-pass α grid (~0.5–1.5), not the dup/prune endpoints.

The other two are ranking hygiene, stated briefly. Rank by balanced-t, and treat no t as a p-value. The harness "strict t" pools every (probe×seed) cell, over-weighting whichever channel has the most cells; the monitor "balanced t" gives one vote per channel. Rank by the latter, and read both as ordering devices only.

Per-probe autopsy is a lens, never the rank target. A balanced 49-probe average dilutes concentrated capability flips, and often that's the real win: Granite's deterministic borrow/carry errors were wrong the same way on every seed, and the winning config flipped them 12 of 12. Read per-probe to see which bug got fixed; never rank by max-over-probes, which just rewards a lucky single tip.

§7What cancels, and what doesn't

A recurring worry on local-model work is that aggressive quantization or sampler choice contaminates everything. The seed-paired design dissolves most of it, and the precise version tells you exactly which worry survives.

A uniform sampler setting, a uniform quant level, even the engine's own nondeterminism: each is a constant offset that applies equally to the config and the baseline on a fixed seed, so it cancels in the paired difference. Same exam paper, same handicap on both students. The only thing that can distort a ranking (as opposed to an effect-size magnitude) is an interaction: a sampler×config or quant×surgery effect, where the offset differs across configs. And a baseline-only ladder structurally cannot detect an interaction: you need ≥2 configs across the ladder to see one.

So the scope statement is: quant noise is real, and it degrades the precision tails (exact multi-digit arithmetic, tool-call and structured tokens, long-context, strict instruction-following), which is exactly where production agentic use breaks even when broad-strokes sweep capability doesn't. But it is not a blocker for what a sweep measures, and it never touches rank or direction. The clean way to settle this rather than argue it is a 3-point quant ladder (IQ2 / IQ4_XS / Q8) on baseline plus a few standouts, reading the shape of per-config Δ across the three: flat = pure offset, monotone = graded but rank-preserving, a threshold flip = the worry vindicated and the cliff located.

§8Coda: belief versus behaviour

There's a more elegant solution to sampling noise than the one this lab uses, and it's worth sitting with because the difference is conceptual, not just engineering. Ng reads the model's logit distribution over the answer tokens and computes the expected score directly from one forward pass: E[score] = Σ p(token)·score. No sampling, no seeds, zero sampling variance, removed at the source. This lab does the opposite: it characterizes and averages over the sampling variance, with temp-0.3 and many paired seeds.

Neither is strictly better; they measure different things. His is cheaper and lower-variance, but it measures belief (what the model assigns probability to) and would therefore hide the very pathologies this lab is built to catch: the seed-1 letter-collapse, the commit/no-commit bimodality, the derailment exposure. This lab measures sampled behaviour, which is noisier but is what a deployed model actually does at the API.

Caveats

This methodology has held up across every specimen in the lab, and produces usable results once a new model is tuned in. The statistics are the primary addition here; Ng's probe design deserves full credit for the eval design this builds on.

Build notes & lineage

This is the longform companion to the terse Methods & references glossary that every specimen links to — the story of how each rule got earned. Specimen pages applying all of it: Gemma 4, Granite, HRM, MiniCPM5. Stat engine: shared/monitor.py (_paired_d, _pair_ratio, _null_stats); strict regrade regrade_strict.py + de-echo regrade_no_echo.py. Technique and probe-design credit: David Ng (dnhkng). Run locally on a 16 GB Mac Mini.