Improving Sparse Decomposition of Language Model Activations with Gated Sparse Autoencoders

Authors: senthooran  rajamanoharan
google  deepmind
arthur  conmy
lewis  smith
tom  lieberum
vikrant  varma
rohin  shah
neel  nanda
Venue: NeurIPS_cc_2024_Conference
Published: 2024-05-14 11:21:06

Abstract: Recent work has found that sparse autoencoders (SAEs) are an effective technique for unsupervised discovery of interpretable features in language models' (LMs) activations, by finding sparse, linear reconstructions of those activations. We introduce the Gated Sparse Autoencoder (Gated SAE), which achieves a Pareto improvement over training with prevailing methods. In SAEs, the L1 penalty used to encourage sparsity introduces many undesirable biases, such as shrinkage -- systematic underestimation of feature activations. The key insight of Gated SAEs is to separate the functionality of (a) determining which directions to use and (b) estimating the magnitudes of those directions: this enables us to apply the L1 penalty only to the former, limiting the scope of undesirable side effects. Through training SAEs on LMs of up to 7B parameters we find that, in typical hyper-parameter ranges, Gated SAEs solve shrinkage, are similarly interpretable, and require half as many firing features to achieve comparable reconstruction fidelity.

Main paper: 
 introduction: 
 Mechanistic interpretability aims to explain how neural networks produce outputs in terms of the learned algorithms executed during a forward pass [33, 34] . Much work makes use of the fact that many concept representations appear to be linear [14, 19, 34, 39] , i.e. that they correspond to interpretable directions in activation space. However, finding the set of all interpretable directions is a highly non-trivial problem. Classic approaches, like interpreting neurons (i.e. directions in the standard basis) are insufficient, as many are polysemantic and tend to activate for a range of different seemingly unrelated concepts [7, 15, 16] . Within the field, there has recently been much interest [8, 11, 21, 22, 4] in using sparse autoencoders (SAEs; [32] ) as an unsupervised method for finding causally relevant, and ideally interpretable, directions in a language model's activations.Although SAEs show promise in this regard [26, 31] , the L1 penalty used in the prevailing training method to encourage sparsity also introduces biases that harm the accuracy of SAE reconstructions, as the loss can be decreased by trading-off some reconstruction accuracy for lower L1. In this paper, we introduce a modification to the baseline SAE architecture -a Gated SAE -along with an accompanying loss function, which partially overcomes these limitations. Our key insight is to use separate affine transformations for (a) determining which dictionary elements to use in a reconstruction and (b) estimating the coefficients of active elements, and to apply the sparsity penalty only to the former task. We share a subset of weights between these transformations to avoid significantly Figure 1 : Gated SAEs consistently offer improved reconstruction fidelity for a given level of sparsity compared to prevailing (baseline) approaches. These plots compare Gated SAEs to baseline SAEs at Layer 20 in Gemma-7B. Gated SAEs' dictionaries are of size 2 17 ≈ 131k whereas baseline dictionaries are 50% larger, so that both types are trained with equal compute. This performance improvement holds in layers throughout GELU-1L, Pythia-2.8B and Gemma-7B (see Appendix E). increasing the parameter count and inference-time compute requirements of a Gated SAE compared to a baseline SAE of equivalent width. 2We evaluate Gated SAEs on multiple models: a one layer GELU activation language model [28] , Pythia-2.8B [3] and Gemma-7B [18] , and on multiple sites within models: MLP layer outputs, attention layer outputs, and residual stream activations. Across these models and sites, we find Gated SAEs to be a Pareto improvement over baseline SAEs holding training compute fixed (Fig. 1 ): they yield sparser decompositions at any desired level of reconstruction fidelity. We also conduct further follow up ablations and investigations on a subset of these models and sites to better understand the differences between Gated SAEs and baseline SAEs.Overall, the key contributions of this work are that we:1. Introduce the Gated SAE, a modification to the standard SAE architecture that decouples detection of which features are present from estimating their magnitudes (Section 3.2); 2. Show that Gated SAEs Pareto improve the sparsity and reconstruction fidelity trade-off compared to baseline SAEs (Section 4.1); 3. Confirm that Gated SAEs overcome shrinkage while outperforming other methods that also address this problem (Section 5.2); 4. Provide evidence from a small double-blind study that Gated SAE features are comparably interpretable to baseline SAE features (Section 4.2). 
preliminaries: 
 In this section we summarise the concepts and notation necessary to understand existing SAE architectures and training methods following Bricken et al. [8] , which we call the baseline SAE. We define Gated SAEs in Section 3.2.As motivated in Section 1, we wish to decompose a model's activation x ∈ R n into a sparse, linear combination of feature directions:EQUATIONwhere d i are dictionary of M ≫ n latent unit-norm feature directions, and the sparse coefficients f i (x) ≥ 0 are the corresponding feature activations for x. 3 The right-hand side of Eq. (1) naturally has the structure of an autoencoder: an input activation x is encoded into a (sparse) feature activations vector f (x) ∈ R M , which in turn is linearly decoded to reconstruct x.Baseline architecture Using this correspondence, Bricken et al. [8] and subsequent works attempt to learn a suitable sparse decomposition by parameterizing a single-layer autoencoder (f , x) defined by: f (x) := ReLU (W enc (x -b dec ) + b enc ) (2) x(f ) := W dec f + b dec (3) and training it using gradient descent to reconstruct samples x ∼ D from a large dataset D of activations collected from a single site and layer of a trained language model, constraining the hidden representation f to be sparse. Once the sparse autoencoder has been trained, we obtain a decomposition of the form of Eq. ( 1) by identifying the (suitably normalised) columns of the decoder weight matrix W dec ∈ R M ×n with the dictionary of feature directions d i , the decoder bias b dec ∈ R n with the centering term x 0 , and the (suitably normalised) entries of the latent representation f (x) ∈ R M with the feature activations f i (x).Baseline training methodology To train sparse autoencoders, Bricken et al. [8] use a loss function with two terms that respectively encourage faithful reconstruction and sparsity:4 EQUATION)Since it is possible to arbitrarily reduce the L1 sparsity loss term without affecting reconstructions or sparsity by simply scaling down encoder outputs and scaling up the norm of the decoder weights, it is important to constrain the norms of the columns of W dec during training. Following Bricken et al. [8] , we constrain norms to one. See Appendix G for further details on SAE training.Evaluating SAEs Two metrics are primarily used to get a sense of SAE quality [8] : L0, a measure of SAE sparsity, and loss recovered, a measure of SAE reconstruction fidelity. L0 measures the average number of features used by a SAE to reconstruct input activations. Loss recovered is a normalised measure of the increase induced in a LM's cross entropy loss when we replace its original activations with the corresponding SAE reconstructions during the model's forward pass. Both these metrics are formally defined in Appendix B, where we also discuss shortcomings of and alternatives to the loss recovered metric as it is defined in Bricken et al. [8] . Since it is possible for SAEs to score well on these metrics and still fail to be useful for interpretability-related tasks [47] , we perform manual analysis of SAE interpretability in Section 4.2.3 Gated SAEs 
