Rotate your phone for a larger view

Behavioral Compositionality of Sparse Autoencoder Representations

If the effects of individual SAE features are known, can their joint effect be predicted by summing them?

Individual feature effects need not add up

Prompt
→
Layer 21
→
16 SAE features
→
Remove some
→
“she” or “he”
After Emily went to the store, she / he
Click a cell to remove that pair of features.
Joint effect larger than the sum Joint effect smaller than the sum Effects add up
How much of the behavior do individual feature effects miss?
Behavior g=logit(she)−logit(he)
—
Predicted by adding single effects
—
Model output
The intervention

At layer 21 and the last token, the activation hx is split into the 16 most active SAE contributions δi=zidi and all other activation content hx0, which includes the reconstruction residual. Keeping a subset S gives

h˜x(S)=hx0+∑i∈Sδi

The upper layers run unchanged and give g(S). For a pair of features the sum of single effects predicts g(N)−[g(N)−g(N∖i)]−[g(N)−g(N∖j)]. The colour of a cell is the model output minus this prediction.

The selected pair is SAE features 21097 and 29794 of the Llama Scope SAE. For this prompt = 0.1677 and = 0.771.

Paper Section 3.1, Figure 9 and Table 22, prompt gendered_pronoun/00310.

SAR measures what individual feature effects leave unexplained

SARr=Var(g−Πrg)Var(g)
?
Explained by first order Added by pairs Unexplained
SAE Additivity Residuals

Subsets are drawn by keeping each feature independently with probability 1/2. Let Πrg be the best approximation of g with terms of at most r features and V the variance of g. Then

SARr=‖g−Πrg‖μ2V,Δ2=SAR1−SAR2,ρ2=Δ2SAR1

Under this sampling SARr is exactly the normalized energy of interactions above order r, and it bounds the coalition ordering error of the best order r approximation.

With 16 real features there are 65,536 subsets. The paper samples 384, fits on 256 and reports SAR̂r=L̂r/(V̂+ϵ) on the other 128.

The toy uses all 16 subsets of four features, so its values are exact. Its behavior is g=A+0.5B+C+0.4D−AC+ABD.

Paper Sections 3.2 to 3.4.

SAE coordinates have lower first order residuals than random rotations

A rotation mixes the 16 selected contributions into 16 new directions. The subspace, the total contribution and the upper layers stay the same.

Each dot is one prompt. Each diamond is the median of one model and behavior.
18 / 18
model and behavior settings where the SAE median is lower
57 / 57
settings where is above zero. A linear readout gives 1.55 × 10−13.
Highlight a model
Rotated coordinates

With the contributions as the columns of Dx, a rotation uses DxQ where Q is orthogonal and Q𝟏=𝟏. Each prompt gets eight random rotations and keeps its subsets and split.

From early to late layers falls in eight of nine comparisons and rises in all nine. Rotations show the same decrease, so part of this trend comes from the shorter downstream computation. SAE coordinates stay lower in all 33 model, behavior and layer comparisons.

Median, SAE/rotationGemmaMistralLlama
Paper Sections 4.2 and 4.5, Figure 3 and Table 10.

Pairwise terms recover most of the missing structure

â1(S)=θ0+∑i∈Sθi
â2(S)=â1(S)+∑i<j∈Sθij
Both are fit on 256 random subsets and evaluated on 128 held out subsets.
Rank fidelity
Frank(r)=SpearmanS∈𝒰(âr(S),g(S))
1 means every held out subset is ordered correctly.
0.9782 → 0.9959
Average rank fidelity over 18 model and behavior settings. Pairwise terms improve it in every setting and beat the same number of random third order terms.
The same prompt, 128 held out subsets
Pairs and a matched control

The pairwise model has 137 coefficients. The control keeps the 17 first order terms and replaces the 120 pair terms with 120 terms of three features drawn at random from 560. Each prompt gets 50 such controls, and this slide shows the one with the median rank fidelity. Over the 50 controls rank fidelity ranges from .

Over the 18 settings pairwise terms also lower sign error in every setting and cut selection regret from 0.0272 to 0.0051. Both gains hold in all 20 repeated splits.

From the lowest to the highest decile, first order rank fidelity falls from 0.9857 to 0.9539 in Gemma, from 0.9939 to 0.9413 in Mistral and from 0.9790 to 0.9289 in Llama.

Paper Sections 4.3 and 4.4, Figures 4 and 5, Tables 15 to 19 and 22.

Pairwise modeling better predicts combined steering

We add 16 published SAE steering directions to Llama-3.1 8B in 1,024 combinations and measure accuracy on 1,400 MMLU-Pro questions.

Each dot is one of 512 held out combinations.
Predict each combination with
Rank fidelity, higher is better
First order
Pairwise
Ordering error, lower is better
ℰ=𝔼[(Δg)2𝟏{ΔgΔa≤0}]2V
First order
Pairwise
Residual estimate , lower is better
First order
Pairwise
The steering experiment

The 16 MMLU-Pro features come from CorrSteer for the Llama Scope SAEs at layers 12 to 30, with their published coefficients. A combination adds each chosen direction at its layer. We sample 1,024 of the 65,536 combinations and split them 512 and 512. Each of the 14 MMLU-Pro domains contributes 100 test questions.

In ordering error, Δg and Δa are the differences in actual and predicted accuracy between two combinations. Domain results are mixed. Pairs raise rank fidelity in 10 of the 14 domains.

DomainResidual, first orderRank, first orderRank, pairwise
Paper Section 4.6 and Tables 1, 7, 20 and 21.
Takeaways

SAE coordinates are comparatively compositional, but faithful joint explanations still need interactions

Individual effects leave a residual
is above zero in all 57 settings.
SAE coordinates add up better
They beat random rotations of the same subspace in all 18 settings.
Pairs recover most of the rest
Rank fidelity rises from 0.9782 to 0.9959, and from 0.5874 to 0.7790 for steering.
What these results do not show
  • A property of a whole SAE dictionary. The results depend on the selected features, the behavior and the intervention.
  • That pairs are always enough. Some higher order structure remains, and pairs did not help in every steering domain.
  • What the interacting features mean.