Changelog · first model
The first model: bit by bit
Kept for the record. This model read every example one bit position at a time — lowest bit first in one pass, highest first in another. It was exact on the named relations it trained on, but could not handle multiplication or decide which direction to read for min; the current model replaced it. Its training and benchmark pages:how it learned ·benchmarks.
The first learned model (447K parameters, superseded) walked through the bit positions, remembered a little about the bits so far, and at each bit copied the answer from the examples in the same situation as the question. It is still the easiest to look inside, so the replay below uses it.
1 · Loop over bits
A small recurrent network (GRU) reads (ak, bk, ck) one position at a time, for every example and for the question. The same weights run at every position.
2 · Remember what matters
Its memory has to hold just enough about the bits already read — a carry for add, a borrow forsub, “a is already bigger” for max. Nobody tells it which; training does.
3 · Look up similar situations
At bit k, the question attends over the 999 examples. Examples whose current bits and memory match get the attention; their known ck becomes the vote. The question's own guess feeds back into its memory for the next bit.
4 · Check both directions
One pass reads from the lowest bit, one from the highest. Each re-predicts 64 of the examples with that example hidden from itself. The pass that explains them better gets more say in the final answer.
One bit step
This repeats 8 times per pass. During training the question's earlier bits are the true ones; when answering, they are its own predictions. Weights never change when answering.
Inside real predictions
These are recordings from the trained model on fresh episodes. Pick a relation and step through the bits. Onadd, low-bit-first, the attention gathers in the shaded intersection — examples whose bitk of a and b match the question — and, within it, only those with the same carry. Try min or a*b to see it fail.
Relation
Question
Pass
The question
Where it looks at bit 0
Each dot is one of the 999 examples (a → right, b → up). Gray = no more than an even share of attention; bigger and bluer = more (log scale, up to 256× an even share). Shaded bands: examples whose bit k of a or of b matches the question. The ring is the question.
Most attended examples
Which direction does it trust?
Average weight given to the high-bit-first pass over 16 episodes per relation. It picks low-first for carries, high-first for max, and doesn't care for bitwise relations. On the held-out min it hesitates — which is exactly where it fails. * never seen in training.
Size
| Parameters | 447,491 |
| Memory (GRU hidden size) | 128 |
| Attention heads | 4 |
| Self-check examples per pass | 64 |
| Examples per question | 999 (fixed) |
| Bit width trained / supported | 8 / up to 64 |
Source: src/teenie/bits/model.py.