TRANSMISSION // 2610.09838v2
A tiny transformer’s algorithm, drawn in two dimensions
Source published
A deliberately minimal transformer learns to retrieve the most recent even number after a plus sign. Its two-dimensional design lets researchers trace how attention turns that rule into a prediction.

Can a transformer’s internal geometry reveal the procedure it has learned? In a preprint, researchers train a very small model on a simple sequence task and visualize its computations directly, while cautioning that this clarity comes at the cost of realism and generality.
Transformers are often described as black boxes: they produce an answer, but the steps connecting input to output can be difficult to follow. Raneem Mahajne and Toviah Moldwin explore whether those steps become easier to understand when a model is made small enough to draw. Their preprint, “Fully Interpretable Minimal Transformers: From Geometry to Algorithm,” presents a visual walkthrough of a transformer learning a simple retrieval rule.
The task is called “plus-last-even.” A sequence contains digits from 0 to 10 and a plus sign. Whenever a plus sign appears, the next token should be the most recent even number earlier in the sequence. Other positions are unconstrained: any token is allowed. For example, after 4 1 + 4 6 9 5 +, the final plus sign should be followed by 6, the latest even number before it.
The researchers used a decoder-only transformer with one layer and one attention head. Crucially, both its token-and-position embedding space and its attention-head space had just two dimensions. That constraint makes it possible to plot internal representations without first compressing them with a method such as PCA or UMAP. The model had a context window of eight tokens and a vocabulary of 12 tokens: the digits 0 through 10 and +.
They trained it on 2,000 generated sequences, using standard next-token prediction and cross-entropy loss. The paper reports 20,000 training steps and evaluates the fraction of rule-constrained positions where the model’s top prediction is wrong. That error fell from around 90% at the start to near zero on held-out batches. The authors also examined the model’s learned representations and traced a sample sequence through its computation.
The pictures suggest a sequence of operations. First, token embeddings separate even digits, odd digits and the plus sign; position embeddings form a ladder that represents where tokens occur. Together, these create points in the two-dimensional plane. The plus sign’s query—the vector used to search for relevant earlier information—occupies a distinct region. Even-number keys, which queries are compared against, lie in positions that score well against that query. Position affects the scores too, so more recent even numbers are favored. Causal masking prevents the model from attending to later tokens.
Attention weights then combine value vectors, which carry information from earlier tokens. For a plus sign, the resulting attention output is added to the current representation. In the paper’s visual account, this moves that point into a region where the output layer assigns the highest probability to the retrieved even digit. The authors describe this as learned geometry functioning like an algorithm: identify the plus sign, retrieve the latest even number, and use that information to predict the next token.
That is a useful demonstration, but not evidence that the same procedure explains large language models. The task is artificial and deliberately simple, and the two-dimensional representation cannot accommodate the complexity of general language modeling. The study also analyzes a single trained model with a default random seed; different seeds could produce different internal geometries. The authors note that deeper models and multiple attention heads would introduce additional interactions that are harder to summarize as a simple geometric procedure.
The result is best understood as a teaching and research testbed: a way to inspect every stage of one model’s computation in a setting where the learned rule is known. Whether comparable visual interpretations can explain more complex models remains an open question. This article is based on the arXiv preprint, which may not have undergone peer review; the findings should be read with that limitation in mind.
- transformer interpretability
- mechanistic interpretability
- attention
- neural networks
- artificial intelligence
Related reading
Automatically matched by shared topic keywords. These links do not imply that the sources agree or establish a consensus.
Can an AI model tell when its own answer is wrong?
Source published
Shared keywords: transformer interpretability
How a tiny particle exposed a flaw in a physics AI
Source published
Shared keywords: mechanistic interpretability
A spectral route to finding AI circuits
Source published
Shared keywords: mechanistic interpretability, neural networks
A bid to make AI circuits more stable has a proof gap
Source published
Shared keywords: mechanistic interpretability, neural networks
When one dominant signal distorts sparse autoencoder scores
Source published
Shared keywords: artificial intelligence, mechanistic interpretability