motivation: 
 The intention behind how SAEs are trained is to maximise reconstruction fidelity at a given level of sparsity, as measured by L0, although in practice we optimize a mixture of reconstruction fidelity and L1 regularization. This difference is a source of unwanted bias in the training of a sparse autoencoder: for any fixed level of sparsity, a trained SAE can achieve lower loss (as defined in Eq. ( 4)) by trading off a little reconstruction fidelity to perform better on the L1 sparsity penalty.The clearest consequence of this bias is shrinkage [51] . Holding the decoder x(•) fixed, the L1 penalty pushes feature activations f (x) towards zero, while the reconstruction loss pushes f (x) high enough to produce an accurate reconstruction. Thus, the optimal value falls somewhere in between, and as a result the SAE systematically underestimates the magnitude of feature activations, without necessarily providing any compensatory benefit for sparsity. 5How can we reduce the bias introduced by the L1 penalty? The output of the encoder f (x) of a baseline SAE (Section 2) has two roles:1. It detects which features are active (according to whether the outputs are zero or strictly positive). For this role, the L1 penalty is necessary to ensure the decomposition is sparse. 2. It estimates the magnitudes of active features. For this role, the L1 penalty is a source of unwanted bias.If we could separate out these two functions of the SAE encoder, we could design a training loss that narrows down the scope of SAE parameters that are affected (and therefore to some extent biased) by the L1 sparsity penalty to precisely those parameters that are involved in feature detection, minimising its impact on parameters used in feature magnitude estimation.Architecture How should we modify the baseline SAE encoder to achieve this separation of concerns? Our solution is to replace the single-layer ReLU encoder of a baseline SAE with a gated ReLU encoder. Taking inspiration from Gated Linear Units [43, 12] , we define the gated encoder asEQUATIONwhere 1[• > 0] is the (pointwise) Heaviside step function and ⊙ denotes elementwise multiplication. Here, f gate determines which features are deemed to be active, while f mag estimates feature activation magnitudes (which only matter for features that have been deemed to be active); π gate (x) are the f gate sub-layer's pre-activations, which are used in the gated SAE loss, defined below.Training A naive guess at a loss function for training Gated SAEs would be to replace the sparsity penalty in Eq. ( 4) with the L1 norm of f gate (x). Unfortunately, due to the Heaviside step activation function in f gate , no gradients would propagate to W gate and b gate . To mitigate this, we instead apply the L1 norm to the positive parts of the preactivation, ReLU (π gate (x)). To ensure f gate aids reconstruction by detecting active features, we add an auxiliary task requiring that these same rectified preactivations can be used by the decoder to produce a good reconstruction:EQUATION)where xfrozen is a frozen copy of the decoder, xfrozen (f ) := W copy dec f + b copy dec , to ensure that gradients from L aux do not propagate back to W dec or b dec . This can be implemented by stop gradient operations rather than creating copies. See Appendix J for pseudo-code for the forward pass and loss function.To calculate this loss (or its gradient), we have to run the decoder twice: once to perform the main reconstruction for L reconstruct and once to perform the auxiliary reconstruction for L aux . This leads to a 50% increase in the compute required to perform a training update step. However, the increase in overall training time is typically much less, as in our experience much of the training wall clock time goes to generating language model activations (if these are being generated on the fly) or disk I/O (if training on saved activations).Parameter reduction through weight-tying Naively, we appear to have doubled the number of parameters in the encoder, increasing the total number of parameters by 50% with respect to baseline SAEs. We mitigate this through weight sharing: we parameterize these layers so that the two layers share the same projection directions, but allow the norms of these directions as well as the layer biases to differ. Concretely, we define W mag in terms of W gate and an additional vector-valued rescaling parameter r mag ∈ R M as follows:EQUATIONSee Fig. 2 for an illustration of the tied-weight Gated SAEs architecture. With this weight tying scheme, the Gated SAE has only 2 × M more parameters than a baseline SAE. In Section 5.1, we show that this weight tying scheme does not harm performance.With tied weights, the gated encoder can be reinterpreted as a single-layer linear encoder with a nonstandard and discontinuous "JumpReLU" activation function [17] , σ θ (z), illustrated in Fig. 12 . To be precise, using the weight tying scheme of Eq. ( 7), f (x) can be re-expressed as f (x) = σ θ (W mag • x + b mag ), with the JumpReLU gap given by θ = b mag -e rmag ⊙ b gate ; see Appendix H for an explanation. We think this is a useful intuition for reasoning about how Gated SAEs reconstruct activations in practice. 
evaluating gated saes: 
 In this section we benchmark Gated SAEs against baseline SAEs across a large variety of models and at different sites. We show that they produce more faithful reconstructions at equal sparsity and that they resolve shrinkage. Through a double-blind manual interpretability study, we find that Gated SAEs produce features that are similarly interpretable to baseline SAE features.Methodology We trained a suite of Gated and baseline SAEs, a family of each type to reconstruct each of the following activations:1. The MLP neuron activations in GELU-1L, which is the closest direct comparison to Bricken et al. [8] ; 2. The MLP outputs, attention layer outputs (taken pre-W O [21] ) and residual stream activations in 5 different layers throughout Pythia-2.8B and four different layers in the Gemma-7B base model.For each model and reconstruction site, we trained multiple SAEs using different values of λ (and therefore L0), allowing us to compare the Pareto frontiers of L0 and loss recovered between Gated and baseline SAEs. We also use the relative reconstruction bias metric, γ, defined in Appendix C to measure shrinkage in our trained SAEs. This metric measures the relative bias in the norm of an SAE's reconstructions; unbiased SAEs obtain γ = 1, whereas SAEs affected by shrinkage (which causes reconstruction norms to be systematically too small) have γ < 1.Since Gated SAEs require at most 1.5× more compute to train than regular SAEs (Section 3.2) of the same width, we compare Gated SAEs to baseline SAEs that have a 50% larger dictionary (hidden dimension M ) to ensure fair comparison in our evaluations. 6Results We plot sparsity against reconstruction fidelity for SAEs with different values of λ. Higher λ corresponds to increased sparsity and worse reconstruction, so as in Bricken et al. [8] we observe a Pareto frontier of possible trade-offs. We plot Pareto curves for GELU-1L in Fig. 3a and Pythia-2.8B and Gemma-7B in Appendix E. At all sites tested, Gated SAEs are a Pareto improvement over regular SAEs: they provide better reconstruction fidelity at any fixed level of sparsity. 7 For some sites in Pythia-2.8B and Gemma-7B, loss recovered does not monotonically increase with L0; we attribute this to difficulties training SAEs (Appendix G.1.3). Finally, full tables of results for Pythia and Gemma can be found in Appendix K. As shown in Fig. 3b , Gated SAEs' reconstructions are unbiased, with γ ≈ 1, whereas baseline SAEs exhibit shrinkage (γ < 1), with the impact of shrinkage getting worse as the L1 coefficient λ increases (and L0 consequently decreases). Fig. 10 shows that this result generalizes to Pythia-2.8B.Although Gated SAEs provide more faithful reconstructions than baselines at equal sparsity, it does not necessarily follow that these reconstructions are better suited to downstream interpretabilityrelated tasks. Currently, there is no consensus on how to systematically assess the degree to which a SAE's features are useful for downstream tasks, but a plausible proxy is to assess the extent to which these features are human interpretable [8] . Therefore, to gain a more qualitative understanding of the differences between their learned features, we conduct a blinded human study in which we rate and compare the interpretability of randomly sampled Gated and baseline SAE features.Methodology We study a variety of SAEs from different layers and sites. For Pythia-2.8B we had 5 raters, who each rated one feature from baseline and Gated SAEs trained on each (site, layer) pair from Fig. 8 , for a total of 150 features. For Gemma-7B we had 7 raters; one rated 2 features each, and the rest 1 feature each, from baseline or Gated SAEs trained on each (site, layer) pair from Fig. 9 , for a total of 192 features.For each model, raters are shown the features in random order, without revealing which SAE, site, or layer they came from. 8 To assess a feature, the rater decides whether there is an explanation of the feature's behavior, in particular for its highest activating examples. The rater then enters that explanation (if applicable) and selects whether the feature is interpretable ('Yes'), uninterpretable ('No') or maybe interpretable ('Maybe'). All raters are either authors of this paper or colleagues, who have prior experience interpreting SAE features. As an interface we use an open source SAE visualizer library [27] ; representative screenshots of the dashboards produced by this library are shown in Fig. 14 .Results & analysis Fig. 4 shows interpretability rating distributions by SAE type and LM, marginalising over layers, sites and raters. 9 To compare the interpretability of baseline and Gated SAEs, we first pair our datapoints according to all covariates (model, layer, site, rater); this lets us control for all of them without making any parametric assumptions, and thus reduces variance in the comparison. We then measure the mean difference between baseline and Gated labels, where we count 'No' as 0, 'Maybe' as 1, and 'Yes' as 2, and compute a 90% BCa bootstrap confidence interval. Thus we find that the mean difference in label scores is 0.13 (90% CI [0, 0.26]) in favour of Gated SAEs, breaking down to mean difference CIs of [-0.07, 0.33] and [-0.04, 0.29] on just the Pythia-2.8B data and Gemma-7B data respectively. Since our central estimate for the mean difference in scores is positive, we also test the hypothesis that Gated SAEs may be more interpretable than baseline SAEs. However, a one-sided Wilcoxon-Pratt signed-rank test on the paired scores does not reject the null hypothesis that they are equally interpretable (p = 0.06). The contingency tables used for these results are shown in Fig. 13 . The overall conclusion is that Gated SAE features are similarly interpretable to baseline SAE features, while also providing better reconstruction fidelity (at fixed sparsity), as shown in the previous section. We provide more analysis of how these break down by site and layer in Appendix I.5 Why do Gated SAEs improve SAE training?Question: Does the paper fully disclose all the information needed to reproduce the main experimental results of the paper to the extent that it affects the main claims and/or conclusions of the paper (regardless of whether the code and data are provided or not)? Answer: [Yes] Justification: The main body of the paper provides a detailed explanation of the Gated SAE architecture and loss function (Section 3) that are the main contributions of the paper; additionally, pseudo-code to help reproduction is provided in Appendix J. We provide a high level summary of the training approach in Section 2 and Section 3, with details on hyperparameters and compute requirements in Appendix G. We also explain the methodologies for our benchmarking and manual interpretability experiments in Section 4 in sufficient detail to be able to reproduce the results there. Guidelines:• The answer NA means that the paper does not include experiments.• If the paper includes experiments, a No answer to this question will not be perceived well by the reviewers: Making the paper reproducible is important, regardless of whether the code and data are provided or not. • If the contribution is a dataset and/or model, the authors should describe the steps taken to make their results reproducible or verifiable. • Depending on the contribution, reproducibility can be accomplished in various ways.For example, if the contribution is a novel architecture, describing the architecture fully might suffice, or if the contribution is a specific model and empirical evaluation, it may be necessary to either make it possible for others to replicate the model with the same dataset, or provide access to the model. In general. releasing code and data is often one good way to accomplish this, but reproducibility can also be provided via detailed instructions for how to replicate the results, access to a hosted model (e.g., in the case of a large language model), releasing of a model checkpoint, or other means that are appropriate to the research performed. • While NeurIPS does not require releasing code, the conference does require all submissions to provide some reasonable avenue for reproducibility, which may depend on the nature of the contribution. For example (a) If the contribution is primarily a new algorithm, the paper should make it clear how to reproduce that algorithm.(b) If the contribution is primarily a new model architecture, the paper should describe the architecture clearly and fully. (c) If the contribution is a new model (e.g., a large language model), then there should either be a way to access this model for reproducing the results or a way to reproduce the model (e.g., with an open-source dataset or instructions for how to construct the dataset). (d) We recognize that reproducibility may be tricky in some cases, in which case authors are welcome to describe the particular way they provide for reproducibility.In the case of closed-source models, it may be that access to the model is limited in some way (e.g., to registered users), but it should be possible for other researchers to have some path to reproducing or verifying the results. 
