Reading by address.
Give a memory a question. Watch what it writes back.

An address is a pattern a reader can respond to. This notebook follows the operation from six hand-built key–value pairs to Gemma’s evolving state: match a query, combine value directions, then read an answer. The film, source code and saved experiments show both what works and where addressing remains approximate.
01 / WHAT IS AN ADDRESS?
Ask for the capital of France. France identifies the entity; capital identifies the relation you want to read. Currency would ask something different about the same place. In the opening animation, that question arrives at an FFN and a Paris direction is written into the residual stream—the model’s changing working state. The conveyor is an explanatory drawing. The address in a model is a vector of numbers, and matching it need not isolate a single neuron or a single fact.
A LOCATION THAT A READER RECOGNISES
An address here is closer to a pattern recognised by a reader than a numbered drawer. The input pattern and the weights that respond to it belong together. That connects this note to the map: a point in a picture is only useful once we know which operation reads the underlying state. We can make that relationship concrete by building a memory whose keys and values we can inspect.
02 / BUILD A MEMORY WITH SIX FACTS
The Mechanism’s ffn.py plants capital, currency and language facts for two invented places. Atlantis has Paris, Euro and Latin; Zerivia has Cairo, Rand and Tamil. Each full question receives its own random, normalised 24-number key. Each answer receives a value direction. We put the six keys into the rows of an input matrix and the corresponding values into an output matrix. There is no training: we choose what this little memory contains.
03 / MATCH → ACTIVATE → WRITE → READ
Choose capital of Atlantis. The demo supplies that address’s key vector as the input, compares it with all six keys using dot products, and clips negative matches to zero with ReLU. Each remaining activation scales its value direction; adding those contributions produces the output vector. Finally, the six answer readers score that output and the highest score supplies the displayed word. This is two matrix multiplications with a nonlinearity between them, followed by an answer readout. Nothing iteratively unpacks all six facts before answering this question.
FROM THE FILM / INTO YOUR HANDS
Give the memory
a question.
Six planted facts. Choose an address.
Switch off a neuron. See what changes.
A WORKING PREVIEW / CAPITAL OF ATLANTIS
READSParis
CONSTRUCTED FFN / 24 DIMENSIONS / RUNS IN YOUR BROWSER
Choose capital of Atlantis and follow the bars to Paris. Switch to currency of Atlantis, then suppress the matching neuron. The key matches, activations and answer scores all come from the calculation you are changing.
WHAT TO NOTICE WHEN YOU SWITCH A NEURON OFF
The matching key scores approximately one because the input is that key itself. Other randomly chosen keys can still have positive matches, so several values may contribute. Suppressing a neuron removes its contribution from the sum; it does not erase the entire output. Watch the answer scores as well as the winning word. The demo always names the largest score, even after a destructive intervention, so a displayed answer is not a guarantee of a confident or correct read.
EVIDENCE
CONSTRUCTED MEMORY / SIX READS
ffn.json records 6/6 intended answers for this set of planted keys and values. The browser adaptation uses the same seed-0 vectors and is checked against independent NumPy readouts. Neuron suppression is an interactive extension, not a result reported in that saved run.
THE QUESTION IS ALREADY ENCODED IN THIS DEMO
Selecting a label supplies a stored key directly. This small memory does not understand the English phrase, derive a new entity–relation combination, or learn from a document. Those jobs are precisely what a real system must add. Its six successful reads also do not establish unlimited capacity: non-orthogonal keys can activate together, and adding more entries can change the combined output.

04 / PACKING AND READING ARE DIFFERENT OPERATIONS
The animation adds capital, currency and language directions into one vector. Recovering every ingredient of that mixture would be a different task from applying a reader that answers one question. The film’s memory argument makes that distinction useful: storing contributions together need not mean reconstructing a complete table of facts for every read. The illustration uses constructed six-dimensional vectors. The 24-dimensional FFN demo uses separate key and value matrices. They illustrate related operations, rather than two measurements of the same model.

