Are a small model’s neurons already clean?
Here is the start of a Linux device driver. I gave it to Qwen3-8B, an open language model, and let it write the body of dev_open():
// SPDX-License-Identifier: GPL-2.0
/*
* Simple character device driver
*/
#include <linux/module.h>
#include <linux/fs.h>
#include <linux/uaccess.h>
static int dev_open(struct inode *inode, struct file *file)
{Left alone, it writes the stub you’d find in any character-driver tutorial, which is what that header invites: log the call and report success. It did this in all three of its normal runs.
printk(KERN_INFO "dev_open\n");
return 0;
}Then I forced a single neuron, one of the 442,368 MLP neurons in the model, to stay switched on, and asked again:
// Close the device
// This is the same as the original code
// So, the device is closed when it's opened
// So, the device is closed when it's opened
// So, the device is closed when it's opened
…Hoist by its own petard
The neuron isn’t mine to take credit for. Goodfire’s essay “Neural Networks Are Already Clean” studies individual neurons in larger Qwen models, and one of them, L38/N15589 in Qwen3-32B, is “a neuron for when your own side turns on you”. It fires when someone’s trouble comes from something of their own: a leader who “died at the hand of his own creation”, Actaeon killed by his own hunting dogs, a judo throw that uses the attacker’s own weight. Goodfire named it after the idiom “hoist by your own petard”, caught in your own trap.
Neuron numbers don’t carry over between models, so I went looking for the same idea in the smaller Qwen3-8B, which fits on my home GPU. I wrote sets of test sentences modeled on Goodfire’s: harm done by your own side, kindness done by your own side, harm done by an outsider, and a plain “his own” with no harm at all. The best match, which also held up on sentences held back from the search, was N5977 in layer 12. On ordinary web text its strongest examples read like a list of backfires: “actually boomeranged on the Powers”, “tripped over your own feet”, “a nation divided against itself”, “possibly by friendly fire”.
On real text this neuron never gets much above +6. To steer the model, I clamped it to a fixed value at every token and let it write code: six beginnings of kernel C files and two chat requests asking for driver code.
Setting it to zero changes nothing that matters. Turning it up makes the code turn on itself.
At +15 the code still looks fluent. One prompt asked for a function that “must be called with drv->lock held”. Qwen wrote a helper with the same rule, and then ended it by releasing the caller’s lock:
/* Allocate the driver's DMA buffer. Must be called with drv->lock held. */
static void mydrv_alloc_buf(struct mydrv *drv)
{
...
drv->buf = buf;
spin_unlock(&drv->lock);
}At +30, in every prompt, at least one run turned self-defeating or self-referential. Asked to continue a probe() function, which sets up a device, it set up the device and then freed it, and then freed something inside the thing it had already freed (comments translated from Chinese):
// 1. allocate a struct
drv = kzalloc(sizeof(*drv), GFP_KERNEL);
// 2. initialize the struct
ret = mydrv_init(drv, pdev);
// 3. free the struct
kfree(drv);
// 4. free resources
kfree(drv->data); // free the data
}Its remove(), which should tear a device down, allocates a new one instead. And cleanup functions call themselves forever:
void mydrv_unmap(struct mydrv *drv, struct mv *mv)
{
int i;
for (i = 0; i < MAX_MV; i++) {
if (i == 0)
continue;
mydrv_unmap(drv, mv);
}
}Asked in chat for a kernel module, it stopped writing code and explained the idea instead: “This is often referred to as ‘self-referential’ programming. The idea is that the module can be used to monitor its own operations.” At +60 it collapses into lines like “the code is used to test the code”.
Is that just what happens when you jam any neuron on? I clamped four random layer-12 neurons at +30 on the same prompts. They break the output too, but differently: // End of code. over and over, “The code is a placeholder”, “The code is not shown here”. None of the self-sabotage, none of the self-reference.
That is eight prompts, with one greedy run at each setting and two extra sampled runs at +30, judged by me, so treat it as a striking anecdote rather than a measurement. But it shows something about how clean a single neuron can be. A neuron that Goodfire found behind stories of poetic justice in one model has a counterpart in a smaller one. Forced on, the counterpart turns kernel code against itself: locks released by the code meant to hold them, memory freed by the code meant to set it up, cleanup that never ends.
Sorting all the neurons
The petard neuron was found by hand, by writing sentences for one idea and searching for a match. The rest of this post asks a broader question: what do you see if you look at all of a layer’s neurons at once?
Inside each layer of a language model sits an MLP: thousands of neurons in no particular order. Their order really is arbitrary. You can shuffle a layer’s neurons, carrying each one’s weights along, and the model computes exactly the same thing. So if you re-sort a layer’s neurons by what they fire on, do they fall into groups? Big departments, small teams, or nothing at all?
Think of a library whose shelves are in random order, but where every book has a record of who borrowed it. Group books that the same readers borrowed, and related books end up together. I did the same with neurons, using the text that makes them fire in place of readers.
The setup
Qwen3-8B has 36 layers with 12,288 MLP neurons each.
A neuron can be negative as well as positive, and its two directions often mean different things. So I split each neuron into two poles, which I treat as separate units. A pole fires on a token when its neuron passes that pole’s top-0.5% threshold, so each pole fires on about one token in 200.
Then I ran 544,000 tokens of web text (FineWeb) through the model and recorded which poles fired on which tokens. Two poles count as similar if they tend to fire on the same tokens. Clustering by that similarity gives groups I call families: at least five poles that tend to switch on together. Where exactly a family ends depends on a cutoff I chose, so the family counts below depend on it too.
One trap: some poles in early layers are nearly silent, with peaks around 0.01. Their tiny thresholds get crossed by the same few noise tokens, so 1,241 of them at layer 4 formed one giant fake family. I drop poles that never get above 5% of the layer’s typical peak.
Small families, no departments
At layer 30, sorting finds 498 families covering about a fifth of the units. The largest has only 94 members. That is the main result: lots of small teams and no big departments.
What the families are about changes with depth:
| Layer | Families | Replicates | What the families are about |
|---|---|---|---|
| 4 | 607 | 89% | Surface form: word pieces, punctuation, separators. The largest (599 units) is mostly machine-spun spam |
| 12 | 178 | 81% | Topics (court cases, cooking, music) next to surface form |
| 20 | 235 | 94% | Mostly surface form again: digits inside numbers, quotes, name fragments |
| 26 | 430 | 83% | Topics (tax law, court opinions, cars, Christian text) plus grammar (“have/has”, “there is”, “not”) |
| 30 | 498 | 77% | Topics; the cleanest layer |
| 34 | 451 | 80% | Spelling and style: words starting with M or S, all-caps, spam. Partly organized by the next token |
“Replicates” is my stability check. I reran everything on a second set of documents with none in common, and counted how often a pole’s closest partner was still among its ten closest.
Layer 20 is a dip, back to surface form between two topic layers. It shows up again in the vision experiment below.
Can anyone name these families?
To see whether the families mean anything, I had LLMs name them. To keep this honest, I mixed the 30 largest families in each layer with six random groups of the same sizes, and the namer didn’t know which was which.
No random group ever got a theme: Claude Sonnet and Claude Opus each called all 36 “mixed”. Real families did much better, but how much better depends on the layer. At layer 30 the separation is perfect: Sonnet called 22 of the 30 largest families clear and none mixed. At layers 4 and 34 the line blurs: many real families get called mixed too.
Stability and nameability tend to run in opposite directions. Layers 4 and 20 replicate best and are among the hardest to name. Layer 30 is the easiest to name and replicates least. My guess at why: word pieces and punctuation recur in any text, while which topics show up depends on the sample. With six layers, that’s a tendency, not a law.
The namer matters most at layer 34. Opus called twice as many of its families clear as Sonnet did. And one family there no namer caught at all: its members fire on the first part of a verb right before an “-s” ending (ev|okes, cul|minates, St|ands). Its output words are “states”, “writes”, “forces”. It’s organized around the token that comes next, which a namer looking at what a neuron fires on can’t easily see.
Same trigger, different output
Each neuron reads its input through one set of weights and writes its output through another. For the 20,000 most strongly co-firing pairs at layer 30, the reading weights point in similar directions: cosine 0.073, against 0.008 for random pairs. The writing weights barely do (0.007 against 0.000).
So a family is units that respond to the same situation and then each do something different with it. It’s a team, not a set of copies.
Pairs often join one neuron’s positive pole with another neuron’s negative pole. In “as soon as possible”, for example, N964+ fires together with N8793−. That’s why poles, not whole neurons, are the right unit.
Do late layers predict the next token?
Partly. I showed the namers what came after each firing as well as what the units fired on, and asked which described a family better.
At layers 4 and 12, almost no family is described better by what comes next. From layer 20 on, some are:
- Layer 20 is mostly digits. Inside a number, the next token is another digit, so what the units read and what comes next coincide.
- Layer 26 is grammar: a possessive before the owned noun, “if” before “you”, “there” before “is/are”.
- Layer 34 has the families defined by the next token alone: a verb stem before its “-s” or “-ed”, the start of a surname before the rest, words inside quotes before the closing quote.
At layer 34, 12–13 of the 30 largest families are described at least as well by their output as their input, and 4–6 by the output alone. Most are still better described by what they read. Layer 30 topics are almost all read, not predicted.
Code reorganizes topics
I repeated the analysis on code: about 1.3 million tokens from GitHub, 70% code in 12 language groups and 30% config files. The two halves came from different repositories.
Layers that are about surface form keep their families on code. At layers 4 and 20, 91–99% of web families still fire together on code, keeping roughly half their strength. Topic layers fall apart. At layers 12, 26 and 30, web families keep only 17–24% of their strength, and layer 30 forms half as many families on code as on web.
Layer 34 on code has one giant family of 1,589 units. Its members’ output words are plain prose (look, pure, trade, likely, guarantee), and it fires in comments, license headers, docstrings and non-English strings. I first guessed it was a “prose inside code” block. Then a later check muddied that: the moments when most of the family fires at once are mostly right before a number (“Copyright © 2…”, encoding="utf-…), which is also true of the biggest web family at layer 34. Those moments are only about a fifth of its firing, so I don’t know yet which reading is right.
Is there a Linux neuron?
Since the petard neuron had such strong opinions about kernel code, I also looked for the opposite of a clean concept neuron: a neuron for Linux kernel source itself.
I compared 256-token chunks of C from four groups: the Linux kernel, other kernels (FreeBSD, OpenBSD, Zephyr…), ordinary userspace programs, and embedded code. I picked units on one half of the chunks and tested them on the other.
The best was L26/N5109−, which tells Linux apart from everything else almost perfectly on the held-out half (AUROC 0.987). It fires on 29% of Linux tokens and on about 1% or less of everything else. Its strongest tokens are Linux’s error-handling idiom and headers: if (ret) return ret;, if (IS_ERR(...)), goto unlock;, #include <linux/...>.
Is it just reacting to Linux coding style? I rewrote Linux code into BSD style and BSD code into Linux style, swapping return x; for return (x);, ret for error, and <linux/...> for <sys/...>. The unit barely moved: 29.2% before and 27.7% after on Linux, and BSD-in-Linux-style rose only from 1.3% to 3.3%. So those style markers aren’t its trigger, though they may still contribute. It probably reads many cues spread across the chunk.
Still, it isn’t a clean “Linux neuron”. Its other pole and its strongest activations on web text are unrelated. The same goes for the other Linux units I found: each is a strong, replicable Linux signal and something else. There are also kernel-general units that fire on any kernel, such as L26/N11186−, whose output words are “Windows” and “OS”. These are all exploratory results from 51 Linux files.
Photos and words share neurons
Qwen3-VL-8B is a version of the same model that can also see images, and its language neurons match Qwen3-8B’s almost exactly, index for index. That means I could show the same units photos and sentences.
I used 400 photos from 10 easy classes (tench, garbage truck, French horn, golf ball…) and 400 sentences about the same classes. For each photo, I asked which class’s sentences made the units fire most like the photo did.
From layer 12 on, the answer is almost always the photo’s own class (98–100%), with no training. Layer 20 dips to 78%. Layer 4 is at chance, 10%.
The shared units land in the web families you’d hope for. Tench photos light up “zoology: species taxonomy”. Garbage trucks light up “dumpsters, debris, construction”, French horns “music: bands, artists, albums”, and golf balls “sports equipment”. Some are odd: parachutes light up “superhero comics”.
This is an easy test, though. The classes are very different from each other and the sentences repeat the class name. Even a random tenth of the units gets 97–98% at layers 12 and 30.
Dog breeds
A harder version used ten dog breeds (Samoyed, beagle, dingo, golden retriever…), with breed sentences written by DeepSeek.
| Layer | Photo matches its breed | Shuffled labels | Random 10% of units |
|---|---|---|---|
| 4 | 14% | 9% | 16% |
| 12 | 39% | 10% | 26% |
| 20 | 22% | 13% | 17% |
| 26 | 42% | 8% | 27% |
| 30 | 65% | 10% | 39% |
| 34 | 47% | 10% | 29% |
Matching still works, but it is weaker and peaks later, at layer 30. At layer 12 only the distinctive breeds match: Samoyed 98%, Border terrier 90%. At layer 30 seven of ten breeds match at 78–95%, but beagles and Australian terriers almost never do.
Almost no single unit is breed-specific in both photos and text, so breed seems to be carried by the overall pattern rather than by dedicated units. One fun exception: Samoyed photos light up a unit from a family named “Russia and Eastern Europe”. The breed is named after the Samoyedic peoples of Siberia. It’s one unit, so take it as a nice anecdote.
Tool calls, and a trap
Finally, I tried transcripts of a model calling tools: a system prompt describing the tools in JSON, a user request, the model’s tool call, and the tool’s response.
The first maps looked dramatic: 15,000–17,000 units in families per layer, against 1,400–5,700 on web text, and one solid block of 1,027 units at layer 12. That block turned out to be a single token, <tool_response>. At layers 30 and 34, about 300 of roughly 470 families were units that all fire at one word of the system prompt: “You”, “are”, “tools”…
The cause was repetition. About 60% of the 1,500 transcripts share the same system prompt, word for word. Identical text produces identical activations, so each word of that prompt added the same co-firing about 900 times. Co-firing counts every copy as fresh evidence, so repeated boilerplate manufactures families out of nothing.
The fix: skip the chat-template special tokens, and skip every position whose preceding 8 tokens appear in more than 2% of transcripts. That drops about 41% of positions.
After filtering:
- The biggest families shrink from 1,027 / 381 / 1,826 units at layers 12, 30 and 34 to 142 / 545 / 936. The 936 is a loose family, not a storm on one word.
- Replication on the other half rises to 91–95%.
- 77–85% of tool-call families also fire together on web text, up from 49% at layer 12 before filtering.
- DeepSeek, naming without the blind test, calls 32–43% of families clear.
The lesson, if you try this yourself: deduplicate templated text first, or it will hand you families that are really just copies.
Wrapping up
This is a hobbyist’s map, not a final answer. A neuron Goodfire found in Qwen3-32B has a counterpart in Qwen3-8B that, forced on, turns kernel code against itself. Families replicate. How nameable they are depends on depth. Code reorganizes topics. Linux source is a strong context signal spread over several units, not one clean neuron. Photos and sentences about the same thing light up the same units from layer 12 on. And templated text manufactures families unless you filter it. All of these are preliminary, descriptive results: co-firing shows what happens together, not what causes what.
You can explore the families yourself in the interactive atlas, and the details are in the paper.
Credits: the petard neuron is Goodfire’s discovery in Qwen3-32B; the Qwen3-8B counterpart and the code experiments are ours. Claude Opus 5.5 ran the analysis, with Claude Sonnet and Haiku agents running some scripts and most naming passes. DeepSeek named the tool-call families and wrote the dog-breed sentences. This post was co-written by Claude and DeepSeek.