ablation study: 
 In this section, we vary several parts of the Gated SAE training methodology to gain insight into which aspects of the training drive the observed improvement in performance. Gated SAEs differ from baseline SAEs in many respects, making it easy to incorrectly attribute the performance gains to spurious details without a careful ablation study. Fig. 5a shows Pareto frontiers for these variations; below we describe each variation in turn and discuss our interpretation of the results.Unfreeze decoder: Here we unfreeze the decoder weights in L aux -i.e. allow this auxiliary task to update the decoder weights in addition to training f gate 's parameters. Although this (slightly) simplifies the loss, there is a reduction in performance, suggesting that it is beneficial to limit the impact of the L1 sparsity penalty to just those parameters in the SAE that need it -i.e. those used to detect which features are active.No r mag : Here we remove the r mag scaling parameter in Eq. ( 7), effectively setting it to zero, further tying f gate 's and f mag 's parameters together. With this change, the two encoder sublayers' preactivations can at most differ by an elementwise shift. 10 There is a slight drop in performance, suggesting r mag contributes somewhat to the improved performance of the Gated SAE.Untied encoders: Here we check whether our choice to share the majority of parameters between the two encoders has meaningfully hurt performance, by training Gated SAEs with gating and ReLU encoder parameters completely untied. Despite the greater expressive power of an untied encoder, we see no improvement in performance -in fact a slight deterioration. This suggests our tying scheme (Eq. ( 7)) -where encoder directions are shared, but magnitudes and biases aren't -is effec- Figure 5 : (a) Our ablation study on GELU-1L MLP neuron activations indicates: (i) the importance of freezing the decoder in the auxiliary task L aux used to train f gate 's parameters; (ii) tying encoder weights according to Eq. ( 7) is slightly beneficial for performance (in addition to yielding a significant reduction in parameter count and inference compute); (iii) further simplifying the encoder weight tying scheme in Eq. ( 7) by removing r mag is mildly harmful to performance. (b) Evidence from GELU-1L that the performance improvement of gated SAEs does not solely arise from addressing shrinkage (systematic underestimation of latent feature activations): taking a frozen baseline SAE's parameters and learning r mag and b mag parameters on top of them (green line) does successfully resolve shrinkage, by decoupling feature magnitude estimation from active feature detection; however, it explains only a small part of the performance increase of gated SAEs (red line) over baseline SAEs (blue line).tive at capturing the advantages of using a gated SAE while avoiding the 50% increase in parameter count and inference-time compute of using an untied SAE.As explained in Section 3.1, SAEs trained with the baseline architecture and L1 loss systematically underestimate the magnitudes of latent features' activations (i.e. shrinkage). Gated SAEs, through modifications to their architecture and loss function, overcome these limitations.It is natural to ask to what extent the performance improvement of Gated SAEs is solely attributable to addressing shrinkage. Although addressing shrinkage would -all else staying equal -improve reconstruction fidelity, it is not the only way to improve SAEs' performance: for example, Gated SAEs could also improve upon baseline SAEs by learning better encoder directions (for estimating when features are active and their magnitudes) or by learning better decoder directions (i.e. better dictionaries for reconstructing activations).Here we try to answer this question by comparing Gated SAEs trained as described in Section 3.2 with an alternative (architecturally equivalent) approach that also addresses shrinkage, but in a way that uses frozen encoder and decoder directions from a baseline SAE of equal dictionary size. 11 Any performance improvement over baseline SAEs obtained by this alternative approach (which we dub "baseline + rescale & shift") can only be due to better estimations of active feature magnitudes, since by construction an SAE parameterized by "baseline + rescale & shift" shares the same encoder and decoder directions as a baseline SAE.As shown in Fig. 5b , although resolving shrinkage only ("baseline + rescale & shift") does improvement baseline SAEs' performance a little, a significant gap remains with respect to the performance of Gated SAEs. This suggests that the benefit of the gated architecture and loss comes from learning better encoder and decoder directions, not just from overcoming shrinkage. In Appendix D we ex-plore further how Gated and baseline SAEs' decoders differ by replacing their respective encoders with an optimization algorithm at inference time.Question: Does the paper provide open access to the data and code, with sufficient instructions to faithfully reproduce the main experimental results, as described in supplemental material? Answer: [No] Justification: We are unable to provide open access to the activation datasets or code used to train the SAEs in our experiments. However, the experiments we have reported involved training SAEs on solely open-source language models, and we have provided pseudo-code for our main contributions (Appendix J). These -alongside open-source codebases that are available for training SAEs (e.g. [5] ) -should be enough to reproduce our main experimental results. Guidelines:• The answer NA means that paper does not include experiments requiring code.• Please see the NeurIPS code and data submission guidelines (https://nips.cc/ public/guides/CodeSubmissionPolicy) for more details. • While we encourage the release of code and data, we understand that this might not be possible, so "No" is an acceptable answer. Papers cannot be rejected simply for not including code, unless this is central to the contribution (e.g., for a new open-source benchmark). • The instructions should contain the exact command and environment needed to run to reproduce the results. See the NeurIPS code and data submission guidelines (https: //nips.cc/public/guides/CodeSubmissionPolicy) for more details. • The authors should provide instructions on data access and preparation, including how to access the raw data, preprocessed data, intermediate data, and generated data, etc. • The authors should provide scripts to reproduce all experimental results for the new proposed method and baselines. If only a subset of experiments are reproducible, they should state which ones are omitted from the script and why. • At submission time, to preserve anonymity, the authors should release anonymized versions (if applicable). • Providing as much information as possible in supplemental material (appended to the paper) is recommended, but including URLs to data and code is permitted. 
