Transformer models can learn robust reasoning skills (beyond those of GPT-4-Turbo and Gemini-1.5-Pro) through a stage of training dynamics that continues far beyond the point of overfitting (i.e. with 'Grokking') 🤯
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. 🤯
'Grokking' refers to a phenomenon where a transformer model continues to improve its generalization performance on a task through extended training, long after it has already fit the training data perfectly (i.e., achieved near-zero training loss).
👉Paper - "Grokked Transformers are Implicit Reasoners: A Mechanistic Journey to the Edge of Generalization"
📌 This paper investigates if transformers can learn to implicitly reason over parametric knowledge, a skill that even SoTA LLMs struggle with. The paper focuses on two types of reasoning - composition and comparison, and finds that transformers can learn implicit reasoning, but only through grokking, i.e. extended training far beyond overfitting. The levels of generalization vary across reasoning types: transformers fail to systematically generalize for composition but succeed for comparison when faced with out-of-distribution examples.
📌 Reveals: 1) The mechanism behind grokking, such as the formation of the generalizing circuit and its relation to the relative efficiency of generalizing vs memorizing circuits. 2) The connection between systematicity and the configuration of the generalizing circuit.
📌 For the composition task, the transformer forms a "sequential" generalizing circuit that stores atomic facts separately across layers, causing it to fail on out-of-distribution generalization. For the comparison task, the transformer forms a "parallel" generalizing circuit that stores atomic facts together, enabling it to achieve systematicity.
📌 The findings suggest that proper cross-layer memory-sharing mechanisms for transformers, such as memory-augmentation and explicit recurrence, are needed to further unlock the transformer's generalization capabilities.