arXiv:2611.09233cs.LGNov 2026

Manuscript Offprint

arXiv:2611.09233

Cross-Layer TopK: Dynamically Allocating Sparsity Across Layers in Transcoders

Anyuan Zhuo, Shaohua Zhang, Tianle Li, Yuan Lin, Diandian Gu, Jun Wang, Pinyan Lu

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original. This text is shared under the same licence.

Abstract

Cross-Layer Transcoders (CLTs) decompose the activations of large language models into human-interpretable features and trace how these features interact across layers to form circuits, making them a key tool for mechanistic interpretability. However, training CLTs effectively and efficiently is hard. Beyond the usual trade-off between sparsity and reconstruction quality, a CLT has to model all layers at once, which adds a further challenge. The common JumpReLU recipe controls sparsity only indirectly through a penalty, while the direct extension of TopK selects a fixed number of latents in every layer. Yet reconstruction difficulty differs widely across layers, and intermediate layers are much harder than others, so giving every layer the same budget is suboptimal. We propose Cross-Layer TopK, which sets a single L0L_0 budget for the whole model and dynamically allocates it across layers during training. In a comparison with JumpReLU and other TopK variants on Qwen3-8B-Base, this gives lower FVU while using 20% fewer active latents than JumpReLU. The better reconstruction carries over to circuit tracing, yielding more complete circuits with higher replacement and completeness scores. The fixed per-token budget of Cross-Layer TopK also makes it easy to pair with sparse decoding, which cuts both computation and communication and gives a 2.9×2.9\times speedup per training step. We further show that Cross-Layer TopK follows scaling laws in both latent size and sparsity. We have open-sourced the weights of our CLT at https://huggingface.co/ByteDance-Seed/Cross-Layer-TopK-CLT.

Date: November 9, 2026

Correspondence: zhangshaohua.cola@bytedance.com, lu.pinyan@mail.shufe.edu.cn

1 Introduction

Mechanistic interpretability aims to explain the computation of LLMs in terms of human-interpretable features and the interactions among them, commonly referred to as circuits. A widely used approach is dictionary learning, in which an encoder maps activations to a sparse, over-complete set of features and a decoder reconstructs a target from these features under a sparsity constraint. Sparse autoencoders (SAEs), transcoders, and cross-layer transcoders (CLTs) share this encoder–decoder structure and differ only in their inputs and outputs. SAEs reconstruct an activation from itself and thus extract the features it encodes [9, 11]. Transcoders instead reconstruct the output of an MLP block from its input, yielding a sparse replacement for the MLP [7]. CLTs further allow a feature read from the residual stream at layer ll to contribute to the

MLP outputs of all layers l′≥ll' \geq l, so that computation distributed across many layers can be captured by a single feature. Compared with training one transcoder per layer (per-layer transcoders, PLTs), CLTs have been shown to produce sparser and more interpretable circuits, and have revealed the mechanisms behind real-world model behaviors such as planning, multilingual processing, and jailbreaks [1, 13].

Training dictionaries effectively and efficiently is challenging, since it requires optimizing reconstruction and sparsity at the same time. Sparsity (typically measured by L0L_0, the number of active features) is enforced by the activation function that follows the encoder. Gated and JumpReLU activations control the sparsity level through a penalty term, whereas TopK [9] directly keeps the kk largest pre-activations and sets the rest to zero. CLTs add a further difficulty: because a feature at layer ll contributes to the MLP outputs of all later layers, all layers must be modeled jointly, and the reconstruction losses of different layers are coupled.

The activation function that enforces this sparsity is therefore a central design choice. The existing CLT recipe [1] uses JumpReLU, which has practical drawbacks. Its sparsity is obtained indirectly through a sparsity penalty, and the level reached at the end of training cannot be predicted from the penalty in advance. Hitting a target sparsity therefore requires repeated searches over the penalty coefficient, at a computational cost that is substantial for large CLTs. Even a penalty designed around a target sparsity [19] cannot control it exactly, and in our experiments JumpReLU also leaves far more latents dead than TopK (Section 4.2).

A natural remedy is to replace the activation function with TopK [9], which keeps the kk most strongly activated latents within each layer and thus makes the sparsity exact by construction. This sacrifices a degree of freedom that JumpReLU enjoys, because layers are not equally hard to reconstruct. The early layers and the last few layers of an LLM are typically easier, whereas the middle layers are harder, and activating more latents at a layer buys a better reconstruction there. Because its penalty is summed over all layers, JumpReLU is free to redistribute sparsity across layers on its own, spending more activations where reconstruction is hard. This per-layer variant, which we call Per-Layer TopK, fixes the number of active latents at every layer ahead of time, leaving the model no such freedom during training.

Motivated by these observations, we propose Cross-Layer TopK. Rather than selecting the top-kk latents in each layer separately, we pool the latents of all LL layers and select the L⋅kL \cdot k with the largest scores for each token. It thus keeps the total sparsity exact, as TopK does, while leaving the allocation across layers to the model, as JumpReLU does. Further analysis shows that Cross-Layer TopK learns to allocate a larger share of the L0L_0 budget to intermediate layers during training, which leads to its better overall reconstruction.

We compare Cross-Layer TopK against two TopK variants in ablations. Per-Layer TopK, the direct extension of TopK SAEs to CLTs described above, gives every layer the same budget regardless of how hard it is to reconstruct. Cross-Layer BatchTopK, which combines BatchTopK, originally proposed for SAEs [4], with our cross-layer selection, selects the top latents over all tokens in a training batch, which relies on the batch being large and randomly mixed; since no such batch is available at inference, a per-feature activation threshold must be calibrated post hoc on training data. This train-inference mismatch leads to good reconstruction on the training set but a marked drop on the validation set.

In summary, we propose Cross-Layer TopK, a simple sparsity mechanism for CLTs, compare it systematically with JumpReLU and other TopK variants, and show that it offers three advantages:

  • Better reconstruction. By allocating the L0L_0 budget across layers dynamically, Cross-Layer TopK achieves a lower fraction of variance unexplained (FVU) than all compared methods, even with 20% fewer active latents than JumpReLU, and exhibits scaling laws in both latent size and sparsity.

  • More complete circuits. The improved reconstruction carries over to circuit tracing, where Cross-Layer TopK attains higher replacement and completeness scores, indicating better circuit-level interpretability.

  • Simpler sparse decoding. Because the number of active latents per token is fixed, Cross-Layer TopK can use sparse decoding directly, without monitoring L0L_0 or handling variable shapes; in our tensor-parallel setup this gives a 2.9×2.9\times speedup per training step.

The rest of the paper is organized as follows. Section 2 reviews prior work on sparse dictionary learning and circuit analysis. Section 3 defines Cross-Layer TopK formally. Section 4 evaluates it against three other

CLT architectures on reconstruction quality (Section 4.2), analyzes how it allocates the budget across layers (Section 4.3), evaluates circuit completeness on attribution graphs (Section 4.4), measures the training speedup that a fixed L0L_0 makes possible (Section 4.5), and studies scaling laws in latent size and sparsity (Section 4.6). Section 5 concludes.