BatchTopK sparse autoencoders beat fixed TopK on both reconstruction error and downstream cross-entropy degradation across GPT-2 Small and Gemma 2 2B while keeping the exact same average number of active latents (L0). Instead of forcing every token to activate k features regardless of how much information it carries, Bart Bussmann, Patrick Leask, and Neel Nanda select the top n * k activations across an entire batch of n samples, letting simple tokens use as little as one latent while dense tokens spend over 80.
- Adaptive allocation on a fixed average: On GPT-2 Small (
L0 = 32), active counts per token range from1(peaking on beginning-of-sequence tokens) to more than 80 on dense tokens. - Direct sparsity targeting: Unlike JumpReLU sparse autoencoders, which require costly penalty sweeps to land near a target
L0, BatchTopK pins average training sparsity directly viak. - GPT-2 Small sweep (12,288 latents): BatchTopK outperforms both TopK and JumpReLU on normalized MSE (NMSE) and cross-entropy (CE) degradation across
k = 16, 32, 64. - Gemma 2 2B nuance (16,384 latents): BatchTopK beats TopK on both metrics and beats JumpReLU on NMSE at all tested
k, but JumpReLU retains lower downstream CE degradation atk = 32andk = 64.
How It Works
Standard TopK sparse autoencoders eliminate the activation shrinkage caused by L1 penalties in ReLU and Gated SAEs, yet they bake in an unnatural assumption: that every token activation vector contains the same number k of active concepts. When a batch mixes a sparse beginning-of-sequence token with a dense multi-clause token, TopK under-allocates to the complex token and forces the near-empty token to burn unused slots on noise.
BatchTopK relaxes the k constraint from the sample level to the batch level. Given a batch X of n activation vectors, the encoder computes pre-activations W_enc X + b_enc, sorts all n * m entries across the batch, and zeroes out everything outside the top n * k values. All kept activations pass through untouched. Like TopK, BatchTopK adds an auxiliary dead-latent reconstruction loss (k_aux = 512, scaled by alpha = 1/32) so rarely triggered dictionary vectors get gradient updates and do not die permanently during training.
Because selecting across a batch couples samples together, deploying BatchTopK as a batch-dependent module would leak information across prompts or break single-token inspection. After training, the authors remove the batch dependency by estimating a single scalar threshold theta equal to the mean minimum positive activation observed across calibration batches. At inference time, BatchTopK simply runs as a constant-threshold JumpReLU_theta function, zeroing any latent below theta independently per token.
Key Findings
The authors evaluate residual-stream SAEs trained for 1 billion tokens of OpenWebText (128-token sequences, batch size 4,096) on GPT-2 Small (layer 8, dictionary sizes 3,072 to 24,576) and Gemma 2 2B (layer 12, dictionary size 16,384), sweeping k across 16, 32, and 64.
Two empirical details stand out beyond the headline Pareto curves. First, BatchTopK genuinely exploits its dynamic budget rather than hovering near k: Figure 3 in the paper shows a bimodal-skewed histogram centered near the target average, with a sharp spike near 1 active latent caused by beginning-of-sequence tokens and a long tail past 80 active latents on dense tokens. Second, on Gemma 2 2B, JumpReLU closes the downstream cross-entropy gap and pulls ahead of BatchTopK once k rises to 32 or 64, even though BatchTopK still has lower NMSE. That split echoes a broader pattern in Gemma Scope and later benchmarks: raw squared reconstruction error does not perfectly predict downstream language-model loss.
Caveats & Builder Takeaway
- No interpretability evaluation: The authors measured NMSE and CE degradation only; they did not run human rater tests or automated LLM explanations, relying on architectural similarity to TopK to assume comparable monosemanticity.
- Global threshold at inference: Unlike JumpReLU, which learns a separate threshold
theta_jfor each latent, BatchTopK collapses inference filtering to one global scalartheta, which may explain why JumpReLU preserves downstream CE better on Gemma 2 2B atk = 32andk = 64. - Narrow scope: Experiments covered one residual-stream layer per model on 128-token OpenWebText chunks, leaving MLP/attention sites, longer contexts, and 9B+ models untested.
For teams training their own SAEs on a compute budget, BatchTopK is an easy drop-in upgrade over TopK: you keep exact control over average sparsity k without running expensive penalty sweeps, and get cleaner reconstructions on mixed-density tokens. If you are willing to pay for hyperparameter tuning to maximize downstream logit fidelity on larger models at L0 >= 32, per-latent JumpReLU still holds a slight edge.


