Mechanistic Permutability: Match Features Across Layers

## Abstract

Abstract Understanding how features evolve across layers in deep neural networks is a fundamental challenge in mechanistic interpretability, particularly due to polysemanticity and feature superposition. While Sparse Autoencoders (SAEs) have been used to extract interpretable features from individual layers, aligning these features across layers has remained an open problem. In this paper, we introduce SAE Match, a novel, data-free method for aligning SAE features across different layers of a neural network. Our approach involves matching features by minimizing the mean squared error between the folded parameters of SAEs, a technique that incorporates activation thresholds into the encoder and decoder weights to account for differences in feature scales. Through extensive experiments on the Gemma 2 language model, we demonstrate that our method effectively captures feature evolution across layers, improving feature matching quality. We also show that features persist over several layers and that our approach can approximate hidden states across layers. Our work advances the understanding of feature dynamics in neural networks and provides a new tool for mechanistic interpretability studies.

## 1 Introduction

In recent years, foundation models have become pivotal in natural language processing research (Llama Team, ; Team et al., ). As these models are applied to a growing range of tasks, the need to interpret their predictions in human-understandable terms has intensified. However, this interpretability is challenged by the presence of polysemantic features—features that correspond to multiple, often unrelated concepts—especially prevalent in large language models (LLMs).

A significant advancement in addressing polysemanticity is the *superposition hypothesis*, which posits that models represent more features than their hidden layers can uniquely encode. This leads to features being entangled in a non-orthogonal basis within the hidden space (Bricken et al., ; Arora et al., ; Elhage et al., ), complicating interpretation because individual neurons or features do not correspond neatly to singular, human-understandable concepts.

To unravel this complexity, *Sparse Autoencoders* (SAEs) trained on the hidden states of LLMs were employed, using feature sizes significantly larger than the models’ hidden dimensions (Yun et al., ; Bricken et al., ). SAEs aim to extract monosemantic features—sparse activations that occur only when processing specific, interpretable functions. For instance, Templeton et al. () used this approach to interpret the Claude Sonnet 3 model, while Lieberum et al. () open-sourced an SAE for the Gemma 2 model, enabling researchers to delve deeper into LLM interpretability.

While SAEs have advanced the interpretability of individual model layers, a crucial question remains: How do these interpretable features evolve throughout the layers of a model during evaluation? Understanding this evolution is essential for a comprehensive interpretation of the model’s internal dynamics and decision-making processes.

In this paper, we introduce SAE Match, a data-free method for aligning SAE features across different layers of a neural network. Our approach enables the analysis of feature evolution throughout the model, providing deeper insights into the internal representations and transformations that occur as data propagate through the network. By addressing the challenge of feature alignment across layers, we contribute to a more comprehensive understanding of neural network behavior and advance the field of mechanistic interpretability.

Our main contributions are as follows:

- •
We propose SAE Match, a novel method for aligning Sparse Autoencoder features across layers without the need for input data, enabling the study of feature dynamics throughout the network.
- •
We introduce *parameter folding*, a technique that incorporates activation thresholds into the encoder and decoder weights, improving feature matching by accounting for differences in feature scales.
- •
We validate our method through extensive experiments on the Gemma 2 language model, demonstrating improved feature matching quality and providing insights into feature persistence and transformation across layers.

By advancing methods for feature alignment and interpretability, our work contributes to the broader goal of making neural networks more transparent and understandable, facilitating their responsible and effective deployment in various applications.

## 2 Background

The goal of the mechanistic interpretability field is to develop tools for understanding the behavior of neural networks. The main challenge with naïve model interpretation approaches stems from the polysemanticity of features in trained models, which states that each feature is linked to a combination of unrelated inputs (Bricken et al., ). One explanation for polysemanticity is superposition hypothesis, which suggests that the number of features trained by a model exceeds the number of neurons in that model (i.e., the size of its hidden layer) (Arora et al., ; Elhage et al., ). In this scenario, the features might be represented using a non-orthogonal basis in the hidden space, making them challenging to interpret with simple methods.

Assuming the superposition hypothesis is correct, Bricken et al. () used Sparse Autoencoders (SAEs) (Yun et al., ) to uncover features in language models that are comprehensible to humans. Given the assumption that models capture more features than their hidden dimensionality allows, unveiling these features can be achieved by training an autoencoder on the hidden states of a model with a large representation size (Templeton et al. () used representation sizes orders of magnitude larger than a model’s hidden size to interpret the Claude 3 Sonnet model):

$$ $\displaystyle{\bm{f}}({\bm{x}})=\sigma\left({\bm{W}}_{\mathrm{enc}}{\bm{x}}+{ \bm{b}}_{\mathrm{enc}}\right),$ (1) $\displaystyle\hat{{\bm{x}}}({\bm{f}})={\bm{W}}_{\mathrm{dec}}{\bm{f}}+{\bm{b}} _{\mathrm{dec}},$ $\displaystyle{\bm{f}}({\bm{x}})\in\mathbb{R}^{F},{\bm{x}}\in\mathbb{R}^{d},F \gg d.$ $$

Here, $\sigma$ is an activation function (e.g., ReLU). Importantly, ${\bm{f}}({\bm{x}})$ is made to be sparse to help the SAE capture monosemantic features. The final loss is defined as $\mathcal{L}({\bm{x}})=\|{\bm{x}}-\hat{{\bm{x}}}({\bm{f}}({\bm{x}}))\|_{2}+
\lambda|\|{\bm{f}}({\bm{x}})\|_{0}$. The sparsity of the model can be increased by adjusting the $\lambda$ hyperparameter, which balances the trade-off between the reconstruction term and the regularization term. However, determining the optimal value for $\lambda$ is not straightforward.

