llmPublished: August 13, 2026

SAEVerbalizer: Generating Explanations for Sparse Autoencoder Features via Representation Verbalization

By Weihan Meng, Hongzhu Guo, Yi Jing, Dewen Liu, Zijun Yao, Xiaozhi Wang, Lei Hou, Juanzi Li

Research TL;DR

"Trains a verbalizer on SAE decoder directions to generate explanations directly, bypassing external observation. Generalizes to unseen features, transfers across dictionaries and models, and combines/reverses feature semantics."

Abstract

Sparse autoencoders (SAEs) are proposed to extract numerous features from large language model (LLM) representations, yet explaining these features still relies primarily on external observation. This reliance leads to superficial explanations inferred from observed model behavior and computational inefficiency from collecting such behavioral evidence at scale. We introduce SAEVerbalizer, a framework that injects SAE decoder directions into an LLM's representations and fine-tunes the LLM's downstream layers to generate natural-language explanations of the injected features. Once trained, the resulting verbalizer explains SAE features directly from decoder directions, addressing both limitations. Our experiments show that the learned verbalization capability generalizes to unseen features, transfers across separately trained SAE dictionaries, and, with a lightweight adapter, extends to SAE features from different LLMs. Intervention experiments show that injecting multiple directions yields an explanation combining their meanings, while reversing individual directions produces corresponding meaning shifts.

Technical Analysis & Implementation

Overview§

SAEVerbalizer addresses the bottleneck of explaining sparse autoencoder (SAE) features in large language models (LLMs). Traditional explainability methods rely on external behavioral probes (e.g., dataset activation maximization) which are slow and yield shallow descriptions. SAEVerbalizer instead learns to verbalize the SAE decoder direction directly: it injects a feature direction into the LLM's residual stream and fine-tunes the subsequent layers to generate a natural-language explanation.

Method§

The core idea is representation verbalization. Given a pretrained LLM with layers $L_1, \dots, L_N$ and an SAE with decoder directions $\{\mathbf{d}_i\}$ (unit-normalized), the residual stream at layer $k$ is perturbed by adding a scaled feature direction:

$$ \mathbf{x}_k \leftarrow \mathbf{x}_k + \alpha \hat{\mathbf{d}}_i $$

where $\alpha$ is a scalar controlling the intervention strength (typically chosen to match the feature activation scale). Only layers $k+1, \dots, N$ are fine-tuned (optionally with LoRA adapters), while lower layers remain frozen. The training objective is the standard next-token cross-entropy between the generated explanation and a target explanation (e.g., from an existing auto-labeler like TCAV or GPT-4).

The training dataset consists of SAE features with known explanations. Each feature's decoder vector is injected into the middle of the LLM, and the fine-tuned upper layers are trained to produce the target text. This forces the model to 'read' the geometric direction and map it to linguistic meaning.

Training Details§

  • Feature injection: At layer $k$, the residual stream is modified as above. The injection point is chosen to balance information retention (lower layers encode general language) and semantics (higher layers ready for generation).
  • Parameter efficiency: Only the layers above $k$ are updated, and in practice a low-rank adapter (LoRA) is applied, enabling cheap training.
  • Loss: Cross-entropy on the explanation tokens. No additional contrastive or auxiliary losses are required.

Transfer and Generalization§

Once trained, the verbalizer generalizes to unseen SAE features (not in training) from the same dictionary. It also transfers to features from a different SAE trained on the same LLM, and—with a lightweight adapter (a linear projection on the decoder direction)—to SAEs from other LLMs. Intervention experiments show that injecting multiple directions yields a blended explanation (e.g., 'cat' + 'dog' → 'pet'), while reversing a direction flips the semantic polarity.

Code Sketch§

The following pseudocode illustrates the training loop in PyTorch-style pseudo-code:

import torch
import torch.nn as nn

class SAEVerbalizer(nn.Module):
    def __init__(self, base_model, injection_layer_idx, adapter=None):
        super().__init__()
        self.base_model = base_model
        self.injection_layer_idx = injection_layer_idx
        self.adapter = adapter  # optional linear projection for cross-model transfer
        # Freeze all layers except those above injection_layer_idx
        for name, param in self.base_model.named_parameters():
            if int(name.split('.')[1]) <= injection_layer_idx:
                param.requires_grad = False

    def inject_feature(self, hidden_states, d_i, alpha):
        # d_i: decoder direction for feature i (normalized)
        if self.adapter is not None:
            d_i = self.adapter(d_i)
        return hidden_states + alpha * d_i.unsqueeze(0).unsqueeze(0)

    def forward(self, input_ids, d_i, alpha):
        outputs = self.base_model(
            input_ids,
            output_hidden_states=True,
            return_dict=True
        )
        hidden = outputs.hidden_states[self.injection_layer_idx]
        hidden = self.inject_feature(hidden, d_i, alpha)
        # Replace the original hidden state and continue forward through upper layers
        # (simplified; in practice you would use hooks or a custom forward)
        return self.base_model.forward_with_hidden_state(hidden, attention_mask=...)

# Training loop
model = SAEVerbalizer(load_llm(), injection_layer_idx=12)
optimizer = torch.optim.AdamW(model.parameters(), lr=1e-5)
for feature_direction, target_explanation in dataloader:
    input_ids = tokenizer(target_explanation, return_tensors='pt').input_ids
    logits = model(input_ids[:, :-1], feature_direction, alpha)
    loss = nn.CrossEntropyLoss()(logits, input_ids[:, 1:])
    loss.backward()
    optimizer.step()

Key Takeaways§

  • Eliminates the need for external behavioral probing by directly decoding the geometric meaning encoded in SAE directions.
  • Achieves cross-dictionary and cross-model transfer, demonstrating that SAE directions share a common semantic geometry.
  • The injection-based approach enables compositional and polarity-based interventions, providing a richer interpretability tool than static feature-labeling methods.
Interactive SEO Tool

Embedding Vector Similarity Visualizer

Embeddings represent text in high-dimensional vector spaces. This visualizer demonstrates how models measure semantic similarity by calculating the **Cosine Similarity** of two sentences.

Cosine Similarity:0.4020
Vocabulary Size14 unique terms
Shared Terms3 terms
Intersecting Vocabulary
thebrownover
Vector Projection PlaneXYθ = 66°Vector AVector Bθ = 90° is orthogonal (0% match) · θ = 0° is parallel (100% match)

Mathematical Formulation

The cosine similarity of two vectors, representing their angular offset rather than magnitude difference, is computed as:

\[\text{Cosine Similarity} = \cos(\theta) = \frac{\mathbf{A} \cdot \mathbf{B}}{\|\mathbf{A}\| \|\mathbf{B}\|} = \frac{\sum_{i=1}^{n} A_i B_i}{\sqrt{\sum_{i=1}^{n} A_i^2} \sqrt{\sum_{i=1}^{n} B_i^2}}\]

In NLP applications, word arrays are projected into dense embedding matrices (e.g. 1536 dimensions). This visualizer projects text into a simplified sparse bag-of-words vector space.

SHARE RESEARCH:
INTEGRATED RECOMMENDATION

Accelerate your workflow with Araho

Need help choosing the right model for your product? We build AI-native MVPs.

Get your MVP built in weeks with top-tier AI developers.