Inferensys

Glossary

Cross-Layer Transcoding

A mechanistic interpretability technique that trains a transcoder to translate the sparse feature representation of one layer into the feature representation of a subsequent layer, enabling the tracking of computational transformations across network depth.
Data engineer managing feature store on laptop, feature definitions visible, casual data engineering session.
MECHANISTIC INTERPRETABILITY

What is Cross-Layer Transcoding?

A technique for interpreting features that span multiple layers by training a transcoder to translate the sparse feature representation of one layer into the feature representation of a subsequent layer.

Cross-Layer Transcoding is a mechanistic interpretability technique that decodes how polysemantic features evolve across transformer depth by training a model to translate the sparse, monosemantic feature representation of one layer's activations into the corresponding feature representation of a later layer. This process explicitly maps the computational transformations applied by intermediate attention heads and MLP layers, revealing how abstract concepts are constructed iteratively.

Unlike single-layer sparse autoencoders (SAEs) that decompose activations in isolation, a cross-layer transcoder learns a direct mapping between the sparse feature dictionaries of two distinct layers. By predicting a later layer's feature coefficients from an earlier layer's, it isolates the functional contribution of the intervening computational block, enabling researchers to trace the lineage of specific features and validate hypotheses generated by circuit analysis and causal mediation analysis.

FEATURE TRANSLATION

Key Characteristics of Cross-Layer Transcoding

Cross-layer transcoding reveals how sparse, interpretable features evolve and transform as they propagate through the residual stream of a transformer. By training a transcoder to map features from one layer to the next, we can trace the computational lineage of concepts.

01

Feature Translation Mechanism

A transcoder is a learned linear or non-linear map that translates the sparse feature activations from a source layer into the sparse feature representation of a target layer. Unlike a standard SAE, which decomposes a single layer, a transcoder explicitly models the computational transformation between layers. It takes a vector of feature coefficients from layer L and predicts the corresponding feature coefficients in layer L+1, revealing how the model refines, combines, or discards features during forward propagation.

02

Resolving Polysemanticity Across Depth

A single neuron in an early layer may respond to multiple unrelated concepts (polysemanticity). Cross-layer transcoding demonstrates how these entangled representations are progressively disentangled by subsequent layers:

  • An early feature might activate for both 'legal documents' and 'scientific papers'
  • The transcoder shows this feature splitting into two distinct, monosemantic features in the next layer
  • This provides direct evidence for the superposition hypothesis and how models build hierarchical abstractions
03

Circuit Continuity Verification

Transcoders enable researchers to verify if a circuit identified in one layer remains functionally intact in subsequent layers. By translating the feature activations of a circuit component forward, one can check if the downstream representation still encodes the same logical operation. This addresses a key limitation of single-layer circuit analysis, where connections between components in different layers are often assumed rather than empirically validated through causal mediation analysis.

04

Training Methodology

A cross-layer transcoder is trained by:

  • Collecting paired activations: Run the model on a diverse corpus and cache the sparse feature coefficients from the SAEs of two adjacent layers
  • Minimizing reconstruction error: Train the transcoder to predict the target layer's feature coefficients from the source layer's coefficients, typically using an L2 loss or a KL divergence if features are probabilistic
  • Sparsity constraint: Apply an L1 penalty on the transcoder's output to ensure the predicted feature set remains sparse and interpretable, preventing the model from activating spurious features
05

Feature Birth and Death Tracking

Transcoders provide a systematic framework for tracking the lifecycle of a feature across the model's depth:

  • Feature birth: A transcoder identifies when a new, distinct feature emerges in a layer that had no direct counterpart in the previous layer
  • Feature death: A feature present in layer L may have near-zero weight in the transcoder's prediction for layer L+1, indicating it has been pruned or fully merged into a higher-level abstraction
  • This allows researchers to build a computational phylogeny of concepts within the model
06

Relationship to Activation Patching

Cross-layer transcoding complements activation patching by providing a predictive model of how features transform. While patching tests causality by replacing an activation and observing the output change, a transcoder predicts the expected downstream feature state. Discrepancies between the transcoder's prediction and the actual patched result can reveal non-linear interactions or the influence of attention mechanisms that route information between token positions, which a purely feed-forward transcoder might miss.

CROSS-LAYER TRANSCODING

Frequently Asked Questions

Answers to the most common questions about interpreting features that span multiple transformer layers using transcoder architectures.

Cross-layer transcoding is a mechanistic interpretability technique that trains a transcoder model to translate the sparse feature representation of one transformer layer into the feature representation of a subsequent layer. It works by first decomposing the activations at layer L into a sparse set of interpretable features using a sparse autoencoder (SAE). A separate transcoder network is then trained to predict the sparse feature activations at layer L+1 directly from the features at layer L, bypassing the complex non-linear transformations of the intervening MLP and attention sub-layers. This creates a direct, interpretable map of how abstract concepts transform as they propagate through the residual stream, revealing the compositional structure of the model's internal reasoning.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.