Inside the model's 1,024-entry codebook.

Halfway through this experimental model, each hidden state is replaced by the nearest of 1,024 fixed vectors. Every character is therefore associated with one codebook entry. This page shows all 1,024 entries extracted from the trained checkpoint and the measurements attached to them.

loading measurements…

Codebook map

All 1,024 entries in one view.

Each dot is one symbol. Its position comes from the two directions in which the 1024 vectors differ most, its size from how often it fires across the corpus, and its colour from where its characters usually appear: in a premise, a working step, or the answer. Click any dot to inspect its examples.

the 1024 symbols, flattened to two directions premise working step answer
Dot area is proportional to how often the symbol fires. The two directions carry of the variation between the 1024 vectors, found by , so this is a projection of the real thing rather than a decorative layout.
Inspector

Select a symbol from the map, or from the text below.

Codes over text

A worked example with the selected code for each character.

This example comes from the training corpus and has been processed by the model. Hover over a character to see its selected code, or click it to open that code in the inspector. You can color the text by argument section or by codebook entry.

trace
loading…

Model architecture

The discrete codebook sits between two three-layer stacks.

The middle of an ordinary is a continuous vector. In this model, that vector is replaced by the nearest entry in a fixed table. This makes the middle state enumerable: each entry has an ID, a frequency, and a set of observed text positions. That design enables the two views above.

DiscreteCore one character at a time · 6.4M parameters · 6 layers · 6000 training steps
text 3 layers nearest symbol 1 of 1024 3 layers next character the only place the state is forced to be a symbol ↑ everything on this page is measured here
The lookup is in a 32-number space, with a rule that revives entries nothing has picked for a while. 1015 of the 1024 symbols are live on this text, so the table is being used rather than collapsing onto a handful of entries.

Observed behavior

Most entries track characters and formatting.

We inspected all 1,015 active entries. The codebook mainly represents spelling and layout. For the median entry, 63% of activations occur on one character, and 326 entries occur on only one character. Other entries group characters by context, such as digits in arithmetic expressions or consonants in the middle of words.

Some entries have a consistent description. Entry 864 is the A in ANSWER:, and entry 470 is the closing bracket in a citation. This makes part of the model's behavior inspectable, but what is exposed here is mostly format rather than reasoning.

symbolfireswhere it landswhat it is
8644,038100% answerthe A of ANSWER:
3963,222100% answerthe R of ANSWER:
470977100% working stepthe ] inside from [1],[2]:
6922,18498% premisethe space after [2] at the start of an uncited line
9881,05958% working stepa full stop ending a step
41032881% working stepa digit, spread evenly over 0 to 9

How much the codes add beyond the raw-character control

The measure is this: knowing which symbol fired, how well can you say whether that character sits in a premise, a working step, or the answer? The weak control is a shuffled table, and the model clears it. The strong control is to throw the model away and guess from the raw character, because the layout of this text already reveals part of the label.

this checkpoint, against a shuffled table

the same question, three ways of answering it
always say the commonest one0.5801the floor
the raw character, no model at all0.6314+0.051
which of the 1024 symbols fired0.6640+0.084

The symbols beat the raw character by +0.033. Sixty-one per cent of the gap over the floor was the character rather than the symbol. Run experiments/06_discrete_core/leakage.py on the codes=1024 checkpoint to get these three numbers back.

The code adds +0.033 beyond the character alone, reflecting context-dependent code selection. Across the tested codebook sizes—64, 256, and 1,024 entries—both role prediction and accuracy increased. This result comes from a small synthetic setting and is superseded by the later real-text capability measurements where the discrete model performed substantially worse.

What the model writes

The model reproduces citation format but not correct arithmetic.

This is 6.4M parameters trained for six minutes on 4,042 synthetic word problems. It cannot do arithmetic and it cannot reason. It does reproduce the corpus's citation format consistently. Here is an unedited sample from the same checkpoint used above.

codes1024.pt prompt: "[1] A train travels" · temperature 0.7 · unedited
loading…
Every quantity in this sample is wrong, while the citation structure is internally consistent: step [3] cites [1] and [2], step [4] cites [3], and the premises are not formatted as citations. This is an example of the model learning local format without learning the underlying operation.

Inspectability and capability are separate measurements.

This model's discrete middle layer can be listed and inspected in a way that a comparable dense hidden state cannot. That does not make its computation useful: this checkpoint fails the arithmetic task, and later real-text experiments show a substantial capability cost.

The next experiment

A stronger test would ask whether the structure is load-bearing: changing premise [1] should produce a corresponding change in the codes used in step [3]. If it does not, the codes may only be tracking formatting. This experiment has not been run for this checkpoint.

Limitations

What these numbers do not cover.

  • One seed, one corpus, one teacher. There are no error bars on anything above.
  • The corpus is synthetic and formulaic, which almost certainly makes its structure easier to encode than real text would be.
  • Three classes is a weak stand-in for legibility. "This symbol predicts a part of the argument" is a good deal less than "a person can name what this symbol means", and the layout of the text leaks part of the label, which is what the character baseline measures.
  • Symbols are read at positions with at least 128 characters in front of them, so this measures the model mid-sentence rather than at a cold start.
  • The dense comparison has no bottleneck at all rather than a matched continuous one, so some of the gap is the extra constraint acting as regularisation rather than discreteness.

Reproduce it

Every number on this page comes out of one script.

export_viz.py loads the checkpoint, runs the corpus through it, and writes the JSON this page fetches. No figures were typed in by hand and nothing is cached. Retrain, and the page changes.

shell
python experiments/06_discrete_core/sample.py       # trains codes=1024, writes codes1024.pt (about 6 min on a GPU)
python experiments/06_discrete_core/export_viz.py   # writes site/codebook.json and web/codebook.json
python experiments/06_discrete_core/leakage.py      # the three-way comparison above
provenance loading…