Changelog

From fuzzy decimals to exact bits

The goal never changed: given exactly 999 examples of an unknown relation c = f(a, b) and one new(a, b), produce c — with no operation name, no menu of formulas, and no retraining at answer time. What changed was how numbers are shown to the model, and what counts as right.

  1. Attempt 1 · float32 · within 1% counts as right

    A small recurrent network on decimal numbers

    Inputs and outputs were float32 numbers. A recurrent network read the 999 examples and had to output c, counted correct within 1% relative error. After 1,000 training updates it was essentially never right.

    add1.2%
    sub1.0%
    mul0%
    div0%

    Fails · experiments/fixed999-seed0-eval.json

  2. Attempt 2 · float32 · within 1% counts as right

    Curriculum, memory slots, more training

    Small numbers first, several memory slots, 3,000 updates and 133K parameters. Better, but just copying the c of the closest example still did better on every basic relation.

    add30.9% (closest example 42.6%)
    sub11.7% (14.1%)
    mul16.4% (19.5%)
    div1.6% (16.4%)

    Below the closest-example baseline · experiments/curriculum-long-m4-eval.json

  3. Attempt 3 · float32 · within 1% counts as right

    A built-in curve fitter (residual loop)

    Replaced the network with a fixed curve-fitting loop (conjugate gradient) over a hand-chosen set of features, with 61 trainable parameters. It passed 90% on all four operations — but an untrained copy scored the same. The fitter did the work, not learning. And “within 1%” is still a guess, not an answer.

    add99.7% (untrained 99.7%)
    sub99.2% (99.4%)
    mul94.5% (94.7%)
    div97.4% (97.7%)

    High score, but not learned · experiments/residual-pilot-basic-seed4000{0,1,2}.json (pooled)

  4. The switch · 8-bit integers · all bits right or wrong

    Write numbers as bits, score only exact answers

    Instead of one decimal number, each of a, b, c becomes 8 bits, and the model predicts each bit of c as 0 or 1. Results wrap at 256. An answer is right only when all 8 bits are. This trades “close enough” for a yes-or-no answer, and the model can say how sure it is about each bit.

    Before building anything, a quick test with no learning asked whether 999 examples are even enough. A hand-written lookup walks the bits from lowest to highest. At bit k it keeps the examples whose bits atk and at the previous position match the question, and copies their ck:

    relationclosest examplelookup, looking back 1 bitlooking back 2 bits
    add2.1%100%99.2%
    sub3.5%100%99.1%
    xor4.7%100%100%
    a+2b3.9%34.3%94.5%
    max21.1%43.2%71.2%

    Three lessons: copying the closest example is useless with bits (2–5% for add/sub); going bit by bit, remembering just the previous position, is exact for carry-style relations; and looking further back fails because 999 examples don't cover all the combinations. So the model has to learn a short summary of the bits so far — like a carry — and that is what its loop does.

  5. Bit-serial model · first learned model

    A learned loop over bit positions, plus a lookup over the examples

    One shared recurrent network reads every example one bit at a time; at each bit the question looks up the examples in the same situation; one pass runs from the lowest bit, one from the highest. 100% exact on all 12 named relations it trained on — but only 32.2% on min, the mirror of a trained idea, because it could not decide which direction to read. Inside this model →

  6. All bits at once · loop on the answer

    Drop the reading order, keep a loop on the answer

    Each example becomes one vector from all 24 of its bits, fixed for the whole run. The question keeps a guess of all 8 answer bits and corrects it every round. Never-seen relations improved: 3a75.8% → 92.3%,min 32.2% → 46.3%, and confidence became far more useful.

  7. Multiplication · multiplicative units

    Networks mostly add; give them a way to multiply

    Trained on a*b alone, the plain loop stalls at 52.3%. Adding bilinear inputs (two projections multiplied) and gated feed-forward layers lifts it to 98.1%. Among 14 relations, though, multiplication got only 1/14 of training and reached 45.3%. Two other designs were dead ends: letting the 999 example tokens act as working memory was too slow on a 4 GB GPU, and inferring the weights of a tiny calculator with a periodic (cosine) readout could represent multiplication exactly but could not be trained.

  8. Adaptive sampling · random expressions

    Spend training where the model is still wrong

    Drawing relations in proportion to how often they are still wrong fixed the starvation: a*b99.6% inside mixed training, every earlier relation 98–100% (min97.7%). Random 1–3 operation expressions joined training, with eight compositions never generated — checked by behaviour, so rewrites cannot leak. Those hidden compositions reached50.0% on average (copying the closest example: about 9%).

  9. Product, then another step · a computation limit

    It multiplies, it adds — but not one after the other

    a*b+a stayed near 19.0%: the low four bits right, the high bits wrong — carries through an intermediate result. More multi-step training data lifted hidden compositions to53.5% but not this; a round counter did not help either. Trained on nothing but four such relations, the model still reached only 39.1%: the loop has no place to hold an intermediate result.

  10. Loops and the difficulty ladder

    Functions defined by loops, measured on a ladder

    Training now includes loops whose repeat count comes from b (sums of sequences, repeated application, Fibonacci-like recurrences, bit counting), and the tests are a ladder from 2-operation expressions to hidden loop bodies run longer than ever trained. The model may either execute the loop or find a shortcut — both count. See the results →

  11. Scratch slots · memory that is never scored

    Somewhere to keep intermediate results

    Four memory vectors per question, carried between rounds, lifted multiplication inside mixed training from53.9% to 80.8% and the Fibonacci-like loop from33.1% to 47.9% — but a product followed by another step stayed near 19.2%, even when trained on nothing else (46.3%).

  12. Bit tokens · step-by-step training tried and dropped

    One token per answer bit

    The limit was never parameters: carries have to move between bit positions through an intermediate result, and one question vector has no structure for that. Giving every answer bit its own token — attending to the other bits and to the examples each round — took that capacity check from 39.1% to99.4%. Training each round against one intermediate step (an operation, or a loop iteration) did not help, kept or faded out: the intermediate values never appear in the examples. Bit tokens trained on final answers only became the model. The design →

  13. Guardrails · a sealed test set

    Checking that it is not fitted to our own tests

    Every test had been used to choose architectures and data. A sealed set of 24 everyday functions, written separately, is evaluated only at the end of a round and never used to decide anything. Every 8-bit candidate cleared it with honest confidence — but at 8 bits the 999 examples cover 1.5% of all inputs, and lookup methods that understand nothing answer about a third of it. That, and the next chapter, moved the measure to 16 and 32 bits.

  14. Bit-aligned reading

    Each answer bit reads the same bit of the examples

    On our generator's held-out combinations (T1–T3) it scored 77.0% / 55.1% / 54.3%, 8–16 points above the plain bit tokens — but nothing extra on the sealed set. The gain was specific to relations shaped like our generator's.

  15. Wider numbers

    One model for any width up to 32 bits

    The 8-bit design trained on 12-bit numbers collapsed (hidden compositions 15.0%). A width-free version sees every bit relative to its own position and from the lowest bit, so the same weights answer any width up to 32 bits. At 32 bits it gets some unseen relations far above lookup — a conditional it never trained on 77.0% against 1.1% — and fails others completely.Where it stands →

  16. Composition at 16 bits

    Identifying the relation, not computing it

    It computes a*b alone almost perfectly at 16 bits, but a*b+b was 0.4% even after training only on products followed by a step. Trained on just four such relations it gets a*b+b 98.2%: the arithmetic is fine; recognising which relation the examples come from is not. Deeply worked probe examples (0.1%), four layers of per-example processing, and a pool of 16 relations did not change that. The model learns these relations one at a time, each needing about a thousand episodes, instead of one way to compose them.

  17. Mixed training, longer

    No late jump

    Multiplication at 16 bits had stayed near zero for 7,000 updates of mixed training before rising to 70–80%, so a long run trained on every kind of composition at random, at 16, 24 and 32 bits. Six thousand updates in, every composition built on a product was still at 0–2% at every check, and it was stopped.

  18. A composition grid

    It memorises combinations instead of combining parts

    Eight product-like first steps × eight second steps: 52 combinations trained, 12 held out, every part still trained in other combinations. The trained combinations it learned reached 87–97%, but held-out ones whose parts it knew stayed low: (a*b)+a 7.7% and ((a+1)*b)^b 10.1%.

  19. Chains · a new measure

    Multi-step chains work — except through a product

    Chains are a start such as a+b or a*b followed by one or two of 21 kinds of step, with a fresh random constant each time. A new measure counts only the questions every lookup method gets wrong. At 32 bits the model answers chains of additions, bitwise operations and shifts mostly where lookup fails, and its sure answers are always right; chains through a product it hardly ever gets, and it is never sure of them — although products followed by a step were in its training. The composition failure of the last chapters was a product failure.Numbers in the findings →

  20. Tried · a relation-code bottleneck

    Guess the relation first, then apply it

    The answer bits read the 999 examples directly, which lets the model look up similar examples and learn each relation on its own. The current experiment adds a bottleneck: a few relation-code tokens per bit position read the examples, and the answer bits read only that code. Still one pass, nothing fitted at answer time, and the code is free vectors rather than a choice among fixed operations. It learned trained combinations faster, in half the time, but combined known parts no better.

