Introduction
Modern Large Language Models (LLMs) do not process language through whole words; instead, they operate on "tokens." While computationally efficient, sub-word tokenization algorithms like Byte-Pair Encoding (BPE) often fracture meaningful words into arbitrary fragments. For example, the word "northeastern" might be split into [_n, ort, he, astern]. Individually, these fragments carry little semantic weight. This raises a fundamental question in mechanistic interpretability: How and where do LLMs bridge the gap between these raw fragments and the meaningful concepts they represent?
This paper identifies a specific mechanistic phenomenon called "token erasure." The authors demonstrate that as a model integrates fragments into a higher-level concept, it rapidly "forgets" the individual identities of those fragments in its early layers. By measuring this effect, the researchers developed a method to map the model’s "implicit vocabulary"—the set of multi-token sequences it treats as atomic units of meaning.
Methodology: Probing for Memory
To investigate how models represent tokens across layers, the researchers utilized Linear Probing on Llama-2-7b and Llama-3-8b. They trained simple linear classifiers to predict the identity of the current and preceding tokens based solely on the hidden representations at specific layers.
- Memory Measurement: If a probe can accurately identify a previous token, the model is still maintaining that raw fragment in its "memory."
- The Erasure Effect: The researchers observed a striking drop in probe accuracy for multi-token words. While the model maintains a clear representation of single-token words throughout its depth, it appears to "overwrite" the specific identities of sub-token fragments once the full word or entity is completed.
- The Erasure Score ($\psi$): This observation was formalized into a metric. A high erasure score indicates a sequence of tokens that the model has successfully integrated into a single, higher-level representation, discarding the underlying raw fragments.
Key Insights and Results
Forgetting as a Sign of Abstraction
In the context of LLMs, "forgetting" is often viewed as a limitation. However, this research suggests that erasure is a feature of abstraction. When the model reaches the final token of a multi-token entity (e.g., the "Young" in "Neil Young"), it collapses the preceding fragments into a unified conceptual representation.
The Layer 9 "Sweet Spot"
For the Llama models tested, the transition from raw tokens to lexical concepts occurs remarkably early. Probe accuracy for previous tokens in multi-token entities plummeted from approximately 90% at the embedding layer to near-zero by layer 9 (out of 32). This suggests that the "detokenization" process is largely completed within the first third of the model's architecture.
Mapping the Implicit Vocabulary
By applying the erasure score to large datasets like Wikipedia and The Pile, the authors were able to "read out" the model's internal lexicon.
- Llama-2 vs. Llama-3: Because Llama-3 has a much larger explicit vocabulary (the tokens defined by its tokenizer), its implicit vocabulary contains fewer simple words and more complex multi-word expressions, LaTeX commands, and code snippets.
- Non-Compositional Items: The method successfully identified items like "dram.atic" and "sil.ences" as high-scoring units, confirming that the model treats these specific token combinations as single concepts rather than a sum of their parts.
- Entity Recognition: Using the COUNTERFACT dataset, the authors showed that the erasure effect is a reliable indicator of named entities. Roughly 45% of high-erasure sequences on Wikipedia were confirmed to be multi-token words or entities recognized by standard NLP tools like spaCy.
Limitations and Future Directions
While the erasure score provides a powerful lens into the model's internal world, the study notes several limitations. There is currently no definitive "ground truth" dictionary for what an LLM has learned, making it difficult to measure the total recall of the implicit vocabulary. Furthermore, the research focused exclusively on English-language Llama models.
Future work may explore whether this erasure footprint exists in other architectures, such as Mixture-of-Experts (MoE) models, or use the metric to diagnose how models internalize new information during fine-tuning. By understanding the "footprint" of a concept, researchers can better understand how LLMs transform raw data into structured knowledge.
Summary updated