Data provenance
ex-2.2.3 · 5680915 · run 2026-09-09
via reports/m2/ex-2.2.3/geometry, reports/m2/ex-2.2.3/metrics
ex-2.2.5 · d2.1-332-gca72577d-dirty (dirty) · run 2026-09-11
via reports/m2/ex-2.2.5/arrays, reports/m2/ex-2.2.5/geometry, reports/m2/ex-2.2.5/metrics

Ex 2.2.5: a pilot of stochastic rounding of off-grid answers

A scouting run, no gates. We retrained two models on a new corpus: the un-anchored control for the six-op grammar, and the adopted recipe. In this corpus an answer that lands between grid levels rounds stochastically, going to the upper level with probability equal to how far up it sits. The model learns the rule's answer distribution rather than a rounding: it puts as much mass on each candidate as the coin does, so exact match against a drawn answer sits at the ceiling the rule sets. Read the expected exact match and the calibration instead. Anchoring is unchanged. The geometry of the answer looked no more graded, though the probes were on lines that never round.

Observations

Why, and what we ran

Ex-2.2.3's grammar computes each answer channel on the 0..15 scale and snaps it to the nearer grid level, so screen, multiply, and (off its on-grid pairs) mix are step functions of their raw value. The stochastic-rounding item asks what a variant that rounds by coin flip would settle: (a) the exact-match ceiling, and whether exact match is then the wrong statistic; (b) whether the answer's representation becomes more graded; (c) whether the redder-than-both counts, and so E3, move.

The variant is sca.data.ops.Rounding = "stochastic": per channel and per line, the upper neighbour is drawn with probability equal to how far up the interval the raw value sits, so the mean target is the raw value itself and a tie is a coin flip. The (op, pair) sequence of the corpus and the eval lines are the production ones at the same seed; only the answers of rounded lines differ. Three arms, all at the adopted point's length (50 epochs), all under ex-2.2.3's either-slot labeller:

condition seeds corpus anchor
control-stoch 2 stochastic none — un-anchored, stochastic corpus
recipe-stoch 3 stochastic λ = 0.1 — the adopted recipe, stochastic corpus
control-near 2 nearest none — un-anchored, nearest-rounded corpus

control-near is two fresh seeds of production's control-short, trained here so the rounding readout and the cube probes have a same-code nearest-rounded comparison. The anchored arm reads against production's recipe-short at twenty seeds. Every task but the corpus build and the rounding readout is ex-2.2.3's code, loaded from its module unchanged, so the placement statistics mean what they meant there.

The grammar under each rounding

