Fine-tuning language models with low-rank adaptation to improve sparse autoencodersLow-Rank Adapting Models for Sparse Autoencoders
The authors report using LoRA on Gemma Scope to reduce the cross-entropy gap after inserting SAEs by 30%–55%.
- SAEs decompose activations into sparse linear features, but inserting the reconstruction back into the forward pass raises cross-entropy. Improving SAEs with gradients requires extensive backpropagation, and SAEs are often trained on cached activations without gradients. The authors ask whether the model can be modified directly after the SAE is trained.
- Freeze the trained SAEs and the original model, add LoRA to MLP and attention sublayers, and minimize the KL divergence of the next-token distribution before and after insertion. JumpReLU only adapts layers after the SAE to maintain sparsity; TopK can adapt all layers.
- The cross-entropy gap on Gemma Scope is reduced by 30%–55%. Relative to e2e, Gemma-2-2B achieves up to 20.01× speedup to the same loss, and Llama-3.2-1B achieves 2.23×–10.38×. On Llama-3.2-1B, e2e reaches a lower final loss.
- The authors state that the method modifies the model that is usually frozen for interpretation, and it has not yet been verified whether more faithful circuits can be found. e2e may not have converged, and the learning rate was not searched further. Experiments include Gemma-2-2B/9B/27B, two Llama models, and some metrics from SAEBench.
- Evaluated models
- Gemma-2-2BGemma-2-9BGemma-2-27BLlama-3.2-1BLlama-3.1-8B
- Benchmarks
- Gemma ScopeLlama ScopeRedPajamaThe Pile (uncopyrighted)SAEBenchMMLUHellaSwagTruthfulQA
- Metrics
- L_SAEL_BASEKL divergencecompound cross entropy losswall-clock speedupSCRTPPSparse ProbingAutoInterpAbsorptionnormalized log-likelihood
The paper proposes fine-tuning the language model itself with low-rank adaptation (LoRA) to adapt a pre-trained sparse autoencoder (SAE), rather than only doing post-hoc SAE training. On Gemma Scope SAEs, this method reduces the cross-entropy loss gap when inserting SAEs in the forward pass by 30% to 55%; compared with end-to-end SAEs, it reaches equivalent downstream cross-entropy loss 3 to 20 times faster on Gemma and 2 to 10 times faster on Llama. The authors state that the method can also improve downstream metrics and can adapt multiple SAEs simultaneously without harming the language model's general capabilities. The study analyzes settings including SAE sparsity, SAE width, language model scale, LoRA rank, and model layer.
Paper analysis
What problem does this paper attempt to solve?
The authors use LoRA to fine-tune the language model to reduce the cross-entropy gap after inserting the SAE.
Inserting the SAE reconstruction raises cross-entropy, and the authors instead fine-tune the model itself with LoRA to reduce this gap.
- Setting: The authors consider that SAEs decompose hidden states into interpretable linear latent variables, but the cross-entropy L_SAE after reconstructing and inserting back into the forward pass is higher than the original model loss L_BASE. The authors cite Gao et al. (2024): the L_SAE of a TopK SAE inserted into GPT-4 is equivalent to the L_BASE of a model trained with only 10% of GPT-4's pretraining compute.
- Existing practice: The authors list TopK, Gated, JumpReLU, ProLU, Switch, and e2e SAEs, and consider that these improve the sparsity–L_SAE frontier on the SAE architecture. Methods that use language model gradients require multiple backward passes; the authors cite Lieberum et al. (2024) and state that SAEs are typically trained on cached activations, with no available gradients.
- Open question: The authors frame the unexplored question as: after an SAE has been trained, can the language model itself be optimized to achieve further Pareto improvements in sparsity and L_SAE.
- This paper's approach: Use low-rank adaptation (LoRA) to fine-tune the model, reducing the KL between the original model's logits and the logits after inserting the SAE. The authors state that this can simultaneously improve L_SAE and a set of downstream SAE metrics, and that to their knowledge this is the first work focused on improving the model around an existing SAE.
What related research exists?
The paper positions itself as modifying the model around existing SAEs, rather than changing the SAE architecture or jointly training from scratch.
Related work is divided into four groups per Section 2.
SAE Architectures
- Early SAEs: Bricken et al. (2023) and Cunningham et al. (2023) use linear encoders, ReLU with L1 penalty, and linear decoders.
- Sparsity constraints: Gao et al. (2024), Bussmann et al. (2024) TopK / BatchTopK, and Rajamanoharan et al. (2024a;b) Gated SAE, JumpReLU, which approximate L0 by keeping largest activations or gating. The authors cite Karvonen et al. (2024) stating no single method is clearly better on downstream tasks.
- Gradient objectives: Braun et al. (2024) e2e SAE optimizes KL on model logits to reduce L_SAE; Olmo et al. (2024) incorporate model gradients into TopK activations. The authors consider gradient methods computationally expensive and conflicting with common gradient-free cached-activation training.
Fine-tuning SAEs
- Domain adaptation: Bricken et al. (2024) oversample specific contexts, Drori (2024) fine-tunes on domain activations.
- Conversation data: Kissane et al. (2024) report that training on conversation data captures refusal latents, while training on The Pile does not.
- Cross-model: Kutsyk et al. (2024) analyze whether base SAEs generalize to chat-tuned models and state it depends on the language model used.
Training More Interpretable Models
- Joint training with SAEs: Lai & Heimersheim (2024) and Lai & Huang (2024) train SAE and model simultaneously and find L_SAE improvements. The authors consider these require training from scratch, are difficult to apply to existing models, and are only shown in toy settings; the authors estimate their method is 10^7 times faster. The footnote says Gemma-2-2B uses 6T tokens, they use 15M tokens, at most 3% parameters, 6T/15M/0.03 = 1.3×10^7.
- Without SAEs: Elhage et al. (2022b) SoLU; Liu et al. (2023) penalize spatially distant connections; Liu et al. (2024) Kolmogorov-Arnold Networks; Heimersheim (2024) fine-tunes to remove LayerNorm from GPT-2. The paper only describes these works without numerical comparison to this paper.
Parameter-Efficient Fine-Tuning
- LoRA: Hu et al. (2021) freeze W0, use low-rank A, B updates. The authors use it as an adapter.
Baselines and data: Comparison baselines are vanilla TopK SAE and e2e SAE. Data and SAE families include Gemma Scope JumpReLU, self-trained TopK/e2e on RedPajama, Llama Scope, The Pile (uncopyrighted); downstream tasks use SAEBench, MMLU, HellaSwag, TruthfulQA.
The authors position this paper as not changing the SAE architecture nor joint training from scratch, but using LoRA to modify the model around existing SAEs, and state they have tested on models up to 27B parameters.
How does the paper address this problem?
Freeze the SAE and the original model, train only LoRA on MLP and attention, and minimize the KL before and after insertion.
The overall approach is: freeze the trained SAE and the original model, train only LoRA, so that the next-token distribution after inserting the SAE aligns with the original model.
Model and SAE Setup
- Network: The decoder Transformer has L layers and hidden dimension d. The activation at layer i is written as xi = hi(xi−1), and the output is y = softmax(xL). Unless otherwise stated, experiments use the layer-12 residual stream SAE.
- TopK: Encoder, decoder with unit-norm columns, and bias; only the k largest activations are kept as latent variables, and the reconstruction is a linear combination of latent variables by the decoder plus bias. The training loss is the squared reconstruction error. Self-trained TopK uses k=64, trained on RedPajama for 2B and 4B tokens for Gemma-2-2B and Llama-3.2-1B, respectively.
- e2e: The reconstruction continues through subsequent layers, minimizing the KL to the original model's next-token distribution rather than the reconstruction error. The same TopK activations and sparsity are used for comparison.
- JumpReLU: The activation is a JumpReLU with threshold θ, and the loss is reconstruction error plus λ times L0. The authors adapt this to Gemma Scope's JumpReLU SAEs without retraining these SAEs.
LoRA Adaptation
- Insertion position: The frozen SAE is inserted after layer ℓ, and the reconstruction continues through subsequent layers to obtain the output distribution. JumpReLU only adapts layers after the SAE to avoid changing the average sparsity; TopK can have adapters on all layers while maintaining the TopK constraint during training.
- Low-rank update: Each adapted layer's MLP and attention sublayers, and each frozen weight, get two matrices of rank r. The forward pass becomes ĥ(x)=W0x+ABx, i.e., the original linear transformation plus a low-rank update.
- Objective: Only these low-rank matrices are trained. The objective is argminΘ KL(ŷ, y), i.e., the KL between the next-token distributions before and after SAE insertion. The SAE and original model weights are frozen.
Training Setup and Multiple SAEs
- Scaling: Gemma Scope JumpReLU, trained on 15M random tokens from The Pile (uncopyrighted), with 1M tokens for validation. Ranks are 1, 4, 16, 64, and 256, and only layers after the SAE are fine-tuned.
- Time comparison: Self-trained TopK and e2e at layer 12 for both models. At each TopK 10% checkpoint, LoRA with rank 64 on all layers is applied; Llama-3.2-1B uses 100M tokens per checkpoint, and Gemma-2-2B uses 15M tokens.
- Multiple SAEs: All SAEs are inserted simultaneously during training, with the rest following Section 3.4. The metric is compound cross entropy loss, i.e., L_SAE when all SAEs are inserted simultaneously. Llama Scope has width 131072 and L0=50, used for Llama-3.1-8B; layer combinations are 1, 3, 5, 7, 10, and 15 SAEs, with layer numbers chosen to increase the layer distance between adjacent SAEs.
Downstream Evaluation
- SAEBench: The same Gemma-2-2B TopK (L0=64) is used, comparing the original model plus SAE with LoRA plus SAE on all layers with rank 64. Metrics are SCR, TPP, Sparse Probing, AutoInterp, and Absorption. The reviewer model for AutoInterp is GPT-4o-mini. RAVEL was not implemented at the time, and Unlearning is recommended only for instruct models, so these were excluded.
- Steering: For latent variable v at layer l, the activation is changed to xl plus α times (xl·v)v. Positive examples are generated by GPT-4o-mini according to four latent variables, and negative examples are an equal mix of five text categories; Appendix A.1.2 gives the full prompt for generating positive examples. The paper does not specify the model used for steering in Section 5.2.
- General capability: Before and after adaptation, with and without SAE insertion, benchmarks are MMLU, HellaSwag, and TruthfulQA. The paper does not specify the SAE family used in Table 5.
What experiments did the paper conduct?
The gap shrinks by 30%–55% on Gemma Scope; Gemma-2-2B achieves up to 20.01× speedup relative to e2e.
Experimental Setup
- Models: Gemma-2-2B, Gemma-2-9B, Gemma-2-27B, Llama-3.2-1B, Llama-3.1-8B. Figure 4 caption says Gemma-2-2B, 7B, 27B; axis labels say 2B, 9B, 27B; Table 5 says Gemma-2-9B. AutoInterp evaluation and some steering text generation use GPT-4o-mini.
- SAEs and data: Gemma Scope JumpReLU; self-trained TopK and e2e use RedPajama, k=64. Figure 1 uses Gemma-2-2B, width 18432, L0=64, 2B tokens; Figure 5 uses Llama-3.2-1B, width 16384, L0=64. Scaling experiments use The Pile (uncopyrighted) with 15M training tokens and 1M validation tokens. Llama Scope has width 131072, L0=50.
- Baselines and adaptation: vanilla TopK and e2e. Scaling ranks are 1, 4, 16, 64, 256; timing comparisons use rank 64, all layers. JumpReLU scaling adapts only layers after the SAE.
- Metrics: L_SAE, L_BASE, and the absolute and percentage gap; wall-clock time and speedup to reach a given CE; number of language model backward passes; compound CE; SAEBench metrics (0 to 1, higher is better except Absorption); normalized log-likelihood change for steering and 90% CI; Table 5 scores have one standard error.
- Sample sizes: Steering uses 500 examples per latent. Per-token analysis uses 15M validation tokens; activation distance uses 500k tokens. The paper does not report the number of repetitions or random seeds for CE curves.
- Evaluation: The primary metric is cross-entropy or KL after SAE insertion. AutoInterp is scored by GPT-4o-mini; the paper does not provide a threshold or agreement with humans.
Main Results
From Table 1 and Table 2 (times rounded to nearest hour). The table below lists only the endpoints; intermediate rows are discussed later.
Swipe horizontally to read the table
Model CE threshold TopK+LoRA e2e Speedup Gemma-2-2B 2.60 12h 37h 3.05× Gemma-2-2B 2.57 12h 243h 20.01× Llama-3.2-1B 2.73 9h 96h 10.38× Llama-3.2-1B 2.70 70h 156h 2.23× - The authors state that TopK+LoRA outperforms e2e and vanilla TopK in Figures 1 and 5. The two figures annotate original model losses of 2.4760 and 2.5481, respectively. The text does not show the exact losses at the curve endpoints.
- The authors state that e2e achieves lower final CE on Llama-3.2-1B, but not on Gemma-2-2B. Table 1's 2.55–2.57 reports only TopK+LoRA (12h–107h); Table 2's 2.67–2.70 reports only e2e (156h–213h). The TopK column in Table 2 is all dashes. Additional speedups not listed in the table include 6.53×, 12.18×, 9.08×, 7.14×.
- The authors state that relative to e2e, Gemma-2-2B requires 130× fewer language model backward passes, and Llama-3.2-1B requires 40× fewer. The abstract says 3×–20× and 2×–10×; the table ranges are 3.05×–20.01× and 2.23×–10.38×.
Sparsity, Width, Layer, and Model Scale
- Gap: Section 4.1 states that on the tested Gemma Scope settings, LoRA reduces L_SAE−L_BASE by at least 30%, sometimes reaching 55%; final gaps range from 0.01 to 0.17 nats. The authors state that larger ranks lead to lower final L_SAE; at 15M tokens the adapter has not converged, and more compute could further reduce loss.
- Figure 3: With fixed width 16k and layer 12, percentage improvement is larger at lower sparsity, with improvement still present at high sparsity. With fixed L0=68 and layer 12, percentage improvement is highest at low width, though the authors state the effect is small. With fixed L0=68 and width 16k, percentage improvement is highest at layer 9, with little overall effect from layer. The text does not provide values for individual points.
- Figure 4: Width 16k, L0 closest to 70. The authors state the method improves with larger models and suggest the larger improvements at low sparsity, low width, and large models may be due to higher initial gaps. The caption says 7B, axis labels say 9B.
Multiple SAEs, SAEBench, and Capabilities
- Multiple SAEs: Section 4.3 states that inserting 5 SAEs on Llama-3.1-8B yields a cross-entropy error of nearly 10 nats. Compound CE for 7 SAEs goes from 7.83 nats to 2.78 nats; for 3 SAEs from 3.55 nats to 2.45 nats, and 2.45 is lower than the original validation CE without LoRA for a single SAE. LoRA uses 15M tokens. The authors believe this is useful for circuit analysis. Figure 6 also has numbers not aligned to specific SAE counts in the text; these are not filled in here.
- SAEBench: In Table 3, LoRA vs. TopK: SCR max 0.526 vs. 0.448, average 0.314 vs. 0.289; TPP max 0.412 vs. 0.372, average 0.145 vs. 0.111; Sparse Probing top 1 is 0.760 vs. 0.732, test is 0.956 vs. 0.955. AutoInterp is 0.830 vs. 0.832, Absorption is 0.210 vs. 0.205 (higher is worse). In Table 6, SCR@2 is 0.094 vs. 0.097, SCR@50 is 0.447 vs. 0.448. The authors state LoRA is better on most applicable metrics, with these two slightly worse.
- Steering and capabilities: Table 4's ΔPOSITIVE, ΔNEGATIVE (500 examples, 90% CI) are: Machine Learning 0.86±0.82 and −0.84±0.43; San Francisco 0.97±0.76 and 0.06±0.20; Donald Trump 2.50±0.56 and 0.20±0.40; COVID-19 0.44±0.25 and −0.01±0.06. The table note says ΔNEGATIVE≤0, but the last two point estimates are positive. In Table 5, Gemma-2-2B with SAE insertion has MMLU 45.8±0.4 vs. 44.2±0.4. Exceptions: Gemma-2-27B with SAE insertion has BLEU 38.9±1.7 vs. 40.9±1.7, ROUGE-1 38.3±1.7 vs. 41.0±1.7. Without SAE, Gemma-2-9B MMLU is LoRA 68.8±0.4, original model 70.0±0.4. The authors state capabilities are not impaired and often better; these cells are inconsistent with that summary. The paper does not specify the SAE family, rank, or token count for Table 5.
Other Ablations and Analyses
- Single-layer LoRA (Figure 9, Gemma Scope 2B): worse the farther from the SAE; training only the layer after the SAE achieves 88.14% of the loss reduction from all subsequent layers (§6.3).
- Per-token (Figure 8, 15M validation tokens): 37% of tokens have worse loss; the authors state most improvements come from small decreases around 10^(−2) to 1 nats. The contributions list also states most improvements occur on tokens with lower L_SAE.
- Activation distance (Figure 11, 500k tokens): the authors state distance slightly decreases and cosine similarity slightly increases, so it does not take a different computational path as feared by Braun et al. (2024). The text does not provide per-layer differences.
- Ranks 1, 4, 16, 64, 256: the authors state larger ranks correspond to lower final L_SAE; no convergence seen at 15M tokens (§4.1).
- Backward passes: Gemma-2-2B requires 130× fewer than e2e, Llama-3.2-1B 40× fewer (§4.2). The paper does not report learning rate values or search.
What are some points that can be further explored?
The authors state that they modified the explained model and have not yet verified whether more faithful circuits can be discovered.
Limitations and Future Directions Noted by the Authors
- Modifying the model: Mechanistic interpretability typically explains frozen models; this work modifies the model. The authors state that this may be unacceptable for some applications (§7.1). They also write: if SAEs are already intended to be used, this method reduces the KL to the original model and is therefore more faithful.
- Circuits: The authors state that they have not yet shown that this technique can discover more faithful behavioral circuits, and leave this direction for future work (§7.1).
- e2e convergence: The authors state that the e2e SAE may not have converged, so converged accuracy cannot be compared; training was stopped after more than a week, and training to full convergence may be impractical (§7.1).
- Learning rate: The recommended value from Gao et al. (2024) is used. The authors believe further tuning might make e2e training faster; due to computational constraints, no learning rate experiments were conducted (§7.1).
- More tokens: The authors state that if LoRA used more tokens, the Gemma Scope scaling experiments might show additional improvements; current results come from 15M tokens (§7.1).
Experimental Coverage
- Models: The experiments specify Gemma-2-2B, Gemma-2-9B and Gemma-2-27B in Table 5, Llama-3.2-1B, and Llama-3.1-8B. The Figure 4 caption says 7B, while the axis labels say 2B, 9B, and 27B.
- SAE: Covers Gemma Scope JumpReLU, self-trained TopK and e2e, and Llama Scope TopK. The number of SAEs is 1, 3, 5, 7, 10, and 15, with layer numbers given in Section 4.3. SAEBench uses the Gemma-2-2B TopK from Section 4.2, L0=64, with rank 64 for all layers.
- Downstream: SAEBench includes SCR, TPP, Sparse Probing, AutoInterp, and Absorption. The paper states that RAVEL was not implemented and Unlearning is recommended only for instruct models, so these were not done. The capability table includes MMLU, HellaSwag, BLEU, ROUGE-1, ROUGE-2, and MC1; the main text names MMLU, HellaSwag, and TruthfulQA.
- Scale: LoRA for Gemma scaling, Gemma checkpoints, and multiple SAEs uses 15M tokens; the Llama-3.2-1B checkpoint uses 100M tokens. Steering uses 4 latent variables, 500 examples each, and 90% CI.
- Unspecified items: The paper does not report the number of repetitions for the CE curves, agreement between AutoInterp and humans, learning rate values, the model used for steering experiments, or the SAE family, rank, and token count for Table 5.
Summarize the main content of the paper
LoRA reduces the cross-entropy gap after inserting SAEs, with improvements also in multiple SAEs and some downstream metrics.
The authors use LoRA to fine-tune the language model around a trained SAE, reducing the cross-entropy gap after reconstruction is inserted back.
- Problem: SAE latents are more interpretable, but inserting reconstructions makes L_SAE higher than L_BASE. Gradient-based improvements to the SAE require multiple backward passes and often conflict with gradient-free cached-activation training.
- Method: Freeze the SAE and original weights, train low-rank adapters on MLP and attention, minimizing KL before and after insertion. JumpReLU only modifies layers after the SAE; TopK can modify all layers while maintaining TopK. Multiple SAEs can be inserted in the same training run.
- Main results: On Gemma Scope, the gap is reduced by 30%–55%, with final gaps of 0.01–0.17 nats. For Gemma-2-2B at CE=2.57, TopK+LoRA takes 12h vs. e2e's 243h (Table 1, 20.01×). For Llama-3.2-1B, speedups are 2.23×–10.38× (Table 2), but the authors state e2e achieves lower final CE.
- Other results: On Llama-3.1-8B, compound CE for 7 SAEs goes from 7.83 nats to 2.78 nats (§4.3). On SAEBench, SCR max goes from 0.448 to 0.526, AutoInterp from 0.832 to 0.830 (Table 3). Training only the layer after the SAE achieves 88.14% of the loss reduction from all subsequent layers. 37% of validation tokens have worse loss.
- Authors' conclusions: The authors argue that improving interpretability need not be limited to post-hoc SAE training; directly optimizing the model can also yield Pareto improvements. They hypothesize the method is faster than e2e because modifying the entire model gives optimization more freedom. They also note the model is modified and that they have not yet shown it discovers more faithful circuits. In Table 5, Gemma-2-27B with SAE insertion has lower BLEU and ROUGE than the unadapted SAE setting.