arXiv Computation and Language

Geometric Factual Recall in Transformers

The paper investigates how transformer language models store factual associations, proposing a geometric memorization framework where embeddings encode relational structure and a small MLP functions as a selector. In a controlled experiment, a single‑layer transformer can memorize random bijections between subjects and attributes using only a logarithmic embedding dimension, with subject embeddings representing linear superpositions of attribute vectors. The authors extend this to multi‑hop relational queries, demonstrating a capacity–depth tradeoff and providing both theoretical proofs and empirical evidence that the MLP learns a generic selection mechanism rather than acting as a key‑value memory.

Hugging Face Trending Papers
Jul 13

Invariant Learning Dynamics of Transformers in Inductive Reasoning Tasks

We present a theoretical framework to explain the emergence of inductive reasoning abilities in Transformer language models. While previous works on Transformer learning dynamics have so far been mostly tied to specific tasks, we study a generalized class of inductive tasks that unifies several synthetic tasks known in the literature, including in-context n-grams and multi-hop reasoning.

arXiv Computation and Language
Aug 28

Why Knowing Both Hops Is Not Enough: Understanding Two-Hop Generalization in Language Models

Large language models can solve complex multi‑hop tasks but often fail on simple two‑hop queries, even when each hop is individually correct. In a controlled symbolic setting, the authors find that models generalize reliably when the second hop follows the training distribution, but always fail when it deviates. Mechanistic analysis shows that successful generalization relies on consistent intermediate representations across contexts, whereas failures arise from a mismatch between lower‑layer representation construction and upper‑layer mapping to outputs. The study proposes a recurrent‑style training strategy that improves out‑of‑distribution two‑hop generalization.

By Zili Zhang, Yilin Wang, Heng Wang, Herun Wan, Minnan Luo