# Poster 31096

- Kind: Poster
- Talk page and recording: https://iclr.cc/virtual/2025/poster/31096

> Transcript of the talk's recording (session_asr), made by speech recognition or taken from the host's captions. It may contain errors. The words are the speakers'; listen to the recording on the talk's page before quoting it.

Hello everyone! My name is Guy. Thanks for joining me. I will present a quick overview of our work from tokens to words on the inner lexicon of LLMs. Let's begin with background. Language is naturally composed of words, but most models work with subword tokens. This discrepancy motivated our study. Can LLMs recover the original word even when it's been split into tokens?
In this example, you see how GPT-4 splits the word unhappiness into several different tokens. So, while the tokenizer splits words into different tokens, the model might be internally regaining the meaning of the whole word, a process we call detokenization. In this chart, we see how a simple probing classifier can tell words apart from non-words by looking at the hidden states in each layer.
The blue line shows the accuracy when we use the final token representation, and it peaks around the middle layers, reaching nearly 90%. By contrast, the orange line, using the penultimate token representation, never comes close. This difference suggests that the model centralizes the complete word representation in the last token.
hinting at an inner mechanism that effectively detokenizes the subword tokens into cohesive concepts. Now I present an illustration that encapsulates the key process derived from our analysis in the paper. The process begins with subword tokenization where the input word is segmented into tokens. Each token is then transformed into corresponding vector embedding, setting the stage for further processing.
After the tokenization and embedding took place, the attention mechanism kicks in. In the early layers, the model propagates information from each subword token within the word to the final token, consolidates their contextual details into unified representation.
Afterwards, the FFN layers take center stage by acting as an implicit key value memory. They retrieve and refine the specific word representation that was encoded earlier. Essentially, as the final token's representation evolves, these FFN layers consolidate the aggregated information into a single cohesive vector that accurately reflects the full word.
Finally, once the data organization process is complete, we test the refined representation by patching it into a new prompt. Remarkably, the model regenerates the original words from this single consolidated vector, which confirms the robustness of its internal data organization mechanism.
Having established that we can extract coherent full-word representations from the model's middle layer, we now turn to an exciting application using these vectors to extend the model's dictionary and reduce token counts. In this approach, we identify multi-token words that the model is already de-tokenized internally.
We then take a single vector representation from the relevant layer and use it to create new entries in both the models embedding and unembedding matrices, essentially adding these words as if they were single tokens in the model's vocabulary.
The results showed that the vocabulary expansion cut down token counts by 10.5 to 14.5 % across multiple data sets. Even with this reduction, the model maintains performance in terms of top one accuracy.
To wrap up, I will finally lead to three key takeaways. First, large language LLMs inherently merge sub-word tokens into complete word representations in the early to middle layers in the process we called de-tokenization. Second, the de-tokenization process is highly robust, successfully handling arbitrary splits, typos, and even out-of-the-vocabulary words.
And finally, the existence of an inner lexicon allows us to expand the model vocabulary without the need for fine -tuning, which not only preserves performance but also reduces the overall token count and computational overhead. So, thanks for listening and I hope you will enjoy the paper.