Building on this approach, Lieberum et al. () introduced a family of SAE models trained on the hidden states of the Gemma 2 model for each layer. These models, along with detailed feature descriptions, are available on Neuronpedia(^1^11[https://www.neuronpedia.org/gemma-2-2b](https://www.neuronpedia.org/gemma-2-2b)). Notably, this work departs from previous methods by employing JumpReLU (Rajamanoharan et al., ) as the activation function:

Figure: Figure 1: Left: Hidden state norms and the mean ${\bm{\theta}}$ value in trained JumpReLU activations within SAE modules. Right: Dynamics of hidden state norm changes and the differences in norms of matched decoder columns ${\bm{W}}_{\mathrm{dec}}$ after the folding operation. These results suggest that ${\bm{\theta}}$ captures the growth of hidden state norms. After folding ${\bm{\theta}}$ into the weights, the decoder weights ${\bm{W}}_{\mathrm{dec}}^{\prime}$ become dependent on the dynamics of hidden state norms, leading to a lower overall MSE during matching. For more details on the folding operation and method description, see Section 3.
Refer to caption: x1.png

$$ $\operatorname{JumpReLU}({\bm{z}})={\bm{z}}\odot H({\bm{z}}-{\bm{\theta}}),{\bm {\theta}}\in\mathbb{R}^{F};$ (2) $$

where $H(\cdot)$ is the Heaviside step function, and ${\bm{\theta}}$ represents learnable thresholds for each component of ${\bm{z}}$.

## 3 Matching Sparse Autoencoder Features

While SAEs can extract human-interpretable features from specific layers of a language model, understanding how these features evolve across layers remains an open question. To address this, we introduce SAE Match, a data-free method to align SAE features across different layers. This approach enables us to analyze the evolution of features throughout the model’s depth, providing deeper insights into the model’s internal representations.

Our central idea is that features from different layers might be similar but permuted differently—that is, the $i$-th feature in layer $A$ might correspond to the $j$-th feature in layer $B$. Therefore, aligning features across layers involves finding the correct permutation that matches semantically similar features.

###### Hypothesis 1 :

Features ${\bm{f}}^{(A)}$ from layer $A$ can be matched with features ${\bm{f}}^{(B)}$ from layer $B$ by calculating the mean squared error (MSE) between the relevant SAE weights. These weights might be either the rows of the encoder weights ${\bm{W}}^{(A)}_{\mathrm{enc}}$ and ${\bm{W}}^{(B)}_{\mathrm{enc}}$ or the columns of the decoder weights ${\bm{W}}^{(A)}_{\mathrm{dec}}$ and ${\bm{W}}^{(B)}_{\mathrm{dec}}$ (or both). Rows or columns that have a low MSE between them suggest semantic similarity between the features.

This matching problem resembles the task of aligning weights from two neural networks that perform the same function but have permuted weights (Ainsworth et al., ). In our case, we aim to find a permutation matrix ${\bm{P}}^{(A\rightarrow B)}\in\mathcal{P}_{F}$ (the set of permutation matrices) that aligns the features of layer $A$ with those of layer $B$. Formally, we seek a permutation that minimizes the MSE between the decoder weights:

$$ ${\bm{P}}^{(A\rightarrow B)}=\underset{{\bm{P}}\in\mathcal{P}_{F}}{\arg\min} \sum_{i=1}^{d}\|{\bm{W}}_{\mathrm{dec}_{i,:}}^{(A)}-{\bm{P}}{\bm{W}}_{\mathrm{ dec}_{i,:}}^{(B)}\|_{2}=\underset{{\bm{P}}\in\mathcal{P}_{F}}{\arg\max}\left \langle{\bm{P}},\left({\bm{W}}_{\mathrm{dec}}^{(A)}\right)^{\top}{\bm{W}}_{ \mathrm{dec}}^{(B)}\right\rangle_{F},$ (3) $$

Figure: Figure 2: A schematic illustration of the differences in SAE matching with and without folded parameters. When no folding is performed (top), ${\bm{\theta}}$ encapsulates differences in hidden state norms, causing features ${\bm{f}}^{(A)}$ and ${\bm{f}}^{(B)}$ to have different scales, while the columns of decoder weights ${\bm{W}}_{\mathrm{dec}_{i,:}}^{(A)}$ and ${\bm{W}}_{\mathrm{dec}_{i,:}}^{(B)}$ have similar norms. Matching similar columns leads to differences in the actual reconstructions of the input $\hat{{\bm{x}}}$, which we hypothesize is detrimental for matching SAE features. With ${\bm{\theta}}$ folding (bottom), we transfer the differences in input (and thus feature) norms to the decoder weights ${\bm{W}}_{\mathrm{dec}_{i,:}}^{{(A)}^{\prime}}$ and ${\bm{W}}_{\mathrm{dec}_{i,:}}^{{(B)}^{\prime}}$, thereby matching features while accounting for differences in input norms. As a result, reconstructions of matched features are closer to each other than in the unfolded variant of the algorithm. See Section 3.1 for more details.
Refer to caption: x3.png

where $\langle{\bm{A}},{\bm{B}}\rangle_{F}=\sum_{i,j}{\bm{A}}_{i,j}{\bm{B}}_{i,j}$ is the Frobenius inner product. To solve this, one can utilize a Linear Assignment Problem (LAP) solver (Ainsworth et al., ). The same logic applies to the encoder weights, provided they are transposed.

###### Hypothesis 1 :

### 3.1 Folding Sparse Autoencoder Weights

While the above method can be directly applied, it does not utilize the information stored in the learnable thresholds ${\bm{\theta}}$ of the JumpReLU activation function. Moreover, differences in feature scales can lead to suboptimal matching when minimizing MSE between vectors with varying norms. To address this, we propose a technique called parameter folding, where we incorporate the activation thresholds into the encoder and decoder weights:

$$ $\displaystyle{\bm{W}}_{\mathrm{enc}}^{\prime}$ $\displaystyle={\bm{W}}_{\mathrm{enc}}\operatorname{diag}\left(\frac{1}{{\bm{ \theta}}}\right),\ {\bm{b}}_{\mathrm{enc}}^{\prime}$ $\displaystyle={\bm{b}}_{\mathrm{enc}}\odot\frac{1}{{\bm{\theta}}},\ {\bm{W}}_{ \mathrm{dec}}^{\prime}$ $\displaystyle={\bm{W}}_{\mathrm{dec}}\operatorname{diag}({\bm{\theta}}),\ {\bm {\theta}}^{\prime}$ $\displaystyle=\bm{1},$ (4) $$

where $\operatorname{diag}({\bm{\theta}})$ creates a diagonal matrix from ${\bm{\theta}}$, and $\odot$ denotes element-wise multiplication. This transformation does not alter the SAE’s output but adjusts the weights to account for differences in feature scales.

Our hypothesis is that parameter folding helps align decoder weights in a way that reflects the actual dynamics of hidden state norms during model evaluation. Specifically, we observed that the learned thresholds ${\bm{\theta}}$ capture the growth of hidden state norms across layers (see Figure 1). We observed that ${\bm{\theta}}$ values, in fact, encapsulate the growth of hidden state norms. By folding ${\bm{\theta}}$ into the weights, we normalize the decoder weights to align with these dynamics.

###### Hypothesis 2 :

Folding the activation thresholds into the weights aligns decoder columns with the dynamics of hidden state norms. This process allows us to match decoder weights based on their MSE in the space of actual hidden state norms. By folding parameters, we can match features across layers in a data-free manner, without needing input data to capture input scales. For a schematic illustration of hypothetical behavior, refer to Figure 2.

By incorporating the folding process, we ensure that the comparison of decoder weights is sensitive to the scale of the hidden states, rather than relying solely on angular proximity. This allows for a more accurate reflection of the underlying feature dynamics and enhances the model’s ability to effectively match features across layers. Consequently, by aligning decoder weights to hidden state norms, we achieve a more robust evaluation of feature similarity, improving the overall performance of the Sparse Autoencoder model.

###### Hypothesis 2 :

### 3.2 Composing Permutations

When a permutation is obtained from layer A to layer B, and another from layer B to layer C, it allows us to approximate a permutation from layer A to layer C by composing these two permutations ${\bm{P}}^{(A\rightarrow C)}\approx{\bm{P}}^{(B\rightarrow C)}{\bm{P}}^{(A
\rightarrow B)}$ instead of evaluating actual permutation between layers $A$ and $C$. Extending this to a model with $T$ layers, we define all possible permutation paths as: ${\mathbb{P}}=\{{\bm{P}}^{(i\rightarrow j)}|j\in[1;T],i\in[0;j)\}$.

###### Hypothesis 3 :

If layers A and C are not too far apart, we can adequately approximate the matching between them by composing the appropriate permutation matrices from intermediate layers.

By examining these composed permutations, we aim to uncover deeper insights into feature dynamics—how certain features retain or transform their semantic meanings as they pass through multiple layers of the network.

###### Hypothesis 3 :

## 4 Experimental Setup

We conducted experiments using Sparse Autoencoders (SAEs) trained on the Gemma 2 model, with feature descriptions from Neuronpedia generated by GPT-4o. We focused on SAEs with a regularization coefficient around 70 (for a complete list of SAEs used, refer to Appendix Table 1). For matching we used MSE from both decoder and encoder layers. During our initial experiments, we observed that the decoder-only option performs similarly to our scheme, while the encoder-only suffers from poor quality of matching (see Appendix Figure 11 for comparison).

To measure the quality of feature matching, we evaluated the quality of the match using two key metrics:

- 1.
Mean Squared Error (MSE): The error between the permuted parameters of the matched features.
- 2.
An external large language model (LLM) compared Neuronpedia descriptions of matched features, categorizing them as "SAME" (identical meanings), "MAYBE" (possibly similar meanings), or "DIFFERENT" (distinct meanings). Each experiment involved approximately 1,600 LLM evaluations over 100 feature paths spanning 16 layers (details in Appendix Section B).

When assessing how approximating hidden states with matched features affects language modeling performance, we used:

- •
Change in Cross-Entropy Loss ($\Delta L$): The difference in loss (in nats) between the model using the encode-permute-decode operation and the original model.
- •
Explained Variance: Calculated as $\operatorname{Var}(\hat{{\bm{x}}}^{(t+1)}-{\bm{x}}^{(t+1)})/\operatorname{Var}
({\bm{x}}^{(t+1)})$. This metric assesses how well the approximated hidden state $\hat{{\bm{x}}}^{(t+1)}$ estimates the true hidden state ${\bm{x}}^{(t+1)}$, providing insight into the accuracy of the approximation.
- •
Matching Score: The probability of paired feature activation between two matched layers.

We tested our methods on subsets of OpenWebText (Gokaslan et al., ), Code(^2^22[https://huggingface.co/datasets/loubnabnl/github-small-near-dedup](https://huggingface.co/datasets/loubnabnl/github-small-near-dedup)), and WikiText (Merity et al., ). From each dataset, we randomly sampled 100 examples, truncated them to 1,024 tokens, and excluded the beginning-of-sequence (BOS) token when calculating metrics.

## 5 Experiments

Figure: Figure 3: Results of the MSE objective for different layer matching methods. "Vanilla matching" refers to matching without any permutations. The "Matched" and "Folded+Matched" variants correspond to unfolded and folded matching, respectively. In all cases, MSE is evaluated with folded parameters (i.e., for unfolded matching, parameters are first matched, then folded, and finally MSE is evaluated). When considering input scales differences (see Section 3.1), this can be interpreted as the MSE in the scale of actual input reconstructions in the relevant layers. The unfolded matching consistently showed higher MSE in this scale, supporting Hypothesis 2. Note that $b_{\mathrm{dec}}$ is omitted as it does not affect the order of features in the SAE layer. For further details, refer to Section 5.1.
Refer to caption: x4.png

Figure: Figure 4: External LLM evaluation split by layers. As before - folding thresholds results in an optimistic labeling, it also affects deeper layers making them also more optimistic.
Refer to caption: x7.png

### 5.1 Understanding Parameter Folding

We start by exploring parameter folding. To understand it, we used our method to create permutation matrices ${\bm{P}}^{(t-1\rightarrow t)},t\in[1;26]$ based on the MSE values for folded and unfolded parameters.

As Hypothesis 2 relies on the observation that ${\bm{\theta}}$ incapsulates differences in hidden state norms, we evaluated MSE of obtained permutations. More concretely, we evaluated MSE for folded matching, and for unfolded and naive (without any permutations) matching strategies, for which we first permuted SAE weights based on unfolded MSE values, and then evaluated MSE of appropriate folded weights. See Figure 3 for the results. Initially, naive matching displayed high MSE across all SAE parameters, indicating the lack of assurance in maintaining feature order between layers. Notably, unfolded matching showed higher MSE in the scale of hidden state representations, supporting behaviour described with Hypothesis 2. Also note that since MSE is plotted with folded parameters, the MSE of the Encoder layer decreases, while the MSE of the Decoder layer increases (this behavior is explained by Equation 4).

Figure: Figure 5: Features matched with folded parameters from the 19th to the 20th layer using the proposed method are sorted by their MSE values across the relevant SAE decoder weights. Features with small MSE values (on the left) indicate semantic similarity, while those with large MSE values (on the right) indicate that no similar features were found. For further details, refer to Section 5.2.
Refer to caption: x9.png

Figure: Figure 6: The distribution of MSE values with folded matching, grouped by three labels provided by an external LLM, is presented. Lower MSE values between pairs of layers indicate better matching. Note that the MSE value distribution varies across different layer pairs due to differences in weight scales For further analysis, refer to Section 5.2.
Refer to caption: x10.png

We compared the performance of folded and unfolded matching based on semantic similarity with an external LLM. The results can be seen in Figure 4 for LLM evaluation across different layers. Folded matching exhibited improved feature matching quality compared to the unfolded variant. Also, we observed a performance drop at the $10$-th layer, which we study in Section 5.3. Combining all the results from this section, we validated Hypothesis 2 regarding the behavior of matching with folded parameters.

### 5.2 Features Matching

Once we estabilished that folded parameters provide more accurate feature matching, we dive into exploring feature matching itself. We tested our hypothesis that features from different layers can be matched by calculating the mean squared error (MSE) between the parameters of Sparse Autoencoders (SAE). In this experiment, we focused on matching the $19$-th and $20$-th layers using parameter folding. The results are shown in Figure 5. Low MSE values indicated semantic similarity between features, while high MSE values suggested differences.

We also evaluated the distribution of MSE values for three pairs of layers matched with folded parameters, grouped according to external LLM evaluation. The results, shown in Figure 6, similarly revealed that lower MSE values were associated with the semantic similarity of matched features. It is important to note that the distribution of MSE values across different layer pairs varied due to differences in weight scales (as described in Section 3.1).

Together, these results supported Hypothesis 1, confirming that MSE reflects feature similarity and enabling us to further investigate feature matching.

Figure: Figure 7: Left: External LLM evaluation of feature matching across layers with folded matching. Right: Matching Score across layers. The LLM evaluation shows near-zero "SAME" features in the initial layers, increasing after the 10th layer. The Matching Score shows a similar pattern but does not drop to zero in the initial layers, indicating some predictive ability. These results suggest that initial layers may have more polysemantic features, making them harder to evaluate using Neuronpedia descriptions. See Section 5.3 for more details.
Refer to caption: x13.png

### 5.3 On the Performance of Matching Across Layers

In previous sections, we observed a decline in the quality of feature matching evaluated by an external LLM in the lower layers of the model, particularly up to the 10th layer. To investigate this phenomenon, we extended our evaluation of folded matching across all layers of the model—excluding the final layer responsible for mapping to the vocabulary. We also examined the Matching Score metric (as defined in Section 4) to gain additional insights into the matching performance.

The results are presented in Figure 7. We observe that the number of "SAME" features—those with identical or closely related meanings—remains near zero in the initial layers and begins to increase after the 10th layer. A similar trend is seen in the Matching Score, although it does not drop to zero in the early layers, suggesting some ability to predict features from previous matched features.

These observations lead us to hypothesize that the features extracted by the SAEs in the initial layers may suffer from polysemanticity—they activate in response to multiple, unrelated inputs and represent overlapping concepts. The descriptions in Neuronpedia cover only a single mode of these polysemantic features, potentially missing other aspects of their activation patterns. As a result, when the external LLM evaluates semantic similarity based on these limited descriptions, it identifies few "SAME" features in the initial layers.

This phenomenon aligns with findings from previous research. Gurnee et al. () also reported increased polysemanticity in the early layers of neural networks. In the initial layers, features tend to be more general and less specialized, capturing a wide range of inputs. As the information propagates through the network, features become more monosemantic, specializing in specific concepts or functions.

Figure: Figure 8: Results of the external LLM evaluation. We compare features from 10th, 12th and 20th layers with matched features in subsequent layers. It can be observed that feature similarity gradually declines, but remains significant for approximately five layers. See Section 5.4 for more details.
Refer to caption: x15.png

### 5.4 Feature Persistence

In purpose to study dynamics of the feature from layer to layer we decided to conduct additional experiments with feature semantics persistence along the feature path.

We used three starting layers $10$, $12$, and $20$ to evaluate permutations with all subsequent layers. We matched features between layers by both evaluating full permutation matrix (Exact) and by approximating it with composition (Composition) of composite permutation matrices (see Section 3.2). We then evaluated these permutations with an external LLM.

Figure: Figure 9: Schematic illustration of layer pruning with matched features. Instead of the standard evaluation (left), we compute features at layer $t$, apply the permutation to match them to layer $t+1$, and then reconstruct the hidden state for layer $t+1$, effectively skipping layer $t$. See Section 5.5 for more details.
Refer to caption: x18.png

See Figure 8 for the results. We observed that composition of permutations showed adequate results for nearby SAEs especially on the later layers, then it starts to diverge, which supports Hypothesis 3. Also, features were well matched when evaluating full permutation matrices, supposing that in later model layers features between layers are similar, which aligns with observations from Section 5.3.

### 5.5 SAE Match as a Layer Pruning

To further evaluate the effectiveness of our method, we conducted experiments where we pruned layers between matched Sparse Autoencoders (SAEs). The key assumption is that features remain consistent during a one-layer forward pass. If the permutation mapping between SAEs is accurate, we can approximate the output of a pruned layer using an encode-permute-decode operation:

$$ $\displaystyle{\bm{f}}^{(t)}({\bm{x}})=\sigma\left({\bm{W}}_{\mathrm{enc}}^{(t) }{\bm{x}}^{(t)}+{\bm{b}}_{\mathrm{enc}}^{(t)}\right),$ (5) $\displaystyle\hat{{\bm{f}}}^{(t+1)}={\bm{P}}_{t}^{t+1}{\bm{f}}^{(t)},$ $\displaystyle\hat{{\bm{x}}}^{(t+1)}={\bm{W}}_{\mathrm{dec}}^{(t+1)}\hat{{\bm{f }}}^{(t+1)}+{\bm{b}}_{\mathrm{dec}}^{(t+1)}.$ $$

Figure 9 provides a schematic illustration of this layer pruning method.

We observed the smallest performance drop on the OpenWebText dataset, while a decrease in quality was noted at the last layer of the Code dataset. These findings indicate that the matched features share similar semantics, enabling us to approximate the next hidden states for all layers beyond the 10th layer.

For experiments on how the sparsity level of the SAE affects feature matching, see Appendix Section A.

Figure: Figure 10: Left: Change in cross-entropy loss ($\Delta L$) after pruning each layer using matched features. Right: Explained variance of the approximated hidden states compared to the true hidden states. Starting from the 10th layer, pruning results in minimal performance loss, indicating that matched features effectively approximate the skipped layers. See Section 5.5 for more details.
Refer to caption: x19.png

## 6 Limitations and Conclusion

We introduced SAE Match, a novel data-free method for aligning Sparse Autoencoder (SAE) features across neural network layers, tackling the challenge of understanding feature evolution amid polysemanticity and feature superposition. By minimizing the mean squared error between folded SAE parameters—which integrate activation thresholds into the weights—we accounted for feature scale differences and improved matching accuracy. Experiments on the Gemma 2 language model validated our approach, showing effective feature matching across layers and that certain features persist over multiple layers. Additionally, we demonstrated that our method enables approximating hidden states across layers. This advances mechanistic interpretability by providing a new tool for analyzing feature dynamics and deepening our understanding of neural network behavior.

While we evaluated our method using SAEs from the Gemma 2 model with promising results, further research is needed to confirm if these findings generalize to other models. Additionally, potential errors in Neuronpedia feature descriptions may affect the precise evaluation of semantic similarity.

## Appendix A On the Matching with Different Sparsity

Figure: Figure 12: Left: Change in cross-entropy loss ($\Delta L$) with respect to the sparsity level (mean $l_{0}$-norm) of the SAE. Right: Explained variance of the approximated hidden states at different sparsity levels. Interestingly, explained variance has a peak on value at $l_{0}\approx 70$. See Section A for discussion.
Refer to caption: x22.png

In this section, we investigate how varying the sparsity level of Sparse Autoencoders (SAEs) affects the quality of feature matching across layers. The Gemma Scope release (Lieberum et al., ) provides SAEs trained with different levels of sparsity, measured by the mean $l_{0}$-norm of their activations. Understanding the impact of sparsity is crucial because it influences the number of active features and, consequently, the effectiveness of our matching method.

To evaluate our approach under different sparsity conditions, we selected five SAEs trained on the 20th and 21st layers of the Gemma 2 model, each with a different mean $l_{0}$-norm. We applied our feature matching method to these SAEs and measured performance using the metrics described in Section 4. Specifically, we assessed how well the matched features could approximate the hidden states when a layer is omitted.

- •
layer drop: We skip the $t$-th layer entirely, using the hidden state ${\bm{x}}^{(t)}$ as input for the $(t+1)$-th layer.
- •
encode-decode current hidden: use SAE reconstruction $\hat{{\bm{x}}}^{(t)}$ as hidden state at $t$-th layer instead of ${\bm{x}}^{t}$.
- •
encode-decode previous hidden: use SAE reconstruction from $t$-th layer $\hat{{\bm{x}}}^{(t)}$ as a hidden state ${\bm{x}}^{(t+1)}$ and omit evaluation of $t$-th layer.

First, when analyzing the change in cross-entropy loss ($\Delta L$), we observe that higher mean $l_{0}$-norm values correspond to a lower difference in loss across all methods. This is expected because SAEs with higher sparsity (i.e., lower $l_{0}$-norm) may not reconstruct the hidden states effectively, leading to a higher $\Delta L$. Conversely, SAEs with lower sparsity (higher $l_{0}$-norm) capture more information, resulting in better approximations and lower $\Delta L$.

Notably, using features from lower layers to approximate subsequent layers leads to higher $\Delta L$ compared to both the encode-decode current and encode-decode previous hidden schemas. This indicates that directly reconstructing the hidden state of a layer using its own SAE provides better performance than attempting to predict it from earlier layers.

Regarding the explained variance—which measures how well the approximated hidden state $\hat{{\bm{x}}}^{(t+1)}$ captures the true hidden state ${\bm{x}}^{(t+1)}$—we observe that it peaks when the mean $l_{0}$-norm is approximately 70. This suggests that there is an optimal sparsity level where feature matching is most effective. At lower $l_{0}$-norms (higher sparsity), SAEs may fail to reconstruct hidden states adequately due to insufficient active features. On the other hand, when the number of active features exceeds 100, accurately matching all features between layers becomes more challenging. This can lead to the inclusion of noisy features, which negatively impacts the estimation of the hidden state, pushing it in the wrong direction. As other schemas do not utilize matching, we do not observe peak as for matching plot.

This experiment underscores a key insight of our work: the sparsity level of SAEs plays a crucial role in the success of data-free feature matching across layers. It emphasizes that not only does our method effectively align features across layers, but it also allows for the identification of optimal model configurations that balance sparsity and performance, further advancing the interpretability and efficiency of language models.

## Appendix B Evaluation Details

Our initial evaluation was conducted using the OpenAI GPT-4o model. However, since the results did not differ significantly from the smaller OpenAI GPT-4o mini model, we opted to use the mini model as the external LLM for faster evaluation. The following system prompt was used for the evaluation:

"""
You will receive two text explanations of an LLM features in the following format:

Explanation 1: [text of the first explanation] Explanation 2: [text of the second explanation]

You need to compare and evaluate these features from 1 to 3 where
# 1 stands for: incomparable, different topic and/or semantics
# 2 stands for: semi-comparable or neutral, it can or cannot be about
the same thing
# 3 stands for: comparable, explanation is about the same things

Avoid any position biases.
Do not allow the length of the responses to influence your evaluation.
Be as objective as possible.
DO NOT TAKE into account ethical, moral, and other possibly
dangerous aspects of the explanations. The score should be unbiased!

## Example:
Explanation 1: "words related to data labeling and classification"
Explanation 2: "various types of labels or identifiers used in a
structured format"

Evaluation: Both explanations are discussing the concept of labels or
identifiers used in organizing or categorizing data in a structured way.
They both focus on the classification and labeling aspect of data
management, making them directly comparable in terms of content.

Label: 3

## Example:
Explanation 1: "references to academic institutions or universities"
Explanation 2: "occurrences of the term "pi" in various contexts"

Evaluation: Both explanation are from different fields and are not
comparable

Label: 1

## Example:

Explanation 1: "words related to data labeling and classification"
Explanation 2: "terms related to observation and measurement in a
scientific context"

Evaluation: While both explanations involve specific vocabulary
related to technical concepts, Explanation 1 focuses on data labeling
and classification, while Explanation 2 pertains to observation
and measurement in a scientific context. Although they both involve
technical terms, the topics themselves are different, with Explanation 1
centering on data organization and Explanation 2 focusing on scientific
research methods.

Label: 2
"""

**Table 1: Full list of SAEs we used for our experiments. To the best of our knowledge these SAEs are used in Neuronpedia website.**
| Layer | SAE | Layer | SAE |
| --- | --- | --- | --- |
| 0 | width_16k/average_l0_46 | 13 | width_16k/average_l0_83 |
| 1 | width_16k/average_l0_40 | 14 | width_16k/average_l0_83 |
| 2 | width_16k/average_l0_141 | 15 | width_16k/average_l0_78 |
| 3 | width_16k/average_l0_59 | 16 | width_16k/average_l0_78 |
| 4 | width_16k/average_l0_125 | 17 | width_16k/average_l0_77 |
| 5 | width_16k/average_l0_68 | 18 | width_16k/average_l0_74 |
| 6 | width_16k/average_l0_70 | 19 | width_16k/average_l0_73 |
| 7 | width_16k/average_l0_69 | 20 | width_16k/average_l0_71 |
| 8 | width_16k/average_l0_71 | 21 | width_16k/average_l0_70 |
| 9 | width_16k/average_l0_73 | 22 | width_16k/average_l0_72 |
| 10 | width_16k/average_l0_77 | 23 | width_16k/average_l0_75 |
| 11 | width_16k/average_l0_80 | 24 | width_16k/average_l0_73 |
| 12 | width_16k/average_l0_82 | 25 | width_16k/average_l0_55 |

## Appendix C Path Examples

Bellow are the path examples obtained via permutation composition.

Figure: Figure 13: Examples of paths first, second, third and fourth features from 20th layer to 25th layer.
Refer to caption: extracted/5927996/figures/example_1.png

## Peer Reviews

confidence: 4
contribution: 3
initial_rating: 8
presentation: 3
questions: Questions for the authors:

1. Parameter folding serves as a form of normalization for encoder/decoder weights (as is mentioned in lines 156-157). What happens if one instead matches feature with encoder/decoder weights normalized to be unit vectors? This would be equivalent to maximizing cosine similarity instead of minimizing MSE, as ||x-y||^2=||x||^2+||y||^2 -2 ||x||*||y||*cossim(x,y).

2. One might expect the set of features to change across layers as the model processes information. In that case, the "correct" form for a matching might not be a bijection. Could one instead define a non-bijective "matching" via P(f)=argmin_i ||f-g_i||_2 where f is a feature in layer n, and {g_i}_i=1^k is the set of features in layer n+1? How does this compare to Feature Matching?

3. In Section 5.4, Figure 8, the y-axis is labelled "GPT Score". What is that metric and how was it calculated? Previous metrics have been a "GPT Score" on a scale of Different/Maybe/Same, or Matching Score in a range of 0-1, but this does not appear to be either of those.

4. In Section 5.5, it seems Layer Pruning may introduce error in two ways: 1) feature activations in layer N do not result in perfect reconstruction of the residual stream even for layer N, and 2) features in layer N do not perfectly match features in layer N+1. Did any experiment disentangle those effects? For instance, what is the \Delta L from replacing x with \hat x? This would provide useful context for the quantities shown in Figure 10.

5. Many SAEs have "dead" features, which presumably contribute little to the matching process. Could SAE Match be modified to exclude "dead" features, and if so how?



If it is permitted for authors to make revisions before the final submission, there are several small changes that could improve the quality of the paper:

- Line 93: The loss function as written is incorrect. The L2 term is squared, and what is written as L0 should be L1. See e.g. Equation 4 in (Cunningham et al, 2023) (https://arxiv.org/pdf/2309.08600). 

- Line 132-133 (equation 3): The L2 norm in the argmin needs to be squared to get the mean *squared* distance.

- Lines 147-149 (equation 4): It appears that b_dec should be b_enc.

References:

Wes Gurnee, Neel Nanda, Matthew Pauly, Katherine Harvey, Dmitrii Troitskii, and Dimitris Bertsimas. Finding neurons in a haystack: Case studies with sparse probing. Trans. Mach. Learn. Res., 2023, 2023. URL https://openreview.net/forum?id=JYs1R9IMJr.

Hoagy Cunningham, Logan Riggs Smith, Aidan Ewart, Robert Huben, and Lee Sharkey. Sparse autoencoders find highly interpretable features in language models. In The Twelfth International Conference on Learning Representations, 2024. URL https://openreview.net/forum? id=F76bwRSLeK.

Samuel Marks, Can Rager, Eric J. Michaud, Yonatan Belinkov, David Bau, Aaron Mueller. Sparse Feature Circuits: Discovering and Editing Interpretable Causal Graphs in Language Models. 2024. https://arxiv.org/abs/2403.19647
soundness: 4
strengths: - The paper's SAE Match technique appears to work well at finding corresponding SAE features between layers, which can contribute to the goal of mapping a "feature circuit" (as in Marks et al. (2024) https://arxiv.org/pdf/2403.19647). This technique is data-free, meaning only the SAE weights are required, and not any model or SAE activations.

- The paper also provides useful empirical evidence that SAEs find features between layers that are simultaneously 1) close in the space of parameters, and 2) interpreted to have similar meaning.
summary: The paper introduces SAE Match, a technique that produces a bijection from [sparse autoencoder (SAE) features in layer n] and [SAE features in layer n+1], with the objective of reducing the average squared distance (i.e., mean squared error (MSE)) between a feature and its target. They also introduce parameter folding, which seeks to augment SAE Match to work on features with different scales. The paper shows via experimentation on Gemma Scope SAEs  that features have more similar LLM-derived interpretations if they have lower MSE, and that SAE Match with parameter folding results in more similar interpretations.
weaknesses: - The authors get far worse results on layers 0-9 of the model than on layers 10-25, indicating that the technique may not fully generalize. The authors claim that this is to be expected, saying "This phenomenon aligns with findings from previous research. Gurnee et al. (2023) also reported increased polysemanticity in the early layers of neural networks." This explanation is unsatisfactory because Gurnee et al. (2023) were working with LLM neurons, not SAE features. Additionally, Cunningham et al. (2023) found that earlier layers were more interpretable (see Figure 2 in https://arxiv.org/pdf/2309.08600).

- The proposed technique of parameter folding is only defined for SAEs using the JumpReLU activation function, and it is not clear how could be adapted to over activation functions like ReLU or TopK.

---

confidence: 3
contribution: 2
initial_rating: 5
presentation: 4
questions: ### Questions
- I'm curious about the takeaways of the experimental results from Section 5. How do I interpret a scale of ∆L about 1? Do the authors believe their results indicate that layers between 10 and 20 can be collectively pruned with the SAE matching method?
- I'd be interested in a discussion of why encoder matching performs worse than decoder matching.

### Further notes
- Line 154: Repetition of meaning in two following sentences.
- Why is Hypothesis 2 formatted as a hypothesis? It seems like a definition of a method to me.
- Line 234: Calling "average ℓ0" a regularization coefficient is misleading; calling it (average) sparsity is clearer.
- Line 235: Do the authors refer to Equation 3 when mentioning MSE? A reference of that equation or a different naming would be useful, since MSE is often used for the reconstruction loss in the context of SAEs.
I- 'm very curious how these results compare to findings with crosscoders (https://transformer-circuits.pub/2024/crosscoders/index.html). Matched features might share decoder vectors of a single crosscoder feature.
- Section 5.3: Gurnee operates on MLP neurons, which are not incentivized to be sparse. I expect SAE features to be (more) monosemantic, so Gurnee's results ideally shouldn't apply to SAE features.
- I'd be curious about a deeper investigation of the sharp increase in semantic feature similarity in Figure 4 left.
soundness: 3
strengths: Main finding: Cosine similarity alone is not a great proxy for late layers, as residual stream norms increase. The authors propose parameter folding, which effectively addresses this problem for JumpReLU SAEs. Current work relies on cosine similarity, and I am convinced the field should adopt this proposed technique.
summary: The authors define a similarity metric between two learned encodings, based on permutations. They find that, specifically for the JumpReLU architecture, θ tracks the growing residual stream norm. Accounting for this observation by normalizing weight vectors with θ improves permutation matching. They find that W_dec MSE decreases substantially for high layers, while not making differences for early layers. They further employ an LLM to judge the semantic similarity of matched features. Interestingly, they find that feature matching works well in early layers (<10) as per MSE but show that feature descriptions do not match. Additionally, they compare matching features across multiple layers by exact match and layer-wise composition, and investigate SAE match as layer pruning technique.
weaknesses: ### Critiques that can be addressed in this paper
- I am unsure whether the original hypothesis of permutation is answered. The term "matching" implies a binary measure of whether a feature mapping is true or false. This might require the introduction of a cutoff threshold, or applying a clustering technique. Otherwise, the framing of similarity measures might be clearer than permutation. I'm curious about the authors' opinion on whether there is a binary criterion for whether features do/don't match.
- To quantify the fraction of "true matches," the MSE over all features is too coarse; only the matching score distribution provides a clear picture of which fraction of features are "well enough" matches.
- Line 315: "...unfolded matching showed higher MSE in the scale of hidden state representations, supporting behaviour described with Hypothesis 2." Comment: This is not true for benc MSE.
- I'm unsure about the statistical significance of the LLM evaluation. I understand that 100 out of 16k (<0.1%) SAE latents (aka features) were chosen. Did the authors choose these features at random? Increasing the number of SAE features would increase the significance of their findings. Using an LLM to judge the coherence of max activating examples of features would be an insightful additional metric that would track the suspected polysemanticity in early layers.
- I do not agree that Figure 7 right reflects the findings in Figure 7 left, where the matching score suddenly increases at layer 10.
- The quantification of "too far apart" in Hypothesis 3 would be a useful improvement.

### Further suggestions (that can be addressed in future work)
How does the mechanistic permutability transfer to other SAE architectures? The only difference will be adapting scaling factors defined in Equation 4. It would be great to provide a generalized definition of parameter folding for all SAE architectures.

---

confidence: 3
contribution: 4
initial_rating: 5
presentation: 3
questions: Could you provide more direct evidence for Hypothesis 2, or provide a clearer argument for why your current result provide evidence for it? Could you provide more discussion of what the takeaways for Section 5.5 were intended to be?
soundness: 2
strengths: - Proposes a novel and interesting strategy for pairing features between layers.
    - Studies some of the shortcomings (e.g. long tail of pairing 'failures') of this strategy.
- The presentation is very clear and understandable.
summary: This paper proposes a new method for comparing and matching features of SAEs of nearby layers in transformers. They propose scaling features according to the activation threshold $\theta$ of a JumpReLU activation function in order to match features in a more natural norm for the underlying activations.
weaknesses: - It would be good to spend more time justifying the hypothesies of Section 3. I do not think that the results in Figure 3 constitute much evidence for Hypothesis 2, since the reasoning here seems slightly circular - you propose parameter folding based off the observation that $\theta$ tracks the activation norms, but then evaluate feature similarity using the same objective that you are explicitly trying to minimize. Therefore, it is trivially true that 'folding+matching' outperforms 'matching'.
    - The evidence for Hypothesis 2 could be strengthened by including an analysis of how the scale of $\theta_i$ tracks with the scale of feature $i$ *on the same layer* (and similarly measuring MSE by scaling the features according to data-dependent statistics instead of $\theta$, e.g. by comparing MSE in the norm induced by some whitening transformation?); the observation in Figure 1 shows that *mean* $\theta$ tracks with *mean* activation norm, but your hypothesis rests on the assumption that $\theta_i$ is predictive of the scale of feature $i$ for features of the same layer.
    - It would be more convincing if you backed up your claims in Figure 2 that "reconstructions of matched features are closer to each other than in the unfolded variant of the algorithm" by comparing the reconstruction loss (perhaps again under a norm induced by a whitening transformation?) of 'folded+matched' and 'matched' permutations when 'skipping' a layer, as in Section 5.5.
- There was little analysis of the results of the experiments in Section 5.5. The loss differences resulting from using feature-matched activation reconstructions were not compared to any nontrivial baseline (e.g. perhaps something like a linear approximation of the layer?) and it was hard to see what the desired conclusion/hypothesis or suggestion at a direction for future study was here, and the paper might benifit from expanding on this a bit.
    - It might also be useful to baseline the figures in Figure 10 using the reconstructions of an SAE at layer $t+1$, i.e. substituting $x^{(t+1)}$ with $W_\mathrm{dec}^{(t+1)} \sigma ( W_\mathrm{enc}^{(t+1)} x^{(t+1)} + b_\mathrm{enc}^{(t+1)} ) + b_\mathrm{dec}^{(t+1)}$; it is known that SAEs achieve nonzero reconstruction loss and that this incurs a performance penalty when using the reconstructions in place of the original activations. Intuitively the penalty incured from using the matched activations is 'mixed' with this base reconstruction penalty.
    - As stated before, it would also be good to include the 'matched' baseline in this section as well.

---

confidence: 4
contribution: 4
initial_rating: 6
presentation: 3
questions: - In Figure 3, there are different results for folder and unfolded b_enc, but b_enc is not affected by folding according to equation 4. How is b_enc different due to folding?
- In Figure 3, vanilla matching performs not much worse than the actual matching techniques. Is vanilla matching essentially equivalent to randomly pairing decoder rows? If so, why is the MSE loss so low?
- In Section 4, it says SAEs with regularization coefficient near 70 are used. Is this referring to the L0 of the SAE in Gemma Scope? Neuronpedia only supports Gemma Scope SAEs with L0 closest to 100 - if Neuronpedia is used for all SAEs, does this mean that the L0 near 100 Gemma Scope SAEs are used as well?
soundness: 3
strengths: Using MSE loss between SAE decoders is simple and fast. The idea of folding the jumprelu threshold parameter into weights to account for differences in layer norm is a really nice idea as well. Aligning SAE latents across layers is important for understanding how features progress throughout the foward pass of the model, so this work is useful to the field.
summary: The paper presents a technique to match SAE latents from two SAEs across different layers called SAE Match. The technique finds permutations of latents which minimize MSE between the encoder and/or decoder representation of the feature in both SAEs. SAE Match addresses different layer norms by folding in the jumprelu threshold parameter into encoder and decoder matrices. The paper evaluates the technique on the Gemma Scope SAEs for Gemma 2.
weaknesses: The paper only focused on a single model (Gemma) and a single type of SAE (JumpReLU). The paper evaluates on Gemma Scope, but uses only a single SAE per layer despite Gemma Scope containing multiple SAEs per layer with different sparsities. It would be a good check to see how the method performs comparing different SAEs trained on the same layer as well. The method seems like it does not address feature splitting, where a single latent in one SAE becomes multiple latents in a different SAE - the method seems like it will only pair latents 1-to-1.

Meta-review: The paper introduces a novel method for mapping Sparse Autoencoder features across adjacent layers, which demonstrates significant improvements in feature correspondence and interpretability compared to traditional cosine similarity metrics. Empirical results showcase its effectiveness with reduced MSE and semantic similarity evaluations, while visualizations and thorough discussions enhance the method’s clarity and accessibility. Reviewers highlight the potential applicability of SAE Match across diverse tasks, particularly in advancing sparse representation and interpretability research. On the other hand, focus on a single model (Gemma) and activation type (JumpReLU) limits generalization. Some claims, such as those related to Hypothesis 2, would benefit from stronger empirical evidence and comparison with alternative matching methods. Nevertheless, SAE Match is recognized as a valuable and innovative contribution, with significant potential to inform future advancements in feature alignment and complex model interpretability.

Decision: Accept (Poster)