atlas

Research map / Large language models / Language, safety and interpretability

From Tokens to Words: On the Inner Lexicon of LLMs

ICLR 2025 · Large language models › Language, safety and interpretability · approach: Linguistic encoding in LLM representations · 3 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

The paper shows LLMs internally detokenize multi-token words into whole-word representations at the last sub-word token (mainly early-middle layers, via FFN updates and early attention aggregation), and uses this to expand vocabulary without finetuning.

Problem

LLMs process sub-word tokens while language is composed of words; it is unclear whether and how models internally compose whole-word representations from sub-word tokens (detokenization), including for out-of-vocabulary words.

Approach

Probes, logit lens, and Patchscopes show that the last sub-word token's hidden state comes to match the full word's representation in early-middle layers, with FFN updates carrying the word concept and early attention aggregating prefix tokens; this inner lexicon is then used to add new vocabulary entries with learned linear maps and no finetuning of core parameters.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Initialize expanded-vocabulary entries with detokenized representations instead of mean token embeddingsLlama2-7B vocabulary expansion · WikiText, new words (new token)token-level top-1 accuracy: 0.071 -> 0.171Helped
Initialize expanded-vocabulary entries with detokenized representations instead of mean token embeddingsLlama2-7B vocabulary expansion · PubMed, new words (new token)token-level top-1 accuracy: 0.123 -> 0.180Helped
Initialize expanded-vocabulary entries with detokenized representations instead of mean token embeddingsLlama2-7B vocabulary expansion · mWiki-Arabic, new words (new token)token-level top-1 accuracy: 0.117 -> 0.402Helped
Expand vocabulary using detokenized representations rather than keep the original vocabularyLlama2-7B · WikiText, all wordstoken-level top-1 accuracy: 0.522 -> 0.519No clear effect
Expand vocabulary using detokenized representations rather than keep the original vocabularyLlama2-7B · PubMed, all wordstoken-level top-1 accuracy: 0.517 -> 0.511No clear effect
Expand vocabulary using detokenized representations rather than keep the original vocabularyLlama2-7B · mWiki-Arabic, all wordstoken-level top-1 accuracy: 0.535 -> 0.532No clear effect
Remove FFN updates carrying full-word representations (ablation)Llama2-7B detokenization of suffix-split words · Suffix-split wordsretrieval rate: 85% -> 18%Hurt
Add the identified full-word FFN updates rather than randomly selected FFN updates (ablation)Llama2-7B detokenization of suffix-split words · Suffix-split wordsretrieval rateHelped
Remove country-name FFN updates (ablation)Llama2-7B capital-city retrieval from split country names · Split country namesaccuracy: 88% -> 41%Hurt
Remove random FFN updates (ablation)Llama2-7B capital-city retrieval from split country names · Split country namesaccuracy: 88% -> 74%Hurt
Use detokenized representations rather than mean token embeddings to initialize expanded vocabularyLlama2-7B vocabulary expansion · All words, WikiTexttoken-level top-1 accuracy: 0.473 -> 0.519Helped
Use detokenized representations rather than mean token embeddings to initialize expanded vocabularyLlama2-7B vocabulary expansion · All words, PubMedtoken-level top-1 accuracy: 0.479 -> 0.511Helped

Surprising findings

Limitations

Experimental setup

Datasets: WikiText Gutenberg corpus PubMed abstracts Arabic Wikipedia (MWiki) ARC Nonword Database

Benchmarks: WikiText PubMed MWiki-Arabic ARC Nonword Database

Metrics: rate of retrieval kNN classification accuracy token-level top-1 accuracy attention weights token reduction

Baselines: Original model Mean embedding vocabulary expansion

Builds on: Patchscopes logit lens FFN key-value memories

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy