← Latest papers
💬 NLP

Inside the LLM Word Factory

This paper uses activation patching to reveal that LLMs perform a two-stage detokenization process—where attention transmits token-specific signals and MLPs compose them with local embeddings—across varying depths depending on positional encoding, enabling a highly accurate probe for detokenization success based on early-layer activations.

Original authors: Benzi Busigin, Yuval Pinter

Published 2026-06-09
📖 5 min read🧠 Deep dive

Original authors: Benzi Busigin, Yuval Pinter

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine a massive, super-smart factory called the LLM Word Factory. Its job is to take sentences and understand them so it can write new ones. But there's a catch: the factory doesn't speak "human words" like "table" or "error." Instead, it only understands subword fragments, like little puzzle pieces: _ta and ble.

When you type the word "table," the factory might see it as one piece (_table) or split it into two (_ta + ble). If it's split, the factory has a problem: it needs to glue those pieces back together in its brain to understand the whole concept of a table before it can do anything useful. This gluing process is called detokenization.

If the factory fails to glue the pieces, it gets confused. It might think "table" is just "ta" and "ble" separately, leading to weird mistakes.

This paper is like a team of detectives using a special "time-travel microscope" (called activation patching) to peek inside the factory and see exactly how and where this gluing happens. Here is what they found:

1. The Two-Step Assembly Line

The detectives discovered that the factory doesn't glue the pieces together all at once. It happens in a very specific two-step dance right at the beginning of the assembly line (in the first few layers of the computer model):

  • Step 1: The Messenger (Attention)
    Imagine the first puzzle piece (_ta) has a tiny note attached to it. A special messenger (called the Attention mechanism) picks up this note and flies it over to the second piece (_ble).

    • The Catch: The note isn't a full picture of the word. It's just a tiny, weak "nudge" or a hint saying, "Hey, I'm part of a specific word." It's like a postal worker dropping off a single letter that says "Package Incoming."
  • Step 2: The Builder (MLP)
    Once the second piece (_ble) receives that tiny note, a builder (called the MLP) steps in. The builder takes the local piece (_ble) and combines it with the tiny note from the messenger.

    • The Magic: The builder doesn't just snap them together; it smoothly blends them to create the full, unified concept of "table."

2. How Long Does the Assembly Line Need to Be?

The paper found that this two-step dance happens almost immediately, usually within the first 1 to 10 layers of the factory.

  • The "RoPE" Factory: Some factories use a specific type of address system (called RoPE). In these, the gluing happens super fast, often in just the first 1 or 2 layers. It's like a factory with a super-efficient conveyor belt where the pieces meet almost instantly.
  • The "Learned" Factory: Other factories use a different address system (Learned Absolute). Here, the gluing takes longer, stretching out over 5 to 10 layers. It's like a slower conveyor belt where the pieces have to travel a bit further before they get glued.

3. What About Longer Words?

What if the word is split into three or four pieces (like _an + ti + ci + pa + tion)?
The paper found that the factory uses a relay race strategy.

  • The first piece passes a baton to the second.
  • The second passes it to the third.
  • The third passes it to the final piece.
    Each intermediate piece acts as a relay station, passing the "nudge" down the line until it reaches the end, where the final gluing happens. The longer the word, the more relay stations are needed, but the process remains the same.

4. Can We Predict Failure?

The most exciting discovery is that the factory leaves a "smoke signal" very early in the process.

  • If the gluing is going to work, the early layers look a certain way.
  • If the gluing is going to fail, they look different.

The researchers built a simple detector (a probe) that can look at just the very first few layers of the factory and predict with 94% to 97% accuracy whether the word will be understood correctly or not. It's like a quality control inspector who can tell if a car will break down just by looking at the engine before the car is even finished being built.

Summary

In simple terms, this paper explains that when AI models try to understand split-up words, they use a two-step process right at the start:

  1. Attention passes a tiny hint from the first piece to the last.
  2. The MLP uses that hint to finish building the full word.

This process is fast, happens early, and the model leaves a clear "signature" in the early layers that tells us if it's going to succeed or fail. The speed of this process depends entirely on how the factory is built (specifically, how it handles positions), not on how big or smart the factory is.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →