Weight-based Analysis of Detokenization in Language Models: Understanding the First Stage of Inference Without Inference
Not on the map. Why?
Abstract (arXiv)
According to the stages-of-inference hypothesis, early layers of language models map their subword-tokenized input, which does not necessarily correspond to a linguistically meaningful segmentation, to more meaningful representations that form the model's "inner vocabulary". Prior analysis of this detokenization stage has predominantly relied on probing and interventions such as path patching, which involve selecting particular inputs, choosing a subset of components that will be patched, and then observing changes in model behavior. Here, we show that several important aspects of the detokenization stage can be understood purely by analyzing model weights, without performing any model inference steps. Specifically, we introduce an analytical decomposition of first-layer attention in GPT-2. Our decomposition yields interpretable terms that quantify the relative contributions of position-related, token-related, and mixed effects. By focusing on terms in this decomposition, we discover weight-based explanations of attention bias toward close tokens and attention for detokenization.
Key facts. Cited by 5 papers in the map (data through 14 Oct 2026). Builds on 21 of its 28 references that are in the map. First posted on arXiv 27 Jan 2025.
Builds on
21 of 28 references.
References · 21
- 2017Attention Is All You Needcited by 60,361
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2024The Llama 3 Herd of Modelscited by 14,715
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,372
- 2016Layer Normalizationcited by 5,669
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
- 2015Neural Machine Translation of Rare Words with Subword Unitscited by 2,918
- 2023Efficient Streaming Language Models with Attention Sinkscited by 2,186
- 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,103
- 2023Towards Automated Circuit Discovery for Mechanistic Interpretabilitycited by 724
- 2018Subword Regularization: Improving Neural Network Translation Models with Multiple Subword Candidatescited by 639
9 more
- 2023Dissecting Recall of Factual Associations in Auto-Regressive Language Modelscited by 528
- 2023Finding Neurons in a Haystack: Case Studies with Sparse Probingcited by 334
- 2024Patchscopes: A Unifying Framework for Inspecting Hidden Representations of Language Modelscited by 235
- 2023How does GPT-2 compute greater-than?: Interpreting mathematical abilities in a pre-trained language modelcited by 202
- 2024The Remarkable Robustness of LLMs: Stages of Inference?cited by 146
- 2024Universal Neurons in GPT2 Language Modelscited by 102
- 2024From Tokens to Words: On the Inner Lexicon of LLMscited by 48
- 2022Norm of Word Embedding Encodes Information Gaincited by 21
- 2024You can remove GPT2's LayerNorm by fine-tuningcited by 11
Built on by
Citing papers per year: 2025: 3; 2026: 2.
5 papers.
- 2025ZeroTuning: Unlocking the Initial Token's Power to Enhance Large Language Models Without Trainingcited by 12
- 2025Understanding the Anchoring Effect of LLM with Synthetic Data: Existence, Mechanism, and Potential Mitigationscited by 6
- 2026Measuring Affinity between Attention-Head Weight Subspaces via the Projection Kernelcited by 5
- 2025Spelling-out is not Straightforward: LLMs' Capability of Tokenization from Token to Characterscited by 4
- 2026Inside the LLM Word Factorycited by 0
- 2026Inside the LLM Word Factory7 Jun 2026
- 2026Measuring Affinity between Attention-Head Weight Subspaces via the Projection Kernel15 Jan 2026
- 2025Spelling-out is not Straightforward: LLMs' Capability of Tokenization from Token to Characters12 Jun 2025
- 2025Understanding the Anchoring Effect of LLM with Synthetic Data: Existence, Mechanism, and Potential Mitigations21 May 2025
- 2025ZeroTuning: Unlocking the Initial Token's Power to Enhance Large Language Models Without Training16 May 2025