[Proposal] Neuron bases for interchange interventions
メンテナーはふだん 1 日以内に返信
@dipo101 がすでに取り組んでいます。
2026年10月20日 から。
評価
この issue はまだ評価されていません。
説明
Proposal
Add neuron_basis(d_mlp, neurons) and random_neuron_basis(d_mlp, k, seed) to tools.analysis.interchange. A chosen set of MLP neurons, such as the features a sparse probe selects, can then be interchanged with SubspaceInterchange and compared with the module's other bases and controls.
Motivation
fit_sparse_probe finds the neurons that best separate a variable, but, as its docs say, that "does not establish causal model use". Interchanging those neurons is the causal test, and can be placed beside difference-in-means and DAS at the same hook, with random neurons as the placebo. IIUC, a random direction is the wrong placebo for a claim about neurons, because it spreads over every neuron. The question is a timely one. The recent Goodfire essay by Nick Cammarata argues that MLP neurons in trained models are mostly clean units, against the superposition picture, and this would make that claim testable on any task.
Pitch
Fit a sparse probe on blocks.N.mlp.hook_post activations, pass result.selected_features to neuron_basis, and evaluate with intervened_logits on held-out pairs. random_neuron_basis draws k neurons for the placebo, either directly or through NormMatchedPlacebo. The helpers only build checked coordinate bases (indices in range, no repeats, seeding local as in random_basis), so the intervention and its evaluation stay exactly as they are.
Alternatives
Users can write torch.eye(d_mlp)[:, idx] themselves, but then the placebo and the link to sparse probing are left to them, as the trained controls were before #1894. Neuron-level patching in patching.py would cover one neuron at a time, but not sets of neurons or a comparison with learned subspaces.
Additional context
On GPT-2 small, with subject number at the subject token, the comparison is concrete. There were 15 runs per layer. 5 seeds for DAS, the sparse probe and the random neurons, each on 3 splits that fit on one sentence frame and evaluate on 32 pairs in another.
At blocks.0.mlp.hook_post, the single neuron a 1-sparse probe selects reaches an interchange accuracy of 1.00 in every run, matching difference-in-means and DAS. Single random neurons reach 0.00, and sets of 8 random neurons average 0.04.
At layer 2, difference-in-means and the 8- and 32-neuron selections reach 0.00, and the single selected neuron reaches 0.44–0.50, while DAS reaches 0.78–1.00. At layer 1, everything but DAS reaches 0.00, and DAS ranges from 0.00 to 0.97 across seeds. DAS finding effects where the model's own directions and neurons do not is consistent with the illusion Makelov et al. (2024) describe for subspace patching of MLP activations, and the neuron baseline is what makes it visible.
References:
Cammarata, "Neural Networks Are Already Clean", Goodfire (undated web essay), https://already-clean.goodfire.com/
Gurnee et al. (2023), "Finding Neurons in a Haystack: Case Studies with Sparse Probing", arXiv:2305.01610
Elhage et al. (2022), "Toy Models of Superposition", Transformer Circuits Thread https://arxiv.org/abs/2209.10652
Makelov, Lange, Geiger and Nanda (2024), "Is This the Subspace You Are Looking for? An Interpretability Illusion for Subspace Activation Patching", https://arxiv.org/abs/2311.17030.
Checklist
- I have checked that there is no similar issue in the repo (required)
- 主要言語
- Python
- スター
- 3.9k
- フォーク
- 708
- 平均マージ
- 2日 1時間
- マージ済み PR(30日)
- 78
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
TransformerLensOrg/TransformerLens のほかの issue
-
[Bug Report] FactoredMatrix SVD, composition scores and SVDInterpreter fail on bf16/fp16 bridges対応中かも @tivris が 1 日前に担当しました。 オープン
TransformerLensOrg/TransformerLens#1918 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
[Bug Report] Granite MoE Hybrid grouped experts produce incorrect or unstable outputs on MPS対応中かも @janmenjayap が 9 日前に担当しました。 オープンbug complexity-simple TransformerBridge
TransformerLensOrg/TransformerLens#1886 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Community Feedback Requested Research Reproduction seen_by_maintainers TransformerBridge
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
TransformerLensOrg/TransformerLens#1884 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[Proposal] Contextual Decomposition: Nonlinear Source Attribution and Dataset-Wide Ranking on GPT-2オープンCommunity Feedback Requested Research Reproduction seen_by_maintainers
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
TransformerLensOrg/TransformerLens#1883 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Community Feedback Requested enhancement seen_by_maintainers TransformerBridge
難易度 5/5 1週間以上 初心者へのやさしさ 8/100
TransformerLensOrg/TransformerLens#1880 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
TransformerLensOrg/TransformerLens の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
pgvector/pgvector-python#169 ·
-
ChaosEngine: backup-remote doctor row passes while consumer mode hides bot memory from git対応中かも @MohabMohie が今日担当しました。 オープンagentic
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
ShaftHQ/SHAFT_ENGINE#7263 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 87/100
huggingface/smolagents#3045 ·
メンテナーはふだん 1 日以内に返信