Yes. But only some of what you see is the raw data. The rest is either derived from it by a standard technique, or drawn to make it readable. This page separates the three.
Part I · Foundations
Chapter 1
How a language model computes
A language model is a function that reads a sequence of tokens and returns, for the next position, a probability for every token in its vocabulary. Everything this tool shows is an intermediate quantity of that function.
1.1 Tokens and the vocabulary
Text is first cut into tokens: whole words, pieces of words, punctuation and spaces, according to a fixed table learned before training. GPT-2's table has 50,257 entries; Qwen2.5's has 151,936. A token is therefore an integer between 0 and V − 1, where V is the size of the vocabulary. Note that the leading space belongs to the token: " Paris" (with a space) and "Paris" are different tokens, which is why the tool sometimes writes a space as ␣.
1.2 The embedding
Each token is turned into a vector by looking up a row of the embedding matrix WE, which has V rows and d columns. The number d is the model's width: 768 for GPT-2, 896 for Qwen2.5-0.5B, 2,048 for Qwen2.5-3B. The row is the token's starting representation; GPT-2 also adds a second learned vector that encodes where in the text the token sits; Llama, Qwen and Pythia instead encode position inside attention, by rotating queries and keys (rotary embeddings).
1.3 The residual stream
For every position the model keeps one vector of width d, the residual stream, and passes it through L identical-looking layers (12 in GPT-2, 36 in Qwen2.5-3B). Each layer reads the stream and adds its result to it, never overwriting it:
xℓ+1 = xℓ + Attnℓ(norm(xℓ)) + MLPℓ(norm(xℓ + Attnℓ(…)))
Sequential form (GPT-2, Llama, Qwen). Pythia evaluates attention and MLP side by side on the same input and adds both.
The sequence x0, x1, …, xL for one position is that token's sequence of hidden states. Because every part only adds to the stream, the final state is literally the sum of the embedding and of everything every part ever wrote. Chapters 10 and 15 depend on this fact.
1.4 Attention
Attention is the only place where positions exchange information. A layer has several heads (12 per layer in GPT-2). For the position being computed, i, a head forms a query qi, and for every earlier position j a key kj and a value vj, each a linear function of the normalised stream. The head's attention weights are
aij = softmaxj( qi · kj / √dh ), j ≤ i
a probability distribution over the earlier positions, and the head writes WO Σj aij vj into the stream. A weight says where the head looks; the value says what it finds there. Both matter, and Chapter 14 shows why confusing them misleads. In grouped-query models (Llama, Qwen) several heads share one set of keys and values but keep their own weights. Models in this tool are causal: position i can only attend to j ≤ i. The diffusion model of Chapter 17 is the exception.
1.5 The MLP
The second part of each layer, the MLP (multi-layer perceptron, or feed-forward block), works on each position separately. It projects the stream up to a wider space (3,072 dimensions in GPT-2), applies a nonlinearity, and projects back down:
h = φ(Win x), MLP(x) = Wout h
φ is GELU in GPT-2 and Pythia. Llama and Qwen use SwiGLU: h = SiLU(Wgate x) ⊙ (Wup x).
Each component hk is a neuron, and its value is the neuron's activation. Neuron k always writes along the same direction, column k of Wout, scaled by its activation. Much of what a model "knows" about words is thought to be stored in these layers.
1.6 Normalisation
Before each part reads the stream, the stream is normalised: LayerNorm subtracts the vector's mean and divides by its standard deviation; RMSNorm (Llama, Qwen) only divides by the root mean square. Both then multiply by learned weights. Normalisation matters for interpretation because it means a part reacts to the direction of the stream far more than to its size.
1.7 From the last state to a prediction
After the last layer, the final state is normalised once more and multiplied by the unembedding matrix WU (V rows), giving one score, a logit, per token. The softmax turns logits into probabilities:
p(w) = exp(zw) / Σv exp(zv), z = WU · norm(xL)
Only differences between logits matter: adding the same constant to all of them changes nothing. Many small models reuse WE as WU (tied embeddings), which is why predictions can be drawn on the embedding cloud. To write text, the model picks the most probable token (greedy decoding) or draws one at random in proportion to the probabilities (sampling), appends it, and repeats. Keys and values of earlier positions are kept (the KV cache), so each new token costs one pass through the layers.
1.8 Uncertainty
How spread out a distribution is can be measured by its entropy, H = −Σ p(w) log p(w). The tool usually reports eH instead, the effective number of choices: a distribution with eH = 3 is as uncertain as a fair choice among three equally likely words.
In this toolThe embedding (1.2) is the cloud of Part II. The residual stream at every depth (1.3) is recorded for every token and drawn directly in Chapter 15. Attention weights (1.4) appear in the field's head grid, the arcs, and the flow. MLP activations (1.5) fill the field's neuron strips. The prediction (1.7) and its uncertainty (1.8) appear at every depth through the logit lens.
Chapter 2
Latent spaces, and how they can be drawn
A latent space is a vector space in which a model represents things. It has hundreds or thousands of dimensions, and a screen has two. Every picture of one is therefore a choice about what to keep and what to give up.
2.1 Two kinds of latent space
- The embedding space
- The V rows of WE: one fixed point per token, the same for every text. This is the cloud of Part II.
- The hidden-state spaces
- The residual stream after each layer: one point per position per depth, different for every text, because each state depends on everything before it. These are drawn in Chapter 15 and read indirectly by most of Part III.
2.2 Measuring closeness
Two vectors are compared by the angle between them, through cosine similarity
cos(a, b) = a · b / (‖a‖ ‖b‖)
which is 1 for vectors pointing the same way, 0 for perpendicular ones and −1 for opposite ones. Cosine distance is 1 − cos. Angles are the natural measure here because the normalisations of §1.6 make the model attend to direction rather than length. A token's nearest neighbours are the tokens with the highest cosine to it, computed over all d coordinates.
2.3 Why every picture distorts
A 768-dimensional cloud cannot be placed in three dimensions without changing some distances. In high dimensions almost all pairs of points are nearly perpendicular, and a point can have many neighbours that are not neighbours of one another; no 3-D arrangement can honour all such relations at once. The tool offers several drawings, each with a different promise:
- PCA (principal component analysis)
- Projects onto the three directions along which the points vary most. Linear and faithful in what it shows, but it shows little: for GPT-2's vocabulary those three directions hold 3.4% of the variation.
- UMAP ("Clusters")
- A nonlinear method that tries to keep each point's nearest neighbours nearby. Local groups are roughly right; distances between groups, directions and the overall shape carry little meaning.
- Chosen axes
- Two directions you define from word pairs (§6.3). Exact along those directions and silent about everything else.
- Radial distances
- Every token at its exact cosine distance from one chosen token (§6.2). Exact in one respect, distance from that token, and arbitrary in angle.
2.4 Map and territory
The tool keeps the drawing (the map) separate from measurements made in the full space (the territory). Neighbour lists, neighbour lines, cosine values and every number in Part III are territory. Positions in a 3-D view are map. When the two disagree, for example a neighbour line that crosses the whole cloud, the line is right and the position is the distortion.
2.5 Reading the fidelity line
Under the layout switch, a line reports how much of the territory the current map keeps, measured live for the model on screen:
- Same region: how often a token's 15 true nearest neighbours fall within its nearest 1% of the cloud as drawn. This asks the question the eye asks of a map: are related tokens drawn in the same area?
- Near/far agreement: for sample tokens, partners at true ranks 1, 2, 3, 5, 8 … up to half the vocabulary, and the rank correlation (Spearman) between true rank and drawn distance. 1 would mean the map orders near and far perfectly; 0, not at all.
- For PCA, the share of the variation its three directions hold. The ⓘ beside the line gives the strict figure, the share of exact 15-nearest neighbours preserved, as a caveat.
LimitsNo drawing is the space. Use the drawing to navigate and the measurements to conclude.
Part II · The embedding space
Chapter 3
The cloud
The Embeddings view draws every token of the vocabulary as one point: the rows of WE (§1.2), placed in three dimensions by one of the methods of §2.3. It is the model's first latent space, the same for every text.
3.1 What is on the screen
- Points. One per token: 50,257 for GPT-2, 151,936 for the Qwen models. Brightness is reduced where many points overlap, so dense regions read as texture rather than as a solid blot.
- Colour. A rule based on spelling: whole word, word piece, number, punctuation, whitespace, other scripts and bytes. The legend at the lower left names them. The model knows nothing of these categories; they are there to help the eye.
- Header. The model's name and size, the Embeddings / Forward pass switch, the layout switch (Clusters · PCA · Axes), a brightness slider, and the fidelity line of §2.5.
- Inspector (right). The token under your gaze, described in Chapter 5.
- Dock (lower left). The legend, the Find a token box, Settings, and a key reminder.
3.2 Moving around
Drag to orbit, use the wheel (or pinch) to zoom, and drag with the right button or with Shift held to pan. H returns to the starting view. When nothing is touched for a while the gaze wanders on its own (Wander when idle in Settings), which is a quick way to sample the vocabulary.
3.3 Layouts
Clusters (UMAP) is the default; PCA is the linear alternative; C switches between them and the points glide from one to the other, so you can follow a group across the change. For the built-in models and popular Hugging Face models the cluster layout was computed in advance; for others the tool shows PCA first and computes the clusters in the background, about a minute for GPT-2's vocabulary, then morphs. Axes is treated in §6.3.
The ◐ slider sets the brightness of the dots, from faint (useful when labels matter) to bright (useful for seeing structure). It is remembered between visits.
3.4 How to read it
Read the cloud as a map of neighbourhoods. Groups of related tokens, such as numbers, years, names, code fragments, or a language's word pieces, sit together in the clusters layout, and the fidelity line tells you how often that holds for this model. Do not read meaning into distances between groups or into the cloud's overall shape (§2.3).
Try thisOn GPT-2, switch between Clusters and PCA with C and compare the fidelity lines. In PCA most tokens collapse into one blob, because three directions hold only a few per cent of the variation; the clusters layout separates them, at the price of arbitrary global placement.
Chapter 4
Foveated viewing
A human eye sees sharply only at the centre of gaze, the fovea, and coarsely around it. The tool works the same way: full detail where you look, a summary elsewhere. This is how a large vocabulary can be explored in a browser without loading all of it.
4.1 Three regions
- Fovea
- A small circle around the pointer (by default 120 pixels in radius, about 3° of visual angle at a normal viewing distance). Here the tool loads the tokens' actual coordinates, labels them, draws their true nearest neighbours as lines, and can re-lay them out (§4.3).
- Parafovea
- A wider ring (by default 330 pixels). Points are brighter, thinned by a fixed per-token sample that falls off with distance, so the area stays legible.
- Periphery
- Everything else: positions only, as faint points.
Press R to show or hide the two rings; the fovea's ring is labelled with its size in degrees. Both radii can be changed under Settings. F turns foveation off altogether, which is useful as a baseline: the whole cloud is then drawn uniformly and no coordinates load.
4.2 What loads, and when
A token's coordinates (d numbers each) are stored in tiles, groups of nearby tokens that occupy one contiguous range of the data file. While you look somewhere, the tiles under the fovea are fetched, nearest the gaze first, within a bandwidth budget, and kept in a cache of fixed size; tiles nobody has looked at recently are evicted. The statistics at the top right (In fovea, Streaming, Cache, Tiles) show this happening. In practice you only need to know one thing: pause on a region and its detail arrives.
4.3 The lens
Inside the fovea the tool can re-arrange the loaded tokens by a local PCA: a principal component analysis of just those rows, which is far more faithful to their mutual arrangement than any global layout. L turns this lens on and off. The fovea's label then reports the share of the local variation its two directions show. Points under the fovea are dimmed so the re-arranged ones stand out.
Try thisMove the gaze slowly across a cluster with L on, then off. With the lens, tokens inside the fovea spread out according to their own geometry; without it, they keep their global positions, which may stack unrelated tokens on top of one another.
LimitsFoveation is how the viewer saves bandwidth and attention. It has nothing to do with the model's attention mechanism (§1.4), despite the shared metaphor.
Chapter 5
Inspecting a token
The inspector reports one token exactly: its identity, its full vector, and its true nearest neighbours.
5.1 Reading the inspector
- The token in quotation marks, with a leading space shown as ␣ and a line break as ↵, and its spelling category.
- Token id, the integer of §1.1, and ‖v‖, the length of its embedding vector. Rare and unusual tokens often have atypical lengths.
- The barcode: all d coordinates side by side, one column each, cyan for positive and violet for negative, brighter for larger magnitude (scaled to the token's largest coordinate, which is named underneath). The barcode appears once the token's tile has loaded; keep looking and it arrives.
- Nearest in the full space: the closest tokens by cosine similarity (§2.2), measured over all d coordinates, with the similarity as a number and a bar.
5.2 Pinning and finding
The inspector follows your gaze until you click a point, which pins it (the pill changes from Following gaze to Pinned); Esc unpins. Clicking a neighbour in the list pins that neighbour and flies to it, so you can walk the neighbourhood graph token by token. To jump to a word, type it in Find a token (or press /): the tool tries it with and without a leading space and in lower case, and flies to the first match.
Worked exampleOn GPT-2, find "king" and read its neighbour list: the closest tokens in the full space, with their cosine similarities. Now watch the neighbour lines in the scene: several reach far across the cloud. Those tokens are near in the full space and far on the map, which is the distortion of §2.3 made visible. Click one to fly there and continue the walk.
LimitsFor the built-in models the neighbours were computed exactly in advance. For models built in your browser they are computed on demand: a fast 8-bit pass shortlists 64 candidates, which are then scored exactly, so a true neighbour is missed only if it failed the shortlist.
Chapter 6
Three ways to redraw the cloud
A single global layout cannot be faithful everywhere. These three tools trade the whole picture for an exact or more faithful one about something specific.
6.1 Semantic zoom: re-arranging one region
Zoom in until the parafovea holds a few hundred to a few thousand tokens, then press Z or Re-arrange this region. The tool runs the clustering again on just those tokens, places the result where the region was, rotated to match the old arrangement, and morphs to it; the rest of the cloud stays as context. The fidelity line then compares how much of the region's true neighbourhoods the old and the new arrangement keep. Press Z again, or switch layouts, to return.
Worked exampleOn GPT-2, a region re-arranged this way kept 26% of its tokens' true 15 nearest neighbours, against 8.9% in the global layout: three times as faithful, because the layout only has to honour a few thousand tokens.
LimitsIt is still a map. Positions across the boundary of the region, between re-arranged tokens and the rest of the cloud, mean nothing.
6.2 Distances from one token
Pin a token, then press D or Distances from here. Every token moves onto a disc facing you, at a radius equal to its exact cosine distance from the pinned token, with rings at cosine 0.9, 0.7, 0.5, 0.3 and 0.1. The radius is measured in the full space, so this view answers exactly a question no map can: what is near this token, and how near? Each token keeps the bearing it had on screen, so you can follow it; that angle carries no meaning. D or Esc returns.
6.3 Axes you choose
Choose Axes and type two word pairs, for example "king − queen" and "Paris − France", then Lay out. The horizontal axis is the difference of the first pair's vectors, the vertical axis the difference of the second pair's, made perpendicular to the first; depth is the direction of greatest remaining spread:
x(t) = e(t) · (e(a) − e(b)), y(t) = e(t) · (e(c) − e(d))⊥x
Positions along x and y are exact projections, so "further right" means precisely "more like a than like b". The axes are labelled at their ends, and the fidelity line reports how much of the variation each holds, typically very little, which is the honest price of an interpretable picture. Only words that are a single token can be used.
Try thisLay out "king − queen" against "man − woman". If the vocabulary encodes a gender direction, gendered words line up along a diagonal; words without gender sit near the origin of both axes.
Part III · The forward pass
Chapter 7
Running a query
The Forward pass view runs the model on your text, records every intermediate quantity of Chapter 1 for every token, and replays the computation layer by layer at a speed you choose.
7.1 Starting a run
Switch views with the tab or M. Type into the query box and press Enter (or pick one of the examples). The first time, the model's weights load into your browser; the status line under the controls says how far it has got and, once ready, where the model runs and how closely it was checked (Chapter 20). The model then reads your text token by token and writes a continuation.
- Tokens
- How many tokens to write after your text (16 by default).
- Greedy / Sample
- Greedy always writes the most probable token, so a run can be repeated exactly. Sample draws from the ten most probable at temperature 0.8, so runs differ.
- Speed
- How long each layer is shown during the replay: Live (no replay), 160 ms, 0.5 s or 1.5 s per layer. The model itself always runs at full speed; only the replay is slowed.
- Play / Pause, Step layer
- Pause the replay, or advance it one layer at a time. When a run has finished, Play and Step continue it by another Tokens' worth.
7.2 The panel and the chips
The panel at the bottom holds the controls (left) and the main display (right). Above the display is a row of chips, one per token, your text in white and the model's in violet; for GPT-2 and DistilGPT2 a dashed ⟨doc⟩ chip comes first, the <|endoftext|> token the model saw before every document in training, put in front so a neuron's values match its book. The outlined chip is the token on screen; click any chip to inspect that position (every token's recordings are kept), and click it again to return to the latest. Next to the chips, the tabs Field · River · Flow (keys 1 2 3) choose the display, and a one-line readout summarises what it shows. P hides the panel to watch the scene alone; drag its top edge to resize it.
The answer appears under the query box as it forms: your text dim, the model's bright, and, while a token is being replayed, its current guess at the layer on screen.
Chapter 8
The field
The field shows the whole network for one token at once: every head, every neuron and the model's guess at every depth. It is the most complete view, and the place most investigations start.
8.1 Layout
Each row is one depth. The bottom row, EMB, is the embedding; above it L0, L1, … up to the last layer. During a replay the current depth is highlighted and rows not yet reached are faint. Each row has three parts, from left to right.
8.2 Heads
One square per attention head. Its fill is the head's write strength, the length of the vector it adds to the stream, relative to the strongest head in that layer. Inside it, a small comb shows how much attention the head pays to each of the eight most recent tokens, newest on the right. Point at a head to open a loupe listing the six tokens it attends to most, with their weights and positions; click to pin the loupe.
Reading: strength and attention are different things. A head can attend sharply and write almost nothing, or spread its attention and write a great deal. Many heads put most of their attention on the very first token, a resting place known as an attention sink; that is normal and usually means the head has nothing to do at this position.
8.3 MLP
A strip of every neuron in the layer's MLP (3,072 per layer in GPT-2), as eight rows of pixels: cyan for positive activation, violet for negative, brighter for larger. Click a strip to open the neuron inspector (Chapter 11).
8.4 Logit lens
The right-hand column shows, at each depth, the token the model would predict if it stopped there, and its probability. This is the logit lens: the stream at depth ℓ is passed through the final normalisation and unembedding of §1.7 as if it were the last layer,
pℓ = softmax( WU · norm(xℓ) )
For models with very large vocabularies running on the CPU, the lens is computed at a spread of depths as the model writes and at any other depth as soon as you point at its row (three faint dots mark a row not yet read); on the GPU every depth is read for every token. Click a row of the lens to explain that depth's guess (Chapter 10). Clicking a layer's label opens its features (Chapter 11) where those are available.
8.5 How to read the field
Read it bottom to top, as the computation runs. A common pattern: near the bottom the lens echoes the input token or produces fragments; in the middle layers plausible continuations appear; in the top layers one of them wins and its probability rises. Heads that light up as the answer forms, and MLP strips that change sharply, are where to look next.
Worked exampleOn GPT-2, run "The capital of France is Paris. The capital of Germany is" and look at the last token, " is". The lens column shows fragments and function words through the lower half (" not", " now", " also"), then " Paris" briefly after layer 7, then " Berlin" at 84% after layer 8 and 85% after layer 9, easing to 32% at the output as other continuations compete. Point at the strongest head of layers 8 and 9: their loupes show 86% and 94% of their attention on " Germany". The answer appears exactly where heads fetch the country.
LimitsThe heads, the neurons and the write strengths are the model's own numbers. The logit lens is a standard technique, not something the model does: middle layers were not trained to be read through the final layers, so the lens is trustworthy near the top and rough near the bottom.
Chapter 9
The scene during a pass
While the panel shows the network, the 3-D scene above it places the run on the embedding cloud: where the tokens are, what the model is leaning toward, and whom it attends to.
9.1 What is drawn
- The sequence. The text's tokens as labelled markers joined by a faint line, the token on screen in cyan, and the token about to be written ringed and marked "predicted".
- The thought path (violet). At each depth reached so far, the probability-weighted average position of the logit lens's top ten guesses. It travels from the input token toward the word the model settles on.
- Attention arcs (cyan). From the current depth back to every earlier token, as thick as the attention paid to it, averaged over the layer's heads, or for one head if you have pinned its loupe. Arcs under 2% are omitted.
9.2 Fly-through
Press T or Fly-through and the camera follows the thought path instead of orbiting: behind it, layer by layer, naming the guesses it passes with their probabilities. Drag or zoom at any time; the flight resumes after a moment. With the hidden-state space on (Chapter 15), the camera follows the token's actual state instead.
LimitsThe thought path is an illustration: an average of positions on a map, not the model's state. The state is a d-dimensional vector that does not live on the vocabulary map; Chapter 15 draws it directly.
Chapter 10
Attribution
Attribution asks which parts of the network pushed the model toward a word. Because the final state is a sum (§1.3), the word's score splits exactly into one share per part.
10.1 The decomposition
The score of a word w is its logit minus the average word's logit, which is what actually sets its odds (§1.7). Write the final state as the sum of what each part wrote, xL = e + Σheads oh + Σlayers mℓ + biases. Holding the final normalisation's scale at its value for this token, the score is linear in xL, so
score(w) = Σparts (1/s) · ( uw − ū ) ⊙ γ · cpart
uw: the word's unembedding row; ū: the average row; γ: the final norm's weights; s: its scale at this token; cpart: what the part wrote (for LayerNorm, centred). This is direct logit attribution.
10.2 Using it
Press A or Attribution. The field recolours: each head cyan where it pushed toward the word and amber where it pushed against it, stronger for larger shares; each MLP strip gets a frame of the same colours; a PUSH column adds up each layer, with the total score at its head. The word explained is the one written next. To explain another, click a row of the logit lens (that depth's guess), or type any word into Explain: "why not Paris?" becomes an exact answer about " Paris".
10.3 Reading it
Large pushes usually come from a handful of late heads and MLPs. Negative pushes matter as much as positive ones: they are often the parts that suppress the word the model would otherwise repeat. The share of the embedding itself, and of biases (rest), are reported too, so the shares add up to the score.
LimitsOnly direct effects are counted. A head that matters because it feeds later layers shows up in those layers, not in its own cell. Interventions (Chapter 12) measure total effects.
Chapter 11
Neurons: reading the network the way it reads itself
Every MLP neuron is one of the model's own parts, built to be read by the layers after it. Read it the way they do: what drives it, what pushes it the other way, what feeds it, what it feeds, and what changes when you turn it up or down.
11.1 The neuron inspector
Click a layer's MLP strip. The drawer lists the neurons firing hardest at this token, and, when a word is being explained, the neurons pushing toward it and against it: a neuron's direct effect is its activation times how much its output direction points at the word through the final normalisation. Pick a neuron to read it:
- Here: its activation at this token, and its input before the activation function. In a SwiGLU model (Llama, Qwen) the activation is SiLU(gate) × value, and both are shown (§11.3).
- Where it fires: its activation, or its input, at every token of the text so far, as background colour.
- Strongest examples and its other side: the passages that drive it hardest, and those that push it hardest the other way, from a public corpus (§11.4).
- Its shape: how its activations spread over its own range (§11.4).
- What feeds it here and what reads it: the earlier parts its input is made of at this token, and the later neurons that read what it writes (§11.5).
- What it writes: the words its output weights push up and down.
- Your name and note for it, kept in this browser and shown wherever it appears; ‹ › (or [ ]) walk back through the neurons you have read.
- Steering and Test it: change it and rerun, or write a sentence meant to fire it (§11.6).
Worked exampleIn GPT-2, layer 9's neuron 1806 writes toward " an", " a" and " another". Its strongest examples are the word just before an article ("An example of a negative…", "the difference between a dialect and a language"); further down its range some of its samples still sit before an article, more weakly ("Signed into law by President Obama is another…", "people who need to follow a diet"); it is pushed hardest away on " a" itself in phrases like "there are a number of". It doesn't detect articles: it predicts one is next, and goes quiet once one has been written.
11.2 Features
A sparse autoencoder (SAE) is a second, small network trained to rewrite the stream at one depth as a sum of a few features from a large dictionary (24,576 for GPT-2 small). Click a layer's label (EMB, L0, …) to open its features at the token on screen. The first time, that layer's dictionary (about 150 MB) streams from Hugging Face and is kept in your browser.
The drawer reports how faithfully the active features rebuild this token's state (the cosine between the rebuilt and the real vector, and the share of its size they miss), then lists the most active features with a one-line description each, written by an AI model from each feature's strongest examples (Neuronpedia). Pick a feature to see where it fires across the text and which words it writes.
Features are a model of the model: useful for asking what is in one token's state, but a second step, not a first. These SAEs read the residual stream, which has no neurons of its own. In Cammarata's essay (below), an SAE trained on a vision model's last layer turned out to be mostly near-copies of single neurons (88% of its activity), and what it added were loose groupings of existing neurons; he also argues that keeping each neuron whole keeps the tools' errors visible, where a decomposition optimised to look cleaner can lose those hints. Start with the neurons.
LimitsAn SAE is trained by others; what it misses is not shown anywhere, and the descriptions are informed guesses. Available for GPT-2 small, the one supported model with open SAEs. Fetching descriptions sends only the layer and feature number to neuronpedia.org, never your text.
11.3 How to read a neuron
Nick Cammarata's essay Neural Networks Are Already Clean (Goodfire, 2026) argues, as a working hypothesis from his experiments on vision and language models, that a neuron which seems to respond to "several unrelated things" is usually one thing we haven't named yet, a branch grown from it, or a tool showing it badly. This section follows that essay. Some ways in:
- A verb, not a list of nouns. Describe the neuron without naming objects. A famous image neuron that fired on "cats and cars" turned out to detect a V shape (pointed snouts, car fronts, flames). A neuron's job is usually to draw a distinction later neurons can use.
- Read both sides. A neuron is built from votes for and against. What pushes it negative shows the distinction it draws, and is often a close cousin of its positive side, not its opposite: the V neuron's other side is an O. A neuron with one thing on its positive side and a related thing on its negative side can act as a gate (the essay's example: cars let through, dogs kept out, before the car detectors). In GPT-2, GELU flattens everything below zero to between −0.17 and 0, so the drawer reads its other side from its input before GELU, the votes against it at their strongest; show input colours the text by that input too.
- Two regimes in SwiGLU. A SwiGLU neuron is SiLU(gate) × value. The essay found a "double-negative regime": when gate and value are both negative, the product is positive. In our reading this is a small, sign-flipped echo of the neuron's negative side, which can crowd a list of strongest firings; the drawer names each sign regime at the token on screen and flags the double negative when it carries a real share of the neuron's range.
- It fires next to the meaning. Neurons often fire not on the word that carries a meaning but on the word before what they predict, or on punctuation, where the model sums up what came before. Read the whole line of an example, not just the outlined token.
- Its shape, in pages. Where its tokens sit in its own range; open a band to see what the middle of its range responds to. A page is about 400 tokens (the essay counts one token in 100 as a quarter of a page): "once every 25 pages" says more than "the 99.99th percentile".
- Weak activations. In the essay's experiments almost all of them could be removed at little cost, except in places like a language model's last layer (which suppresses single tokens) and a vision model's early layers (dials, where slightly versus medium bright matters); elsewhere what weak activations carry is fine distinctions between things the model already confuses, and the strange-looking cases he traced came through ordinary routes. Follow what feeds a weak firing before calling it noise, and open the bands of its shape (§11.4) to see what sits in the middle of its range.
- Groupings are clues. A neuron that grows from "iy" to "diy" to "do it yourself" has branched, not been packed with unrelated things. If two meanings share a neuron, ask what the network sees in common.
- Try to break your reading. A good explanation predicts things that could fail: what steering will make the model write, what knocking it out will change, a sentence that should fire it hard.
11.4 Strongest examples and shape
For the built-in GPT-2 and DistilGPT2, every neuron has a book, built once offline (tools/build_neuron_examples.py) by running the model over about three million tokens of FineWeb-Edu (ODC-By): every fourth document of 20 row groups spread across one file of it. Each document is read from its own start, after the <|endoftext|> token GPT-2 saw between documents, for up to 1,023 tokens (1,024 with that token), so a neuron that needs long context gets it and no example's context runs into another document. The first position, where the model parks attention and values are outsized, is left out. Per neuron the book keeps the twelve tokens that drive it hardest and the six where its input is most negative, no two closer than 29 tokens in one document, so no two windows overlap, each with the 24 tokens before it and 4 after, and the neuron's value along the line; ↑ runs an example's whole passage, from the start of its document, through the model. It also counts, in halving bands of the neuron's own maximum, how many tokens land in each band: its shape, drawn on a log scale, with the share of tokens where it is positive at all and how often it reaches half its maximum; and it keeps up to eight random tokens from its top band and from each of the five bands below it, no two within 29 tokens in one document. Click a band to read them: the top band is what it mostly does when it fires hard (its twelve strongest are a sliver of it, and for some early-layer neurons all sit in a document's first few tokens, which the drawer flags); the lower ones are the middle of its range, where a reading should still hold; ↑ shades a sample's whole passage, to see why it fires there. The drawer reads one neuron's records with a few small requests.
LimitsThree million tokens of educational web text, from one file of the corpus, is a sample: a neuron for something rare in it, or for code, fiction or dialogue, may show weak or mixed examples, and its true maximum may be higher than any shown. Documents longer than 1,023 tokens are cut there, and the browser kernel holds 256 tokens, so a long passage is re-run on the tokens nearest its example and its value can differ from the book's. Models loaded from Hugging Face have no book yet; their drawer shows the text on screen and your own tests.
11.5 What feeds it, what reads it
A neuron's input is the normalised residual stream dotted with its input weights, plus a bias. The stream is a sum of parts (the token's embedding, every earlier head's output, every earlier neuron's activation times its output weights), and the norm, at this token's scale, is linear in each part once that part is centred. So the input splits exactly into one share per part:
inputj = Σparts c r · (c − mean c) · (γ ⊙ wj) + biases
r: the norm's 1/scale at this token; γ: its weights; wj: the neuron's input weights (for SwiGLU, its gate's and its value's in turn). RMSNorm has no mean to subtract. In float32 the shares and the biases add up to the input to within about 2×10−5.
What feeds it here lists the largest shares at the token on screen; heads stand for what attention brought in from other tokens. What reads it is from the weights alone: the later neurons whose input weights line up most with this neuron's output, either way. Click any neuron to read it in turn.
11.6 Steering and testing
Below a neuron's name: Knock out sets its activation to zero; Hold at its max sets it to its strongest activation in the book (or in this text) at every token, so a silent neuron speaks; Hold at its trough (GELU) sets it to the most negative value it reaches in the book: −0.17, GELU's own trough, for a neuron whose input reaches −0.75 (where GELU bottoms out), else what its lowest input gives; its readers never get less from it, and it is close to a knockout; Hold at its minimum (SwiGLU) sets it to its most negative value in this text. Then Rerun (under Playback) sends the same text through the changed model, beside the unchanged run (Chapter 12). What the model writes when a neuron is held high is a strong test of what it means, but every token at once is far from anything the neuron does naturally: make the same change to a random neuron of the same layer before reading much into it.
Test it runs any sentence of yours through the unchanged model (whatever is steered), after <|endoftext|> as the corpus does (for GPT-2 and DistilGPT2), and shows the neuron's activation on every token and how close your strongest token comes to the strongest in the book. This is the essay's blind maximum, and it only counts if your reading came first: turn on Read blind, which hides the neuron's examples, shape, neighbours, words, its activations across your text and its maximum until you have written your reading in the note and then tested a sentence (after that it stays revealed; the layer's lists still show its value at the token on screen, among the others), and write one meant to fire the neuron as hard as possible. If your reading is right, the sentence lands near the centre of what the neuron looks for, and can beat every example in the corpus. Copying an example proves nothing; a sentence that should not fire it, a near miss, is as good a test.
Your names and notes are kept in this browser, per model, and listed under yours at the top of the drawer; export notes saves them as one JSON file (with a Markdown summary inside) and import merges a file back, keeping the newer note. The page's address follows what you read (#model?ask=…&p=…&n=layer.neuron&g=1), with the changes in force at the last Rerun, so a link reopens the same model, prompt, token, neuron, graph and changes (generated words match only with Greedy decoding); prompts over 400 characters leave the address unchanged.
11.7 Neuron graphs
Trace the neurons behind a word draws the model's own neurons that carry it at this token. It starts from the eight neurons with the largest direct effect, then walks back layer by layer: each neuron's input is split exactly (§11.5), each share is passed through the slope of the neuron's activation function at this token, and weighted by how much that neuron moves the word. Up to 36 neurons, with the four strongest routes into each; attention heads and the embedding end the walk. A circle's size is the neuron's total: its direct push plus everything it sends through the neurons drawn.
Click a neuron to read it (the graph docks to a bar; Show graph brings it back); shift-click to group neurons, then Knock out the group and rerun, and run the two controls beside it: as many random neurons, and as many of the most active neurons, from the same layers. Random neurons almost never move anything, so they are a weak control; the most active ones at this token are a stronger one, though a neuron that matters at an earlier token escapes both. Then look at what else the model now says: a knockout can break a prediction rather than remove one meaning.
Worked exampleGPT-2, "The Eiffel Tower is in the city of" (after ⟨doc⟩): the model gives " Paris" 6.9%. Knocking out the graph's four largest neurons takes it to 0.12%; four random neurons from the same layers leave it between 6.8% and 7.3%. But almost all of that is one layer-0 neuron (#2733, 0.16% on its own), which is also the most active neuron of its layer, and its knockout breaks the prediction rather than removing Paris (" the" rises from 0.2% to 12%); the four most active neurons of the same layers other than the graph's leave " Paris" at 6.9%. The same layer-0 neuron dominates other "in the city of" prompts. On "The capital of … is" prompts the model is less sure (" Berlin" 0.54%, " Tokyo" 0.64%), and the graph's top four cut the word about 1.6 to 5 times, with no rise in " the" (" Berlin" to 0.26%, " Tokyo" to 0.13%). Yet the same layer-0 neuron, knocked out alone, cuts them about as far or further (" Berlin" to 0.06%, " Tokyo" to 0.14% against the four's 0.13%); knocked out only at " of", it does all of that. It is nearly silent at the last token (−0.10), so neither the graph nor the most-active control finds it: it fires on " of" (5.3), two tokens back, which the graph doesn't follow. The graph is a map of where to look, not a verdict.
LimitsThe slope linearises each neuron at this token, so edges are a first-order account that can miss a neuron pushed far into its flat side; the knockout is exact for the changed model, but it acts at every token, while the graph is traced at one, and it tests whether a group is needed, not whether it is specific to this word. The graph doesn't follow attention back to other tokens. Needs the CPU kernel (choose CPU under Run on for a model on the GPU), is unavailable while weights are streamed, and isn't available for MDLM.
Chapter 12
Experiments: interventions and comparisons
Observation says what happened; an experiment says what would happen otherwise. Interventions change the model; comparisons put two runs side by side.
12.1 Knocking parts out
Shift-click a head, or press K while pointing at it, to mark it for removal (an amber ✕). In the neuron inspector you can mark a whole MLP or a single neuron. Nothing changes until you press Rerun: the same text then runs through the changed model, in which those parts write nothing, at every position, so every later layer and token sees the change. The unchanged run is kept and shown beneath the new answer, with the first difference underlined, and the readout gives the probability the changed model now assigns to the word the unchanged model wrote. Clear restores the model.
Worked exampleGPT-2 on "The country of Canada is a country of immigrants. We are a country of": the four heads attribution ranks highest for " immigrants" take its probability from 44.9% to 9.1% when knocked out together, while four other early heads leave it at 56.4%. Attribution suggested where to look; the intervention confirmed it.
12.2 Comparing two runs
Press Pin as A to keep the run on screen, then run something else: change one word, switch to Sample, or knock parts out. The answer shows A's beneath it; chips whose token differs from A's are outlined in amber. In the field, a Δ A column gives at each depth the cosine distance between this run's state and A's at the token on screen (0 means the same direction), and marks the depth where they part ways, the first to reach a quarter of the largest difference. Heads whose attention differs from A's get an amber outline. Rerunning with interventions pins the unchanged run as A automatically.
Worked examplePin "The capital of France is" and run "The capital of Germany is". At " Germany" the runs part ways at the embedding, as they must. At the final " is" the state barely moves (cosine distance about 0.001) until layer 9, where it jumps tenfold: the country reaches the last token's state late in the network.
LimitsKnocking out sets a part's output to zero, a blunt change: in normal use no part ever falls completely silent. Runs are compared position by position, which is exact only when both texts have the same number of tokens.
Chapter 13
The lens river
The field shows one guess per depth. The river shows the whole contest: every serious candidate at every depth, so you can see when and how the model makes up its mind.
13.1 Construction
Open the River tab (2). For the token on screen, the horizontal axis is depth, from the embedding on the left to the output on the right. At each depth the logit lens (§8.4) gives the ten most probable tokens; they are stacked bottom to top as bands, each as tall as its probability, joined smoothly from depth to depth. The eight tokens that ever do best get a colour, kept across the whole river; the rest of each depth's top ten is grey; the empty space above the bands is the probability of every other token in the vocabulary. A strip above the river traces the uncertainty, eH of §1.8, on a logarithmic scale from one word to the whole vocabulary.
13.2 Using it
Point at a depth to read its top five and its uncertainty. During a replay, a cyan line marks the depth being computed and the river grows to it. Choose another chip to see another token's river. The readout states the conclusion in words: the token it settles on, the first depth from which the top guess no longer changes, and the depth where that token first entered the top ten.
13.3 How to read it
- A band that appears late and grows quickly is a decision made late in the network.
- A guess that leads for several layers and then vanishes is the model changing its mind; the depth where it falls is worth inspecting in the field.
- A large empty region means the model is spread over many tokens; the uncertainty line says how many, in effect.
Worked exampleOn GPT-2, generate after "The capital of France is Paris. The capital of Germany is Berlin. The capital of" and look at the token " the" that the model writes: the river settles on " United" from layer 11, having entered the top ten at layer 6, as the model heads for "the United Kingdom". On Qwen2.5-0.5B, the " is" before " Berlin" leans toward " capitals" around layer 20 and settles on " Berlin" (92%) only at layer 23.
LimitsThe river is the logit lens at every depth, with the lens's caveat: rough near the bottom. For large vocabularies on the CPU, depths not yet read out appear as dots and fill in when you pause.
Chapter 14
Attention flow
Attention moves information between positions (§1.4). The flow draws where it moved, for the whole text and every layer at once, and estimates what fed the token on screen.
14.1 Construction
Open the Flow tab (3). Tokens run left to right and depths bottom to top; each dot is one token's state after one layer. A line from token j at depth ℓ to token i at depth ℓ+1 means layer ℓ's attention carried information from j into i. Its weight is not the raw attention but attention times the length of the value vector being read, averaged over the layer's heads and scaled so that each state's incoming weights sum to one:
fℓ(i ← j) ∝ Σheads h ahij · ‖vhj‖
After Kobayashi et al. (2020). Links under 3%, and beyond each state's four strongest, are omitted.
Why weight by the value? Most models park a large share of their attention on the first token, whose value vector is tiny: looking there moves almost nothing. Raw weights would draw thick lines from the first token everywhere; weighted ones show where information actually came from.
14.2 Rollout
With Rollout on, the tool chains the flow through the layers to estimate how much each input token contributes to the token on screen by the last layer (Abnar and Zuidema, 2020). Counting each layer's residual connection as half:
rL = ei, rℓ = ( ½ Fℓ + ½ I )T rℓ+1
The result is drawn as a cyan cone of dots and links reaching back from the token, and as bars under the input tokens. Because the first token only ever attends to itself, whatever reaches it stays there, and rollout accumulates on it; the readout therefore reports the first token's share separately, and the shares of the other tokens among themselves.
14.3 Using and reading it
Point at any dot to see what that state took in at that layer: its sources, each with the weighted share and the raw attention side by side. Click a column to put that token on screen. Look for long, strong lines in the upper layers: they are the model fetching a specific earlier word.
Worked exampleOn GPT-2, "The country of Canada is a country of immigrants. We are a country of": point at the second " of" at layer 9. It took in 50% of what it read from the earlier " immigrants", although only 12% of its raw attention went there. This is the copying step behind the model's answer, " immigrants". On Qwen2.5-0.5B with the capitals prompt, the second " is" at layer 18 gives "The" 57% of its raw attention but takes only 13% from it; its real sources are " capital" (29%), " Paris" (18%) and " Germany" (14%).
LimitsAttention weights and value sizes are real; their product is a derived measure, and rollout is an estimate that ignores what the MLPs do and how the heads' outputs combine. In the example above, rollout for " of" does not rank " immigrants" in its top three even though the per-layer link shows it plainly: read the layer-by-layer links first and the cone second.
Chapter 15
The hidden-state space
The hidden states (§1.3) are the model's working representations: one vector per token per depth. This view draws them directly, as a space of their own, so you can watch each token's meaning move through the network.
15.1 Construction
Press S or Hidden states. The word cloud dims, and every recorded state of the current run appears: n tokens × (L + 1) depths. Each state is first normalised as the model's own normalisation would (centred and divided by its root mean square, §1.6), so the growth of the stream from layer to layer, and the few huge dimensions some models carry, do not dominate. Then one PCA is fitted on all of the run's states except the first token's (an attention sink with outsized values, which would stretch the axes toward itself; it is still drawn) and every state is projected onto its three directions. The readout reports how much of the variation those three directions show. The fit is refreshed as the text grows.
15.2 Reading the drawing
- Paths. Each token is a line from its embedding through every layer. The token on screen is drawn boldly; the others faintly.
- Steps. Each segment is one layer. Its cyan part is how much attention changed the state, its violet part how much the MLP did, and its thickness how large the change was compared with that token's largest. These amounts are exact: the MLP's output is recorded, and the rest of the layer's change is attention's.
- The slice. White dots mark every token at the depth being replayed, so during playback you watch the whole text advance one layer at a time. Short texts are labelled at the slice.
Point at any dot to read its token, depth and what the logit lens says there; click it to put that token on screen. With T, the camera follows the token's actual state.
15.3 How to read it
Tokens whose paths converge have come to be represented alike by the model; paths that separate are being distinguished. A long, violet-heavy step is a layer whose MLP rewrote the token substantially; a cyan-heavy step is one where information arrived from elsewhere. In most models the first layer makes a large jump, from the embedding into the network's working region.
Worked exampleOn GPT-2 with "The capital of France is Paris. The capital of Germany is", by layer 6 the countries and capitals (" France", " Paris", " Germany") have gathered in one region, apart from the function words. On Qwen2.5-0.5B, the final " is" wanders through the middle layers and makes one large final step to the state that reads "Berlin 92%".
LimitsThe states are real; the 3-D picture is a projection, typically showing a third to a half of their variation. Near in the picture usually means near in the full space; far holds less exactly than near.
Part IV · Models and machinery
Chapter 16
Choosing a model, and where it runs
Every view works on every supported model. Choosing a model is a choice of subject; choosing where it runs is a choice of speed and size.
16.1 The model menu
Click the model's name at the top left. The menu lists, under Ready to use, the built-in models (GPT-2, DistilGPT2, MDLM) and any you have downloaded, with the one open marked. Below, a search of Hugging Face lists open models this tool can run, by family and sorted by downloads, trends or likes, each with a badge:
- Verified
- Checked end to end against the reference implementation (Chapter 20).
- Should load
- A supported design that fits; not checked one by one.
- Runs on your GPU
- Too big for the CPU path, but your browser can run it on the graphics card (§16.3).
- GPU, 8-bit
- Too big for the CPU path and, at full precision, for a typical graphics card; it runs on the GPU with its weights stored as 8-bit integers (§16.4).
- Streams
- Too big to hold in memory on the CPU; its weights are read from storage one layer at a time, exactly but slowly.
- Needs HF token
- A gated model: accept its licence on Hugging Face and add a read token under Token.
- Too big · Unsupported
- Shown with the reason, when "Also show models it can't run yet" is ticked.
Choosing a model shows a check before anything downloads: its family, format, tokenizer, the memory it needs, the space it will take in your browser, expected speed and licence. The weights then come straight from Hugging Face into your browser's storage, are converted there, and load from storage on later visits. The Storage tab (also reached from Manage storage at the top of the menu) shows how much of your browser's storage the tool uses and on what: downloaded models, the feature dictionaries of §11.2, and any download that did not finish. Each can be deleted on its own, and Free up space deletes everything except the model open now. Everything deleted can be downloaded again; when experimenting with large models, clearing the ones you are done with keeps the browser within its storage allowance.
A browser keeps each site's storage separate, and each browser and profile has its own, so a model downloaded in one place is invisible in another. Export, beside each model (Chrome and Edge), copies it to a folder you choose on your disk, with a list of its files and their sizes. Import model from a folder… (any browser) copies one or several exported models back in and checks every file against that list, so a model never needs downloading twice: a copy on disk takes seconds to a minute, where the download of a 15 GB model takes many minutes. The list itself is cached in your browser and refreshed at most hourly, so opening the menu costs nothing most of the time.
16.2 Families
GPT-2 and DistilGPT2 use learned positions, LayerNorm and GELU. Llama 3.2, SmolLM2, Qwen2.5 and Qwen3 rotate queries and keys for position, use RMSNorm, gated SwiGLU neurons and grouped-query attention; Qwen3 also normalises each head's queries and keys. Pythia applies rotation to part of each head and runs attention and the MLP side by side. Instruction-tuned and chat models receive your text exactly as typed, without the chat template they were trained with, so they continue it rather than reply.
16.3 CPU or GPU
Models from Hugging Face run on the graphics card when your browser supports WebGPU (Chrome and Edge, Safari 26, Firefox on Windows), and on the CPU otherwise; the status line says which, and why if the GPU could not take the model. Both compute the same function on the same weights. The GPU is many times faster and, because its memory lies outside the 4 GB a page gets for everything else, holds models of up to about 7 GB of weights whole, where the CPU must stream them. Run on under Playback switches to the CPU for comparison; the model loads again.
MeasuredOn an Apple M-series machine: Qwen2.5-0.5B, about 11 ms per token for the forward pass on the GPU against 93 ms on the CPU; Qwen2.5-3B, about 0.17 s per token on the GPU with the logit lens at all 37 depths and full attribution, against 1.6 s per token streamed on the CPU with the lens at a sample of depths.
16.4 Eight-bit weights
A model's weights are published as 16-bit numbers, two bytes each. When those do not fit in the graphics card's memory, the tool can store each weight matrix as 8-bit integers instead, one byte each plus one scale for every 64 weights: about half the memory, and, because decoding one token is limited by how fast the weights can be read, roughly twice the speed. The conversion happens on the GPU as the model loads; the download and the files kept in your browser are unchanged. Formally, each group of 64 weights w1 … w64 is replaced by
ŵk = s · round(wk / s), s = maxk |wk| / 127
so each weight moves by at most half a step. The tool measures the result as it converts: the status line gives the relative size of the change, √(Σ(w − ŵ)² / Σw²), typically about 0.6%. Normalisation weights and biases are kept at full precision.
Run on offers GPU when available (full precision, then 8-bit if that does not fit, then the CPU), GPU, 8-bit weights, and CPU only.
MeasuredQwen2.5-3B at 8 bits: 3.4 GB of GPU memory instead of 6.2 GB, 19.8 ms per step instead of 52.5, the probability of " Berlin" 0.883 instead of 0.887, and the same 20-token continuation. Qwen2.5-0.5B keeps the same top guess at 23 to 25 of its 25 depths. Qwen2.5-7B at 8 bits: 8.2 GB instead of 15.3 GB, 52 ms per step instead of 110, the same top guess at all 29 depths, and the same continuation.
LimitsAn 8-bit model is a close copy of the published one, not the same model: every number the tool shows moves slightly, and greedy text can take a different turn where two words were nearly tied. The tool says when it is in use. For exact work, choose a model that fits at full precision, or run on the CPU.
Chapter 17
A different kind of model: diffusion
MDLM is not a next-word model. It writes the whole answer at once, starting from blanks and filling them in over several steps, and every position can attend to every other.
With MDLM chosen, your text is followed by a number of [MASK] slots (the Tokens setting). At each denoising step the model reads the whole sequence, and each still-masked slot is filled with probability proportional to the step size, taking a token from the model's belief for it; a final pass fills any slot left. The answer shows every slot: locked words bright, the word that just locked highlighted, and masked slots as their current best guess, faded by confidence. The field replays each pass for one slot, by default the one that unmasks at this step; its heads show attention to words on both sides. In the scene, masked slots hang at the weighted centre of their guesses and snap onto a token when they lock. Attribution, interventions and the newer views apply to next-word models and are hidden here.
Chapter 18
Attention without a decoder: a KnowDrive store
A retrieval store does what one attention head does: it scores a query against a fixed set of keys, masks some of them out, and reads from the best. It has no weights and writes nothing, but its key space can be explored exactly like a vocabulary.
A KnowDrive store built into a data set (with tools/build_kdstore.py, which needs a KnowDrive account) appears in the model menu. Its points are atoms. An atom is a passage of a file (a heading and its paragraph, a table, a speech), stored as one 1,024-number vector made by the Jina-CLIP-v2 embedding model. A model's vocabulary is a fixed set of vectors with labels, and so is a store, so most of Part II applies unchanged.
18.1 What carries over, and what changes
| In a transformer | In the store | Where you see it |
| Keys | Atoms: one vector per passage, fixed when the file is stored | The cloud (Chapter 3) |
| Query · key score | Cosine between the question and an atom | Distances from the question (§18.3) |
| A second head | Full-text (BM25) over the words | The Full-text switch |
| Combining heads | Reciprocal Rank Fusion of the two lists | The Hybrid switch |
| Attention mask | Tags, store, version and access: which atoms may be read | Clicking the legend (§18.4) |
| How peaked the attention is | The recall shape: how the score falls along the page | The bars in the panel |
| What the head writes (OV) | The facet read-out: the tags the matched atoms carry | "What the page is about" |
What does not exist in a store: learned weights, neurons, a next word to predict. The Forward pass view, the lens, attribution and features are therefore absent for it.
18.2 The cloud of atoms
Each point is an atom, coloured by the domain of its file. Labels are not the atom's text, which would bury the cloud in sentences, but a short name: the three words most particular to that passage (frequent in it, rare in the rest of the store), in reading order. The inspector shows the passage itself, with any web-page markup removed for reading, the file it comes from, its position in that file, and the file's tags. Nearest neighbours are exact over all 391,922 atoms, as for a vocabulary; the fovea streams the vectors tile by tile (about 800 MB in all, of which only what you look at is loaded).
18.3 Asking a question
Pick a question in Ask the store. Arcs run from the question to the page of atoms the chosen head returns, thickest for the best; the top five are numbered. In a cloud layout the question is placed among its five best atoms, since a layout has no position for a vector it was not built from. Distances from the question is exact: every atom moves to a radius equal to its true cosine distance from the question, with rings of equal cosine and a dashed ring at the page's edge, the last atom the page took. Everything inside that ring was attended to; everything outside was not.
A browser cannot run the embedding model, and KnowDrive's search does not return the question's vector. It does return the score of every atom it ranks, and each score is a fixed function of one dot product with an atom whose vector the data set holds. The vector head's score is exactly the cosine between the question and the atom (checked by searching with an atom's own vector: KnowDB's scores for the 100 nearest atoms equal the cosines computed here). So 1,500 scored atoms pin down all 1,024 numbers of the question's vector by least squares, and the result must reproduce every score. For each of the ten example questions it does: the recovered vector has length 1.0000, every one of the 1,500 scores is reproduced to within 2×10−7 (the rounding of 32-bit numbers), and the browser's top 50 matches KnowDB's vector list, in order, for all ten. With that vector, the Vector head is recomputed here, over every atom.
Full-text needs the store's word index, which stays on the server, so that list is KnowDB's own, recorded when the data set was built and replayed. Hybrid is KnowDB's fusion of the two, also replayed.
18.4 The mask
Click a domain in the legend to mask it out, and again to bring it back. Masked atoms fade where they are: the keys never move, because masking changes what may be read, not what is stored. The vector page is re-ranked over the atoms still lit, exactly; the replayed lists are filtered, and say so, since the server would have refilled the page from further down.
18.5 Recall shape and read-out
The bars are the page's scores, best first, the top five bright. A steep fall means the question has a clear answer in a few passages; a flat run means many passages are about equally relevant, the retrieval analogue of a spread-out attention pattern. The line beneath gives the share of the page's score held by the top five. What the page is about counts the tags of the files on the page: domain, document type, source. It is how a store reports what it read, and in KnowDrive it is also how a next question can be narrowed, by turning a tag found here into a mask.
Real: the atoms, their vectors, tags and text; the vector head's distances and ranking; KnowDB's replayed lists. Derived: the recovered question vector (checked as above), labels, layouts. Illustrated: arcs, the question's placement in a cloud layout.
Chapter 19
A 744-billion-parameter model, streamed from a drive
GLM-5.2 is far too large for any browser's memory, but each token uses only a small, changing part of it. Keep the part every token needs on the GPU, leave the rest on a fast drive, and read each piece at the moment it is needed.
GLM-5.2 (Z.ai, MIT licence) has 744 billion parameters in 78 layers. Three layers are ordinary; in the other 75, the feed-forward part is a mixture of experts: 256 small networks per layer, of which a router picks 8 for each token, plus one shared expert every token uses. So about 40 billion parameters work on any one token, and only the routed experts, about 12.7 GB of them, change from token to token. The technique, and the int4 container the page reads, come from colibrì by Vincenzo Fornaro (Apache-2.0): parameters are not something to hold in memory but data to be staged, the way a just-in-time compiler compiles only the code that runs. Open it from the model menu: GLM-5.2 under "Streamed from your drive".
19.1 What lives where
- On the GPU, always: attention, the shared experts, the three dense layers and the output layer, about 10 GB in the container's own 4-bit and 8-bit form, decoded inside the GPU kernels.
- On the GPU, as a cache: as many routed experts as the cache you choose holds (21.2 MB each), split equally between the 75 layers, the least recently used of a layer giving way. (One shared pool would fail: a token needs 600 experts, so each layer would evict the experts the next layer is about to use.)
- In RAM, optionally: on a computer with a separate graphics card, experts evicted from the GPU drop into system memory instead of going back to the drive, so a later need for them costs a memory copy rather than a drive read. On Apple Silicon the GPU and the processor share one memory, so this tier would only take room from the GPU cache, and it is off.
- On the drive: all 19,200 routed experts, about 407 GB. When the router picks an expert the cache does not hold, its bytes are read straight from the file on the drive, in place; nothing is copied into the browser's storage.
19.2 One token, layer by layer
Attention in GLM-5.2 is multi-head latent attention: instead of a key and a value per head, each position stores one compressed 512-number latent plus a 64-number positional part, and every head reads through that latent. Then the router scores all 256 experts; its scores come back from the GPU, the eight best (by score plus a learned balance term) are chosen exactly as the reference does, any missing ones are read from the drive, and the experts run, weighted, added into the residual stream. The page waits on the drive whenever the cache misses, which is why speed depends on the drive far more than on the GPU: a token that misses every expert reads 12.7 GB.
19.3 What the page shows
- Experts: 75 rows (the MoE layers) by 256 columns (the experts). For the current token, the eight chosen in each layer: cyan if they were already on the GPU, amber if they had to be read from the drive. Purple shows how often each was routed this session, so the structure of routing (the same experts recur for the same kind of text) builds up as you use it. Hover for an expert's layer, weight and history.
- This token / Session: seconds per token, experts served from the cache, gigabytes and speed read from the drive, the hit rate.
- Logit lens: the next word read off the residual stream at a few depths (Chapter 8), the same idea as for the smaller models.
- Attention: for the newest token, each layer's attention over the earlier tokens, averaged over the 64 heads.
- Warm the cache: colibrì's container ships a routing history; this fills the cache with the most-routed experts before you start, raising the hit rate.
19.4 Reading ahead
The router of layer l+1 is tiny and always on the GPU, so it can be run early on the state layer l already has, to guess which experts the next layer will want and start reading them before it asks (Read ahead). The guesses are good: measured on GLM-5.2, 79% of the next layer's eight experts are guessed right (colibrì reports 71.6%). But reading ahead only pays when the drive has idle time to fill. On a USB SSD it does not: every token already keeps it busy, so the 38% of early reads that turn out unneeded, and the cached experts they push out, cost more than the overlap saves (about 31 s per token, against 22.5 s without). It stays off by default; on a faster drive, or with a cache large enough to keep spare slots, it may win. The Experts view marks experts that arrived by reading ahead in green.
19.5 The experts as a space
A router scores expert e as sigmoid(we · h), where h is the token's normalised hidden state and we is the expert's row of the router: one 6,144-number vector per expert, the direction in the hidden state that wakes it. So the 19,200 experts are 19,200 vectors in one space, exactly the kind of thing the Embeddings view draws, and the model menu lists them as GLM-5.2 experts. Experts close together answer to the same kind of state; their nearest neighbours often sit in other layers. Each is labelled by layer and number, and with the vocabulary words whose embeddings align best with its row: a rough guide only, since the router reads hidden states, not raw words.
With GLM-5.2 running in another tab, each token's choice lights up in the cloud, coloured by where the expert came from. Distances from the token places every expert at its exact rank in its own layer's choice for the last token (sigmoid score plus balance bias, as the router decides), following the run token by token: the eight chosen per layer sit inside the first ring (checked: 600 of 600 for a token). The balance biases are large (about 4 to 20, rising with depth) beside scores between 0 and 1, so they weigh heavily in every choice; ranks show the decision itself.
19.6 Previews: the periphery at lower fidelity
An exact token waits on the drive; a preview does not. For the next few words, the page runs the token on the GPU alone: each chosen expert that is not already on the GPU is stood in for by the resident expert of the same layer whose router row is closest to it (the expert cloud's geometry, used as a lower-fidelity periphery), with no drive reads, in about half a second per word. The preview is shown faintly after the exact text, then confirmed or replaced as the exact words arrive about 20 seconds later; the exact answer never depends on it. Measured on GLM-5.2, with about 72% of each token's chosen experts missing from the GPU: the preview's first word was exactly right 69% of the time over 13 tokens (71% live, 10 of 14), and the exact word was in its top three 92% of the time. Simply leaving the missing experts out does worse (54%). A preview that runs several words ahead can drift (each word builds on the last approximate one), which shows as an occasional repeated word. Preview ahead sets how many words; previews never make the exact answer faster, since every chosen expert must still be read.
19.7 Limits
The context stops at 2,048 tokens: GLM-5.2's sparse attention indexer is not in the container, and without it attention is exact only up to that length. The draft head for speculative decoding is not used. Speed: a fraction of a second to a few seconds per token of GPU work, plus whatever the drive takes; on a USB SSD reading about half a gigabyte a second, a cold token takes tens of seconds, and it improves as the cache warms.
Checked: on two test models in the same container format (colibrì's own tiny oracle, converted by its converter, and a random model at GLM-5.2's full dimensions), the engine matches transformers run on the same dequantized weights: identical predictions and experts at every position, residual streams within 2×10−5, identical greedy text (tools/glm_ref.py).
Chapter 20
How the numbers are checked
A visualiser is only as trustworthy as its arithmetic. Every model in the tool is a from-scratch implementation, and each is compared with a reference.
- Built-in models. GPT-2 matches a reference implementation to four decimal places; MDLM to about 0.00001.
- Hugging Face models marked Verified are checked against the reference library (transformers): the same next word, at least nine of the same top ten guesses, and probabilities within 0.0013 at worst. Others use a supported design but are not checked one by one; the status line says which applies.
- The GPU path is checked against the CPU path recording by recording on the same prompt: the internal state at every depth, attention, neurons, the lens at every depth, attribution and interventions. They agree to about one part in 100,000 for most models (one in 10,000 for Pythia, whose large activations magnify rounding), with probabilities within 0.001.
- Attribution is exact by construction (its shares add up to the score), and was checked against independent computations to about 1e-5.
- A KnowDrive store's vector head (Chapter 18) is checked against KnowDB itself: recovered question vectors reproduce KnowDB's scores to 2×10−7, and the browser's top 50 matches KnowDB's list in order for all ten example questions.
- GLM-5.2 (Chapter 19) is checked on test models in its container format against transformers on the same dequantized weights: identical predictions, experts and greedy text, residuals within 2×10−5.
- Eight-bit weights (§16.4) are a deliberate approximation, checked against the full-precision model on the GPU; the status line reports how far the weights moved, and the figures in §16.4 show how far the predictions move.
The sections at the top of this page classify every element of the screen as real (the model's own numbers), derived (a standard technique applied to them) or illustrated (a drawing to make them readable); what you write yourself, the names and notes you give neurons, is tagged yours. When in doubt about a view, its row there says which it is.