Repeated-Token Counting Reveals a Dissociation Between Representations and Outputs
This paper demonstrates that large language models' failure to count repeated tokens stems not from an inability to represent the correct count internally, but from a specific format-triggered MLP mechanism that overwrites the accurate representation with a fixed wrong answer during output generation.
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 you have a very smart, well-read librarian (the AI model). You ask this librarian to count how many times the word "apple" appears in a long list. You'd expect them to get it right, but instead, they confidently say, "There are 8 apples," even though there are clearly 10.
For a long time, people thought the librarian was just bad at counting. They assumed the librarian's brain didn't have a "counter" built into it, so they couldn't keep track of the numbers.
This paper says that assumption is wrong.
Here is the simple breakdown of what the researchers actually found, using some everyday analogies:
1. The Librarian Does Know the Answer
The researchers looked deep inside the librarian's brain (the model's internal layers) at every single step of the thinking process. They found that the correct number (10) was written down clearly and perfectly from the very first step to the very last.
- The Analogy: Imagine the librarian is walking down a hallway with a whiteboard in their hand. At every single step of the walk, the whiteboard clearly says "10." The information is there, loud and clear. The librarian isn't confused; they actually know the answer.
2. The "Glitchy" Sign-Writer
So, if the librarian knows the answer is 10, why do they say "8"?
The researchers found a specific "glitch" in the middle of the hallway. About 90% of the way through the thinking process, there is a specific worker (a part of the computer code called an MLP block) who sees the list format (words separated by spaces) and decides to ignore the whiteboard.
- The Analogy: Imagine the librarian is walking down the hall, holding the "10" sign. Suddenly, a specific worker (let's call him "Format-Fred") jumps out. Fred sees that the list is written with spaces (like "apple apple apple"). He has a pre-programmed rule: "If I see a list of words with spaces, I must change the sign to say '8'."
- Fred grabs the whiteboard, erases the "10," and writes "8" on it.
- Even though the librarian's brain still knows it's 10 (the original signal is still there in the background), the final output is now "8" because Fred overwrote it.
3. It's Not About the Words, It's About the Format
This glitch only happens with words (like "apple" or "cat"), not numbers (like "1" or "2").
- The Analogy: If you give the librarian a list of numbers ("1 1 1 1..."), Format-Fred doesn't care. He only reacts to words. The librarian counts the numbers perfectly. But if you give them words, Fred gets triggered.
- Also, if you change the format to use commas instead of spaces (e.g., "apple, apple, apple"), Fred doesn't jump out. The "8" rule isn't triggered, and the librarian gets it right. This proves the problem isn't the counting ability; it's a specific reaction to how the list looks.
4. The "Routing" Problem, Not a "Representation" Problem
The paper makes a big distinction between two types of failures:
Representation Failure: The librarian doesn't know how to count. (This paper says this is NOT happening).
Routing Failure: The librarian knows how to count, but the signal gets hijacked before it reaches the mouth. (This is what is happening).
The Analogy: It's like a radio station playing the correct song (the count), but a DJ in the booth (the MLP block) decides to cut the music and play a different song (the wrong number) right before it goes out to the speakers. The music is fine; the routing is broken.
5. Bigger Models Have a Different Glitch
The researchers also looked at bigger, smarter models. These models usually get the count right, but they fail if you sneak a "banana" into the list of apples.
- The Glitch: These bigger models see the banana. Their attention system notices it. But, just like the smaller models, they fail to let that information change the final answer. They see the anomaly but can't "route" that new information to the final output.
The Bottom Line
The paper concludes that these AI models aren't "bad at math." They are actually very good at tracking the numbers internally. The problem is that a specific part of their brain gets triggered by the way the list is written (spaces vs. commas, words vs. numbers) and forces a wrong answer onto the final output, overwriting the correct one that was already there.
To fix this, we don't need to teach the AI how to count (it already knows). We need to fix the "traffic cop" (the routing mechanism) that is currently blocking the correct answer from getting out.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.