---
title: Cross-Layer Transcoder Analysis
url: https://www.emergentmind.com/topics/cross-layer-transcoder-clt-analysis
type: topic
---

# Cross-Layer Transcoder Analysis

Cross-Layer Transcoder (CLT) analysis is a mechanistic interpretability paradigm for deep neural networks, designed to explicitly trace representational transformations and information flow across multiple network layers. The CLT framework factorizes the mapping between layers, compresses activations into sparse, interpretable features, and reconstructs downstream computations via dedicated decoder projections. This approach has been applied to large language models (LLMs) for multilingual interpretability [2511.10840] and to protein language models (pLMs) for computational circuit tracing [2602.12026], providing insights into shared representations, language and function-specific decoding, and experimentally steerable latent circuits.

## 1. Mathematical Formulation and Architecture

The canonical CLT architecture consists of layer-specific encoders and decoders that map a model’s residual-stream activations into a shared latent feature space and reconstruct feedforward (MLP) outputs downstream.

Let the residual-stream activation at layer $\ell$ and position $k$ be $\mathbf{h}_\ell^{(k)} \in \mathbb{R}^{d_\mathrm{model}}$. For each $\ell$, the CLT factorizes the transformation into:

- **Encoder**:
  $$
  \mathbf{z}_\ell^{(k)} = \mathrm{ReLU}(W_\mathrm{enc}^\ell \mathbf{h}_\ell^{(k)} + b_\mathrm{enc}^\ell)
  $$
  where $\mathbf{z}_\ell^{(k)} \in \mathbb{R}^{d_\mathrm{feat}}$ is the sparse latent representation.

- **Decoder**:
  $$
  \hat{\mathbf{m}}_{\ell'}^{(k)} = \sum_{\ell \leq \ell'} (W_\mathrm{dec}^{\ell \to \ell'} \mathbf{z}_\ell^{(k)} + b_\mathrm{dec}^{\ell \to \ell'})
  $$
  reconstructing the MLP output at downstream layer $\ell'$.

In ProtoMech for protein LMs [2602.12026], a “joint” CLT variant encodes the full set of layerwise activations $X^{(\ell)}$, aggregates latents across all layers, and uses a TopK nonlinearity to enforce exact sparsity.

## 2. Training Objectives and Sparsity Constraints

CLTs are trained to accurately reconstruct target MLP outputs from earlier activations, with additional regularization to yield interpretable, sparse feature sets. The full loss can be expressed as:

