[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-116254":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":16,"stars30d":16,"stars90d":15,"forks30d":15,"starsTrendScore":17,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":20,"hasPages":20,"topics":22,"createdAt":10,"pushedAt":34,"updatedAt":35,"readmeContent":36,"aiSummary":37,"trendingCount":15,"starSnapshotCount":15,"syncStatus":38,"lastSyncTime":39,"discoverSource":40},116254,"neuron-lens","stdlogits\u002Fneuron-lens","stdlogits","A catalog of every MLP neuron and attention head of Qwen3-8B and Gemma 4 12B, read from the weights through two Jacobian lenses (R and S), from activations, and from their exact token drivers","https:\u002F\u002Fneuron-lens.com",null,"Python",61,5,54,0,6,1,45.93,"MIT License",false,"main",[23,24,25,26,27,28,29,30,31,32,33],"attention-heads","gemma","interpretability","llm","logit-lens","mechanistic-interpretability","multimodal","neurons","qwen3","r-lens","s-lens","2026-11-23 18:16:52","2026-11-23 18:14:47","# neuron-lens\n\nWhat does each part of a large language model do? This project reads every MLP neuron and every\nattention head of two open models, [Qwen3-8B](https:\u002F\u002Fhuggingface.co\u002FQwen\u002FQwen3-8B) (442,368 neurons,\n1,152 heads) and [Gemma 4 12B](https:\u002F\u002Fhuggingface.co\u002Fgoogle\u002Fgemma-4-12B) (737,280 neurons, 768 heads),\nthree ways: from their weights alone, through two Jacobian lenses; from what they do on 15M tokens of\nreal text; and from the exact tokens that drive them. Gemma 4 also takes images and sound, so its\nneurons are read through images and sound too. The result is a public catalog, the lenses that\nproduced it, and measurements of how each way of reading compares with steering, firings and token swaps.\nThe rest of the Qwen3 family up to 14B, post-trained and base, is catalogued the same way without\nlabels, to see what changes with size.\n\n- **Lenses:** [`stdlogits\u002Frs-lenses`](https:\u002F\u002Fhuggingface.co\u002Fstdlogits\u002Frs-lenses), the R-lens and S-lens\n  for Qwen3-8B, for Gemma 4 12B in text, images and sound, and for Qwen3 from 0.6B to 14B, post-trained and base.\n- **Catalog:** [`stdlogits\u002Fneuron-lens`](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fstdlogits\u002Fneuron-lens): every\n  neuron's and head's reads, activation statistics, token drivers and tests of each read; what the residual\n  holds where each neuron fires, what drives it and how neurons are wired; labels in\n  words; for Gemma 4, what each neuron responds to in images and sound; and the same tables for nine more\n  Qwen3 models, with labels for the post-trained ones.\n- **Results:** [docs\u002Ffindings.md](docs\u002Ffindings.md). **Methods:** [docs\u002Fdesign.md](docs\u002Fdesign.md).\n\nBy [@_a9lim](https:\u002F\u002Fx.com\u002F_a9lim) and [@treetowntree](https:\u002F\u002Fx.com\u002Ftreetowntree), with Claude. [Matthew Khoriaty](https:\u002F\u002Fwww.lesswrong.com\u002Fusers\u002Fmatthew-khoriaty) raised the\nquestion of what MLPs add beyond amplifying their input and suggested the orthogonal write read (finding 18).\n\n## Background\n\n### Neurons and heads\n\nA transformer keeps one vector per token, the *residual stream* (4,096 numbers in Qwen3-8B). Each of its\n36 layers reads that stream and adds to it, in two steps:\n\n- **Attention heads move information between tokens.** At each position, a head looks back over the\n  earlier tokens and copies something from them into the current one. Its *QK circuit* decides where it\n  looks; its *OV circuit* decides what it copies. Qwen3-8B has 32 heads a layer. Head L20h17, for\n  example, copies *she* forward and pushes against *he*.\n- **MLP neurons transform what is already there, one position at a time.** A neuron measures how\n  strongly the stream points along a direction it reads (its *activation*), then adds a fixed vector\n  (its *write*) scaled by that activation. Qwen3-8B has 12,288 a layer. In Qwen's SwiGLU MLPs the\n  activation is a gated projection of the stream times a plain linear one (\"gate\" times \"up\"), so it\n  can be positive or negative, and each neuron has two *poles* that can mean different things.\n  `L8 n344 +` (layer 8, neuron 344, positive pole) fires on *owl* and writes toward owls and night.\n\nAt the bottom, the embedding matrix `W_E` turns each input token into its starting vector; after the\nlast layer, a final normalization (`norm`, an RMSNorm) and the unembedding matrix `W_U` turn each\nposition's vector into next-token probabilities. Gemma 4 12B is built the same way, with 48 layers,\n16 heads and 15,360 neurons a layer (GELU in place of SiLU in the gate, so its neurons have two poles\ntoo), and its input positions can also hold a patch of an image or 40 ms of sound.\n\n![What neurons and heads do](docs\u002Ffigures\u002F01_anatomy.png)\n\nSo \"what does this unit mean?\" has two halves: what makes it fire (its *input side*) and what its output\ndoes to the model's predictions (its *write side*). Running the model samples either one: activations over\na corpus show where a unit fired, and *steering* (adding a unit's write and watching the predictions move)\nshows what a push does. A *lens* answers either half from the weights alone, by turning a vector inside\nthe model into a ranking over tokens, averaged over the contexts it was fitted on.\n\n### Lenses: from the logit lens to the R-lens and S-lens\n\n![The lens family](docs\u002Ffigures\u002F02_lenses.png)\n\n- **Logit lens** ([nostalgebraist,\n  2020](https:\u002F\u002Fwww.lesswrong.com\u002Fposts\u002FAcKRB8wDpdaN6v6ru\u002Finterpreting-gpt-the-logit-lens)). Read a\n  vector `h` at layer `L` as if it were already at the output: `softmax(W_U · norm(h))`. This works\n  near the output and reads mostly noise early on, because the remaining layers transform `h` heavily.\n- **J-lens** ([Gurnee et al., 2026](https:\u002F\u002Ftransformer-circuits.pub\u002F2026\u002Fworkspace\u002F)). Instead of\n  ignoring the later layers, linearize them. `J_L` is the Jacobian of the final residual with respect to\n  layer `L`'s, summed over the current and later positions (so effects carried by attention count) and\n  averaged over a corpus. The read is `softmax(W_U · norm(J_L h))`: what `h` makes the model say, on\n  average, after everything downstream has acted on it.\n- **R-lens** ([camilablank et al.,\n  2026](https:\u002F\u002Fwww.lesswrong.com\u002Fposts\u002Fnv8oedrnLXKRzNEL9\u002Fr-lens-making-j-lens-more-faithful-on-early-layers)).\n  The same average Jacobian, taken under [RelP](https:\u002F\u002Farxiv.org\u002Fabs\u002F2508.21258)'s propagation rules\n  instead of the true gradient: norm scales held constant, the SwiGLU gate linearized, and the\n  gate-times-up product passing half of each factor's change. On Qwen3-8B it predicts what steering a\n  neuron does better than the J-lens from layer 4 to 23.\n- **K-lens and S-lens.** The J-lens and R-lens look forward, to the output. Theia Vogel's K-lens\n  ([@voooooogel, 2026](https:\u002F\u002Fx.com\u002Fvoooooogel\u002Fstatus\u002F2084858861551526002), unpublished) takes the\n  Jacobian the other way, back to the input embeddings: `K_L` averages the Jacobian of layer `L`'s\n  residual with respect to the current and earlier token embeddings, and a direction `c` scores each\n  token `v` by `c · K_L (W_E[v] − mean(W_E))`, answering which input tokens put that direction there.\n  The S-lens, introduced here, is the K-lens under RelP's rules, as the R-lens is the J-lens under\n  them. Under those rules the R-lens's backward map is exactly the transpose of the S-lens's forward\n  one, so one estimator fits both.\n\n| lens | maps a vector `h` at layer `L` with | reads with | answers |\n|---|---|---|---|\n| logit | nothing | `W_U` | what `h` says if nothing downstream acts on it |\n| J \u002F R | `J_L = mean_t Σ_{t'≥t} ∂h_final(t')\u002F∂h_L(t)` | `W_U` | what `h` makes the model say later (true \u002F RelP derivatives) |\n| K \u002F S | `K_L = mean_t Σ_{s≤t} ∂h_L(t)\u002F∂e(s)` | `W_E` | which input tokens put `h` there (true \u002F RelP derivatives) |\n\nFor each model, both lenses are fitted on the same 1,000 documents of\n[DCLM](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002FHuggingFaceFW\u002Fdclm_100BT-shuffled) (128 tokens each), at 11-16\ns per document per lens on one H100; Gemma 4's are also fitted on images (COCO) and sounds (ESC-50).\nFitting needs no training objective: each is an average of exact linearizations. An R-lens read is\nscale-free (the final norm removes a vector's size), and the catalog's S-lens reads use unit\ndirections, so reads describe directions, not effect sizes.\n\n## The catalog\n\nEvery neuron has a `+` and a `−` pole, so the catalog has 884,736 neuron entries and 1,152 heads for\nQwen3-8B, and 1,474,560 neuron entries and 768 heads for Gemma 4 12B. Qwen3-0.6B, 1.7B, 4B and 14B and the\nbases 0.6B to 14B add 6,103,040 neuron entries and 8,448 heads, labelled but for the bases. Each is read from three sides:\n\n- **from the weights,** through both lenses: what a neuron writes and what its read direction responds\n  to; what a head copies (OV) and attends to (QK), token by token;\n- **from activations** over 15M positions of web, Chinese, Python and chat text: how hard and how often\n  it fires, and its top contexts;\n- **from exact token drivers:** every common token substituted at one position of 8 real documents,\n  to measure which tokens directly make the unit fire.\n\nFor Gemma 4, each neuron is also read through images and sound: which of 49,694 labelled images and\n49,703 labelled sounds make it fire, what its read direction looks like as a patch of pixels or 40 ms\nof sound, and a pattern optimised to drive it.\n\nEither lens can read either side of a neuron. Applied to its read direction, the R-lens says what the\nstream is about to say when the neuron fires, and the S-lens which input tokens put it there; applied\nto its write, the R-lens says what the write makes the model say, and the S-lens which tokens'\n*footprints* it imitates (a token's footprint is the average change it makes to the stream at that\nlayer). Raw reads share *hub tokens* that top many units' reads at once (` the`, ` and` early);\nthe catalog also keeps *layer-contrastive* reads (`_z`), each token's score z-scored across the\nlayer's units, which remove them. Each pole also has its write with what it reads removed (`write_orth_*`),\nthe cosines of its write with the gate and up rows it reads (`cos_write_gate`, `cos_write_up`), and, from activations, the\nresidual, MLP output and model prediction at its firings (the `firings` table) and what drives it\nwhen it fires and what fires with it (`sources`, beside the weight `edges`).\n\nSome Qwen3-8B neuron entries (top tokens, abridged; ⟦ ⟧ marks the token where it fires):\n\n| pole | fires on | exact drivers | R-lens read of its input | R-lens read of its write |\n|---|---|---|---|---|\n| `L1 n11672 −` | 德⟦國⟧ (Germany) | 德国, german, Germany | noise (S-lens read: German, Germany, 德国) | German, Germany, then hub tokens |\n| `L8 n344 +` | the sound of the⟦ ow⟧ls | owl, Owl, OWL, Athena | owl, 星空 (starry sky), Owl | owl, noct, bedtime, night |\n| `L8 n1931 +` | non-B⟦ib⟧lical, God's⟦ Word⟧ | biblical, 圣经 (Bible), Scripture | 圣经, 基督教, 信仰 (faith) | 圣经, 基督徒, Bible, Scripture |\n| `L28 n8868 −` | quite⟦ arist⟧ocratic, a⟦ plut⟧ocracy | arist, bureauc, democr, anarch | democracy, 民主 | democracy, 民主, democratic |\n| `L30 n1034 +` | is⟦ once⟧ again | Once, once | again, 再次 | again, 再次, Again |\n| `L35 n9510 +` | hashes and IDs: jsessionid=⟦0⟧000 | unrelated words | punctuation | none: it sets the output's temperature |\n\nAnd some heads, read from the weights:\n\n| head | what its weights say |\n|---|---|\n| `L20h17` | copies *she, herself, 她* and suppresses *he, himself* (and the reverse when it reads *himself*) |\n| `L26h31` | copies quantities: weight, 体重 (body weight), strength, temperature |\n| `L34h1`, `L32h9` | L34h1 copies surnames (Heller, Crosby, Gallagher); L32h9, a copy-suppression head, suppresses the same ones |\n| `L1h28` | a duplicate-token head: as a query it seeks the same token again (Paris → Paris), and copies almost nothing |\n| `L0h27` | attends to the starts of code and documents (`\u002F*`, `import`) |\n\nNeurons and heads get the same four tables, one row per pole or per head: `reads` (weight-only lens\nreads), `acts` (activation statistics and top firings), `drivers` (exact token drivers) and `labels`\n(Claude Haiku's labels in words).\nNeurons add `firings` (what the residual holds, what the MLP layer writes and what the model predicts where a pole\nfires, and how much the pole amplifies what it reads and adds off it), `edges` (each pole's strongest direct weight edges from earlier poles and to later ones) and `sources` (what drives\na pole when it fires, and what fires with it). Gemma 4 adds `image` and `audio` tables, per neuron and per head. The [dataset card](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fstdlogits\u002Fneuron-lens) documents\nevery column.\n\n**Which read to use where.** No single read works at every depth. The S-lens names what early neurons detect, and the R-lens\nsays what a neuron writes and, from the middle of the network on, what it reads\n(findings [§7](docs\u002Ffindings.md#7-what-each-read-names)). For Qwen3-8B (Gemma 4's map has the same shape at its own depths: the S-lens\nfor inputs through L13, and the R-lens for inputs and writes from L11;\n[§13](docs\u002Ffindings.md#13-gemma-4-12b-the-text-catalog-in-a-second-model)):\n\n| layers | what drives a pole | what a pole writes |\n|---|---|---|\n| L0-L7 | the S-lens read of its read direction (literal tokens) | the S-lens read (early neurons write back the tokens they detect); the R-lens from about L4 |\n| L8 | both lenses, agreeing most | both |\n| L9-L12 | the R-lens read of its read direction (concepts) | the R-lens read: what steering does |\n| L13-L20 | the R-lens read, with exact drivers and top contexts beside it | the R-lens read, for steering |\n| L21-L35 | the R-lens read of its read direction | the R-lens read: what steering does, the next token from about L23, suppression from L32 |\n\n![Which reads work at which depth](docs\u002Ffigures\u002F03_depth_map.png)\n\n## Findings\n\nFindings 1-12, 17, 18 and 21 are Qwen3-8B's, 13-16 Gemma 4 12B's, and 19 and 20 compare Qwen3's sizes. Numbers are medians or means over a layer's poles\nunless stated. Each heading links to its findings section, with setup, controls and limits.\n\n### 1. The lenses are stable, and their corpus changes tokens, not concepts\n\nFitting each lens on two halves of its corpus gives matrices that differ by at most 6% at every layer,\nand the R-lens halves' reads of neurons' writes share their top token for 89-99% of neurons. An R-lens\nfitted on chat conversations instead shares the top token with the web-text lens for only 31-51% of\nneurons through L16, yet reads the same concepts in a different order and scores the same on every\ncausal test, chat-format ones included\n([§1](docs\u002Ffindings.md#1-the-lenses-stability-and-corpus-dependence)).\n\n![Split-half reliability of the lenses](docs\u002Ffigures\u002F04_lens_reliability.png)\n\n\u003Cdetails>\u003Csummary>A chat-fitted lens predicts steering as well as the web-text lens\u003C\u002Fsummary>\n\n![Chat-fitted lens against the DCLM halves](docs\u002Ffigures\u002F05_chat_lens.png)\n\n\u003C\u002Fdetails>\n\n### 2. Activations: where neurons fire\n\nOver 15M positions, the typical activation is flat at 3-5 from L5 to L21 and grows tenfold to L35. At\nL1, 56% of poles are near-silent; at L2-L3, most poles do their work at the first position alone.\nChinese-selective poles sit at both ends of the network, code-selective ones at L20-L29, and poles\nselective for the chat slice fire on ChatGPT's register (\" delve\", \"As of 2021\")\n([§2](docs\u002Ffindings.md#2-activations-over-15m-positions)).\n\n![Activation statistics](docs\u002Ffigures\u002F06_activations.png)\n\n### 3. A neuron's write, read from weights alone, predicts what steering it does\n\nAdd a pole's write vector, at about its typical activation, to 48 positions of 16 web documents,\nmeasure the change in next-token log-probabilities, and correlate it with the lens's read of the same\nvector. The R-lens reaches a median r of 0.45-0.50 at L4-L8, 0.65-0.75 at L12-L16 and 0.9 or more from\nL22, against ±0.04 for another neuron's read. It leads the J-lens by 0.03-0.13 from L4 to L23; the logit\nlens trails until about L20 (L8: 0.49 against 0.12). From L5, 94-100% of random poles' writes predict\ntheir own steering effect, against 0-6% for mismatched pairs\n([§3](docs\u002Ffindings.md#3-a-writes-lens-read-predicts-what-steering-it-does)).\n\n![Lens reads against steering](docs\u002Ffigures\u002F07_steering.png)\n\n### 4. One firing is one sample of what a write does\n\nA pole's write read predicts what steering it does (finding 3), yet it rarely names the token after a firing: before L22,\n1-4% of poles (net of chance) promote the tokens that follow their top firings, against 31-32% at L28-L29. An exact\nlinearization of 2,290 poles at their real firings shows why the two differ. A firing's effect is close to linear, but before L21\nit depends on its context: the same pole, firing equally hard, pushes the predictions different ways in different documents, so\nits firings barely predict each other (r 0.05-0.11; from L28: 0.78), and against a single firing the weight-only read gets 60-85% of\nthe correlation the pole's own other firings get. The lens and steering agree because both average over contexts. A write read\nis the pole's average push, and a firing is one context's share of it\n([§4](docs\u002Ffindings.md#4-one-firing-is-one-sample-of-a-write)).\n\n![Amplified against in context](docs\u002Ffigures\u002F08_amplified_vs_in_context.png)\n\n\u003Cdetails>\u003Csummary>Per-context linearization\u003C\u002Fsummary>\n\n![Per-context linearization](docs\u002Ffigures\u002F09_context_linearity.png)\n\n\u003C\u002Fdetails>\n\n### 5. Prediction and suppression are two signs of one neuron\n\nLate poles fire on the token before a word their write promotes (\"is⟦ once⟧\" → *again*; \"⟦arist⟧\" →\n*-ocracy*). Prediction rises from L20 and peaks at L28-L31, where 7-8% of poles have more than a third\nof their top firings followed by a token they promote (control under 0.1%). Suppression starts at L32\nand overtakes prediction at L35. This is the pattern Gurnee et al. (2024) found in GPT-2; in SwiGLU\nthe two kinds sit on one neuron, with the promoting pole firing harder through L32 and\nthe suppressing pole from L34 ([§5](docs\u002Ffindings.md#5-prediction-and-suppression)).\n\n![Prediction, suppression and the read side by layer](docs\u002Ffigures\u002F10_side_agreement.png)\n\n### 6. The input side: the S-lens early, the R-lens later, exact sweeps in between\n\nEarly neurons detect tokens and token families (阔 \"wide\"; words starting with 出; English given names),\nwhich no output-facing lens reads: at L2, 95% of a typical write, carried forward by the R-lens, lies\nalong one direction. The S-lens recovers these detectors from the weights: at L0, on average 38% of a\npole's top firings have their token in its S-lens read's top 10 (another pole's read: under 0.1%), and 2-9%\nat L1-L8, where the R-lens read gets under 1.5% (3.5% at L8). Early neurons also write back the\nfootprint of the tokens they detect: layers 0-8 in effect act as an extended embedding. From L9\nthe R-lens read of the input direction names exact drivers more often. L13-L20 shares the fewest tokens with them, and there\nthe strongest single-token swap reaches only about 9% of a typical firing, so the drivers are a weak yardstick in that stretch. Past L0 a token's effect is mostly nonlinear (an exact linearization\nin the token's own context explains 86% of its footprint at L0 and 7% at L15), though that alone\ndoesn't explain why S-lens reads fade after L8 ([§6](docs\u002Ffindings.md#6-the-input-side)).\n\n![Which reads name the exact drivers](docs\u002Ffigures\u002F11_drivers.png)\n\n### 7. What each read names\n\nEvery pole's weight-only reads are scored against what can be counted around it: the S-lens read against the token under each\nfiring, the R-lens read against its exact drivers, and the write against the token after a firing. The S-lens names the firing token\nfor 85% of poles at L0, the R-lens read names exact drivers for 44-51% at L27-L31, and the write names the next token for about a third\nat L28-L30. These are narrow targets, so a miss doesn't make a read wrong. An R-lens read reads forward (`L30 n7004 +` fires on *play*\nand reads *role*). A firing's token contributes under 0.5% of its activation directly from L7, the rest coming through heads and\nearlier neurons. And the token after a firing is one context's outcome, while the causal test of a write is steering (finding 3)\n([§7](docs\u002Ffindings.md#7-what-each-read-names)).\n\n\u003Cdetails>\u003Csummary>Read signal holds to rank 64\u003C\u002Fsummary>\n\n![Rank depth](docs\u002Ffigures\u002F13_rank_depth.png)\n\n\u003C\u002Fdetails>\n\n### 8. Describing neurons from the lenses alone\n\nClaude explainers labelled 160 random poles from only their lens reads, only their top contexts, or\nboth, never seeing steering. Firing labels are scored by *detection*: can a fresh model, given the\nlabel, pick the pole's held-out top firings out from quiet text (AUROC; 0.5 is chance). Write labels\nare scored by whether a judge picks the pole's label out of four from text generated while steering\nit. From the lenses alone, firing labels score 0.80 and write labels are picked 65% of the time (95%\nat L28-L35, 34% at L0-L8; chance 25%). Firing labels are scored on firings, which favours top contexts (0.87), yet the lenses\ntie them at L13-L27 and lead for writes (contexts: 54%); both together reach 0.89 and 63%. Claude Opus explains no better than Sonnet, which suggests\nthe bottleneck is the evidence. Claude Haiku then labelled all 884,736 poles for $105; on 100 more\nrandom poles, with a card that keeps only the reads that carry signal at each layer plus top contexts,\nit matches Sonnet (0.82 against 0.83). The labels in the catalog now come from a leaner card, one input and one write\nread a pole chosen for its depth, for Qwen3-0.6B to 14B and Gemma 4: their firing labels pick a pole's held-out firings out from\nanother pole's at 0.82-0.88 (another pole's label: 0.44-0.54), as well as the earlier labels on the same poles, at half the\ncost. Asked to predict activations token by token (*simulation*), the same labels correlate at 0.21 on Qwen3-8B (another\npole's label: 0.00): they name the context a pole fires in more often than the token (on held-out top firings, the predicted\npeak lands within a token of the true one 25% of the time, elsewhere in the excerpt 39%, and a third go unrecognised), and\nrarely its weak firings ([§8](docs\u002Ffindings.md#8-describing-neurons)).\n\n![Blind test](docs\u002Ffigures\u002F14_lens_blind.png)\n\n### 9. Attention sinks and the output's temperature\n\nThe final RMSNorm divides each position's vector by its overall size, then scales each dimension by a\nlearned weight. That weight is about 1e-4 on two dimensions, so writes there move no prediction\ndirectly; but those dimensions hold 64% of the final residual's squared length, so they set what\neverything is divided by, and with it how sharp every prediction is. Three L6 neurons fire at up to\n10,752 on the first token, writing onto one of those two dimensions and creating the *attention sink*\nthat later heads attend to by default; the trigger is layer 0's MLP output at that position. L16\nneurons create a second sink on the year after a date (\"May 7, ⟦2⟧013\"), which four L34 neurons clear\nbefore the output. L35 n9510 + fires on hashes and IDs, where the next token is hard to guess, and\nraises the output's entropy through this scale: an entropy neuron in the sense of Stolfo et al. (2024)\n([§9](docs\u002Ffindings.md#9-attention-sinks-the-outputs-temperature-and-entropy-neurons)).\n\n### 10. Outside labels\n\nThe [Neuron Persona Library](https:\u002F\u002Fneuronpersonas.com) labels poles by steering each one while the\nmodel answers \"Who are you?\". Judged generously and blind on 360 rows, 34% of its personas clearly\nmatch the pole's write read, 27% its input read and 40% both together (swapped names: 2-5%), most late\nand least mid-network; weighted by the library's depth mix, 27%, 22% and 34%. Labels from steering one\nprompt disagree most often with where the pole fires (the library's \"creator god\" pole fires on time\nwords), and the library misses what can't be a persona: idiom completers, morphology, everyday\nconcepts ([§10](docs\u002Ffindings.md#10-outside-labels)).\n\n![Persona labels judged against each side](docs\u002Ffigures\u002F15_library_judge.png)\n\n### 11. Attention heads: what each copies and attends to, from the weights\n\nQwen3-8B has 33 induction heads (which continue repeated text: after `A B … A`, they attend to `B` and\npredict it), 33 duplicate-token heads (which attend to earlier copies of the current token), 4\nprevious-token heads and 16 sink heads, and removing any one head costs in-context copying at most\n0.07 nats: the work is spread over many heads. A head's keys and values read best through the S-lens (a\nhead reads what a position holds, not what it is about to say); its output with the S-lens up to L8 and the\nR-lens from L9, as for neurons. Feeding each vocabulary token's S-lens footprint through a head's\ncircuits gives two token-by-token maps. The OV map says what it copies and suppresses (L26h31 copies\nquantities: ` weight | 体重 | strength`; L32h9 suppresses the surnames L34h1 copies), and predicts where\nthe attended token ranks in the head's actual output at each firing (Spearman +0.51; 0.00 under\nanother head). The QK map finds the duplicate-token heads from the weights (AUROC 0.96), and late\nheads attend to the classes they copy or suppress. With an R-lens query against S-lens keys (`qk_self_R`)\nit finds the late heads that attend to earlier copies of the token their position is about to say; with a\nnegative OV map, these are copy suppression in context (17 heads at L21-L35, AUROC 0.91; on Gemma 4, 25\nheads at L24-L47, AUROC 0.88) ([§11](docs\u002Ffindings.md#11-attention-heads-circuits-read-token-by-token),\n[§13](docs\u002Ffindings.md#13-gemma-4-12b-the-text-catalog-in-a-second-model)).\n\n![Which lens on each side of a head](docs\u002Ffigures\u002F16_head_lens_sides.png)\n\n### 12. What heads' reads name, and a label for every head\n\nAt their own top firings, 26% of L28-L35's heads write the next token as their OV read predicts, and\nfew heads before. Claude Haiku\nlabels every head (where it fires, what it attends to, what it writes); checked blind, the firing labels\ntell a head's held-out firings from another head's at AUROC 0.70 (control 0.50), and the write labels\nare picked out of four 54% of the time (79% at L28-L35; chance 25%)\n([§12](docs\u002Ffindings.md#12-attention-heads-tests-and-labels)).\n\n![What heads' reads name](docs\u002Ffigures\u002F17_head_census.png)\n\n### 13. A second model reads the same way\n\nGemma 4 12B comes from another lab, with another activation, norm layout and attention scheme. Its\ncatalog shows the same picture. The R-lens read of a write predicts steering from L11 on (median r\n0.53 at L12-L23, 0.82 at L24-L35, 0.97 at L36-L47), ahead of the logit lens; before L11, pushes at a\nneuron's natural size move the output too little for either lens to predict, though larger pushes\nstill raise the tokens the R-lens names. The S-lens read of a neuron's input names its firing token through L13, about the same\nrelative depth as Qwen3-8B's L8, and the write promotes the next token from L33. Its R-lens read of a neuron's input direction\nnames the exact drivers for 29% of poles, once the read row, a covector, is made a vector by the residual's own scale:\nGemma 4's residual coordinates differ in scale by up to 1,600×, and read as a vector in the raw basis, as released, it named\nthem for 2% ([Matthew Khoriaty](https:\u002F\u002Fwww.lesswrong.com\u002Fusers\u002Fmatthew-khoriaty) spotted the junk reads). Claude Haiku labelled every pole and head;\nchecked blind, the heads' firing labels hold as Qwen3-8B's do (AUROC 0.71), their write labels are near\nchance, and of the neuron labels only the relabelled poles are checked (AUROC 0.72)\n([§13](docs\u002Ffindings.md#13-gemma-4-12b-the-text-catalog-in-a-second-model)).\n\n![Both models by relative depth](docs\u002Ffigures\u002F18_two_models.png)\n\n\u003Cdetails>\u003Csummary>Gemma 4's steering and reads by layer\u003C\u002Fsummary>\n\n![Gemma 4: lens reads against steering](docs\u002Ffigures\u002F19_gemma_steering.png)\n\n![Gemma 4: what each read names](docs\u002Ffigures\u002F20_gemma_census.png)\n\n\u003C\u002Fdetails>\n\n### 14. Images and sound: what drives a neuron\n\nGemma 4 has no separate encoder for images or sound: each 48 × 48-pixel patch or 40 ms of audio\nenters the residual stream through a few norms and one linear map. So the lenses can be fitted on\nimages and sounds, and a neuron's read direction can be carried back to pixels or samples. Over\n49,694 labelled images and 49,703 labelled sounds, a quarter to a half of each band's poles have a\nlabel that holds on held-out documents (AUROC 0.96-0.97 for images, 0.77-0.91 for sound): gratings,\ncheckerboards and writing systems early, objects, scenes and languages later. The lens's patch read\nshows what a neuron's input direction looks like, but added to held-out images it raises the neuron\nonly in the first six layers. Started from the read and optimised by gradient ascent through the\nmodel, a single patch or 40 ms frame drives its neuron through L23\n([§14](docs\u002Ffindings.md#14-images-and-sound-what-drives-a-neuron)).\n\n![What the image and sound reads are good for](docs\u002Ffigures\u002F21_media_reads.png)\n\n![The patch each neuron reads, and the patch that drives it](docs\u002Ffigures\u002F22_media_gallery.png)\n\n### 15. One concept in text, images and sound\n\nMany of Gemma 4's neurons mean the same thing whatever the input. At L12-L23, 42% of the poles with a\nreliable image label also fire on the label's name in text (5% by chance). 4,382 poles pass every\ntext test for their image label (its name fires them, the text S-lens reads it, the text R-lens writes\nit), and 730 for their audio label. 19 pass all of them for both, where independent lists would share\n2.0: places and peoples, with their language\n([§15](docs\u002Ffindings.md#15-one-concept-in-text-images-and-sound)).\n\n| pole | image label | audio label | exact text drivers | R-lens read of its write |\n|---|---|---|---|---|\n| `L14 n8313 +` | mosque indoor | Arabic | Amal, أ, Mohamed, Noor | Arabic, Quran, islamic, Saudi |\n| `L33 n5249 +` | tacos | Spanish | Peruvian, Ecuadorian, Mexican, Aztecs | Mexican, 墨西哥 (Mexico), Mexico |\n| `L33 n6099 +` | pagoda | Mandarin Chinese | WeChat, Xiaomi, Weibo, Shanghai | Chinese, China, Beijing, 中国 |\n| `L37 n7165 +` | giant panda | Mandarin Chinese | 熊猫 (panda), 四川 (Sichuan), 成都 (Chengdu) | panda, 熊猫, Chengdu |\n\n![One concept in text, images and sound](docs\u002Ffigures\u002F23_crossmodal.png)\n\n### 16. Heads carry what an image shows into the text\n\nWith an image in the prompt followed by ` a`, Gemma 4 gives the image's own label a lower loss than\nanother class's 97% of the time. Early heads attend within the image, from a patch to its neighbours;\nthe text reads the image most at L23-L31. Zeroing single heads (L28h6, L29h1, L29h9, L25h2) costs the\nright label more than a wrong one, and from L35 heads write the right class. With a sound, the model\nprefers the right label only 55% of the time, and no head carries it\n([§16](docs\u002Ffindings.md#16-attention-heads-in-image-and-audio-contexts)).\n\n![Heads in image and audio contexts](docs\u002Ffigures\u002F24_heads_media.png)\n\n### 17. What feeds a neuron: the wiring is in the weights, the traffic is in the context\n\nWhat a neuron writes reaches every later neuron's input unchanged, so the weights give an edge between\nevery pair of poles: how far one pole's firing pushes a later one. Concept poles are wired from their\nconcept (an L14 animals pole from L12's dogs-and-pets pole), and an edge ranks every upstream neuron's\nactual effect at Spearman 0.88. But when a pole fires, a few units drive it, and they are units firing\nwith it: its 64 largest sources carry nearly all its activation, its 64 weight edges about a tenth.\nHeads carry a third (half at L13-L20). Into a head, the value and keys come mostly from neurons, and the query a third to a half from\nearlier heads ([§17](docs\u002Ffindings.md#17-direct-edges-between-neurons)).\n\n### 18. What a neuron writes beyond what it reads\n\nIf MLPs mainly amplified what attention brings them, a neuron's write would point along what it reads. [Matthew Khoriaty](https:\u002F\u002Fwww.lesswrong.com\u002Fusers\u002Fmatthew-khoriaty) questioned\nthat, and suggested reading the part of an output orthogonal to its input. Through L14 a write does lean on what it reads, almost all\nof it on the `up` side (cosine 0.35-0.55 at L6-L14, against 0.05-0.20 for the gate), and the lean is gone by L30. But the\nrest of the write carries 84-100% of its steering effect, and what it means can differ: `L21 n1180 −` reads *women* and writes women, wives\nand husbands; with what it reads removed, its write reads parenting, childbirth and family education (育儿, 生育, 家庭教育). Rated blind, the rest of a\nwrite through L20 is as often unrelated to the pole's read as the same concept, and from L22 usually a related one\n([§18](docs\u002Ffindings.md#18-what-a-write-adds-beyond-what-it-reads)).\n\n### 19. Across Qwen3's sizes, late reads hold and early ones fall\n\nNine more Qwen3 models, 0.6B to 14B, post-trained and base, each with its own lenses and the same documents, show which\nreads depend on size. Late ones don't: at every size a late write's R-lens read predicts steering at r 0.98-0.99 and promotes\nwhat follows the firings for a quarter of poles, and the R-lens names the inputs of a fifth to a third. Early ones do. The\nS-lens names the firing token for 16-25% of mid-network poles in the 28-layer models but 2-8% from 36 layers on (a step\nbetween lineages too: finding 20), and early writes predict steering less at every step in size (first-quarter r 0.62 at\n0.6B, 0.31 at 14B). Heads' reads fall a little with size too. The bases read like their siblings. Their R-lens input reads seem to trail at every size, but only against a\nnull pooled over each layer: through a base's lens about 1% of poles read as frequent function words and match every pole's\ndrivers, which raises the bar for all; held to its own null, a pole passes as often in the base (Qwen3-8B and 4B). Post-training\nmoves every matrix by 5-13% and keeps each neuron's directions (cosines above 0.99); its clearest added directions read as\nquestions, hedges and contrast (and `Wait` in the 4B), likely the style of the models' reasoning\n([§19](docs\u002Ffindings.md#19-the-qwen3-family-what-changes-with-size)).\n\n### 20. Qwen3-4B and 0.6B are pruned from the 8B and the 1.7B\n\nIn the 4B and the 0.6B a neuron's index tracks its activation (Spearman ρ to −0.76), where every other model's indices\nare exchangeable (±0.03). The 4B's near-silent neurons fill the end of its L1 and L3. Each pair shares its attention heads\none for one (their weight norms correlate at 0.93-0.98 by layer). A linear map fitted on those heads takes the parent's\nresidual to the model's, and through it 99-100% of the 4B's neurons from L1 to L34 match a parent neuron: matched pairs\nkeep their activation scale (ρ 0.85-0.95) and promote the same tokens. The order follows the parent neuron's activation,\nand the neurons cut were the parent's least active: at L1-L3, its near-silent ones. This is what width pruning by\nactivation leaves, as in Minitron. So finding 19's five sizes are three lineages, and its step from 28 to 36 layers is also a step\nbetween them. In these two models a range of neuron indices is a slice by activation rank, not a random sample. Each\nneuron's parent can be named. It is identified when the weight match is also what an independent signal picks: the\ncorrelation of the two neurons' activations over the same text, or the tokens their writes promote. That covers 93% of\nthe 4B's neurons (96.5% of those that fire) and 85% of the 0.6B's, with chance agreement under 0.2% a layer. The 4B's\nnear-silent neurons match only as a class. The catalog's `lineage` table holds each neuron's parent, or child, and\nneuron-lens.com links the two ([§20](docs\u002Ffindings.md#20-qwen3-4b-and-06b-are-pruned-from-the-8b-and-the-17b)).\n\n### 21. The dark sector: what the lens barely reads\n\nAt each layer of Qwen3-8B a few directions carry 90% of what the R-lens reads from the layer's neurons: 60-200 of 4,096\nat L0-L3, about 1,900 at L21. The rest, the dark sector, holds 87-95% of the residual early and 71-81% at L4-L15.\nRemoving one layer's dark sector from its MLP output moves the model's predictions 300-5,700 times more than the lens\npredicts, and early and in the middle it costs more than removing the bright sector. Removed over a band of layers, it\nbreaks something different at each depth. Early, word forms, the kind of document, and the sentences only syntax decides\n(\"rome\", \"The mitochondria is not the powerhouse of the cell\", object relatives at chance). In the middle, facts and the use\nof context (\"the capital of the south is the city of Marseille\", comprehension lost on every kind of sentence). Late, the\npieces that finish a word (\"I am Q, a large language model\"), with comprehension kept; removing the late bright sector\ninstead leaves \"the, the, the\". Swapping a sector between two prompts shows where their difference lives: which country,\nthe answer's language, the next word piece, and even whether the reply is a story or small talk move with the bright\nsector from L4-L12, and the dark part of the difference, most of its energy, changes nothing. In between, the country\nneeds the R-lens's top directions and more of the difference besides, and thinking mode at L12 sits in a few directions\nneither lens weights. Ranked by gain without a cut (its loudest direction, the residual's massive-activation offset,\nleft out), the R-lens puts what prompts differ in well above chance at every layer: the early dark sector is the lens's\nmiddle ranks. The readouts span the residual unevenly: early, the R-lens barely reads about half of it (the S-lens's\nfootprints span nearly all of it there), and nothing two prompts differ in sits in that half. So the dark sector likely holds what prompts share rather\nthan what they differ in\n([§21](docs\u002Ffindings.md#21-the-dark-sector-what-the-r-lens-barely-reads)).\n\n### Limits\n\n- Two models read in depth, and nine more Qwen3 models (the four post-trained ones labelled, the bases not); one lens corpus for text (English-heavy web text), and COCO photos and ESC-50 sounds for\n  Gemma 4's media lenses; lenses averaged over 128-token documents.\n- Activations are bf16 passes over documents of up to 256 tokens; the exact drivers match an fp32 rerun\n  through L9 on Qwen3-8B, and later layers are unchecked.\n- The tests of each read are token-level; labels are written, scored and judged by Claude models, and\n  of Gemma 4's neuron labels only the relabelled poles are checked. Media labels name what a whole image or sound is about.\n- Findings 3 and 4 stand as first measured, with 24 top firings a pole; the catalog now holds 64.\n- Steering adds a write at every position of neutral text, up to many times its natural size: it measures a direction's\n  average effect.\n\n## Using the release\n\nRead one neuron's write through the R-lens:\n\n```python\nimport torch\nfrom huggingface_hub import hf_hub_download\nfrom transformers import AutoModelForCausalLM, AutoTokenizer\n\nmodel = AutoModelForCausalLM.from_pretrained(\"Qwen\u002FQwen3-8B\", dtype=torch.bfloat16)\ntok = AutoTokenizer.from_pretrained(\"Qwen\u002FQwen3-8B\")\nJ = torch.load(hf_hub_download(\"stdlogits\u002Frs-lenses\", \"qwen3-8b\u002Fr-lens\u002Flens.pt\"), weights_only=True)[\"J\"]\n\nL, n, sign = 8, 344, +1                        # L8 n344 +\nw = sign * model.model.layers[L].mlp.down_proj.weight[:, n].float()\nh = J[L] @ w                                   # layer L's output -> the final residual\nh = h * torch.rsqrt(h.pow(2).mean() + 1e-6) * model.model.norm.weight.float()\nprint(tok.convert_ids_to_tokens((model.lm_head.weight.float() @ h).topk(8).indices))\n```\n\nRead which input tokens drive it, through the S-lens to the MLP input:\n\n```python\nK = torch.load(hf_hub_download(\"stdlogits\u002Frs-lenses\", \"qwen3-8b\u002Fs-lens\u002Fmid.pt\"), weights_only=True)[\"K\"]\n\nlayer = model.model.layers[L]\ng = layer.post_attention_layernorm.weight.float()\na = g * layer.mlp.gate_proj.weight[n].float()\nb = g * layer.mlp.up_proj.weight[n].float()\nc = a \u002F a.norm() + sign * b \u002F b.norm()         # the pole's read direction\nE = model.model.embed_tokens.weight.float()\nscores = (E - E.mean(0)) @ (c @ K[L])          # token v: c · K_L (W_E[v] − mean(W_E))\nprint(tok.convert_ids_to_tokens(scores.topk(8).indices))   # the catalog also masks rare tokens\n```\n\nQuery the catalog (one layer of neuron reads is about 100 MB):\n\n```python\nimport pandas as pd\n\nbase = \"hf:\u002F\u002Fdatasets\u002Fstdlogits\u002Fneuron-lens\u002Fqwen3-8b\"\nreads = pd.read_parquet(f\"{base}\u002Fneurons\u002Freads\u002FL08.parquet\")\nreads.query(\"neuron == 344 and pole == 1\")[[\"write_R_str\", \"read_R_str\", \"read_S_str\"]]\n\nlabels = pd.read_parquet(f\"{base}\u002Fneurons\u002Flabels\u002FL08.parquet\")\nlabels.query(\"neuron == 344 and pole == 1\")[[\"fires\", \"fires_conf\", \"writes\", \"writes_conf\"]]\n\nheads = pd.read_parquet(f\"{base}\u002Fheads\u002Freads.parquet\").merge(pd.read_parquet(f\"{base}\u002Fheads\u002Facts.parquet\"))\nheads.query(\"layer == 20 and head == 17\")[[\"ov_R_str\", \"qk_S_str\", \"duplicate\", \"contexts\"]]\n```\n\nBrowse a local copy with `python -m neuron_lens.catalog show 8 344 +`, `head 20 17` or\n`search 'Bible|圣经'`. Both lenses also load in [Drowse](https:\u002F\u002Fgithub.com\u002Fstdlogits\u002Fdrowse) (6.0 or\nlater): `drowse lens fetch Qwen\u002FQwen3-8B rs-r` for the R-lens and `rs-s` for the S-lens.\n\nFor Gemma 4 12B, with this package installed (`neuron_lens.weights.tensors` reads only the named\nweights from the checkpoint, so no model is loaded), read a neuron's write, then see its image read,\nthe images that drive it and an optimised patch:\n\n```python\nimport io\nimport pandas as pd\nimport torch\nfrom huggingface_hub import hf_hub_download\nfrom PIL import Image\nfrom transformers import AutoTokenizer\nfrom neuron_lens.neurons import directions\nfrom neuron_lens.weights import tensors\n\nM = \"google\u002Fgemma-4-12B\"\ntok = AutoTokenizer.from_pretrained(M)\nJ = torch.load(hf_hub_download(\"stdlogits\u002Frs-lenses\", \"gemma-4-12b\u002Fr-lens\u002Flens.pt\"), weights_only=True, mmap=True)[\"J\"]\nw = tensors(M, [\"model.language_model.embed_tokens.weight\", \"model.language_model.norm.weight\"])\nE, g = w[\"model.language_model.embed_tokens.weight\"].float(), w[\"model.language_model.norm.weight\"].float()\n\nL, n, sign = 33, 6099, +1                      # L33 n6099 +: pagodas, pandas, Mandarin speech\nh = J[L].float() @ (sign * directions(M, L)[\"write\"][:, n])   # the write: s · γ_post ⊙ W_down[:, n]\nh = h * torch.rsqrt(h.pow(2).mean() + 1e-6) * g\nprint(tok.convert_ids_to_tokens((E @ h).topk(8).indices))      # tied unembedding\n\nbase = \"hf:\u002F\u002Fdatasets\u002Fstdlogits\u002Fneuron-lens\u002Fgemma-4-12b\"\nimage = pd.read_parquet(f\"{base}\u002Fneurons\u002Fimage\u002FL33.parquet\").query(\"neuron == 6099 and pole == 1\").iloc[0]\nimage[[\"label\", \"labels_str\", \"sig\", \"stable\", \"text_fire_rank\", \"text_read_rank\", \"text_write_rank\"]]\nImage.open(io.BytesIO(image[\"read_png\"][\"bytes\"]))            # its read direction, in pixels\ndocs = pd.read_parquet(f\"{base}\u002Fmedia\u002Fimage_docs.parquet\")\ndocs.loc[image[\"top_doc\"][:8], [\"labels\", \"link\"]]            # the images that drive it, at their sources\nopt = pd.read_parquet(f\"{base}\u002Fneurons\u002Fimage_optimised.parquet\").query(\"layer == 20 and gain > 0\")\nImage.open(io.BytesIO(opt.iloc[0][\"opt_png\"][\"bytes\"]))      # a patch that drives its neuron\n```\n\nSound is the same with `audio` for `image`: `read_wave` and `opt_wave` hold 640 samples at 16 kHz.\n\n## Reproducing\n\n```bash\nuv pip install -e \".[plots]\"     # add the drowse extra (Drowse >= 6.0) to export lenses to Drowse\npython -m pytest -q              # estimator tests: brute-force Jacobians\n```\n\nThe pipeline, in run order. `NEURON_LENS_MODEL` picks the model (Qwen3-8B by default;\n`google\u002Fgemma-4-12B` for Gemma 4). Runtime artifacts go to `data\u002F` (ignored), compact results to\n`data\u002Fsummary\u002F` and figures to `docs\u002Ffigures\u002F`. Costs are Qwen3-8B's unless marked; Gemma 4's lens fits\ntake about 1.5× as long.\n\n| script | what | cost |\n|---|---|---|\n| `01_lens_corpus.py` | the lens corpus: the first 1,000 rows of DCLM-shuffled at a pinned revision | minutes |\n| `02_fit.py` | fit the R-lens or S-lens (`--lens R\\|S`, and for Gemma 4 `--modality image\\|audio`); resumable, shardable across GPUs, detachable | ~3 h per text lens on one H100; 45-90 min per media lens |\n| `03_token_counts.py` | token counts over the activation corpora, which set the kept tokens | minutes |\n| `04_export_rlens.py` | export an R-lens fit to a Drowse home | minutes |\n| `05_act_corpus.py` | the activation corpora: web (held out from the lens), Chinese, Python, chat | minutes |\n| `06_activations.py` | one pass for every neuron and head: statistics, top firings, attention patterns, position 0 | ~70 min on an RTX 4090 |\n| `07_drivers.py` | every kept token swept through 8 real documents: neuron and head drivers | 12 min (Qwen3-8B), 24 min (Gemma 4) on an H100 |\n| `08_reads.py` | weight-only reads of every pole and head through both lenses | 5-7 min on an H100, ~10 min per side on a Mac |\n| `10_labels.py` | a label for every pole and head by Claude Haiku 5.5, and the heads' blind check | ~$105 for the neurons, under $1 for the heads (Batch API) |\n| `16_edges.py` | every pole's strongest direct weight edges | minutes |\n| `17_firings.py` | one pass over every pole's top firings: the residual, the MLP output and the model's prediction there (`firings`), and what drives the pole and what fires with it (`sources`); what drives each head through its value, query and key (`heads\u002Fsources`) | ~2 h for Gemma 4 on an H100 |\n| `13_media_activations.py` | Gemma 4: every pole's activation over the labelled images and sounds; its exemplars | 25-40 min per modality on an H100, and 220 GB of RAM for the images |\n| `14_media_tables.py` | Gemma 4: the per-layer image and audio tables | ~15 min on an H100 |\n| `15_media_optimised.py` | Gemma 4: the optimised patches and sounds | ~25 min per modality on an H100 |\n| `11_figures.py` | every figure in `docs\u002Ffigures\u002F` | seconds |\n| `12_release.py` | release the lenses and the catalog on the Hub | |\n\nAn Apple-silicon Mac runs everything but the lens fits and the GPU passes, which want a CUDA card (24\nGB is enough for the text passes); `scripts\u002Fcatalog_box.sh` sets up a GPU machine and runs them in order. `scripts\u002Fchecks\u002F` holds the analyses behind the findings, each\nnamed in its findings section (steering and per-context linearization, prediction and suppression, read\ndepth, driver precision, the description pilot and the blind tests, sinks and entropy neurons, outside\nlabels, heads' ablation, copying, census and lens sides; for Gemma 4, the media lens tests, the\ncross-modal ranks `14_media_tables.py` reads, and the heads in media contexts). The package\n`neuron_lens\u002F` holds the estimator (`transport.py`, the layer maps of every model in `layers.py`, and\n`rules.py` as their test reference), the models' geometry (`arch.py`, `neurons.py`), the readouts\n(`readout.py`, `heads.py`), the firing and source passes (`firings.py`, `sources.py`), lens loading (`lenses.py`), images and sound (`media.py`, `media_sets.py`)\nand the catalog (`catalog.py`).\n\n\u003Cdetails>\u003Csummary>Gemma 4 12B, in order\u003C\u002Fsummary>\n\n```bash\nexport NEURON_LENS_MODEL=google\u002Fgemma-4-12B\npython scripts\u002F02_fit.py --model $NEURON_LENS_MODEL --lens R --docs 1000             # and --lens S\npython scripts\u002F02_fit.py --model $NEURON_LENS_MODEL --lens S --modality image --docs 1000\npython scripts\u002F02_fit.py --model $NEURON_LENS_MODEL --lens S --modality audio --docs 2000\npython scripts\u002F02_fit.py --model $NEURON_LENS_MODEL --lens R --modality image --docs 512 --dim-batch 512\npython scripts\u002F02_fit.py --model $NEURON_LENS_MODEL --lens R --modality audio --docs 512 --dim-batch 512\npython scripts\u002F05_act_corpus.py --docs chat=8000    # Gemma's chat slice; the other slices are Qwen3-8B's\npython scripts\u002F03_token_counts.py\npython scripts\u002F06_activations.py --batch-docs 64\npython scripts\u002F07_drivers.py --batch 128\npython scripts\u002F08_reads.py\npython scripts\u002Fchecks\u002Freads_at_firings.py\npython scripts\u002F16_edges.py\npython scripts\u002F17_firings.py\npython scripts\u002F13_media_activations.py --modalities audio --batch 32   # then image: one at a time\npython scripts\u002Fchecks\u002Fcrossmodal.py\npython scripts\u002F14_media_tables.py\npython scripts\u002F15_media_optimised.py --modality image                   # and audio\npython scripts\u002Fchecks\u002Fhead_media.py\npython scripts\u002Fchecks\u002Fcausal_lens.py measure --per-layer 24\npython scripts\u002Fchecks\u002Fcausal_lens.py score --lenses logit,hub\npython scripts\u002F11_figures.py && python scripts\u002F12_release.py\n```\n\n\u003C\u002Fdetails>\n\n## Related work\n\n- Bills et al., [Language models can explain neurons in language\n  models](https:\u002F\u002Fopenaipublic.blob.core.windows.net\u002Fneuron-explainer\u002Fpaper\u002Findex.html) (2023): every\n  GPT-2 XL neuron, from activations.\n- Choi et al., [Scaling automatic neuron description](https:\u002F\u002Ftransluce.org\u002Fneuron-descriptions)\n  (Transluce, 2024): every Llama-3.1-8B-Instruct neuron, both polarities.\n- Gur-Arieh et al., [Enhancing automated interpretability with output-centric feature\n  descriptions](https:\u002F\u002Farxiv.org\u002Fabs\u002F2501.08319) (2025): descriptions from what a feature writes,\n  combined with what makes it fire.\n- Gurnee et al., [Universal neurons in GPT2 language models](https:\u002F\u002Farxiv.org\u002Fabs\u002F2401.12181) (2024):\n  prediction and suppression neurons; Stolfo et al.,\n  [Confidence regulation neurons in language models](https:\u002F\u002Farxiv.org\u002Fabs\u002F2406.16254) (2024): entropy\n  neurons.\n- The lens sources above; [docs\u002Fdesign.md](docs\u002Fdesign.md#related-work) has the full list.\n\n## License\n\nThe code and docs in this repository are [MIT](LICENSE). The lenses and the catalog on the Hugging Face\nHub are [CC BY 4.0](https:\u002F\u002Fcreativecommons.org\u002Flicenses\u002Fby\u002F4.0\u002F); both models are Apache 2.0. Made by\n[@_a9lim](https:\u002F\u002Fx.com\u002F_a9lim) and [@treetowntree](https:\u002F\u002Fx.com\u002Ftreetowntree) with Claude (Anthropic).\n","neuron-lens 是一个面向大语言模型（LLM）可解释性的开源项目，系统性地解析 Qwen3-8B 和 Gemma 4 12B 中全部 MLP 神经元与注意力头的功能。它通过三种互补方式刻画每个组件：基于权重的 Jacobian R\u002FS 透镜分析、1500 万真实 token 上的激活行为统计、以及精确识别驱动其高激活的原始 token；对支持多模态的 Gemma 4，还扩展至图像与音频输入。项目产出结构化公开目录，包含神经元\u002F头的读取方向、响应模式、残差流关联、跨模态触发特征及验证实验结果，适用于 LLM 机制研究、安全对齐分析与模型行为诊断等场景。",2,"2026-11-24 04:53:18","CREATED_QUERY"]