related work: 
 Mechanistic interpretability Recent work in mechanistic interpretability has found recurring components in small and large LMs [38] , identified computational subgraphs that carry out specific tasks in small LMs (circuits; [50] ) and reverse-engineered how toy tasks are carried out in small transformers [30] . A central difficulty in this kind of work is choosing the right units of analysis. Sparse linear features have been identified as a promising candidate in prior work [52, 46] . The superposition hypothesis outlined by Elhage et al. [16] also provided a theoretical basis for this theory, sparking a new interest in using SAEs specifically to learn a feature basis [42, 8, 11, 21, 22, 4] , as well as using SAEs directly for circuit analysis [26] . Other work has drawn awareness to issues or drawbacks with SAE training for this purpose, some of which our paper mitigates. Wright and Sharkey [51] raised awareness of shrinkage and proposed addressing this via fine-tuning. Gated SAEs, as discussed, resolve shrinkage during training. [35, 47, 2, 36] have also proposed general SAE training methodology improvements, which are mostly orthogonal to the architectural changes discussed in this work. In parallel work, Taggart [45] finds early improvements using a Jump ReLU [17] , but with a different loss function, and without addressing the problems of the L1 penalty.Classical dictionary learning Research into the general problem of sparse dictionary learning precedes transformers, and even deep learning. For example, sparse coding [13] studies how discrete and continuous representations can involve more representations than basis vectors, and sparse representations are also studied in neuroscience [48, 37] . One dictionary learning algorithm, k-SVD [1] also uses two stages to learn a dictionary like Gated SAEs. Although classical dictionary learning algorithms can be more powerful than SAEs (Appendix D), they are less suited for downstream uses like weights-based circuit analysis or attribution patching [44, 24] , because they typically use an iterative algorithm to decompose activations, whereas SAEs make feature extraction explicit via the encoder. Bricken et al. [8] have also argued that classical algorithms may be 'too strong', in the sense they may learn features the LM itself could not access, whereas SAEs uses components similar to a LM's MLP layer to decompose activations.Question: Does the paper specify all the training and test details (e.g., data splits, hyperparameters, how they were chosen, type of optimizer, etc.) necessary to understand the results? Answer: [Yes] . Justification: The main body of the paper -in particular the training and evaluation subsections of Section 2, the Gated SAE definition of Section 3.2 and the experimental methodology subsections of Section 4 -explain training and evaluation details to a sufficient level of detail to be able to understand and appreciate the results. Details of hyperparameters, optimizer type, etc are provided in Appendix G. Guidelines:• The answer NA means that the paper does not include experiments.• The experimental setting should be presented in the core of the paper to a level of detail that is necessary to appreciate the results and make sense of them. • The full details can be provided either with the code, in appendix, or as supplemental material. 
conclusion: 
 In this work we introduced Gated SAEs which are a Pareto improvement in terms of reconstruction quality and sparsity compared to baseline SAEs (Section 4.1), and are comparably interpretable (Section 4.2). We showed via an ablation study that every key part of the Gated SAE methodology was necessary for strong performance (Section 5.1). This represents significant progress on improving Dictionary Learning on LMs -at many sites, Gated SAEs require half the L0 to achieve the same loss recovered (Fig. 8 ). This is likely to improve work that uses SAEs to steer language models [31] , interpret circuits [26] , or understand LM components across the full distribution [8] .Limitations & future work. Our benchmarking study focused on GELU-1L and models in the Pythia and Gemma families. It is therefore not certain that these results will generalise to other model families. On the other hand, the theoretical underpinnings of the Gated SAE architecture (Section 3) make no assumptions about LM architecture, suggesting Gated SAEs should be a Pareto improvement more generally. While we have confirmed that Gated SAE features are comparably interpretable to baseline SAE features, it does not necessarily follow that Gated SAE decompositions are equally useful for mechanistic interpretability. It is certainly possible that human interpretability of SAE features is only weakly correlated with either: (i) identification of the causally meaningful directions in a LM's activations; or (ii) usefulness on downstream tasks like circuit analysis or steering. A framework for scalably and objectively evaluating the usefulness of SAE decompositions (gated or otherwise) is still in its early stages [25] and further progress in this area would be highly valuable. It is plausible that some of the performance gap between Gated and baseline SAEs could be closed by inexpensive inference-time interventions that prune the many low activating features that tend to appear in baseline SAEs, mimicking Gated SAEs' thresholding mechanism. Finally, we would be most excited to see progress on using dictionary learning techniques to further inter-pretability in general, such as to improve circuit finding [10, 26] or steering [49] in language models, and hope that Gated SAEs can serve to accelerate such work.Question: Does the paper report error bars suitably and correctly defined or other appropriate information about the statistical significance of the experiments? Answer: [No] Justification: We do measure statistical significance in our interpretability study. Section 4.2 includes a detailed explanation of the statistical analysis undertaken to compare Gated and baseline SAEs (continued in Appendix I). The error bar methodology for Fig. 4 is explained in Footnote 9. However, error bars are not shown on the Pareto curve plots because it would have been computationally prohibitive. Nevertheless, the smoothness (or otherwise) of these curves across multiple values of λ does informally convey the noisiness of these curves. Guidelines:• The answer NA means that the paper does not include experiments.• The authors should answer "Yes" if the results are accompanied by error bars, confidence intervals, or statistical significance tests, at least for the experiments that support the main claims of the paper. • The factors of variability that the error bars are capturing should be clearly stated (for example, train/test split, initialization, random drawing of some parameter, or overall run with given experimental conditions). • The method for calculating the error bars should be explained (closed form formula, call to a library function, bootstrap, etc.) • The assumptions made should be given (e.g., Normally distributed errors). • It should be clear whether the error bar is the standard deviation or the standard error of the mean. • It is OK to report 1-sigma error bars, but one should state it. The authors should preferably report a 2-sigma error bar than state that they have a 96% CI, if the hypothesis of Normality of errors is not verified. • For asymmetric distributions, the authors should be careful not to show in tables or figures symmetric error bars that would yield results that are out of range (e.g. negative error rates). • If error bars are reported in tables or plots, The authors should explain in the text how they were calculated and reference the corresponding figures or tables in the text. 