With no model in the loop: how much of each op rounds, the exact-match ceiling a stochastic target imposes (the mean over unordered pairs of the mode's probability, which is the most a predictor that knows the rule can match a drawn answer), and the redder-than-both count of each op's lines, where under stochastic rounding an answer counts with its probability.

oppairs that roundEM ceilingceiling on rounded pairsredder (nearest)redder (stochastic, expected)change
mix87.1%0.4250.3394,9204,870-1.0%
add0.0%1.0001.0002,1652,165+0.0%
screen82.9%0.6510.5791,4271,634+14.5%
multiply82.9%0.6510.5793,8934,703+20.8%
lighten0.0%1.0001.00000—
darken0.0%1.0001.0004,2584,258+0.0%

The six ops under the two rounding rules. The ceiling is 1 on the three ops that never round; on the other three it is the mean mode probability over all unordered pairs, and over the pairs that round. Redder-than-both counts are over each op's 46,656 lines.

Exact match against a moving target

Ex-2.2.3 reads holdout exact match against the corpus answer. On a stochastic corpus that answer is one draw, so the statistic has a ceiling below 1 on the rounded ops however well the model knows the rule. Three readings of the same eval pass, all on held-out pairs: exact match against the drawn answer (what the production statistic is), against the rule's mode (the nearest answer, which a stochastic model should still name), and the expected exact match, which is the chance a fresh draw of the line would match the model's guess and is what the drawn-answer statistic converges to over many draws.

Three panels side by side, each with the six ops on the horizontal axis and accuracy from 0 to 1 on the vertical. Left: exact match against the drawn answer; the two stochastic-corpus arms sit near a short black ceiling tick on mix, screen and multiply and near 1 elsewhere, while the nearest-rounded arms sit near 1 on every op. Middle: exact match against the rule's mode, where every arm sits near 1. Right: expected exact match, where the stochastic arms again meet the ceiling ticks. Three panels side by side, each with the six ops on the horizontal axis and accuracy from 0 to 1 on the vertical. Left: exact match against the drawn answer; the two stochastic-corpus arms sit near a short black ceiling tick on mix, screen and multiply and near 1 elsewhere, while the nearest-rounded arms sit near 1 on every op. Middle: exact match against the rule's mode, where every arm sits near 1. Right: expected exact match, where the stochastic arms again meet the ceiling ticks.

Three readings of holdout accuracy, per op and condition. Each mark is one seed. Left: exact match against the corpus answer, the production statistic. The black tick is the stochastic ceiling of the op (its mean mode probability); pale marks are production's control-short, on the nearest-rounded corpus. Middle: exact match against the rule's mode, the nearest answer. Right: the exact match a model would score on average over fresh draws of each line, which is what the left panel estimates with one draw.

conditionopholdout ceilingEM vs drawnexpected EMEM vs modeEM vs mode, rounded pairs
control-stochmix0.4430.443 ±0.0060.443 ±0.0000.457 ±0.0200.350 ±0.023
control-stochscreen0.6380.564 ±0.0020.606 ±0.0010.818 ±0.0060.788 ±0.007
control-stochmultiply0.6520.627 ±0.0020.629 ±0.0000.859 ±0.0040.826 ±0.005
recipe-stochmix0.4430.424 ±0.0100.443 ±0.0000.451 ±0.0530.343 ±0.063
recipe-stochscreen0.6380.581 ±0.0060.598 ±0.0130.801 ±0.0290.767 ±0.034
recipe-stochmultiply0.6520.624 ±0.0080.622 ±0.0050.845 ±0.0200.808 ±0.024
control-nearmix0.4431.000 ±0.0000.443 ±0.0001.000 ±0.0001.000 ±0.000
control-nearscreen0.6380.998 ±0.0020.637 ±0.0010.998 ±0.0020.998 ±0.002
control-nearmultiply0.6521.000 ±0.0000.652 ±0.0001.000 ±0.0001.000 ±0.000

The three readings on the ops that round, held-out pairs. Seed means with half the seed range. The last column restricts the mode reading to the pairs that round at all, where the two corpora differ.

Where the answer mass goes

A model trained on a stochastic target has a reason to spread its answer probability over the two (or up to eight) candidate colors of a line in proportion to their probabilities, which is what "reads the effective geometry rather than the snap" meant in the item. The read is on the rounded eval lines only, pooled over ops and splits: the model's probability on the mode against the mode's true probability (a calibrated model sits on the diagonal; a nearest-trained one sits near 1 whatever the ceiling), and the model's total mass on the line's candidate set (near 1 for any model that has learned the rule, whichever way it rounds).

Two panels. Left: the model's probability on the mode answer against the mode's true probability, from about 0.15 to 1, with a dashed diagonal. The stochastic-corpus arms run close to the diagonal; the nearest-rounded arm stays near the top whatever the true probability. Right: the model's total mass on the candidate colors against the same axis; every arm sits near 1. Two panels. Left: the model's probability on the mode answer against the mode's true probability, from about 0.15 to 1, with a dashed diagonal. The stochastic-corpus arms run close to the diagonal; the nearest-rounded arm stays near the top whatever the true probability. Right: the model's total mass on the candidate colors against the same axis; every arm sits near 1.

Calibration of the answer distribution on rounded lines. Lines binned by the true probability of their mode answer (the line's exact-match ceiling), pooled over ops, splits and seeds; each mark is a bin with at least twenty lines, placed at the bin's mean ceiling. Left: mean model probability on the mode; the dashed line is perfect calibration. Right: mean model mass on the line's candidate set, the colors the stochastic rule can produce.

conditionopKL(rule ‖ model) ↓model P(mode)rule P(mode)mass on candidates ↑
control-stochmix0.249 ±0.0010.325 ±0.0060.334 ±0.0000.968 ±0.002
control-stochscreen0.129 ±0.0000.591 ±0.0040.577 ±0.0000.978 ±0.000
control-stochmultiply0.151 ±0.0120.593 ±0.0040.570 ±0.0000.974 ±0.001
recipe-stochmix0.239 ±0.0280.321 ±0.0180.334 ±0.0000.965 ±0.003
recipe-stochscreen0.136 ±0.0180.567 ±0.0230.577 ±0.0000.977 ±0.003
recipe-stochmultiply0.158 ±0.0170.580 ±0.0090.570 ±0.0000.970 ±0.001
control-nearmix5.127 ±0.1360.983 ±0.0030.334 ±0.0000.990 ±0.003
control-nearscreen2.262 ±0.0720.989 ±0.0000.577 ±0.0000.997 ±0.001
control-nearmultiply2.259 ±0.0260.982 ±0.0030.570 ±0.0000.994 ±0.001

The same readings as means over the rounded held-out lines of each op. KL is from the rule's answer distribution to the model's, over the palette; it is zero for a model that reproduces the rule's spread and grows as the model commits to one level.

Anchoring on the stochastic corpus

The labeller and the anchor are ex-2.2.3's; only the corpus changed. The placement statistics of the anchored arm against production's recipe-short at twenty seeds, on the mix probe lines, plus the two task-cost reads: holdout exact match on mix (whose held-out lines include rounded pairs) and against the mode.

conditionseedsm_line ↑r² grading ↑contrast ↑lead ↓latch π ↓ᾱ op1 ↓retention ↑holdout EM mix
recipe-stoch30.391 ±0.0010.884 ±0.0130.867 ±0.0090.848 ±0.0310.021 ±0.0030.077 ±0.0300.986 ±0.0100.424 ±0.010
recipe-short (production)200.392 ±0.0200.886 ±0.0440.868 ±0.0190.826 ±0.0440.018 ±0.0060.083 ±0.0560.993 ±0.0120.999 ±0.002

Ex-2.2.3's gated statistics on the recipe, stochastic corpus against production. Arrows are the direction the gates read as good. Seed means with half the seed range.

conditionopred acc cleanred acc projected ↓non-red deficit ↓redder acc cleanredder acc projected
recipe-stochmix1.00 ±0.000.04 ±0.050.001 ±0.0011.00 ±0.000.98 ±0.01
recipe-stochmultiply0.88 ±0.010.12 ±0.050.016 ±0.0080.78 ±0.030.54 ±0.05
recipe-short (production)mix1.00 ±0.000.01 ±0.040.026 ±0.0351.00 ±0.010.94 ±0.07
recipe-short (production)multiply1.00 ±0.000.08 ±0.110.012 ±0.0121.00 ±0.000.61 ±0.12

The eval contract's suppression reads under the full projection, on the probe lines (nearest-rounded, as production's). Red lines have dose ≥ 0.8; non-red ≤ 0.2; redder lines have an answer redder than both operands.

The answer's geometry

Question (b) of the item: does a stochastic target make the answer's representation more graded? The cube probes are ex-2.2.3's: strict-holdout ridge R² of each slot's RGB at every (slice, position) site, on mix's on-grid probe lines, where no rounding ever happens. The read is the answer's own RGB at = (the prediction site) and at the answer position, un-anchored control on each corpus, with production's full-length control pale.

Two panels, one for the equals position and one for the answer position, each with the five residual-stream slices on the horizontal axis and strict-holdout R-squared from 0 to 1 on the vertical. In the equals panel the stochastic-corpus control sits at or above the nearest-rounded control at every slice, peaking near 0.9 at slice 2. In the answer panel the two overlap through slice 2 and fall together after it, with the two nearest-rounded seeds far apart at the deepest slice. Production's full-length control is pale beside them, lower in both panels. Two panels, one for the equals position and one for the answer position, each with the five residual-stream slices on the horizontal axis and strict-holdout R-squared from 0 to 1 on the vertical. In the equals panel the stochastic-corpus control sits at or above the nearest-rounded control at every slice, peaking near 0.9 at slice 2. In the answer panel the two overlap through slice 2 and fall together after it, with the two nearest-rounded seeds far apart at the deepest slice. Production's full-length control is pale beside them, lower in both panels.

Strict-holdout R² of the answer's RGB, by slice, at = and at the answer position. Mean over the three channels; one line per seed. Production's control ran twice as long as the two pilot arms.

What we make of it

A model trained on a coin-flip target learns the coin. Its answer distribution mirrors the one the rule defines, so the ceiling the item asked about is a fact about the corpus, and the model sits on it. That settles question (a).

Exact match against the drawn answer is the wrong statistic twice over: it is capped, and it carries the noise of a single draw that every seed shares. Read instead the expected exact match against the holdout ceiling, the calibration of the answer mass (P(mode) against the same quantity for the rule, or the KL), and, on ops without ties, exact match against the mode. The off-grid channels of mix are always half-way ties, so there the mode read is a coin toss and the calibration read is the one to keep.

The corpus changes nothing on the prompt side. The labeller reads operands, the anchor pulls the prompt span, and the placement statistics on the stochastic corpus match production to the third decimal.

The answer side does move. Every clean accuracy on a rounded line falls to the level a calibrated argmax can reach, and the suppression reads follow it down. They are still a deficit measured from clean, which the contract already handles, and the redder lines go on holding their answers under projection at the same ratio as production.

Redder-than-both counts on screen and multiply rise by a fifth, because a line that would round down under nearest rounding sometimes rounds up. An E3 on those ops would have more lines to read and the same finding.

Question (b), whether the representation of the answer becomes more graded, is still open. The cube probes come from ex-2.2.3, which runs them on the on-grid lines of mix, where nothing rounds. A pilot that could answer it would probe the rounded lines of screen or multiply and compare the spread of the answer distribution against the raw value: a graded representation would show up as a smooth function of the odds of the coin.

For D2.2 we would keep nearest rounding: it keeps every accuracy read simple, and the anchored-op experiments read the prompt side, where the corpus makes no difference. What the variant adds, a calibrated answer distribution, is not something those experiments ask about. It earns a place when a question is about the representation of the answer itself, and then it comes with the reads above and probes on the lines that round.

Method notes


  1. Kullback–Leibler divergence, in nats: how much surprise you take on average by predicting with the model's distribution when the rule's is the truth. Zero means the two match. ↩