Australia, Sydney and Canberra. The layer readouts change as the model computes an answer. Watch the transition before treating the address as something fixed from the start.
FILM & SOURCE RECORD ↗05 / THE MODEL HAS TO BUILD THE QUERY
The film asks for Australia’s capital. Sydney becomes prominent around layer 24; Canberra leads by layer 26 and the answer settles later. These are intermediate readouts during one prediction, rather than words the model has already printed. The state reaching each FFN changes as attention and earlier FFNs update it. Addressing is therefore a process across layers. This example motivates inspecting when a useful query becomes available; the picture alone does not prove an exact database lookup.
ONE OBJECT · TWO INTERPRETATIONS
Two questions about the address
- Capital, currency or language
- A probe reads relation at layer 10
- Test different words for the same relation
Two questions about the address — as what are we asking for?: capital, currency or language, a probe reads relation at layer 10, test different words for the same relation. As which place are we asking about?: one of 150 tested entities, a learned router reads the state at later layers, test a new phrasing or a different relation.
06 / A RELATION CAN SURVIVE A CHANGE OF WORDING
In address.json, a logistic-regression probe trained on capital, currency and language is tested on seat, metropolis, money, cash, tongue and speech. Each tested synonym decodes to its intended relation for all 15 entities. This says something specific about information a trained probe can recover at layer 10. It does not mean the model has exposed a universal address format, or that an unseen entity will be routed correctly.
THE ENTITY IS A LESS EXACT READ
route_sweep.py trains a separate entity router at each tested layer, using capital prompts for 150 places. It then changes the wording, or asks about currency instead. At layer 26, the right entity ranks first for 66% of paraphrases and about 50.7% of the cross-relation prompts. Allowing a shortlist of five raises those figures to 86% and 76%. The entities are already present in the router’s training set; this is a test of changed questions, not held-out places.
A SHORTLIST STILL NEEDS A WAY TO CHOOSE
Layer 26 is the best tested layer for paraphrase top-five retrieval in this saved run. It is not best on every metric: layer 28 has higher top-one scores. That distinction matters for a system such as LARQL. Retrieving several plausible places may be useful if another operation can inspect them and resolve the answer. It is not yet the same contract as looking up one guaranteed row.

The earlier LARQL INSERT demonstration. Writing a new answer turns the address question into a practical test: will the model read what we placed there?
FILM & SOURCE RECORD ↗07 / WRITE WHERE THE MODEL CAN READ
The separate native.py demonstration edits Gemma 3 4B at layer 26. It first captures the FFN input for each target question, removes directions shared with competing addresses, then alters a gate row, an up-projection row and a down-projection column. The gate and up rows respond to the selected address; the down column writes an answer direction. A subsequent ordinary forward pass reads the changed weights. This is a weight edit, unlike swapping the transient residual state in the map experiment.
EVIDENCE
NATIVE WRITE / THREE TARGETS
native.json records 3/3 successful target reads: capital of Zelandia → Oslo, currency of Qtaria → Yen, and language of Vornholt → Welsh. Six control prompts retain their original top-ranked next token. The controls check those six outputs; they do not establish that unrelated behaviour is unchanged everywhere.
A READBACK IS ONLY THE FIRST TEST
Six planted reads do not measure the capacity of a trained model.
Decoding a relation and identifying an entity are different tests.
Three successful writes do not establish unrestricted editing or multi-step use.
Specify the question, the reader and the operation that actually succeeded.
a readback is only the first test — six planted reads do not measure the capacity of a trained model.; decoding a relation and identifying an entity are different tests.; three successful writes do not establish unrestricted editing or multi-step use.. Specify the question, the reader and the operation that actually succeeded.
Can a written fact become a step in another answer?
After writing a capital, ask a new question that requires using it. Compare an exact readback with paraphrases, held-out entities, competing facts and a second reasoning step. Record both target success and changes to control prompts. That would test whether an address supports a useful operation beyond repeating its stored value.
The map follows the changing state. This note examines a reader of that state. LARQL asks how to turn those operations into something we can query; VINDEX3 asks how the model’s parts and relationships should be represented.
SOURCES & PROVENANCE
- Film / The Model Doesn’t Unpack Its Memory · 17:10 ↗
Chris Hay, 10 June 2026. Selected automatic English captions reviewed alongside the code and recorded outputs. The film supplies the explanation; saved runs define the numerical claims.
- The Mechanism / constructed memory ↗
ffn.py and ffn.json reviewed 6 September 2026. Six keys, 24 dimensions, six successful reads. The browser study records its source revision and file hash.
- Native-model writing / recorded result ↗
Read alongside native.py: Gemma 3 4B, L26, three target writes, six top-token retention checks. Separate from the constructed FFN and the earlier LARQL film.
- Relation probe / saved results ↗
Layer 10, logistic regression, 15 entities and six tested synonym variants.
- Entity routing / layer sweep ↗
150 entities; held-out phrasing and cross-relation tests on entities used in training. Layer 26 peaks on paraphrase top-five, not all metrics. Read alongside route_sweep.py.
- Film / LLMs Are Databases — So Query Them · 21:30 ↗
Chris Hay, 13 April 2026. The earlier software demonstration remains a separate source.
- The Mechanism / original visual studies ↗
v1_spot_in_space.py and v3_conveyor.py. Constructed illustrations, not measured trajectories or native-model traces.
AUTHOR / CHRIS HAY · VERSION / 0.2
REFERENCE THIS DRAFT
An unpublished working record. These references identify the draft and omit a publication date. They become version-specific publication citations when the record is released.
Chris Hay. Reading by address. [Unpublished draft, version 0.2]. https://chrishayuk.com/notebook/reading-by-address