Lune

NeurIPS2024顶会

Grokking of Implicit Reasoning in Transformers: A Mechanistic Journey to the Edge of Generalization

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. 2 * Project started when at OSU. 2 Code and data: https://github.com/OSU-NLP-Group/GrokkedTransformer.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 17 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Improving Language Models by Retrieving from Trillions of Tokens 引用了 Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks
  • Improving Language Models by Retrieving from Trillions of Tokens 引用了 Retrieval Augmented Language Model Pre-Training
  • How do Transformers Learn Implicit Reasoning? 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • Demystifying Reasoning Dynamics with Mutual Information: Thinking Tokens are Information Peaks in LLM Reasoning 引用了 Compositional Generalization from Learned Skills via CoT Training: A Theoretical and Structural Analysis for Reasoning
  • Demystifying Reasoning Dynamics with Mutual Information: Thinking Tokens are Information Peaks in LLM Reasoning 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • Compositional Generalization from Learned Skills via CoT Training: A Theoretical and Structural Analysis for Reasoning 引用了 Locating and Editing Factual Associations in GPT
  • Compositional Generalization from Learned Skills via CoT Training: A Theoretical and Structural Analysis for Reasoning 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper17

  1. Demystifying Reasoning Dynamics with Mutual Information: Thinking Tokens are Information Peaks in LLM ReasoningChen Qian, Dongrui Liu, Haochen Wen, Zhen Bai 等NeurIPS 2025 · 63 次引用
  2. Topology of Reasoning: Understanding Large Reasoning Models through Reasoning Graph PropertiesGouki Minegishi, Hiroki Furuta, Takeshi Kojima, Yusuke Iwasawa 等NeurIPS 2025 · 31 次引用
  3. How do Transformers Learn Implicit Reasoning?Jiaran Ye, Zijun Yao, Zhidian Huang, Liangming Pan 等NeurIPS 2025 · 17 次引用
  4. Scaling can lead to compositional generalizationFlorian Redhardt, Yassir Akram, Simon SchugNeurIPS 2025 · 11 次引用
  5. Compositional Generalization from Learned Skills via CoT Training: A Theoretical and Structural Analysis for ReasoningXinhao Yao, Ruifeng Ren, Yun Liao, Lizhong Ding 等ICLR 2026 · 6 次引用

它引用的 Paper38

  1. Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma 等NeurIPS 2022 · 22,562 次引用
  2. Retrieval-Augmented Generation for Knowledge-Intensive NLP TasksPatrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni 等NeurIPS 2020 · 19,162 次引用
  3. Locating and Editing Factual Associations in GPTKevin Meng, David Bau, Alex Andonian, Yonatan BelinkovNeurIPS 2022 · 3,415 次引用
  4. Retrieval Augmented Language Model Pre-TrainingKelvin Guu, Kenton Lee, Zora Tung, Panupong Pasupat 等ICML 2020 · 2,937 次引用
  5. Improving Language Models by Retrieving from Trillions of TokensSebastian Borgeaud, Arthur Mensch, Jordan Hoffmann, Trevor Cai 等ICML 2022 · 1,629 次引用

相关 Paper

  1. Is Grokking Worthwhile? Functional Analysis and Transferability of Generalization Circuits in TransformersKaiyu He, Mian Zhang, Peilin Wu, Xinya Du 等ACL Findings 2026
  2. Grokking in the Wild: Data Augmentation for Real-World Multi-Hop Reasoning with TransformersRoman Abramov, Felix Steinbauer, Gjergji KasneciICML 2025
  3. Implicit Reasoning in Transformers is Reasoning through ShortcutsTianhe Lin, Jian Xie, Siyu Yuan, Deqing YangACL Findings 2025
  4. Leap-Of-Thought: Teaching Pre-Trained Models to Systematically Reason Over Implicit KnowledgeAlon Talmor, Oyvind Tafjord, Peter Clark, Yoav Goldberg 等NeurIPS 2020 · 119 次引用
  5. Are Transformers Able to Reason by Connecting Separated Knowledge in Training Data?Yutong Yin, Zhaoran WangICLR 2025
黄昏的海面,两侧是细线勾勒的悬崖