Grokked Transformers are Implicit Reasoners: A Mechanistic Journey to the Edge of Generalization
Boshi Wang, Xiang Yue, Yu Su, Huan Sun

TL;DR
This paper investigates how transformers can learn implicit reasoning skills like composition and comparison through grokking, revealing internal mechanisms, generalization limits, and potential architectural improvements.
Contribution
It demonstrates that transformers can develop implicit reasoning via grokking, analyzes the internal circuits involved, and explores how training and architecture influence reasoning capabilities.
Findings
Transformers require extended training to grok reasoning tasks.
Generalization varies: successful for comparison, limited for composition.
Parametric memory in transformers can outperform non-parametric approaches in complex reasoning.
Abstract
We study whether transformers can learn to implicitly reason over parametric knowledge, a skill that even the most capable language models struggle with. Focusing on two representative reasoning types, composition and comparison, we consistently find that transformers can learn implicit reasoning, but only through grokking, i.e., extended training far beyond overfitting. The levels of generalization also vary across reasoning types: when faced with out-of-distribution examples, transformers fail to systematically generalize for composition but succeed for comparison. We delve into the model's internals throughout training, conducting analytical experiments that reveal: 1) the mechanism behind grokking, such as the formation of the generalizing circuit and its relation to the relative efficiency of generalizing and memorizing circuits, and 2) the connection between systematicity and the…
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.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsEvolutionary Algorithms and Applications · Neural Networks and Applications · Semantic Web and Ontologies
