MapFormer: Self-Supervised Learning of Cognitive Maps with Input-Dependent Positional Embeddings
The paper introduces MapFormer, a novel Transformer-based architecture that utilizes input-dependent positional embeddings derived from Lie-algebra generators to learn unsupervised cognitive maps, thereby achieving superior out-of-distribution generalization and scalability across diverse cognitive tasks compared to existing AI models.
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 are walking through a new city. You don't just memorize every single building you see; instead, you build a mental map. You understand that "turning left" always changes your position relative to the street, regardless of whether you are in Paris or Tokyo. This ability to separate where you are (the structure) from what you see (the content) is what scientists call a "cognitive map."
Current AI systems, like the large language models you might chat with, are incredibly good at memorizing patterns. However, they are often "brittle." If you ask them to solve a problem slightly different from what they trained on, they often fail. They struggle to understand the underlying rules of a situation and instead rely on guessing based on surface-level similarities.
This paper introduces a new type of AI architecture called MapFormers. Think of MapFormers as giving AI a "mental GPS" that learns the rules of the road rather than just memorizing the scenery.
The Core Idea: Separating the "Where" from the "What"
The authors argue that to be truly smart, an AI needs to untangle two things:
- Content: The specific things it sees (e.g., a red apple, a blue car).
- Structure: The rules of how things move or relate (e.g., "moving right" always shifts you one step to the right).
Standard AI models mix these together. MapFormers are designed to keep them separate. They do this using a mathematical trick involving Lie groups (a fancy way of describing smooth rotations and movements). Instead of hard-coding rules, the AI learns to generate "movement matrices" based on the input.
The Two Types of MapFormers
The paper presents two versions of this system, which the authors compare to human memory types:
- MapEM (Episodic Memory): This is like a diary. It keeps a separate, dedicated list of "where I am" and "what I saw." It's very good at recalling specific past events (like remembering exactly what you had for breakfast last Tuesday), but it's a bit slower to process.
- MapWM (Working Memory): This is like your brain's active scratchpad. It mixes the "where" and "what" together on the fly. It's faster and more efficient, similar to how RoPE (a popular current AI technique) works, but with a crucial upgrade: it can actually learn to move around a map dynamically.
How They Learned (The Training Grounds)
To prove these models work, the researchers tested them on three specific "video game" style challenges where the rules were hidden:
- The "Ignore the Noise" Game: The AI had to copy a list of items but ignore the blank spaces in between. Standard AI gets confused by the blanks; MapFormers learned to "gate" (block out) the noise and focus only on the items to copy.
- The "Blindfolded Navigator" Game: The AI was given a sequence of "move" and "see" commands but wasn't told which was which. It had to figure out that "Up" moves you up and "See a Tree" just updates your view. Once it learned the map, it could predict exactly what it would see if it returned to a spot it had visited before, even if the sequence was much longer than it had ever seen before.
- The "Nested Brackets" Game: This tests the ability to handle deep layers of logic (like
((()))). Standard AI struggles to count how many open brackets are waiting to be closed when the sequence gets long. MapFormers treated opening a bracket as "moving forward" and closing it as "moving backward," allowing them to track the stack perfectly, even in sequences much deeper than they were trained on.
The Results: Why This Matters
The paper claims that MapFormers achieved near-perfect generalization.
- The "OOD" Test: In AI terms, "Out-of-Distribution" (OOD) means testing the model on scenarios it has never seen before. While standard models failed miserably when the sequences got longer or the environments changed, MapFormers succeeded. They didn't just memorize; they learned the geometry of the problem.
- Real-World Test: The researchers also tried this on a chunk of real internet text (OpenWebText). While the improvement was smaller than on the logic games, the MapFormers still performed slightly better than standard models, suggesting these principles might scale up to real-world language tasks.
The "Secret Sauce": Math as a Compass
The paper explains that MapFormers use a specific mathematical approach where actions (like "move right") are treated as rotations.
- Imagine you are spinning a dial. If you turn it 90 degrees, then another 90 degrees, you end up at 180.
- MapFormers learn that "Right" is a specific rotation and "Left" is the opposite rotation.
- Because they use this mathematical framework, they can calculate the result of a long journey (path integration) by simply adding up the angles, rather than doing complex, slow calculations for every single step. This allows them to process information in parallel (very fast) while still understanding the sequence.
Summary
In short, this paper proposes that to make AI more robust and adaptable, we should stop treating it like a giant pattern-matching machine and start giving it a cognitive map. By teaching the AI to separate the rules of movement from the things it sees, MapFormers can navigate new, unseen situations with a flexibility that current AI systems lack. They don't just guess; they understand the map.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.