paper-with-me

홈 › Papers

Grokked Transformers are Implicit Reasoners: A Mechanistic Journey to the Edge of Generalization

2024-05-23 · Boshi Wang, Xiang Yue, Yu Su, Huan Sun

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 configuration of the generalizing circuit. Our findings guide data and training setup to better induce implicit reasoning and suggest potential improvements to the transformer architecture, such as encouraging cross-layer knowledge sharing. Furthermore, we demonstrate that for a challenging reasoning task with a large search space, GPT-4-Turbo and Gemini-1.5-Pro based on non-parametric memory fail badly regardless of prompting styles or retrieval augmentation, while a fully grokked transformer can achieve near-perfect accuracy, showcasing the power of parametric memory for complex reasoning.

📄 PDF Abstract BibTeX arXiv:2405.15071

Code (1)

osu-nlp-group/grokkedtransformer 공식 구현 jax

Similar Papers 제목 키워드 기반

Is Grokking Worthwhile? Functional Analysis and Transferability of Generalization Circuits in Transformers

2026-01-14 · Kaiyu He, Zhang Mian, Peilin Wu, Xinya Du 외 arxiv

While Large Language Models (LLMs) excel at factual retrieval, they often struggle with the "curse of two-hop reasoning" in compositional tasks. Recent research suggests that parameter-sharing transformers can bridge thi…

Towards Empirical Interpretation of Internal Circuits and Properties in Grokked Transformers on Modular Polynomials

2024-02-26 · Hiroki Furuta, Gouki Minegishi, Yusuke Iwasawa, Yutaka Matsuo

Grokking has been actively explored to reveal the mystery of delayed generalization and identifying interpretable representations and algorithms inside the grokked models is a suggestive hint to understanding its mechani…

Dimensional Criticality at Grokking Across MLPs and Transformers

2026-04-06 · Ping Wang arxiv

Abrupt transitions between distinct dynamical regimes are a hallmark of complex systems. Grokking in deep neural networks provides a striking example -- an abrupt transition from memorization to generalization long after…

Bayesian Classifier for Route Prediction with Markov Chains

2018-08-31 · Jonathan P. Epperlein, Julien Monteil, Ming-ming Liu, Yingqi Gu 외

We present here a general framework and a specific algorithm for predicting the destination, route, or more generally a pattern, of an ongoing journey, building on the recent work of [Y. Lassoued, J. Monteil, Y. Gu, G. R…

Prediction

Transformers meet Neural Algorithmic Reasoners

2024-06-13 · Wilfried Bounsi, Borja Ibarz, Andrew Dudzik, Jessica B. Hamrick 외

Transformers have revolutionized machine learning with their simple yet effective architecture. Pre-training Transformers on massive text datasets from the Internet has led to unmatched generalization for natural languag…

Graph Neural NetworkLanguage ModelingLanguage ModellingNatural Language Understanding