experiments compute resources: 
 Question: For each experiment, does the paper provide sufficient information on the computer resources (type of compute workers, memory, time of execution) needed to reproduce the experiments? Answer: [Yes] Justification: The final bullet in Appendix G covers the requirements below. Guidelines:• The answer NA means that the paper does not include experiments.• The paper should indicate the type of compute workers CPU or GPU, internal cluster, or cloud provider, including relevant memory and storage. • The paper should provide the amount of compute required for each of the individual experimental runs as well as estimate the total compute. • The paper should disclose whether the full research project required more compute than the experiments reported in the paper (e.g., preliminary or failed experiments that didn't make it into the paper). 9. Code Of Ethics 
 
 Appendix: This work introduces a method to obtain higher fidelity sparse decompositions of LM activations, under the hypothesis that progress in this area will ultimately help us understand the representations used by LMs. If successful, this could lead to greater understanding of how LMs complete tasks and novel mechanisms for controlling their behavior. Greater understanding and control could be put to beneficial uses such as mitigating the harms caused by current and future models, although bad actors could also misuse these tools, for example to circumvent safety training and steer models towards harmful behaviors. Currently, the SAE research program is in its early stages. For any potential misuse of SAEs, there is typically a more practical and effective way to achieve the same end using existing tooling, e.g. fine tuning or activation editing. Therefore, we see negligible negative societal impact in the short term. Longer term, advances in LM interpretability and control pose similar benefits and risks to advances in AI capabilities in general.SAEs are expected to decompose input activations sparsely, and yet in a manner that allows for faithful reconstruction. L0 and loss recovered are two metrics typically used [8] to measure sparsity and reconstruction fidelity respectively. These are defined as follows:• The L0 of a SAE is defined by the average number of active features on a given input, i.e E x∼D ∥f (x)∥ 0 . • The loss recovered of a SAE is calculated from the average cross-entropy loss of the language model on an evaluation dataset, when the SAE's reconstructions are spliced into it.If we denote by CE(ϕ) the average loss of the language model when we splice in a function ϕ : R n → R n at the SAE's site during the model's forward pass, then loss recovered isEQUATIONwhere x • f is the autoencoder function, ζ : x → 0 the zero-ablation function and Id :x → x the identity function. According to this definition, a SAE that always outputs the zero vector as its reconstruction would get a loss recovered of 0%, whereas a SAE that reconstructs its inputs perfectly would get a loss recovered of 100%.In this paper, we have used loss recovered as defined in Bricken et al. [8] to measure reconstruction fidelity. However, there are deficiencies with this metric:• Firstly, zero-ablation is arguably too poor a baseline for defining the zero-point of this metric and mean-ablation is better justified. Using the mean-ablation function µ : x → E x ′ ∼D x ′ , instead of ζ in the definition of loss recovered above would also have the benefit that SAEs' loss recovered would tend towards zero in the limit L0 → 0, instead of tending to a positive value as it does when computing loss recovered using zero-ablation. • Furthermore, the very fact we normalise the increase in the spliced LM's loss when computing loss recovered makes it difficult to compare the impact of splicing SAEs at different sub-layers of the model. For example, mean or zero-ablating the output of a MLP layer typically has a much milder impact on LM loss than mean or zero-ablating the residual stream, making the denominator in Eq. ( 8) smaller for MLP SAEs than for residual stream SAEs. So we unsurprisingly find that residual stream SAEs' loss recovered tend to be much higher than MLP or attention SAEs. This suggests that it may be more informative to report raw changes in cross-entropy loss ("delta LM loss") instead of using a normalised metric like loss recovered, since these are directly comparable across SAEs trained on different sub-layers of the same LM.In practice however, both mean-ablated loss recovered and delta LM loss are related to zero-ablated loss recovered (the metric used in this paper) by an affine transformation. In other words, all the loss recovered versus L0 figures in this paper would look identical if we had used one of these other metrics instead, with the only difference being the tick labels on the y-axis. Consequently, none of the conclusions we draw in this paper would be affected by using one of these other reconstruction fidelity metrics instead. Nevertheless, we draw the reader's attention to our subsequent work [41] , which compares Gated SAEs to other SAE varieties adopting the delta LM loss metric, instead of loss recovered, for measuring reconstruction fidelity. 12As described in Section 3.1, the L1 sparsity penalty used to train baseline SAEs causes feature activations to be systematically underestimated, a phenomenon called shrinkage. Since this in turn shrinks the reconstructions produced by the SAE decoder, we can observe the extent to which a trained SAE is affected by shrinkage by measuring the average norm of its reconstructions.Concretely, the metric we use is the relative reconstruction bias,EQUATIONi.e. γ -1 is the optimum multiplicative factor by which an SAE's reconstructions should be rescaled in order to minimise the L2 reconstruction loss; γ = 1 for an unbiased SAE and γ < 1 when there's shrinkage. 13 Explicitly solving the optimization problem in Eq. ( 9), the relative reconstruction bias can be expressed analytically in terms of the mean SAE reconstruction loss, the mean squared norm of input activations and the mean squared norm of SAE reconstructions, making γ easy to compute and track during training:EQUATIONwhere the second equality makes use of the identity 2a• b ≡ ∥a∥ 2 2 + ∥b∥ 2 2 -∥a -b∥ 2 2. Notice from the second expression for γ that an unbiased reconstruction (γ = 1) therefore satisfiesE x∼D ∥x SAE (x)∥ 2 2 = E x∼D ∥x∥ 2 2 -E x∼D ∥x SAE (x) -x∥ 2 2 .In other words, an unbiased but imperfect SAE (i.e. one that has non-zero reconstruction loss) must have mean squared reconstruction norm that is strictly less than the mean squared norm of its inputs even without shrinkage. Shrinkage makes the mean squared reconstruction norm even smaller.The task SAEs perform can be split into two sub-tasks: sparse coding, or learning a set of features from a dataset, and sparse approximation, where a given datapoint is approximated as a sparse linear combination of these features. The decoder weights are the set of learned features, and the mapping represented by the encoder is a sparse approximation algorithm. Formally, sparse approximation is the problem of finding a vector α that minimises;EQUATIONi.e. that best reconstructs the signal x as a linear combination of vectors in a dictionary D, subject to a constraint on the L0 pseudo-norm on α. Sparse approximation is a well studied problem, and SAEs are a weak sparse approximation algorithm. SAEs, at least in the formulation conventional in dictionary learning for language models, in fact solve a slightly more restricted version of this problem where the weights α on each feature are constrained to be non-negative, leading to the related problemEQUATIONIn this paper, we do not explore using more powerful algorithms for sparse coding. This is partly because we are using SAEs not just to recover a sparse reconstruction of activations of a LM; ideally we hope that the learned features will coincide with the linear representations actually used by the LM, under the superposition hypothesis. Prior work [8] has argued that SAEs are more likely to recover these due to the correspondence between the SAE encoder and the structure of the network itself; the argument is that it is implausible that the network can make use of features which can only be recovered from the vector via an iterative optimisation algorithm, whereas the structure of the SAE means that it can only find features whose presence can be predicted well by a simple linear mapping. Whether this is true remains, in our view, an important question for future work, but we do not address it in this paper.In this section we discuss some results obtained by using the dictionaries learned via SAE training, but replacing the encoder with a different sparse approximation algorithm at inference time. This allows us to compare the dictionaries learned by different SAE training regimes independently of the quality of the encoder. It also allows us to examine the gap between the sparse reconstruction performed by the encoder against the baseline of a more powerful sparse approximation algorithm.As mentioned, for a fair comparison to the task the encoder is trained for, it is important to solve the sparse approximation problem of Eq. ( 12), rather than the more conventional formulation of Eq. ( 11), but most sparse approximation algorithms can be modified to solve this with relatively minor changes.Solving Eq. ( 12) exactly is equivalent to integer linear programming, and is NP hard. The integer linear programs in question would be large, as our SAE decoders routinely have hundreds of thousands of features, and solving them to guaranteed optimality would likely be intractable. Instead, as is commonly done, we use iterative greedy algorithms to find an approximate solution. While the solution found by these sparse approximation algorithms is not guaranteed to be the global optimum, these are significantly more powerful than the SAE encoder, and we feel it is acceptable in practice to treat them as an upper bound on possible encoder performance.For all results in this section, we use gradient pursuit, as described in Blumensath and Davies [6] , as our inference time optimisation (ITO) algorithm. This algorithm is a variant of orthogonal matching pursuit [40] which solves the orgothonalisation of the residual to the span of chosen dictionary elements approximately at every step rather than exactly, but which only requires matrix multiplies rather than matrix solves and is easier to implement on accelerators as a result. It is possibly not crucial for performance that our optimisation algorithm be implementable on TPUs, but being able to avoid a host-device transfer when splicing this into the forward pass allowed us to re-use our existing evaluation pipeline with minimal changes.When we use a sparse approximation algorithm at test time, we simply use the decoder of a trained SAE as a dictionary, ignoring the encoder. This allows us to sweep the target sparsity at test time without retraining the model, meaning that we can plot an entire Pareto frontier of loss recovered against sparsity for a single decoder, as in done in Fig. 7 .Fig. 6 compares the loss recovered when using ITO for a suite of SAEs decoders trained with both methods at three different test time L0 thresholds. This graph shows a somewhat surprising result; while Gated SAEs learn better decoders generally, and often achieve the best loss recovered using ITO close to their training sparsity, SAE decoders are often outperformed by decoders which achieved a higher test time L0; it's better to do ITO with a target L0 of 10 with an decoder with an achieved L0 of around 100 during training than one which was actually trained with this level of sparsity. For instance, the left hand panel in Fig. 6 shows that SAEs with a training L0 of 100 are better than those with an L0 of around 10 at almost every sparsity level in terms of ITO reconstruction. However, gated SAE dictionaries have a small but real advantage over standard SAEs in terms of loss recovered at most target sparsity levels, suggesting that part of the advantage of gated SAEs is that they learn better dictionaries as well as addressing issues with shrinkage. However, there are some subtleties here; for example, we find that baseline SAEs trained with a lower sparsity penalty (higher training L0) often outperform more sparse baseline SAEs according to this measure, and the best performing baseline SAE (L0 ≈ 99) is comparable to the best performing Gated SAE (L0 ≈ 20). Gated SAEs trained at lower target sparsities consistently achieve better dictionaries by this measure. Interestingly, the best performing baseline dictionary by this measure often has a much higher test time sparsity than the target; for instance, at a test time sparsity of 30, the best baseline SAE was the one that had a test time sparsity of more like 100. This could be an artifact of the fact that the L0 measure is quite sensitive to noise, and standard SAE architectures tend to have a reasonable number of features with very low activation. As shown in the plot above, the best baseline encoder by the ITO measure had a much larger test time sparsity (around 100) than the best gated model (around 30). This figure suggests that the gap between SAE performance and 'optimal' performance, if we assume that ITO is close to the maximum possible reconstruction using the given encoder, is much smaller for the gated model. level, as mentioned, ITO lets us plot a Pareto frontier by sweeping the target sparsity with a single dictionary; here we plot only the best performing dictionary from each model type to avoid cluttering the figure. This figure suggests that the performance gap between the encoder and using ITO is smaller for the gated model. Interestingly, this cannot solely be explained by addressing shrinkage, as we demonstrate by experimenting with a baseline model which learns a rescale and shift with a frozen encoder and decoder directions. E More loss recovered / L0 Pareto frontiersIn Fig. 8 we show that Gated SAEs outperform baseline SAEs. In Fig. 9 we show that Gated SAEs ourperform baseline SAEs at all but one MLP output or residual stream site that we tested on.In Fig. 9 at the attention output pre-linear site at layer 27, loss recovered is bigger than 1.0. On investigation, we found that the dataset used to train the SAE was not identical to Gemma's pretraining dataset, and at this site it was possible to mean ablate this quantity and decrease loss -explaining why SAE reconstructions had lower loss than the original model.Table 1 provides cross-entropy losses for the Gemma-7B and Pythia-2.8B, both before and after zero-ablating specific sub-layers of these models, to help provide further context for interpreting the loss recovered results presented in this paper; 100% loss recovered corresponds to the SAE-spliced language model attaining a loss matching the original language model, whereas 0% loss recovered corresponds to the SAE-spliced language model attaining a loss matching the language model with the corresponding sub-layer zero-ablated.In Fig. 10 , we show that Gated SAEs resolve shrinkage, as measured by relative reconstruction bias (Appendix C), in Pythia-2.8B.Other details of SAE training are:• SAE Widths. Our SAEs have width 2 17 for most baseline SAEs, 3 × 2 16 for Gated SAEs, except for the (Pythia-2.8B, Residual Stream) sites we used 2 15 for baseline and 3 × 2 14for Gated since early runs at these sites had lots of learned feature death. • Training data. We use activations from hundreds of millions to billions of activations from LM forward passes as input data to the SAE. Following Nanda [29] , we use a shuffled buffer of these activations, so that optimization steps don't use data from highly correlated activations. 14 • Resampling. We used resampling, a technique which at a high-level reinitializes features that activate extremely rarely on SAE inputs periodically throughout training. We mostly follow the approach described in the 'Neuron Resampling' appendix of Bricken et al. [8] , except we reapply learning rate warm-up after each resampling event, reducing learning rate to 0.1x the ordinary value, and, increasing it with a cosine schedule back to the ordinary value over the next 1000 training steps. • Optimizer hyperparameters. We use the Adam optimizer with β 2 = 0.999 and β 1 = 0.0, following Templeton et al. [47] , as we also find this to be a slight improvement to training. We use a learning rate warm-up. See Appendix G.1.2 for learning rates of different experiment. • Decoder weight norm constraints. Templeton et al. [47] suggest constraining columns to have at most unit norm (instead of exactly unit norm), which can help distinguish between productive and unproductive feature directions (although it should have no systematic impact on performance). However, we follow the original approach of constraining columns to have exact unit norms in this work for the sake of simplicity. • Compute resources. Individual SAEs were each trained on TPU-v3 slices with a 2x2 topology [20] . The same chips were used to generate LM activations on-the-fly, train SAE parameters and evaluate SAEs during training, using up to 8-way model parallelism. With this setup, the time to train a SAE varies by SAE width, LM residual stream dimension, sequence length, layer and site. 15 We also used a negligible amount of compute on resampling (Appendix G), evaluation (e.g. Figure 1 ) and interpretability experiments (Section 4.2). Training wall clock time ranges from around 7 hours to train on GELU-1L MLP activations to around 47 hours to train on Gemma-7B sites at layer 27. We estimate that we used twice as much compute as used in the paper on preliminary experiments.• We use learning rate 0.0003 for all Gated SAE experiments, and the GELU-1L baseline experiment. We swept for optimal baseline learning rates for the GELU-1L baseline to generate this value. For the Pythia-2.8B and Gemma-7B baseline SAE experiments, we divided the L2 loss by E||x|| 2 , motivated by better hyperparameter transfer, and so changed learning rate to 0.001 and 0.00075. We didn't see noticeable difference in the Pareto frontier and so did not sweep this hyperparameter further. • We generate activations from sequences of length 128 for GELU-1L, 2048 for Pythia-2.8B and 1024 for Gemma-7B. • We use a batch size of 4096 for all runs. We use 300,000 training steps for GELU-1L and Gemma-7B runs, and 400,000 steps for Pythia-2.8B runs.• Learned feature death is unpredictable. In Fig. 11 there are few patterns that can be gleaned from staring at which runs have high numbers of dead learned features (called dead neurons in Bricken et al. [8] ). • Resampling makes hyperparameter sweeps difficult. We found that resampling caused L0 and loss recovered to increase, similar to Conmy [9] . • Training appears to converge earlier than expected. We found that we did not need 20B tokens as in Bricken et al. [8] , as generally resampling had stopped causing gains and loss curves plateaued after just over one billion tokens.We evaluated the models on over a million held-out tokens.In this section we show under the weight sharing scheme defined in Eq. ( 7), a gated encoder as defined in Eq. ( 5) is equivalent to a linear layer with a non-standard (and parameterized) activation function.Without loss of generality, consider the case of a single latent feature (M = 1) and set the preencoder bias to zero. In this case, the gated encoder is defined asEQUATIONand the weight sharing scheme becomes w mag := ρ mag w gate (14) with a non-negative parameter ρ mag ≡ exp(r mag ).Substituting Eq. ( 14) into Eq. ( 13) and re-arranging, we can re-express f (x) as a single linear layerEQUATIONwith the parameterized activation functionEQUATIONcalled JumpReLU in a different context [17] . Fig. 12 illustrates the shape of this activation function.We perform some further analysis on the data from Section 4.2, to understand the impact of different sites, layers, and raters.We first pose the question of whether there's evidence that the sites had different interpretability outcomes. A Friedman test across sites shows significant differences (at p = 0.047) between the Gated-vs-Baseline differences, though not (p = 0.92) between the raw labels.Breaking down by site and repeating the Wilcoxon-Pratt one-sided tests and computing confidence intervals, we find the result on MLP outputs is strongest, with mean 0.40, significance p = 0.003, and CI [0.18, 0.63]; this is as compared with the attention outputs (p = 0.47, mean .05, CI [-0.16, 0.26]) and final residual (p = 0.59, mean -0.07, CI [-0.28, 0.12]) SAEs.Next we test whether different layers had different outcomes. We do this separately for the 2 models, since the layers aren't directly comparable. We run 2 tests in each setting: Page's trend test (which tests for a monotone trend across layers) and the Friedman test (which tests for any difference, without any expectation of a monotone trend).Results are presented in Table 2 ; they suggest there are some significant nonmonotone differences between layers. To elucidate this, we present 90% BCa bootstrap confidence intervals of the mean raw label (where 'No'=0, 'Maybe'=1, 'Yes'=2) and the Gated-vs-Baseline difference, per layer, in Fig. 15 and Fig. 16 , respectively.In Table 3 we present test results weakly suggesting that the raters differed in their judgments. This underscores that there's still a significant subjective component to this interpretability labeling. (Notably, different raters saw different proportions of Pythia vs Gemma features, so aggregating across the models is partially confounded by that.) 12 : After applying the weight sharing scheme of Eq. ( 7), a gated encoder becomes equivalent to a single layer linear encoder with a JumpReLU (Erichson et al. [17] , previously named TRec by Konda et al. [23] ) activation function σ θ , illustrated above. This particular feature, taken from a layer 20 Gemma-7B residual stream Gated SAE seems to promote completions like "above", "aforementioned", "mentioned above" etc. in contexts where such a completion would be likely. # Currently the gated encoder only has gradient signal to be sparse, and # not to reconstruct well, so we also do a "via gate" reconstruction, to # give it an appropriate gradient signal. We stop the gradients to the # decoder parameters in this forward pass, as we don't want these to be # influenced by this auxiliary task. via_gate_reconstruction = ( via_gate_feature_magnitudes @ stop_gradient(W_dec) + stop_gradient(b_dec) ) gated_sae_loss += sum((via_gate_reconstruction -x)**2, axis=-1) return gated_sae_loss Figure 20 : Pseudo-code for the Gated SAE loss function. Note that this pseudo-code is written for expositional clarity. In practice, taking into account parameter tying, it would be more efficient to rearrange the computation to avoid unnecessarily duplicated operations.We evaluated the models on over a million held-out tokens. Tables 4 10 .Question: For each theoretical result, does the paper provide the full set of assumptions and a complete (and correct) proof? Answer: [NA] Justification: The main contributions of this paper are not theoretical. There are two minor points in the main paper -deriving an expression for the shrinkage metric γ and showing that a tied-weights Gated SAE is equivalent to a single-layer encoder SAE with a Jump-ReLU activation -where fuller explanations are provided in Appendix C and Appendix H respectively (and referenced from the main text). These are not numbered theorems as this would be excessive for these low-importance (and easily derived) points. Guidelines:• The answer NA means that the paper does not include theoretical results.• All the theorems, formulas, and proofs in the paper should be numbered and crossreferenced. • All assumptions should be clearly stated or referenced in the statement of any theorems. • The proofs can either appear in the main paper or the supplemental material, but if they appear in the supplemental material, the authors are encouraged to provide a short proof sketch to provide intuition. • Inversely, any informal proof provided in the core of the paper should be complemented by formal proofs provided in appendix or supplemental material. • Theorems and Lemmas that the proof relies upon should be properly referenced.Although due to an auxiliary loss term, computing the Gated SAE loss for training purposes does require 50% more compute than computing the loss for a matched-width baseline SAE.3 In this work, we use the term feature to refer only to the learned features of SAEs, i.e. the overcomplete basis directions that are linearly combined to produce reconstructions. In particular, learned features are always linear and not necessarily interpretable.Note that we cannot directly optimize the L0 norm (i.e. the number of active features) since this is not a differentiable function. We do however use the L0 norm to evaluate SAE sparsity.Conversely, rescaling the shrunk feature activations[51] is not necessarily enough to overcome the bias induced by by L1 penalty: a SAE trained with the L1 penalty could have learnt sub-optimal encoder and decoder directions that are not improved by such a fix. In Section 5.2 and Fig.7we provide empirical evidence that this is true in practice.Since wider SAEs provide better reconstructions (all else being equal), the gap between Gated SAEs' and baseline SAEs' performance is even wider when we use baseline SAEs with equal width in the comparison. This can be seen in the difference between the "1.5× width" and "equal width" baseline curves in Fig.5.Although both Gated and baseline SAEs have loss recovered tending to one for high enough L0.Although due to a debugging issue, Gemma-7B attention SAEs were rated separately, so raters were not blind to that.95% error bars were obtained by modelling each frequency shown as binomial, with p set to the sample frequency, and calculating the 2.5% and 97.5% quantiles.Because the two biases bgate and bmag can still differ.Concretely, we do this by training baseline SAEs, freezing their weights, and then learning additional rescale and shift parameters (similar to Wright and Sharkey[51]) to be applied to the (frozen) encoder preactivations before estimating feature magnitudes.We also provide in Table1cross entropy losses for the LMs used in our experiments, both with and without zero-ablation, which could in principle be used to translate the loss recovered results in this paper to delta LM loss.We have defined γ this way round so that γ < 1 intuitively corresponds to shrinkage.In contrast to earlier findings[9], we found that when using Pythia-2.8B's activations from sequences of length 2048, rather than GELU-1L's activations from sequences of length 128, it was important to shuffle the 10 6 length activation buffer used to train our SAEs.The FLOPs required to compute LM activations increase with layer; SAEs trained on MLP activations have a higher parameter count than those trained on MLP outputs, attention outputs or the residual stream. 


Decision: There was consensus among all reviewers that this paper belongs at the conference. The work is well-motivated, tackles the important topic of LLM interpretability, and provides extensive experimentation and ablation. Reviewers expressed concerns about the denseness of the paper, which I anticipate the authors will be able to redemy to some extent with the extra page for the camera-ready version.

Reviews: review: paper_summary: paper_summary: This paper introduces Gated Sparse Autoencoders (Gated SAEs), an improvement over standard sparse autoencoders (SAEs) for decomposing language model activations. The key idea is to separate the tasks of detecting which features are active and estimating their magnitudes, allowing the sparsity penalty to be applied only to feature detection. Through experiments on language models up to 7B parameters, the authors show that Gated SAEs achieve better reconstruction fidelity for a given level of sparsity compared to baseline SAEs, while resolving issues like shrinkage. A human evaluation study finds Gated SAE features to be comparably interpretable to baseline features.
strength_weakness: strength_weakness: - The presentation could be improved in some areas, particularly in explaining some of the technical details and metrics
- Some of the figures are quite dense and could be made more readable
- The human evaluation study, while valuable, has a relatively small sample size
questions: questions: - Do you have any insights on how Gated SAEs might scale to even larger language models? Are there any potential limitations as model size increases?
- Have you explored using Gated SAEs for any downstream mechanistic interpretability tasks beyond the basic reconstruction and interpretability metrics? For example, does the improved reconstruction enable better circuit analysis?
- The weight tying scheme seems important for computational efficiency. Have you explored any alternative tying schemes? Is there a theoretical justification for why this particular scheme works well?
limitations: limitations: The authors provide a good discussion of limitations in the conclusion section. They appropriately note that their experiments were limited to specific model families and that further work is needed to evaluate usefulness for downstream interpretability tasks. They also acknowledge the subjective nature of the human interpretability study.
Regarding potential negative societal impacts, the authors do discuss this briefly in Appendix A. They note that advances in LM interpretability could potentially be misused, but argue that the current work poses minimal short-term risks. While this discussion is somewhat brief, it does address the key points and seems appropriate for the nature of this work.
paper_summary: paper_summary: This work introduces a new technique under mechanistic interpretability's sparse autoencoders. By using a less naive SAE, with a gating mechanism and a little extra computation, the paper shows a decent improvement over the baseline.
strength_weakness: strength_weakness: While I generally like the paper, I have two primary concerns:

* The architecture and loss are somewhat difficult to understand. I did appreciate the pseudo-code in the appendix, but I feel for readers not familiar with SAEs may have a hard time, especially with the optimization-based design choices of weight tying. Perhaps explaining weight tying later in 3.2 would help. I would especially prefer if a few lines of pseudo code could be added in the main paper, next to figure two.
* The user study results. I don't mind the small change in means between the method and the baseline, but the explainable AI community has been around for a long time and the shift from studies with a few experts to larger cohorts has been the norm for a while now. Just because there's a rebranding to mechanistic interpretability doesn't mean this field should settle for underpowered studies. Nevertheless, I do find the study setup itself to be well articulated and a very useful starting point for future work in this area.

Minor:
Some of the design choices (weight-tying, no r_mag, etc) aren't well explained until the ablation where we find they are primarily for optimization. This could be motivated a little earlier, i.e. that the pareto improvement comes from the separation, and not those choices.
questions: questions: None
limitations: limitations: Yes
paper_summary: paper_summary: The paper attempts to resolve the issue of feature shrinkage in sparse autoencoders (SAEs) by replacing the SAE ReLU activation function with a gated ReLU unit. The weight-tying scheme they use for the gated unit effectively turns it into a jump ReLU activation function.
They train gated SAEs and baseline SAEs on a one layer transformer, Pyhtia-2.8B and Gemma-7B. They find that gated SAEs eliminate systematic shrinkage, and consistently outperform baseline SAEs on the pareto-curve of sparsity, measured by the L0 pseudonorm, and faithfulness, measured by the model loss recovered relative to a zero ablation baseline. 
They run various additional tests involving variations of the gated and baseline SAE architectures, including combinations of SAE dictionaries with the classic gradient pursuit algorithm for choosing sparse feature coefficients at inference time. They conclude that the Pareto improvement of their gated SAEs over their baseline SAEs is due in part to better feature dictionaries, in addition to better estimated feature coefficients.
They compare the subjective interpretability of 150 gated SAE and baseline SAE features in Pythia-2.8B and 192 features in Gemma-7B, using a blinded analysis of activating dataset examples. They find that the features were similarly interpretable.
strength_weakness: strength_weakness: The paper does not really address the concern that gated SAEs may outperform baseline SAEs in part by implicitly widening the definition of what it means for ‘features’ to be represented in the model. As the paper itself notes in Appendix D, though other more powerful sparse coding algorithms greatly outperform SAEs in terms of reconstruction and sparsity, there are concerns that the greater expressivity of these techniques lets them find spurious ‘features’ that would not be accessible to the model’s own internal computations. An SAE can only find features that are represented in the sense that their current values can be read off with a single ReLU probe, while an inference time algorithm or a multi-layer probe may read off ‘feature’ values that the model itself could not possibly access using a single MLP layer. A gated ReLU is far less expressive than an algorithm like gradient pursuit, but more expressive than a ReLU. So to what extent do gated SAEs outperform baseline SAEs merely because they are implicitly working with a more relaxed definition of what it means for a feature to be represented in the model? Figure 6 in Appendix D incidentally investigates this somewhat, since it attempts to compare the quality of gated vs. baseline dictionaries independent of their coefficients. However, the results there seem inconsistent, with smaller performance gaps and baseline SAEs outperforming gated SAEs at higher L0. I think this issue of the representational power of the probe used is pretty central for contextualizing the results, and should at least have been discussed.

Throughout the paper, the authors present reconstruction scores for SAEs in terms of the fraction of model loss recovered compared to a zero-ablation baseline. I think this metric obscures vital information. Lowering CE loss from e.g. 4.5 to 4.0 is typically much easier than lowering it from 1.5 to 1.0. Thus, the same difference in loss recovered between two SAEs can correspond to very different gaps in SAE quality. Without the raw CE scores, there is no direct way to infer how large the gap is quantitatively. At minimum, these raw CE scores should be in the supplementals. Better yet, the recovered performance could additionally be reported in terms of the compute required to train a model with the same CE score, as suggested in https://arxiv.org/abs/2406.04093.
questions: questions: Why are the raw CE loss recovered scores not in the paper? Since it is typically much harder to lower CE loss from e.g. 4.5 to 4.0 than from 1.5 to 1.0, it is difficult to evaluate the quality gap between baseline and gated SAEs, or the quality of the baseline SAEs, without these scores.
limitations: limitations: All addressed.
paper_summary: paper_summary: This work proposed a Gated Sparse Autoencoder (Gated SAE) to mitigate the standard SAEs' biases, such as shrinkage, which systematically underestimate the feature activations from SAEs. The key difference between Gated SAE and SAE is that the Gated SAE separates affine transformations within the encoder in order to decide which dictionary elements to use in a reconstruction loss, and estimate the coefficients of active elements, although with the 50% more computing required to achieve. Comprehensive experiments are conducted to compare and verify how good the Gated SAE is to standard SAE, including a blinded human study to rate and compare the interpretability of randomly sampled Gated and baseline SAE features.
strength_weakness: strength_weakness: - It is not very straightforward to understand how well the features from Gated SAE are compared to SAE based on Figure 4. Some case studies based on the open-source SAE visualizer library [1] are required to help better understand this.
- It will be better to see more case studies on downstream tasks to compare Gated SAE and SAE, e.g., automatic circuit detection [2]

[1] C. McDougall. SAE Visualizer, 2024. https://github.com/callummcdougall/sae_vis

[2] Huben, Robert, et al. "Sparse Autoencoders Find Highly Interpretable Features in Language Models." The Twelfth International Conference on Learning Representations. 2023.
questions: questions: - As mentioned in the weakness above, the interpretability analysis was conducted via human rating for randomly sampled feature visualizations. However, those visualizations are not included in the main body or appendix. It will be better to help understand how well the sampled features are when comparing Gated SAE and SAE.
- Although the Gated SAE has good performance on the loss recovered (fidelity) and relative reconstruction bias, it is still not clear whether features from Gated SAE are better than SAE under downstream tasks. It will make this work very solid if some analysis of mini downstream applications can be conducted, e.g., IOI task, greater-than task, etc.
limitations: limitations: N/A

Comments: title: Response
Reply by Reviewer
Reply by Reviewer 58d7
comment: Thanks for considering our rebuttal and for your reply.

We did consider translating CE losses into equivalent compute, but realized that it would be difficult to do this in a principled manner, because neither of the main model families used in the paper (Pythia and Gemma v1) were scaled compute optimally. We do nevertheless agree that – given a family of models scaled compute optimally – translating CE loss into FLOPs would provide a more intuitive meaning to the y-axes of our plots.

Turning to the point about representational power, we indeed agree that Gated SAEs do have (slightly) more representational power than ReLU SAEs. However, our argument is that ReLU SAEs have insufficient representational power to faithfully recover representations that would be considered linear features in the first place, e.g. the linear representations (in the presence of interference) described in [1]. In the presence of interference between features, ReLU SAEs must choose between underestimating feature magnitudes or allowing more false detections, and as a result they can’t faithfully recover the original features even when they are linear. Gated SAEs on the other hand do not make this trade off, and thereby better capture the class of representations that are considered to be linear representations (under interference) in the first place.

However, we acknowledge that this conceptual argument does not prove that Gated SAEs improve usefulness on downstream tasks in practice, and are glad you agree with the limitation we noted regarding Gated SAEs being comparably interpretable and more faithful not necessarily implying that they are equally (or more) useful. Given the excitement about SAEs and the research priorities of the mechanistic interpretability field, we anticipate future work that evaluates Gated SAEs on downstream tasks, shedding further light on these concerns.

[1] Elhage, et al. “Toy Models of Superposition.” Transformer Circuits Thread, 2022. https://transformer-circuits.pub/2022/toy_model/index.html
Thanks to the authors for their responses and updates. 

The raw CE scores have been provided, which addresses what I think was the biggest problem with evaluating the paper’s results. Converting the CE scores into the compute required to train a model with the same CE score under the assumption of conventional scaling curves holding would still be preferred. As a reader, I currently need to perform this conversion myself ad-hoc anyway to actually judge the results quantitatively.

I don’t find the authors’ reply to my concern about the greater representational power of gated SAEs compared to vanilla SAEs wholly convincing. Whether we classify them as part of a ‘simplest class of models’ or not, a single gated ReLU can compute outputs a vanilla ReLU cannot. Meaning it is theoretically able to find ‘features’ a ReLU cannot. 

It may be the case that in practice, sparse ‘features’ tend to be represented in a way that makes this unconcerning. But that would be an assumption that would need to be concretely defined, and empirically tested. I still believe this deserves more discussion than it got.

The features being just as interpretable as those of vanilla SAEs does not seem to me to address the concern of representational power either. Merely mapping the hidden activations back to the original token embedding of the prompt that produced them would also yield highly human-interpretable ‘features’. Yet such ‘features’ would not be useful for interpretability, since they don’t describe the structure of the hidden representation at the current layer of the model in a way that would be accessible to the model’s own computations. With no constraints on the definition of a ‘feature’, metrics like human interpretability of feature activations are not particularly meaningful.

Ultimately the authors do conclude: ‘Nevertheless, we admit in the limitations section that "while we have confirmed that Gated SAE features are comparably interpretable to baseline SAE features, it does not necessarily follow that Gated SAE decompositions are equally useful for mechanistic interpretability", i.e. that our evaluations do not conclusively show that Gated SAEs are comparably "useful" as vanilla SAEs in a practical sense, and agree that this is an important open question that needs resolving.’, which I agree with.
Thanks for this explanation. I will raise my score.
Thank you authors, I am satisficed that this paper is of interest to the community. I will keep my score.
Thanks for considering our rebuttal and for your response. We believe the consensus in the field – as argued in [1], an example of work that explores and proposes metrics for both interpretability and reconstruction fidelity – is that fidelity, sparsity and interpretability are all important criteria to be satisfied by a good decomposition. From this perspective, we think there is no mismatch: fidelity and interpretability are separate desiderata, and it is a valuable contribution to establish – as we have done in this paper – that a change of architecture improves one without damaging the other. Furthermore, we have established our key result – that Gated SAEs improve fidelity (at fixed sparsity) and maintain interpretability – using similar standards of evidence to those used in influential prior work such as [1]. For these reasons, we believe our paper stands on its own even without further, downstream task-oriented evaluations, although we nonetheless agree that such evaluations would be interesting and informative.

[1] Bricken, Trenton, et al. “Towards Monosemanticity: Decomposing Language Models With Dictionary Learning.” Transformer Circuits Thread, 2023. https://transformer-circuits.pub/2023/monosemantic-features
Thanks for this helpful rebuttal regarding the weaknesses and questions.

Although proposed Gated SAEs outperform other SAE baselines under the standard SAE evaluation metrics, I am still wondering whether there are some existing works which try to explore and propose a reasonable metric to measure different SAEs in the mech interp areas. To my understanding, the purpose of utilising SAEs in the mech interp area is to better understand and explain different features (monosemanticity or polysemanticity) from original LLMs' attention heads, MLPs and residual streams. By comparing the better SAEs evaluation metrics of Gated SAEs and other baselines and the slight differences between them, it seems like there exists a mismatch between the objective SAEs metrics and subjective interpretability evaluation results. It might be unclear how valuable the new proposed Gated SAEs or other designed SAEs contribute to the interpretability of different features and semantic meanings of different LLMs' internal components.