- **Reconstruction loss** (MSE):
  $$
  \mathcal{L}_\mathrm{rec} = \sum_{\ell'} \sum_k \|\hat{\mathbf{m}}_{\ell'}^{(k)} - \mathbf{m}_{\ell'}^{(k)}\|_2^2
  $$
- **$L_0$ feature-count sparsity**:
  $$
  \mathcal{L}_{L_0} = \lambda_0 \sum_{\ell,k} \tanh(C|\mathbf{z}_\ell^{(k)}|\odot\|W_\mathrm{dec}^{\ell}\|)
  $$
- **Dead-feature penalty**:
  $$
  \mathcal{L}_\mathrm{df} = \lambda_\mathrm{df} \sum_{\ell,k} \mathrm{ReLU}(\exp(\tau) - \|\mathbf{h}_\ell^{(k),\mathrm{pre}}\|\|W_\mathrm{dec}^\ell\|)
  $$

The total loss is:
$$
\mathcal{L} = \mathcal{L}_\mathrm{rec} + \mathcal{L}_{L_0} + \mathcal{L}_\mathrm{df}
$$

ProtoMech also incorporates an auxiliary error decoding loss and optionally $L_1$ regularization on encoder weights. Sparsity is typically enforced by a TopK nonlinearity per layer.

## 3. Cross-Language and Cross-Layer Alignment

CLTs enable systematic measurement of cross-language and cross-layer alignment through the following methods [2511.10840]:

- **Cosine Similarity**: For activations $X, Y \in \mathbb{R}^{N\times d}$,
  $$
  \mathrm{cosine}(X,Y) = \frac{1}{N} \sum_{i=1}^N \frac{X_i \cdot Y_i}{\|X_i\|\|Y_i\|}
  $$
- **CCA Similarity**: Finds linear projections $w_1, w_2$ that maximize
  $$
  \rho = \mathrm{corr}(H^{(1)}w_1, H^{(2)}w_2)
  $$
  Expresses the aggregate alignment of two languages at a given layer.
- **Multilingual Score ($H(f)$)**: For feature $f$, counts activation rates $A_l(f)$ per language $l$, forming probabilities $p_l(f)$ and entropy
  $$
  H(f) = -\sum_{l=1}^L p_l(f) \log p_l(f)
  $$
  High $H(f)$ denotes a multilingual feature, low $H(f)$ language specificity.

Layerwise averaging of $H(f)$ reveals a characteristic “U-shape”: entropy (cross-language sharing) is minimal in early/late layers, reflecting language-specific or decoding features, and maximal in the middle (shared pivot representation).

Statistical tests confirm that middle-layer alignments between all language pairs are nearly identical ($p \gg 0.05$, Wilcoxon signed-rank test), implicating a single pivot representational space.

## 4. Attribution Graphs and Circuit Extraction

Cross-layer attribution quantifies the contribution of features across layers to targeted outputs. Pairwise attribution scores from source node $(\ell,k,n)$ to target $(\ell',k',n')$ are given by [2511.10840]:
$$
a_{\ell,k,n}^{\;\ell',k',n'} = \sum_{s=\ell}^{\ell'} f_{k,n}^{\;\ell\to s} J_{\ell,k}^{\;\ell',k'} g_{k',n'}^{\,\ell'}
$$
where $f_{k,n}^{\,\ell\to s}$ (decoder row), $J_{\ell,k}^{\;\ell',k'}$ (stop-gradient Jacobian), and $g_{k',n'}^{\,\ell'}$ (encoder activation) quantify the effect on the logit.

Pruning the resulting graph to the minimal edge set explaining ≥95% of the logit effect yields sparse attribution circuits spanning multiple layers.

ProtoMech extracts functional “circuits” by greedily selecting latent channels with highest attribution (gradients of probe scores w.r.t. latent activations), iteratively accumulating those that recover ≥70% of baseline performance [2602.12026].

| Framework              | Circuit Size ($\gamma$)      | Recovery     |
|------------------------|------------------------------|--------------|
| ProtoMech (pLM, ESM2)  | $<$1% of latents ($\sim$150) | 74–79%       |
| LLM CLT (GPT-2, 12L)   | 4–6 features for language ID | $>$90% swap  |

## 5. Intervention and Steering

CLT representations allow for targeted interventions on model computations. In multilingual LLMs, a small set of “language features” $F_L$ in the final layers have activation rates $\approx$50–100% on tokens of language $L$ [2511.10840]. By zeroing out features associated with a source language ($F_S$) and activating those of a target language ($F_T$), model output can be switched to a different language with high reliability.

The intervention formula is:
$$
\tilde{\mathbf{z}}_\ell = \mathbf{z}_\ell + \sum_{f \in F_T} \alpha_f \mathbf{e}_f - \sum_{f \in F_S} \beta_f \mathbf{e}_f
$$
Logit changes are predominantly linear, with language swaps raising the target token rank from $\sim$100 to top-5, and $>90\%$ success rates with only 4–6 features manipulated.

In protein LMs, steering along extracted circuits by clamping relevant latents yields variant sequences with superior design fitness; for instance, on 7 deep mutational scanning (DMS) assays, circuit steering produced the single highest-fitness variant in 71% of cases (mean ProtoMech score 4.17 vs. CAA 2.93 and random 2.74 for GFP_AEQVI) [2602.12026].

## 6. Empirical Results and Benchmarks

CLT-based analysis provides high-fidelity and compressible mechanistic models:

- For protein classification (InterPro, ESM2), CLT replicates 82–89% of the original model’s F$_1$; ProtoMech circuits ($\gamma \approx$0.8%) recover 79% [2602.12026].
- In LLMs, linear language-ID probes on early-layer features achieve $\sim$98% accuracy by layer 2 [2511.10840].
- The multilingual entropy peak and cross-language alignment maxima are observed in the midlayers, supporting the pivot representation hypothesis (cosine-CCA peaks at $0.93$ in GPT-2 layers 5–8, with minima $0.2$, maxima $1.4$ for $H(f)$).
- Sparse CLT interventions induce robust changes despite extreme compression: in pLMs, using $<$1% of the latent space retains $>$75–80% of baseline task performance at $\gamma \leq 1\%$.

## 7. Interpretability, Mechanistic Insights, and Implications

CLT analysis enables a compositional, circuit-level view of deep model computations. In multilingual LLMs, shared pivot-layer representations are evident, with language identity encoded and decodable from early features and final outputs determined by high-frequency language-specific activations. In pLMs, CLTs recover circuits that map onto known structural and functional protein motifs (e.g., catalytic loops, binding pockets).

A notable finding is that architectural or tokenization design influences downstream feature activation and language-specific decoding, rather than formation of the shared pivot. For non-English languages, failures correlate with weaker activation of late-layer language features and increased sub-token fragmentation (embedding-to-feature edge strengths correlate $r=-0.82$ with average subword count per token in LLMs).

*This suggests* that CLTs bridge the methodological gap between solely layerwise interpretability (as in sparse autoencoders) and end-to-end circuit tracing, producing interpretable surrogates that maintain high fidelity to the original model’s computations.

## References

- "Tracing Multilingual Representations in LLMs with Cross-Layer Transcoders" [2511.10840]
- "Protein Circuit Tracing via Cross-layer Transcoders" [2602.12026]

Source: https://www.emergentmind.com/topics/cross-layer-transcoder-clt-analysis