Geometric Factual Recall in Transformers
Shauli Ravfogel, Gilad Yehudai, Joan Bruna, Alberto Bietti

TL;DR
This paper proposes a geometric perspective on how transformer models memorize facts, showing that learned embeddings encode relational structures and that MLPs act as relation-specific selectors, with theoretical proofs and empirical validation.
Contribution
It introduces a geometric model of memorization in transformers, demonstrating that small embeddings and MLPs can encode and retrieve relational facts efficiently, with proven capacity and transferability.
Findings
Logarithmic embedding dimension suffices for memorizing relations.
MLPs act as relation-conditioned selectors, not key-value stores.
Models transfer zero-shot to new facts after re-initializing subject embeddings.
Abstract
How do transformer language models memorize factual associations? A common view casts internal weight matrices as associative memories over pairs of embeddings, requiring parameter counts that scale linearly with the number of facts. We develop a theoretical and empirical account of an alternative, \emph{geometric} form of memorization in which learned embeddings encode relational structure directly, and the MLP plays a qualitatively different role. In a controlled setting where a single-layer transformer must memorize random bijections from subjects to a shared attribute set, we prove that a logarithmic embedding dimension suffices: subject embeddings encode \emph{linear superpositions} of their associated attribute vectors, and a small MLP acts as a relation-conditioned selector that extracts the relevant attribute via ReLU gating, and not as an associative key-value mapping. We…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
