Interpretability
A language model, opened up in your browser.
Type a text and watch GPT-2 small read it: what it expected after every token, where each of its 144 attention heads looks, the answer forming layer by layer, and the features a sparse autoencoder finds in its thoughts, each with a written explanation. Then push a feature or silence a head and see what changes. The model runs in your browser; nothing is uploaded.
- Web
- Free
- Private
- 124 million parameters, run in plain JavaScript in your browser
- 144 attention heads, each one's pattern drawn on your text
- 24576 named features per autoencoder, with Neuronpedia's explanations
- 0 bytes sent to a server
Six areas. Read, look, trace, name, steer, open.
A text box and the tokens it becomes, each coloured by how much the model expected it. The other areas follow the token you click: the heads reading it, the layers deciding on it, the features on for it. The last area shows what the model is made of and what is in your browser's cache.
Text
Type anything, press Run. GPT-2 small reads it in your browser and the tokens come back coloured by surprise; click one to see the ten tokens the model expected instead, with their probabilities. Continue lets the model write the next tokens, with temperature, top-k and a seed.
Attention
The 144 heads in a grid, each with its pattern on your text, and the selected head enlarged: rows are the token looking, columns the tokens looked at. Four scores measured in advance mark the heads with a job: previous token, induction, duplicate token, first token.
Residual
The logit lens reads the residual stream before every block, so you see the answer form layer by layer, with the probability of the token that actually came. Direct logit attribution says how much each head and each MLP added to that token's score, for and against.
Features
A sparse autoencoder of the residual stream, for four of the twelve blocks: 24,576 features each, with Neuronpedia's explanation of what each one responds to. See which are on for the selected token, search the explanations, and colour the text by where a feature fires.
Steer
Push a feature up or down with a coefficient, silence a head or an MLP, and compare: how much the prediction after every token moved, the next token before and after, and two continuations written side by side from the same seed.
Inside
What GPT-2 small is made of and what each part weighs, the autoencoders, what sits in your browser's cache and how to remove it, how long the last run took, and where the model, the autoencoders and the explanations come from.
The text stays in the tab. So does everything the model thinks.
The weights are downloaded from this site and kept in your browser's cache; the text, the activations, the features and the continuations are computed in this tab and never sent anywhere. There is no server behind the page.
- The model runs on your machine, in a Web Worker
- No account, no upload, no server behind the model
- Links to Neuronpedia open in a new tab, and only when you click them
Requirements
- Runs in
- A recent browser; a desktop is faster than a phone
- Downloads
- 157 MB for the model, the first time; 38 MB for each autoencoder you open
- Reads
- Up to 128 tokens of text at a time, about a paragraph
- Account
- Not needed
- Price
- Free
Questions
Do I need to install anything?
No. The model runs in the page, in plain JavaScript inside a Web Worker. Its weights are downloaded the first time you press Run and kept in the browser's cache; each autoencoder is downloaded when you first open its block in Features.
How fast is it?
On a recent laptop a paragraph of 60 tokens takes about two seconds to read, and the model writes around ten tokens a second. A phone takes several times longer. The text is limited to 128 tokens so that every area stays quick.
Is this the real GPT-2?
Yes, OpenAI's GPT-2 small with its 124 million parameters, re-exported with 8-bit integers in the blocks and 16-bit in the token embedding. Against the original in float32 the difference is 0.001 nats on average, and the top prediction is the same on every position of the test text.
What is an autoencoder feature?
The residual stream carries many things at once in 768 numbers. A sparse autoencoder trained on it rewrites each vector as a sum of 24,576 directions of which only a few dozen are on for any token, and those directions turn out to mean something: a feature for years, one for code, one for a name that was mentioned before. The explanations come from Neuronpedia, written by a language model shown the texts where each feature fires most, so take them as a first reading.
What does steering do?
It adds a feature's direction to the residual stream entering its block, on every token, scaled by the coefficient you set. The model then behaves as if that feature were on, and its predictions and continuations change accordingly. Silencing a head or an MLP sets its output to zero, which shows what the model can still do without it.
Why these four blocks for the features?
The autoencoders are 38 MB each, so the page ships four of the twelve: blocks 4, 6, 8 and 10, from early to late, which is where the features go from spelling to meaning. They are Joseph Bloom's, trained on GPT-2 small's residual stream.