We instrumented GLM-5.2, a 753B-parameter open frontier MoE (MLA + sparse attention + IndexShare), at three levels: weight space (no forwards), per-token generation forensics (512→32,768-token contexts), and a learned tap periphery. The measurements locate a late, scale-invariant decision front (median L76/78, invariant across a 64 context change) behind a motor band that weight anatomy independently predicts. Exploiting this, we attach per-layer linear translators trained closed-form from streaming Gram statistics; no gradients ever pass through the trunk. The same 302 MB/tap statistical object () is simultaneously the training set, the continual-learning memory, and the exit policy's substrate: streaming 49k tokens of a held-out language into the frontier model's Grams and re-solving lifts tap agreement 0.076 → 0.732 in 5.1 minutes (≈$12) on a same-corpus holdout. This is continual readout adaptation, deliberately scoped: the trunk already carries the language, so the stream re-aims the periphery's transport rather than adding a capability. The dip on code is not catastrophic forgetting, which pooled solves rule out by construction; it is mixture dilution, which compounds as streams accumulate unless reweighted. Live early-exit decoding with margin gates and MLA-cheap KV backfill reproduces the full model token-for-token on math over the full 80-token horizon (≈82% exit rate, NLL 0.000) and on code for the first ~40 tokens. Ablating backfill collapses code from 40/40 to 10/40 matched tokens, putting measured causal weight on the skipped-layer KV problem that CALM first named, the serving subtlety that decides whether early exit works autoregressively at all. On out-of-distribution input the margin gate exits confidently wrong; a ridge-leverage veto computed from the same Grams closes that hole live (wrong-exit rate 26% → 3–8%).
- The decision front is late and scale-invariant. Realized tokens become lens-top-1 at median L76/78, flat from 512 to 32,768-token contexts; the final 8 layers carry 71.3% of direct-logit attribution. Weight anatomy (a write↔unembed alignment atlas computed with no forward passes) independently predicts the motor band from ~L50.
- The periphery is linear, closed-form, and gradient-free. Per-layer ridge taps () train from streaming Gram statistics accumulated during plain prefill. One consultation costs 0.09% of a forward; six taps total ≈ 0.03% of model parameters.
- Continual learning is Gram addition. Streaming 49k tokens of a held-out language and re-solving lifts tap agreement 0.076 → 0.732 in 5.1 minutes (≈$12), with no trunk gradients. Forgetting is ruled out by construction, since pooled solves equal the joint fit; the code dip is mixture dilution, not interference.
- Early exit works live, if you backfill. Margin-gated exits with MLA-cheap KV backfill reproduce full-model decode token-for-token on math across the whole 80-token horizon (≈82% exit rate, NLL 0.000). Ablate backfill and code collapses from 40/40 to 10/40 matched tokens.
- The same Grams patrol the exit. On out-of-distribution input the margin gate exits confidently wrong; a ridge-leverage veto computed from the identical statistics cuts wrong-exit rate 26% → 3–8% live.
Three independent instruments agree on the macro-organization of GLM-5.2 [1], whose substrate combines multi-head latent attention [2], multi-token prediction [3], and natively trainable sparse attention [4]:
| Finding | Evidence |
|---|---|
| Motor band: writes align with the unembedding only from ~L50, peaking L68+ | weight-space read/write Gram atlas (no forwards) |
| Decision front: realized tokens become lens-top-1 at median L76/78; final 8 layers carry 71.3% of direct-logit attribution | 20-pack generation battery |
| Context invariance: decision depth and attn:mlp write ratio flat from 512 → 32,768-token contexts | variable-context battery |
| Sparse-attention scaling: IndexShare inter-layer selection agreement decays 0.64 → 0.52 (8k → 32k); retrieval reach scales ~linearly; local anchor fixed at ~128 tokens | DSA selection captures |
The invariances are the load-bearing engineering facts: an exit policy tuned at short context transfers, and taps placed against the decision front remain correctly placed as context scales. The vocabulary of residual writes follows the transformer-circuits formalism [5], and the write↔unembed alignment behind the motor band builds on published analyses of FFN outputs in vocabulary space [6], [7], [8]; the depth phenomenology matches independent stages-of-inference measurements [9]. The raw logit lens [10] is structurally weak early (embed/unembed per-token cosine ≈ 0.0006); that weakness is the pre-registered basis for learned translators rather than lens readouts.
Per tap layer : , decoded by the frozen final norm + head, at 0.09% of a forward per consultation; six taps total ≈ 0.03% of model parameters. Training accumulates per-tap sufficient statistics (, ) on-GPU during plain prefill (states are never stored) and solves a per-feature (Marquardt) ridge closed-form. is the Gauss–Newton curvature of the readout regression; adaptation is Gram addition + re-solve. The portable, re-solvable unit is ≈ 302 MB/tap in fp32. Per-layer translators of this kind are tuned-lens objects [11], previously fit by plain least squares for early exit [12], the nearest single ancestor of the tap. The construction sits in the recursive closed-form readout family, online sequential extreme learning machines [13] and recursive least squares [14], with outer-product fast-weight state as the underlying primitive [15], [16].
Top-1 agreement with the full model on GLM-5.2 (147,456 training positions, single provenance), tap / identity-translator baseline per cell; every cell reproduces from the committed holdout-state pack to (60/60 verified independently):
| tap / identity | L26 | L38 | L50 | L58 | L66 | L72 |
|---|---|---|---|---|---|---|
| code | .25 / .01 | .24 / .01 | .34 / .07 | .41 / .12 | .52 / .20 | .71 / .32 |
| math | .82 / .00 | .81 / .00 | .74 / .03 | .75 / .09 | .77 / .19 | .90 / .28 |
| prose | .21 / .03 | .20 / .03 | .22 / .03 | .24 / .05 | .29 / .11 | .69 / .26 |
| agentic | .23 / .01 | .19 / .01 | .26 / .06 | .31 / .11 | .44 / .18 | .61 / .29 |
| chinese (held out) | .02 / .00 | .02 / .01 | .02 / .04 | .02 / .07 | .02 / .17 | .07 / .34 |
The held-out row is the setup for §3: before adaptation, the periphery simply cannot read a language it never saw.
Because the taps are solved from pooled sufficient statistics, "learning something new" is not fine-tuning: it is streaming new tokens through plain prefill, adding their Grams, and re-solving the ridge. Doing exactly that with 49k tokens of the held-out language lifts tap agreement 0.076 → 0.732 in 5.1 minutes (≈$12) on a same-corpus holdout. This is continual readout adaptation, deliberately scoped: the trunk already carries the language (the raw lens reads it at 0.34), so the stream re-aims the periphery's transport rather than adding a capability. The dip on code is not catastrophic forgetting, which pooled solves rule out by construction (the pooled solution equals the joint fit, the absolute-memorization property of analytic continual learning [17]); it is mixture dilution, and it compounds as streams accumulate unless reweighted. The contrast classes are gradient-based continual learning [18] and adapter tuning [19], [20], which trains by backpropagation through the frozen base, while the taps live at the readout and solve closed-form from forward-pass statistics. The analytic family is the direct predecessor line: streaming LDA [21], the same accumulate-Grams-then-ridge recipe on frozen vision backbones [22], and one prior reach into LLMs for task routing rather than readout heads [23]. The test-time-training lineage [24], [25], [26] occupies the nonlinear tier of the same design space, recently unified with linear attention [27].
The same ~302 MB object is thus three things at once: the training set (sufficient statistics), the continual-learning memory (addable), and, in §5, the substrate of the exit policy's safety check.
Anytime early exit [28] is where periphery claims usually die: matching a frozen model's distribution offline says little about matching its decode autoregressively, where every exited token perturbs the KV cache the full model would have written. Live decoding with margin gates and MLA-cheap KV backfill reproduces the full model token-for-token on math over the entire 80-token horizon (≈82% exit rate, NLL 0.000), and on code for the first ~40 tokens.
Ablating backfill collapses code from 40/40 to 10/40 matched tokens, putting measured causal weight on the skipped-layer KV problem that CALM first named [29], the serving subtlety that decides whether early exit works autoregressively at all; published early-exit systems document the same degradation under naive state propagation [30]. The surrounding design space instead skips or reallocates depth [31], [32], [33], [34], while speculative methods preserve outputs by re-verifying with the full model [35], [36], [37], with self-speculative early exit as the hybrid [38]; the nearest 2026 neighbors are KV-share exits [39] and calibrated self-speculation [40]. High-entropy prose fails the uniform output gate, as it should: the gate is doing its job on inputs where the periphery's confidence is not warranted.
On out-of-distribution input the margin gate has a hole: it exits confidently wrong. The fix comes from the same statistics that trained the taps: a ridge-leverage veto computed from the Grams flags positions whose activations sit outside the mass the ridge was solved on. Applied live, it cuts wrong-exit rate 26% → 3–8% and returns decode to near-reference, at a cost of 3–17 points of code exit rate. The deployment pattern follows selective generation gated by density scores on hidden states [41], [42]; the difference is that the veto needs no separately fitted background model, because the statistics are already there for the solve. The gate itself is the predictive variance of Bayesian linear regression [43], and evaluation follows the selective-prediction risk and coverage methodology [44]. Concurrent work probes LLM uncertainty with Bayesian linear models over hidden states [45]. Four adversarial defense studies (source-disjoint evals, tuned-lens SGD races [11] including the canonical KL objective, a five-phase sequential continual-learning matrix, and full-model perplexity scoring of exit-decoded text) are folded into the lab below.
Total study spend was ≈ $190 of B200 time plus one RTX 5090 workstation; every defense run cost $0 and minutes. All headline numbers reproduce from committed capture packs, and the lab below exists so you can check.
The entire study is auditable here. The embedded notebook recomputes every number and chart in this post from the raw capture packs: three run packs (v1/v2/v3) are selectable in the run picker, and the sliders re-execute the underlying Python. The instant static snapshot keeps full pan/zoom/hover on every plot; the interactive kernel boots Python in your browser (via Pyodide, ~30–60 s on first load, cached after) and unlocks the run pickers.
Loading snapshot…
The lab walks the full argument in nine sections: method, the decision front, where the trunk gets written, routing dynamics, uncertainty, context and the sparse regime, limitations, the move from instrument to mechanism, and the open problems, pre-registered.
This is a single-model study (GLM-5.2) with single-provenance training positions; the code dip under continual learning is a mixture bias we expect to manage with reweighting rather than architecture. The prose row is the honest boundary of the current gate: high-entropy text does not clear the uniform output gate, and the leverage veto trades exit rate for correctness on OOD input. The falsifiable next round, pre-registered in the lab, extends the tap matrix to more layers, more domains, and adversarially chosen streams.
- [01]GLM-5 Team. “GLM-5: from Vibe Coding to Agentic Engineering.” arXiv preprint, 2026. [arXiv]
- [02]DeepSeek-AI. “DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Model.” arXiv preprint, 2024. [arXiv]
- [03]DeepSeek-AI. “DeepSeek-V3 Technical Report.” arXiv preprint, 2024. [arXiv]
- [04]Jingyang Yuan, Huazuo Gao, Damai Dai, et al.. “Native Sparse Attention: Hardware-Aligned and Natively Trainable Sparse Attention.” arXiv preprint, 2025. [arXiv]
- [05]Nelson Elhage, Neel Nanda, Catherine Olsson, et al.. “A Mathematical Framework for Transformer Circuits.” Transformer Circuits Thread, 2021. [LINK]
- [06]Mor Geva, Roei Schuster, Jonathan Berant, Omer Levy. “Transformer Feed-Forward Layers Are Key-Value Memories.” Empirical Methods in Natural Language Processing, 2021. [arXiv]
- [07]Mor Geva, Avi Caciularu, Kevin Ro Wang, Yoav Goldberg. “Transformer Feed-Forward Layers Build Predictions by Promoting Concepts in the Vocabulary Space.” Empirical Methods in Natural Language Processing, 2022. [arXiv]
- [08]Guy Dar, Mor Geva, Ankit Gupta, Jonathan Berant. “Analyzing Transformers in Embedding Space.” Association for Computational Linguistics, 2023. [arXiv]
- [09]Vedang Lad, Wes Gurnee, Max Tegmark. “The Remarkable Robustness of LLMs: Stages of Inference?.” arXiv preprint, 2024. [arXiv]
- [10]nostalgebraist. “interpreting GPT: the logit lens.” LessWrong, 2020. [LINK]
- [11]Nora Belrose, Zach Furman, Logan Smith, et al.. “Eliciting Latent Predictions from Transformers with the Tuned Lens.” arXiv preprint, 2023. [arXiv]
- [12]Alexander Yom Din, Taelin Karidi, Leshem Choshen, Mor Geva. “Jump to Conclusions: Short-Cutting Transformers with Linear Transformations.” arXiv preprint, 2023. [arXiv]
- [13]Nan-Ying Liang, Guang-Bin Huang, P. Saratchandran, N. Sundararajan. “A Fast and Accurate Online Sequential Learning Algorithm for Feedforward Networks.” IEEE Transactions on Neural Networks 17(6), 2006.
- [14]Simon Haykin. “Adaptive Filter Theory (4th ed.).” Prentice Hall, 2002.
- [15]Imanol Schlag, Kazuki Irie, Jürgen Schmidhuber. “Linear Transformers Are Secretly Fast Weight Programmers.” International Conference on Machine Learning, 2021. [arXiv]
- [16]Jürgen Schmidhuber. “Learning to Control Fast-Weight Memories: An Alternative to Dynamic Recurrent Networks.” Neural Computation 4(1), 1992.
- [17]Huiping Zhuang, Zhenyu Weng, Hongxin Wei, et al.. “ACIL: Analytic Class-Incremental Learning with Absolute Memorization and Privacy Protection.” Neural Information Processing Systems, 2022. [arXiv]
- [18]James Kirkpatrick, Razvan Pascanu, Neil Rabinowitz, et al.. “Overcoming Catastrophic Forgetting in Neural Networks.” Proceedings of the National Academy of Sciences 114(13), 2017. [arXiv]
- [19]Edward J. Hu, Yelong Shen, Phillip Wallis, et al.. “LoRA: Low-Rank Adaptation of Large Language Models.” International Conference on Learning Representations, 2022. [arXiv]
- [20]Tim Dettmers, Artidoro Pagnoni, Ari Holtzman, Luke Zettlemoyer. “QLoRA: Efficient Finetuning of Quantized LLMs.” Neural Information Processing Systems, 2023. [arXiv]
- [21]Tyler L. Hayes, Christopher Kanan. “Lifelong Machine Learning with Deep Streaming Linear Discriminant Analysis.” CVPR Workshops, 2020. [arXiv]
- [22]Mark D. McDonnell, Dong Gong, Amin Parvaneh, Ehsan Abbasnejad, Anton van den Hengel. “RanPAC: Random Projections and Pre-trained Models for Continual Learning.” Neural Information Processing Systems, 2023. [arXiv]
- [23]Kai Tong, Kang Pan, Xiao Zhang, et al.. “Analytic Subspace Routing: How Recursive Least Squares Works in Continual Learning of Large Language Model.” arXiv preprint, 2025. [arXiv]
- [24]Yu Sun, Xinhao Li, Karan Dalal, et al.. “Learning to (Learn at Test Time): RNNs with Expressive Hidden States.” arXiv preprint, 2024. [arXiv]
- [25]Ali Behrouz, Peilin Zhong, Vahab Mirrokni. “Titans: Learning to Memorize at Test Time.” arXiv preprint, 2025. [arXiv]
- [26]Tianyuan Zhang, Sai Bi, Yicong Hong, et al.. “Test-Time Training Done Right.” arXiv preprint, 2025. [arXiv]
- [27]Junchen Liu, Sven Elflein, Or Litany, Zan Gojcic, Ruilong Li. “Test-Time Training with KV Binding Is Secretly Linear Attention.” arXiv preprint, 2026. [arXiv]
- [28]Maha Elbayad, Jiatao Gu, Edouard Grave, Michael Auli. “Depth-Adaptive Transformer.” International Conference on Learning Representations, 2020. [arXiv]
- [29]Tal Schuster, Adam Fisch, Jai Gupta, et al.. “Confident Adaptive Language Modeling.” Neural Information Processing Systems, 2022. [arXiv]
- [30]Sangmin Bae, Jongwoo Ko, Hwanjun Song, Se-Young Yun. “Fast and Robust Early-Exiting Framework for Autoregressive Language Models with Synchronized Parallel Decoding.” Empirical Methods in Natural Language Processing, 2023. [arXiv]
- [31]Luciano Del Corro, Allie Del Giorno, Sahaj Agarwal, et al.. “SkipDecode: Autoregressive Skip Decoding with Batching and Caching for Efficient LLM Inference.” arXiv preprint, 2023. [arXiv]
- [32]Yanxi Chen, Xuchen Pan, Yaliang Li, Bolin Ding, Jingren Zhou. “EE-LLM: Large-Scale Training and Inference of Early-Exit Large Language Models with 3D Parallelism.” International Conference on Machine Learning, 2024. [arXiv]
- [33]Ajay Jaiswal, Bodun Hu, Lu Yin, et al.. “FFN-SkipLLM: A Hidden Gem for Autoregressive Decoding with Adaptive Feed Forward Skipping.” arXiv preprint, 2024. [arXiv]
- [34]David Raposo, Sam Ritter, Blake Richards, et al.. “Mixture-of-Depths: Dynamically Allocating Compute in Transformer-Based Language Models.” arXiv preprint, 2024. [arXiv]
- [35]Yaniv Leviathan, Matan Kalman, Yossi Matias. “Fast Inference from Transformers via Speculative Decoding.” International Conference on Machine Learning, 2023. [arXiv]
- [36]Tianle Cai, Yuhong Li, Zhengyang Geng, et al.. “Medusa: Simple LLM Inference Acceleration Framework with Multiple Decoding Heads.” International Conference on Machine Learning, 2024. [arXiv]
- [37]Fabian Gloeckle, Badr Youbi Idrissi, Baptiste Rozière, David Lopez-Paz, Gabriel Synnaeve. “Better & Faster Large Language Models via Multi-Token Prediction.” International Conference on Machine Learning, 2024. [arXiv]
- [38]Mostafa Elhoushi, Akshat Shrivastava, Diana Liskovich, et al.. “LayerSkip: Enabling Early Exit Inference and Self-Speculative Decoding.” Association for Computational Linguistics, 2024. [arXiv]
- [39]Yingtao Shen, An Zou. “River-LLM: Large Language Model Seamless Exit Based on KV Share.” Association for Computational Linguistics, 2026. [arXiv]
- [40]Zhuofan Wen, Yang Feng. “SpecBound: Adaptive Bounded Self-Speculation with Layer-wise Confidence Calibration.” Findings of the Association for Computational Linguistics, 2026. [arXiv]
- [41]Jie Ren, Jiaming Luo, Yao Zhao, et al.. “Out-of-Distribution Detection and Selective Generation for Conditional Language Models.” International Conference on Learning Representations, 2023. [arXiv]
- [42]Kimin Lee, Kibok Lee, Honglak Lee, Jinwoo Shin. “A Simple Unified Framework for Detecting Out-of-Distribution Samples and Adversarial Attacks.” Neural Information Processing Systems, 2018. [arXiv]
- [43]Christopher M. Bishop. “Pattern Recognition and Machine Learning.” Springer, 2006.
- [44]Yonatan Geifman, Ran El-Yaniv. “Selective Classification for Deep Neural Networks.” Neural Information Processing Systems, 2017. [arXiv]
- [45]Ramzi Dakhmouche, Adrien Letellier, Hossein Gorji. “Can Linear Probes Measure LLM Uncertainty?.” arXiv preprint, 2025. [arXiv]