Inferensys

Glossary

Cross-Coder

A variant of a sparse autoencoder trained on the activations of two different models simultaneously to identify shared and distinct features between them.
Data engineer managing feature store on laptop, feature definitions visible, casual data engineering session.
MECHANISTIC INTERPRETABILITY

What is Cross-Coder?

A cross-coder is a variant of a sparse autoencoder trained simultaneously on the activations of two different models to identify shared and distinct learned features.

A cross-coder is a dictionary learning architecture that decomposes the internal activations of two distinct neural networks into a shared, sparse set of interpretable features. Unlike a standard sparse autoencoder trained on a single model, a cross-coder is trained on the concatenated activations of a 'base' and a 'target' model at a specific layer. This forces the learned dictionary to capture features that are common to both models, as well as features that are uniquely represented in one model but not the other, enabling direct comparison of their internal representations.

The primary utility of a cross-coder is in model comparison and circuit analysis. By isolating features that are shared versus idiosyncratic, researchers can quantify how different training runs, architectures, or fine-tuning stages alter a network's learned concepts. This technique provides a lens into the universality of specific circuits and helps validate whether two models have converged on similar monosemantic representations for the same underlying concept, or if they rely on divergent internal algorithms.

MECHANISTIC INTERPRETABILITY

Key Features of Cross-Coders

Cross-coders are a variant of sparse autoencoders trained simultaneously on the activations of two different models to identify shared and distinct features between them. This technique enables direct comparison of learned representations across architectures.

01

Shared Feature Dictionary

A cross-coder learns a single, shared dictionary of feature vectors that span the activation spaces of two models simultaneously. Unlike training separate sparse autoencoders and attempting post-hoc matching, the cross-coder jointly optimizes for features that appear in both models. This produces a unified feature basis where each latent dimension can be active in Model A, Model B, or both, enabling direct quantitative comparison of which concepts are universal versus architecture-specific.

02

Model-Specific Feature Gates

Cross-coders introduce per-model gating mechanisms that allow a feature to be active in one model but dormant in another. The architecture learns:

  • Shared features: Concepts represented similarly in both models
  • Model-A-specific features: Concepts unique to the first model's representational geometry
  • Model-B-specific features: Concepts unique to the second model

This gating is implemented through separate encoder weights for each model that map into the shared latent space, with sparsity penalties applied independently per model.

03

Training Objective

The cross-coder minimizes a combined loss function:

  • Reconstruction loss: Sum of MSE for both models' activations, ensuring the shared dictionary faithfully reconstructs each model's internal state
  • Sparsity penalty: L1 regularization applied to the latent coefficients, encouraging only a small number of features to activate for any given input
  • Optional alignment term: A contrastive or correlation-based loss that explicitly encourages features to align across models when they represent the same underlying concept

The balance between these terms determines whether the cross-coder prioritizes faithful reconstruction or feature alignment.

04

Comparative Circuit Analysis

Cross-coders enable direct comparison of how different models compute the same function. By decomposing both models' activations into the same feature basis, researchers can:

  • Identify which features are computed by both models at the same layer depth
  • Detect features that one model computes earlier or later in its forward pass
  • Quantify the representational similarity between architectures trained on different data or with different objectives
  • Trace how a specific concept flows through each model's residual stream using the shared feature vocabulary
05

Universal vs. Idiosyncratic Features

A key finding enabled by cross-coders is the distinction between universal features and idiosyncratic features:

  • Universal features appear consistently across models with different random initializations, architectures, or training data. These often correspond to fundamental concepts like syntax, factual knowledge, or basic visual primitives
  • Idiosyncratic features are model-specific and may represent quirks of optimization, dataset artifacts, or redundant representations

This distinction has implications for AI safety, suggesting that some features are robust invariants of the learning process while others are contingent.

06

Relationship to Sparse Autoencoders

Cross-coders extend standard sparse autoencoders (SAEs) in a critical way:

  • Standard SAE: One encoder, one decoder, trained on one model's activations at one layer
  • Cross-coder: Two encoders (one per model), one shared decoder dictionary, trained on two models' activations simultaneously

The shared decoder forces the latent space to represent features that are meaningful across both models. This is analogous to bilingual dictionary induction in NLP, where a shared semantic space is learned from parallel corpora, but applied to neural network internals rather than text.

CROSS-CODER MECHANISTICS

Frequently Asked Questions

Explore the architecture and application of cross-coders, a variant of sparse autoencoders trained on the activations of two different models simultaneously to identify shared and distinct features between them.

A cross-coder is a variant of a sparse autoencoder trained on the activations of two different models simultaneously to identify shared and distinct features between them. Unlike a standard sparse autoencoder that decomposes a single model's activations into a sparse set of interpretable features, a cross-coder learns a shared dictionary of features that can represent the computational states of both models. The architecture consists of a shared encoder that projects activations from either model into a common sparse latent space, and two separate decoders—one for each model—that reconstruct the original activations. This design forces the learned features to capture concepts that are either universal across both models or uniquely present in one, enabling direct comparison of their internal representations. The key innovation is that the sparsity constraint operates on the shared latent representation, meaning a feature is only active if it is genuinely needed to explain the activations of at least one model, preventing the dictionary from learning spurious, model-specific noise.

ARCHITECTURAL COMPARISON

Cross-Coder vs. Standard Sparse Autoencoder

A feature-level comparison between Cross-Coders trained on shared model activations and standard Sparse Autoencoders trained on a single model's activations.

FeatureCross-CoderStandard Sparse Autoencoder

Training Input

Activations from 2 models simultaneously

Activations from 1 model

Primary Objective

Identify shared and distinct features between models

Decompose dense activations into monosemantic features

Learned Dictionary

Shared latent space with model-specific feature activations

Single set of basis vectors for one model

Shared Feature Detection

Model-Specific Feature Isolation

Output Granularity

Per-model feature coefficients from shared dictionary

Single set of sparse feature coefficients

Typical Use Case

Comparing representations across models or checkpoints

Interpreting a single model's internal features

Computational Overhead

Higher (dual forward passes + joint training)

Lower (single forward pass + training)

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.