Where it goes next

If composing appears

Scale it: the target is unseen multi-step expressions at 32 bits, such as((a*b)^(a>>3))|(b+9), where even 25% exact could not be luck.

If it does not

Then this design memorises compositions instead of generalising them, and needs a structural change — still guessing the relation in one pass, never searching or fine-tuning at answer time.

Then: noisy data

The aim is not a calculator. Once fixed rules can be inferred, the same approach goes to examples that are partly corrupted or random, to see which patterns still emerge.

Every experiment

Exact match on 1,024 fresh questions per relation (64 episodes × 16, seed 60000), at 8 bits unless the run says otherwise. "Trained" is the mean over the relations each run trained on, so rows with different training sets are not directly comparable. Every run is described in the findings.

chapterruntrainedhiddena*ba*b+amin
Bit by bitBit-serial model (reads one bit position at a time)98.0%—5.8%—32.2%
All at onceAll bits at once, loop on the answer97.8%—6.7%—46.3%
Multiplicationa*b in training, plain loop92.7%—18.8%—45.0%
Multiplicationa*b only, plain loop (capacity check)52.3%—52.3%—2.1%
Multiplicationa*b only, multiplicative units (capacity check)98.1%—98.1%—1.8%
Multiplicationa*b in training, multiplicative units94.6%—45.3%—43.3%
Multiplicationmultiplicative units + round counter94.6%—50.0%—47.0%
Multiplicationonly pieces of multiplication trained (a*b unseen)97.2%—16.5%—41.7%
Expressionsrandom 1-3 operation expressions + adaptive sampling96.6%50.0%99.6%13.6%97.7%
Expressionsmore steps: 1-5 operations, more products91.4%53.5%97.4%19.0%95.4%
Expressionsmore steps + round counter, 12 rounds90.3%54.1%78.1%21.6%96.0%
Expressions"product, then another step" only (capacity check)———6.0%—
Loops and the laddermix2 model on the ladder (never saw a loop)86.6%53.5%97.4%19.0%95.4%
Loops and the laddertrained with loops and held-out combinations87.7%52.8%53.9%23.1%94.1%
Loops and the ladder+ 4 scratch slots per question89.7%53.4%80.8%20.1%94.1%
Bit tokens"product, then a step" only, loop + scratch slots (capacity check)———7.0%—
Bit tokens"product, then a step" only, bit tokens (capacity check)———12.3%—
Bit tokensbit tokens, final answers only (mix4) — current model88.1%57.5%91.8%37.4%96.8%
Bit tokensbit tokens, second seed89.2%52.6%98.4%20.9%95.8%
Bit tokensbit tokens, trained 10,000 updates longer89.3%62.3%96.2%40.1%97.9%
Bit tokensbit tokens, fine-tuned with 16 rounds88.3%57.5%92.3%36.6%96.5%
Bit tokensbit tokens, each bit reads its own bit of the examples90.8%64.2%99.5%32.0%99.1%
Bit tokensbit tokens + every operation pair equally often (mix5)88.0%58.7%91.5%39.3%97.1%
Bit tokensbit tokens, training loops up to 31 iterations (mix6)88.5%56.1%93.1%38.4%96.8%
Bit tokensbit tokens, trained on 12-bit numbers76.3%15.0%14.1%3.2%89.7%
Bit tokensbit tokens, step-by-step hints faded out82.1%38.0%71.4%17.2%89.0%
More conceptsbit tokens + division, remainder, comparisons, variable shifts, squares, bit counts85.2%56.0%78.9%32.1%97.0%
Wide numberswidth-free bit tokens, 8/12/16 bits — scored at 16 bits74.5%36.4%80.0%1.4%99.5%
Wide numbers+ 24- and 32-bit episodes — scored at 32 bits66.3%31.3%0.2%0%98.7%
Composition at 16 bitsproduct-then-step only, from the 32-bit model23.8%34.8%99.2%0.5%99.2%
Composition at 16 bitssame, questions also read deep probes23.8%35.6%98.9%0.2%99.1%
Composition at 16 bitsfour fixed product-then-step relations only (diagnostic)99.3%—92.6%—4.1%
Composition at 16 bitsa pool of 16 product-then-step relations35.9%3.3%97.7%0%93.3%
Composition at 16 bitscomposition grid: 52 combinations trained, 12 held out18.0%13.3%97.3%7.7%3.5%
Composition at 16 bitssame grid, answers read only a relation code23.6%11.9%97.5%2.5%0%