AI
How Transformers Encode Factual Memory Using Geometric Structure, Not Parameter Scaling
Researchers reveal that language models memorize facts through a geometric mechanism in embeddings rather than storing them as separate weight matrices.
Transformer language models don't memorize facts the way most people assume. Rather than encoding each factual association as a separate key-value pair in their weight matrices, new research suggests they use a more efficient geometric mechanism based on the structure of learned embeddings.
The Problem with Traditional Assumptions#
The conventional understanding treats transformer weights as an associative memory, where each fact requires its own storage slot. This approach creates a scaling problem: to remember more facts, you need proportionally more parameters. A new study from arXiv challenges this model and proposes an alternative.
A Geometric Solution#
The researchers developed both theoretical and empirical evidence for how transformers actually handle factual recall. In their account, the system works through two coordinated components:
- Embeddings encode relational structure directly as linear superpositions of attribute vectors, rather than storing discrete facts
- The MLP acts as a relation-conditioned selector, extracting the relevant attribute from that superposition
In controlled experiments where a single-layer transformer learned random mappings between subjects and attributes, the team proved that an embedding dimension growing only logarithmically with the number of facts is sufficient—far more efficient than linear scaling.
Scaling to Complex Queries#
The findings extend beyond simple associations to multi-hop reasoning—chains of relational questions like "Who is the mother of the wife of x?" The researchers constructed solutions both with and without chain-of-thought reasoning, revealing a capacity-depth tradeoff: storing more facts requires either deeper reasoning chains or larger embeddings. They backed this up with matching information-theoretic lower bounds.
Empirical Validation#
Gradient descent naturally discovered solutions with the predicted structure when trained on the task. More strikingly, causal experiments demonstrated that when subject embeddings were reinitialised to new, unseen facts, the frozen MLP transferred zero-shot to entirely new bijections. This shows the MLP has learned a rather than functioning as a lookup table—a key distinction supporting the geometric account over memory-based alternatives.

