To See the Unseen: on the Generalization Ability of Transformers in Symbolic Reasoning
This paper identifies and addresses a representational collapse in decoder-only transformers, where unembeddings of unseen tokens converge to similar vectors, causing failures in symbolic reasoning generalization, and proposes a combination of architectural modifications, data diversity, and embedding reset strategies to overcome this limitation.
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
The Big Problem: The "Name-Change" Glitch
Imagine you teach a robot to play a logic game using a deck of cards. You show it cards labeled A, B, and C. You teach it the rule: "If you see A, then you must say B." The robot learns this perfectly.
But then, you give it a new card labeled Z (a card it has never seen before) and ask, "If you see Z, what happens?"
Most modern AI models (Transformers) fail miserably here. Even if the logic is identical, the robot gets confused. It might ignore the card, guess the wrong answer, or try to force the old card names (A, B, C) onto the new situation. It seems like the robot is memorizing the names of the cards rather than understanding the rules of the game.
The Secret Culprit: The "Clumping" Effect
The authors of this paper discovered why the robot fails. It's not just that the robot hasn't seen the card before; it's that the robot's internal "dictionary" gets messy.
The Analogy: The Blurry Filing Cabinet
Think of the AI's memory as a giant filing cabinet where every word or symbol has its own specific drawer.
- Seen Words (A, B, C): These drawers are distinct. Drawer A is red, Drawer B is blue, Drawer C is green. The robot knows exactly which is which.
- Unseen Words (Z, Q, X): When the robot encounters a new word it hasn't trained on, something strange happens. Instead of giving each new word its own unique drawer, the robot's training process accidentally pushes all the new drawers into the same corner of the room. They all get painted the same shade of gray.
This is called "Embedding Collapse." The mathematical vectors (the coordinates) for all unseen tokens collapse into nearly the same spot. To the robot, the new variable "Z" looks almost identical to the new variable "Q." Since it can't tell them apart, it can't reason about them.
The Theoretical Proof: Why the Cabinet Clumps
The paper proves mathematically that this clumping is almost inevitable.
- The Mechanism: During training, the AI tries to minimize errors. If a word never appears in the training data, the math forces its "drawer" to drift toward the center of the room, merging with other unused drawers.
- The Result: The AI loses the ability to distinguish between different unseen variables. It's like trying to solve a puzzle where all the new pieces look exactly the same.
The Solutions: How to Fix the Robot
The authors tested three main ways to stop the robot from getting confused by new names.
1. The "Copy-Paste" Tool (Copy Attention)
- The Problem: Standard AIs try to "invent" the answer for a new word, which is hard when the word is unfamiliar.
- The Fix: They added a special "Copy Head" to the architecture. Think of this as giving the robot a highlighter and a photocopier.
- How it works: Instead of trying to generate the new symbol from scratch, the robot is allowed to simply point to the symbol in the question and copy it directly to the answer. It's like saying, "I don't know what 'Z' means, but I see 'Z' right here, so I'll just write 'Z' down."
2. The "Freeze" Strategy (Frozen Embeddings)
- The Problem: The robot keeps trying to rearrange its filing cabinet, which causes the new drawers to clump together.
- The Fix: Lock the drawers in place.
- How it works: The researchers stopped the robot from changing the definitions of the words during training. They kept the "drawers" for new words in their original, distinct positions. Because the robot couldn't mess them up, it could tell them apart and reason correctly.
3. The "Memory Wipe" (Active Forgetting)
- The Problem: The robot gets too attached to the old patterns and forgets that new things exist.
- The Fix: Periodically reset the dictionary.
- How it works: Every few steps of training, the researchers wipe the slate clean for the new words, resetting their "drawers" back to their original distinct positions. This prevents them from clumping together over time. It's like a teacher telling a student, "Forget what you just memorized for a second; let's look at this new problem with fresh eyes."
The Real-World Test: Gemma 3 Models
The authors didn't just test this on small, made-up models. They looked at Gemma 3, a large, real-world AI model released by Google.
- The Discovery: Even in this massive, sophisticated model, the unused tokens (words reserved for future use) were clumped together, just like in their small experiments.
- The Consequence: When they tried to teach Gemma 3 a new logic game using these "unused" tokens, it took 10 times longer to learn compared to using common words. The model was struggling to distinguish between the new symbols because their internal representations were so blurry.
The Takeaway
To build AI that can truly reason with new, abstract ideas (like a scientist discovering a new element or a programmer writing code with new variables), we can't just feed it more data. We have to change how it stores information.
We need to ensure that:
- The AI can copy new symbols directly rather than guessing them.
- The AI's internal "dictionary" doesn't let new words merge into a blurry mess.
By fixing this "clumping" issue, we can make AI much better at generalizing—solving problems it has never seen before, not just memorizing the ones it has.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.