Decoding dark matter: explaining rare concepts in foundation models with specialized sparse autoencodersDecoding Dark Matter: Specialized Sparse Autoencoders for Interpreting Rare Concepts in Foundation Models
The authors propose SSAE; on BiB its SHIFT worst-group accuracy is 88.5%, while GSAE is 76.0%.
- General SAEs trained on large-scale general corpora easily miss low-frequency but critical concepts in subdomains. The authors compare such features to dark matter and paraphrase: a concept that appears only once per billion tokens may require a billion-feature SAE to capture.
- SSAE starts from a small seed set, uses BM25, Contriever dense retrieval, or TracIn to draw subdomain data from the pretraining corpus, then fine-tunes a general SAE. High-tilt TERM shifts the objective from average loss to high-loss samples to improve tail concept recall.
- On Physics and Toxicity, the perplexity–L0 curve of dense retrieval plus TracIn outperforms BM25 and full data. On BiB, SSAE SHIFT has worst-group accuracy 88.5%, while GSAE SHIFT is 76.0% (Table 1). The authors say TERM matches ERM perplexity at common L0 values.
- The authors note TERM is more computationally expensive, may be unstable at high tilt, and depends on seed quality. Experiments used Gemma-2b, Pythia-70M, and TinyStories-1M, with data including Physics, Toxicity, BiB, and TinyStories. The paper does not report F1 values.
- Evaluated models
- Gemma-2bPythia-70MTinyStories-1M
- Benchmarks
- OpenWebTextarXiv PhysicsPhysics instruction tuningPile ToxicityThe PileBias in BiosTinyStories
- Metrics
- L0Perplexity with SAEprofession accuracygender accuracyworst-group accuracyreconstruction errorF1
The paper proposes specialized sparse autoencoders (SSAE) to capture rare but critical subdomain concepts in foundation models, addressing the gap where general sparse autoencoders struggle to cover tail concepts. The authors provide a training recipe that uses dense retrieval for data selection and Tilted Empirical Risk Minimization as the training objective to improve concept recall. On standard metrics such as downstream perplexity and L0 sparsity, SSAE outperforms general SAE in capturing subdomain tail concepts. In a case study on the Bias in Bios dataset, applying SSAE to remove spurious gender information improves worst-group classification accuracy by 12.5%.
Paper analysis
What problem does this paper attempt to solve?
The authors propose SSAE, which fine-tunes a general SAE on subdomain-retrieved data to capture rare concepts in foundation models.
General SAEs struggle to capture low-frequency but critical concepts in foundation models.
- Scenario: The authors argue that understanding and mitigating foundation model risks depends on interpretability. Rare or very specific concepts activate rarely; the authors compare them to "dark matter" in interpretability. Templeton et al. (2024) found features for some San Francisco neighborhoods but still lacked cafes and street intersections; the authors paraphrase that if a concept appears only once per billion tokens, a billion-feature SAE might be needed to capture it.
- Existing methods: Bricken et al. (2023), Cunningham et al. (2023), Rajamanoharan et al. (2024), Gao et al. (2024) train SAEs on large-scale general data matching the foundation model. The authors think this may learn high-frequency concepts in the pretraining corpus and miss concepts that are rare by that frequency in a subdomain.
- What this paper asks: Whether it is possible to extract the tail concepts of interest without widening the SAE to a billion features. The authors also examine whether high-tilt TERM—which approximates minimax risk at high tilt—can improve tail representations.
- Proposed approach: Specialized Sparse Autoencoders (SSAE). Use a small seed set to retrieve subdomain data from the pretraining corpus, fine-tune a pretrained general SAE (GSAE), and the training objective can use Tilted Empirical Risk Minimization (TERM). The application case is removing spurious gender information on Bias in Bios.
What related research exists?
Related work includes mechanistic interpretability, general SAEs and dark matter features, as well as retrieval, TERM, and baselines.
Grouped according to the introduction, Related Work, and Appendix A.
Coarse-grained and fine-grained interpretation
- Component-level circuits: Olsson et al. (2022), Elhage et al. (2022b), Geva et al. (2023), Meng et al. (2022), Nanda et al. (2023b) analyze coarse-grained components such as induction heads and MLPs. The authors argue that the inherent polysemy of such components makes interpretation difficult.
- Probes and directions: Kim et al. (2018), Belinkov (2022), Geiger et al. (2023), Zou et al. (2023) perform fine-grained analyses such as linear probes. The authors argue they rely on curated data isolating specific behaviors and are hard to generalize to unknown mechanisms.
- Editing-type applications: Appendix A.1 lists removing toxic outputs (Li et al., 2023), editing facts (Meng et al., 2022), improving truthfulness (Li et al., 2024), analyzing gender bias (Vig et al., 2020), and mitigating spurious correlations (Gandelsman et al., 2023). These are only application background here, not critiqued one by one.
Sparse autoencoders
- General SAEs: Bricken et al. (2023), Cunningham et al. (2023) et al. decompose activations into sparse linear combinations of overcomplete feature directions. The authors note that training on general pretraining data misses rare subdomain concepts.
- Dark matter and width: Templeton et al. (2024) report that wider SAEs can produce features for some rarer concepts, but still miss a large amount of dark matter features.
- Known issues: Appendix A.3 writes that features trained at a specific context length do not generalize to longer contexts (Anders and Bloom, 2024), and feature suppression (Wright and Sharkey, 2024; Jermyn et al., 2024). Existing remedies include post-training fine-tuning, other sparsity penalties, and Gated SAE (Rajamanoharan et al., 2024). The appendix frames this paper as focusing on the representation of tail concepts.
Disentanglement, retrieval, and TERM
- Disentangled representations: Bengio (2013) and Chen et al. (2018), Kim and Mnih (2018), Mathieu et al. (2019) often impose priors on learned representations. Appendix A.4 states that SAEs decompose pretrained language model representations into sparse linear combinations of overcomplete bases.
- Data selection: Okapi BM25 (Robertson and Zaragoza, 2009), Contriever (Izacard et al., 2022), and TracIn (Pruthi et al., 2020) are used to select documents related to the seed from the pretraining corpus.
- TERM: Li et al. (2020), Beirami et al. (2018) use tilt to interpolate between average loss and maximum or minimum loss. This paper applies it to SAEs.
Baselines and datasets
- Baselines: Physics and toxicity experiments use an SAE fine-tuned on the full OpenWebText as baseline, and compare training only on the seed validation set, BM25, Dense retrieval, and BM25 TracIn, Dense TracIn. Bias in Bios comparisons include Original, Oracle, Concept Bottleneck Probing (Yan et al., 2023), Neuron skyline, GSAE SHIFT, and a compressed SAE with the decoder cut to 1/8 width. The application framework is SHIFT (Marks et al., 2024).
- Data: OpenWebText, arXiv Physics, Physics instruction tuning, Pile Toxicity, The Pile, Bias in Bios, TinyStories.
The authors position SSAE as an unsupervised method for subdomains: rather than widening the SAE to a billion features, it fine-tunes a GSAE on retrieved subdomain data and uses TERM with a large tilt to improve tail-concept recall.
How does the paper address this problem?
Fine-tune GSAE on retrieved subdomain data; high-tilt TERM is used to improve tail concept recall.
SSAE does not cover all concepts; instead, it uses seed data to retrieve subdomain corpora and fine-tunes a GSAE already pretrained on general data; optionally, TERM shifts the optimization from average loss to high-loss samples.
Setup and training objective
- Superposition and SAE: The authors adopt the superposition hypothesis, i.e., finite neurons encode more overlapping concepts (Elhage et al., 2022b). A single-layer SAE encodes activations as ReLU(W_enc x + b_enc), then decodes via W_dec f + b_dec; during training, the columns of W_dec are constrained to unit norm. The sparse coefficients fi(x) are non-negative.
- ERM loss: The trade-off between reconstruction and L1 sparsity is L(x)=|x−x̂(f(x))|22+λ|f(x)|1, with λ>0 controlling fidelity versus sparsity.
- TERM: On a minibatch, it is L̃(t;w)=1/tlog(1/N∑i∈[N]et· Lw(zi)). t→0 recovers the average loss, t→+∞ approaches the maximum loss, and t→−∞ approaches the minimum loss. This paper takes t≫0 to approximately minimize the maximum risk. The authors state that ERM favors precision with more specialized features, while TERM favors recall with broader coverage, especially for rare concepts.
Subdomain data selection
- Pipeline: The seed is a concept, or data from the target subdomain (examples in the paper include toxicity). High-recall retrieval expands it from the base model's pretraining corpus, and the GSAE is then fine-tuned with the above loss. The authors' rationale is that the GSAE already covers a broad set of concepts, and fine-tuning biases it toward features that are common in the subdomain but rare in the general domain.
- BM25: A TF-IDF-like ranking with the seed as query, considering term frequency, inverse document frequency, and document length.
- Dense retrieval: Contriever embeds the seed and candidate documents, and the most similar documents are retrieved by cosine similarity.
- SAE TracIn: Two stages. First, BM25 or Dense narrows the corpus (in physical experiments, first reduced to 1% of OpenWebText), then the dot product of the loss gradients of training points with the seed reranks and selects the fine-tuning data.
Key implementation settings
- Gemma-2b: checkpoint gemma-2b-res-jb, layer blocks.12.hook_resid_post, width 16384, pretrained on OpenWebText. Adam, learning rate 5e-5, token batch 4096, buffer size 4, linear learning rate decay over the last 1000 steps. Sweep 8 L1 coefficients, each selected on the validation set and then tested on the held-out set. Physics: seed 9.2K tokens, expanded to 13.9M, fine-tuned for 1000 iterations. Toxicity: seed 4072 tokens, retrieved 5.25M, trained for 500 iterations. Training and analysis use SAELens.
- Bias in Bios: GSAE width 32768 for each layer's MLP output, attention output, and residual stream, pretrained on 2B tokens of The Pile (first 128 tokens of random documents). SSAE is guided by 5 BiB examples via dense retrieval to obtain 8M tokens, fine-tuned on all layers for one epoch, λ=0.1, learning rate 10^{-4}. The compressed variant keeps only the first 4096 rows of the decoder before fine-tuning.
- TinyStories: TinyStories-1M with 8 layers and 1M parameters, SAE of width 64 trained on the residual stream of layer 7. batch 64, learning rate 10^{-3}, λ=0.01, 1 epoch on the dataset roneneldan/TinyStories. The TERM tilt is written as 10^9 in Figure 18; the main text and Figures 12 and 14 typeset it as 109. Report the checkpoint with L0 of 16.
How to determine whether a concept is learned
- L0 and perplexity: L0 is the expected number of active features on inputs. Perplexity with SAE is the average cross-entropy after splicing the SAE reconstruction back into the language model. The authors argue that, all else equal, an SAE that recovers more of the base model's performance with lower L0 is better. Evaluation uses in-distribution and out-of-distribution tests from the same subdomain, rather than evaluating only on the training subsample, to distinguish memorizing templates from learning concepts.
- logit lens: Use the unembedding matrix to look at the top-10 token logits for each feature, and count, bucketed by corpus frequency, how many tokens appear in the top-10 of at least one feature.
- Automatic interpretation: Sequence-level classification, rather than per-token activation prediction. The Interpreter writes an explanation based on the 10 highest-activating examples; the Predictor takes the explanation and 10 examples (5 activating, 5 not activating) and judges whether it activates, using F1. Both are Claude 3.5 Sonnet. Appendices J and K give the prompts; their wording is not repeated here.
- SHIFT: Biographies are used to predict profession, with gender as a spurious feature. The ambiguous set consists of male professors and female nurses; the balanced set has equal numbers of the four gender–profession combinations. Only the ambiguous set is used for training, and the goal is to classify professions correctly on the balanced set. The metric the circuit must explain is the classifier's negative log probability of the true label, using zero-ablation to find the circuit. Feature ablation is not decided by human judgment; instead, Feature skyline is used: scan 1–200 circuit features most causally related to spurious-feature accuracy on the balanced set, with the number selected by profession classification performance on the development set; optionally retrain a linear probe. The classifier is logistic regression on mean-pooled non-padding tokens of the penultimate residual stream of Pythia-70M, AdamW learning rate 0.01, trained for one epoch (Appendix G.1).
What experiments did the paper conduct?
On BiB, SSAE SHIFT achieves a worst-group accuracy of 88.5%, and GSAE SHIFT achieves 76.0% (Table 1).
Experimental setup
- Models: Gemma-2b (residual stream SAE for Physics and Toxicity); Pythia-70M (Bias in Bios linear classifier); TinyStories-1M (layer 7 residual stream SAE). Retrieval used Contriever. Automatic interpretation and feature diversity scoring used Claude 3.5 Sonnet.
- Data scale: Physics seed is arXiv Physics Validation, 9.2K tokens, expanded to 13.9M tokens from OpenWebText; in-distribution testing 4.8M tokens, out-of-distribution is 700K tokens from Physics instruction tuning. Toxicity seed 4072 tokens, retrieval 5.25M, in-distribution testing 3.357M. BiB SSAE retrieved 8M tokens with 5 examples. Appendix O gives BiB full counts: training 257k, validation 39.6k, test 99.1k; ambiguous and balanced subset counts are not given.
- Baselines: SAE fine-tuned on full OpenWebText (called All Data in toxicity figures); trained only on the seed validation set; BM25; Dense retrieval; two TracIn variants. BiB also has Original, Oracle, CBP, Neuron skyline, and a compressed SAE of width 4096.
- Metrics: L0; perplexity after SAE concatenation; profession accuracy, gender accuracy, worst-group accuracy (lowest profession accuracy across four demographic groups). TinyStories also looks at reconstruction error, decoder direction coverage, and diversity scores. Automatic interpretation uses F1; the paper does not state the decision threshold.
- Replication: Curves in Figures 1, 9, 10, 12, 13 are averaged over three SAE training seeds. BiB tables and TinyStories checkpoints do not state replication counts. Physics comparison uses area under the curve for L0 from 60 to 140; the main text does not give AUC values.
Main results
The table below shows Pythia-70M accuracy (%) on the Bias in Bios balanced set, per Table 1. Four rows of Comp. results are omitted; see later.
Swipe horizontally to read the table
Method Prof.↑ Gen.↓ Worst↑ Original 61.9 87.4 24.4 Neuron skyline 75.5 73.2 41.5 CBP 83.3 60.1 67.7 GSAE SHIFT 88.5 54.0 76.0 SSAE SHIFT 90.2 53.4 88.5 GSAE SHIFT+retrain 93.1 52.0 89.0 SSAE SHIFT+retrain 93.4 51.9 89.5 Oracle 93.0 49.4 91.9 - The authors say that relative to baselines such as CBP, GSAE SHIFT reduces the classifier's dependence on gender, with the step-3 feature ablation giving the largest improvement. Using neurons for SHIFT is worse than using SAE; the authors link this to the polysemy of individual neurons and cite Marks et al. (2024).
- The authors say that after switching to SSAE, profession accuracy increases by 1.7%, worst-group accuracy by 12.5%, and spurious gender accuracy decreases; after retraining the probe, the gains remain but are smaller.
- The authors attribute the gain to SSAE activating more subdomain-relevant features: 908 at threshold 0.01, versus 602 for GSAE. Appendix H draws circuits at TN=0.1, TE=0.01 and says these new features explain more variance previously attributed to the error node; no value for that variance is given.
Data selection and tail coverage
- Physics Pareto: Figure 1 plots concatenated perplexity against validation L0 on the arXiv Physics test set. The authors say Dense TracIn and BM25 TracIn are close, slightly better than Dense alone, and better than BM25 and full OWT. The main text does not give perplexity or AUC values for each point. On the out-of-distribution test in Figure 9, the authors say BM25 and training only on the validation set generalize poorly. Multiple passes over the seed data improve in-distribution performance and reduce out-of-distribution performance; the authors think this may overfit to the seed's templates.
- Toxicity: Appendix C, Figure 10. The authors say Dense retrieval outperforms BM25, and TracIn gives only marginal gains over Dense alone. The figure legend order is Dense TracIn, Dense retrieval, BM25 TracIn, BM25, full data baseline, averaged over three seeds.
- Logit lens: Figure 2 compares full OWT fine-tuning with Dense fine-tuning at test L0=100. The authors say the latter covers a higher proportion of tail tokens in features, and these tokens often correspond to physics concepts. Figure 11 on toxicity data shows a similar trend, per the authors. Neither figure gives proportion numbers in the main text.
Compressed SAE
- What was tested: Keeping only the first 4096 rows of the decoder (the table note says cut to 1/8 width), then fine-tuning on retrieved data, to see what SHIFT does when GSAE does not cover subdomain features.
- Results (Table 1): Comp. GSAE SHIFT is profession 80.5%, gender 68.2%, Worst 48.6%; Comp. SSAE SHIFT is 89.6%, 52.2%, 78.8%. After retraining, they are 80.0%, 68.8%, 57.1% and 93.2%, 52.1%, 88.5%.
- Authors' interpretation: Comp. GSAE drops relative to full GSAE, retraining the probe does not recover it, and SHIFT also struggles to remove spurious features with it. The authors say Comp. SSAE recovers most of the loss, with profession accuracy 1.1% higher than GSAE SHIFT; after retraining, it recovers most of the lost performance.
TERM and automatic interpretation
- GSAE trained from scratch on TinyStories: Figure 22: the authors say TERM reduces maximum reconstruction error, with slightly higher average error. Figure 3: the authors say tail token error and error variance are lower. Figure 21 in-figure text: to explain 90% variance, ERM needs 21 PCA components, TERM needs 40. Figure 20 in-figure text: decoder direction cosine similarity, ERM mean 0.0428, standard deviation 0.1381, TERM mean -0.0096, standard deviation 0.0763. Figure 19 caption says TERM's decoder directions look more spread out.
- Diversity and activation: Figure 4: the authors say TERM produces both higher- and lower-diversity features; low-diversity ones specialize in the tail, high-diversity ones cover more broadly. Diversity scores were given by Claude 3.5 Sonnet using the prompt in Appendix N.6; the main text does not give specific quantiles of the distribution. Figure 5: the authors say TERM has lower token activation entropy and higher per-token max activation. The authors' proposed use is: during pretraining, mark features strongly related to rare concepts, and at test time check when these features activate strongly; they think this distinguishes rare feature types better than ERM's error node, because the error node does not distinguish types.
- Fine-tuning SSAE: Figure 6, after normalizing the "cumulative proportion of tokens with features" to 1 at validation L0=100 per model, the authors say Dense with higher tilt covers more tail tokens than Dense alone, and this increases with tilt. Figure 12: on Physics data, at L0 85–100, TERM fine-tuning has downstream perplexity comparable to Dense alone; outside this range, reconstruction error is higher. Figure 13: on Toxicity data, the comparable range is L0 100–140. Figure 8: the authors say TERM's F1 is higher than the OWT baseline and ERM fine-tuning; ERM fine-tuning, despite better perplexity–L0, does not produce interpretations that predict activations better than the baseline. The main text does not give F1 values.
Other ablations and analyses
- Figure 7: at high tilt, more features activate more broadly; the authors say this differs from ERM's feature learning mechanism and promotes compositional features.
- Figures 17, 18: log2 ratio of activation counts relative to the OWT baseline, ERM fine-tuning probability mass shifts right; from tilt=500 to 10^9 in Figure 18, the mass shifts left and strengthens. No specific density values.
- §3.2.2: at very large or very small L0, Adam-based TERM fine-tuning shows higher average risk or many inactive features.
- Appendix E: increase λ when L0 is above the target range, decrease when below. The authors say this maintains target sparsity better than Adam at extreme L0 and avoids inactive features at low L0; no perplexity is given for this scheme.
- §3.2.3: the authors align "ERM fine-tuning has better perplexity but interpretations are not more predictable" with O'Neill et al. (2024)'s observation that fine-grained features become harder to interpret as SAEs widen; the authors say TERM encourages coarser, more compositional features, making interpretations easier to understand.
What are some points that can be further explored?
The authors note that TERM is more computationally expensive, depends on seed data, and they hope to continue validating it on broader tasks.
Limitations and future directions noted by the authors
- TERM computation: More computationally expensive than standard ERM because it requires computing the exponential of the loss for each data point; at high tilt it can be numerically unstable and converge more slowly. The authors hope future work reduces this cost for wider adoption (Limitations).
- Seed data: SSAE depends on the quality and representativeness of the initial seed. Low-quality or unrepresentative seeds may fail to capture relevant subdomain concepts or inherit biases in the seed. The authors propose future automatic selection or generation of high-quality seeds and analysis of sensitivity to different selection strategies (Limitations).
- Cross-domain: Experiments used Physics, Toxicity, Bias in Bios, and TinyStories. The authors say there is no reason to think the findings would not generalize, but empirical results on broader tasks and datasets would strengthen the conclusions; the authors particularly want to evaluate in AI safety, healthcare, and fairness (Limitations).
- Concept erasure: The conclusion states that future work is to explore using SSAE for targeted concept erasure (Conclusion and Future Work).
Experimental coverage
- The interpreted models are Gemma-2b (residual stream blocks.12.hook_resid_post, GSAE width 16384), Pythia-70M (BiB linear classifier; GSAE width 32768 on each layer's MLP outputs, attention outputs, and residual stream), TinyStories-1M (layer 7 residual stream, SAE width 64).
- Data selection compared seed validation set, BM25, Dense retrieval, BM25 TracIn, Dense TracIn, and full data on OpenWebText. Physics testing used arXiv Physics 4.8M tokens (in-distribution) and Physics instruction tuning 700K tokens (out-of-distribution); toxicity testing used Pile Toxicity 3.357M tokens.
- BiB comparisons include Original, Oracle, CBP, Neuron skyline, GSAE/SSAE SHIFT and retraining, and a compressed variant with the decoder cut to 4096 (Table 1). Retrieval used 5 BiB examples and 8M tokens.
- TERM was both trained from scratch on TinyStories (Figure 18 with tilt 10^9, reporting a checkpoint with L0 of 16) and used for SSAE fine-tuning on Physics and Toxicity (tilt=500 and 10^9). Pareto curves are averaged over three SAE training seeds.
- Automatic interpretation used Claude 3.5 Sonnet as both Interpreter and Predictor, with sequence-level F1 as the metric. The paper does not report F1 values, nor agreement with human judgment; it does not report AUC values for L0 of 60–140.
Summarize the main content of the paper
SSAE uses subdomain retrieval and TERM to capture tail concepts; on BiB, SHIFT's worst-group goes from 76.0% to 88.5%.
SSAE fine-tunes a general SAE on subdomain data to interpret rare concepts in the base model.
- Problem: General SAEs are trained on large-scale general corpora. The authors argue this misses low-frequency but critical concepts in subdomains, comparing them to dark matter; the proposed way out is not widening the width to a billion features.
- Approach: A small seed set is expanded with data from the pretraining corpus via BM25, Contriever dense retrieval, or TracIn reranking, then the GSAE is fine-tuned. TERM with a large tilt approximately minimizes the maximum loss. The authors state that ERM favors head precision and TERM favors tail recall.
- Data selection: In the Gemma-2b physics experiments, the authors state that Dense TracIn and BM25 TracIn are close and better than Dense alone, which is better than BM25 and full OpenWebText (Figure 1). On toxicity data, Dense TracIn is best (Figure 10). The main text gives no perplexity numbers. BM25 and multiple passes over the seed data worsen out-of-distribution performance.
- BiB: On Pythia-70M, SSAE SHIFT achieves 88.5% worst-group accuracy, while GSAE SHIFT achieves 76.0%. The authors state occupation accuracy increases by 1.7% and worst-group by 12.5% (Table 1). At threshold 0.01, active features are 908 versus 602. After cutting the decoder to 4096, the authors state Comp. SSAE's occupation accuracy is still 1.1% higher than GSAE SHIFT.
- TERM: On TinyStories, the PCA components needed to explain 90% of decoder direction variance are 40 for TERM and 21 for ERM (Figure 21). The authors state that on physics data with L0 85–100 and toxicity data with L0 100–140, TERM-fine-tuned downstream perplexity is comparable to ERM, and automated interpretation F1 is higher; the paper gives no F1 values. At extreme L0, Adam fine-tuning can produce higher average risk or inactive features.
- Authors' conclusion: SSAE can serve as a tool for concept detection and control in subdomains, e.g., deception detection, outliers, and underrepresented groups. The authors also state that TERM is more computationally expensive, its effectiveness depends on seed data, and they plan to explore targeted concept forgetting in the future.