Inside the LLM Word Factory
Not on the map. Why?
Abstract (arXiv)
Transformer language models process input provided as subword fragments, but natural language semantics usually rely on word-level concepts. Detokenization is the process where models reconcile these two facts, aggregating subwords into word-level representations through their computation. Prior work has found that this takes place mostly in early-to-middle layers, but so far the exact mechanics of the process have not been pinned down. We venture deep into detokenization using activation patching in controlled paired experiments that isolate the contribution of different model components, localizing English detokenization in Llama2-7B to a two-stage process at Layer 1. Attention transmits a token-specific signal from nonfinal subwords, using sequential relays if necessary, while the MLP composes it with the local embedding. This two-stage structure generalizes to twelve models from eight families, but the depth over which it takes place depends on the flavor of positional encoding: RoPE-based models detokenize over 1 to 5 layers, while learned-absolute models take 5 to 10. Finally, we provide a probe for determining the success of the detokenization process based on early-layer activations alone, performing at 0.94-0.97 AUROC depending on the amount of context.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 25 of its 32 references that are in the map. First posted on arXiv 7 Jun 2026.
Builds on
25 of 32 references.
References · 25
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
- 2022OPT: Open Pre-trained Transformer Language Modelscited by 3,512
- 2016Pointer Sentinel Mixture Modelscited by 3,096
- 2015Neural Machine Translation of Rare Words with Subword Unitscited by 2,918
- 2022Locating and Editing Factual Associations in GPTcited by 2,691
- 2024Gemma 2: Improving Open Language Models at a Practical Sizecited by 1,998
- 2022BLOOM: A 176B-Parameter Open-Access Multilingual Language Modelcited by 1,984
- 2023Pythia: A Suite for Analyzing Large Language Models Across Training and Scalingcited by 1,786
- 2020Transformer Feed-Forward Layers Are Key-Value Memoriescited by 1,336
- 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,103
- 2023Steering Llama 2 via Contrastive Activation Additioncited by 1,085
- 2019How Contextual are Contextualized Word Representations? Comparing the Geometry of BERT, ELMo, and GPT-2 Embeddingscited by 784
13 more
- 2023The Geometry of Truth: Emergent Linear Structure in Large Language Model Representations of True/False Datasetscited by 712
- 2018Subword Regularization: Improving Neural Network Translation Models with Multiple Subword Candidatescited by 639
- 2023Eliciting Latent Predictions from Transformers with the Tuned Lenscited by 623
- 2022Transformer Feed-Forward Layers Build Predictions by Promoting Concepts in the Vocabulary Spacecited by 532
- 2021Causal Abstractions of Neural Networkscited by 422
- 2023Finding Neurons in a Haystack: Case Studies with Sparse Probingcited by 334
- 2024The Remarkable Robustness of LLMs: Stages of Inference?cited by 146
- 2024Tokenization counts: the impact of tokenization on arithmetic in frontier LLMscited by 115
- 2024Tokenization Is More Than Compressioncited by 89
- 2024From Tokens to Words: On the Inner Lexicon of LLMscited by 48
- 2024Token Erasure as a Footprint of Implicit Vocabulary Items in LLMscited by 18
- 2025Weight-based Analysis of Detokenization in Language Models: Understanding the First Stage of Inference Without Inferencecited by 5
- 2026Defragmenting Language Models: An Interpretability-based Approach for Vocabulary Expansioncited by 2
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2024Separating Tongue from Thought: Activation Patching Reveals Language-Agnostic Concept Representations in Transformers
- 2026LLM Layers Immediately Correct Each Other
- 2026Divergent large language model predictions from convergent representations in ambiguous word pairs
- 2025LLM-Microscope: Uncovering the Hidden Role of Punctuation in Context Memory of Transformers
- 2025Tracing Multilingual Representations in LLMs with Cross-Layer Transcoders
- 2023Jump to Conclusions: Short-Cutting Transformers With Linear Transformations
- 2024Talking Heads: Understanding Inter-layer Communication in Transformer Language Models
- 2026Rethinking Layer Relevance in Large Language Models Beyond Cosine Similarity