現実世界におけるマルチホップ推論のためのデータ拡張:Transformersを用いたGrokkingの実践
Grokking in the Wild: Data Augmentation for Real-World Multi-Hop Reasoning with Transformers
April 29, 2025
著者: Roman Abramov, Felix Steinbauer, Gjergji Kasneci
cs.AI
要旨
Transformerは多くのNLPタスクで大きな成功を収めているが、特に実世界の知識が乏しい場合の多段階の事実推論において、依然として顕著なギャップを示している。最近のgrokkingの進展により、ニューラルネットワークが基礎となる論理パターンを検出すると、記憶から完全な一般化へと移行できることが実証されたが、これらの研究は主に小規模で人工的なタスクを使用してきた。本論文では、初めてgrokkingを実世界の事実データに拡張し、データセットの希薄性という課題に対処するため、既存の知識グラフを注意深く設計された合成データで拡張し、推論された事実と原子的事実の比率φ_rをgrokkingに必要な閾値以上に引き上げる。驚くべきことに、事実的に誤った合成データでさえ、モデルが記憶ではなく関係構造に依存することを強制するため、推論回路の出現を強化し、精度を低下させることはないことがわかった。多段階推論ベンチマークで評価した結果、我々のアプローチは2WikiMultiHopQAにおいて最大95-100%の精度を達成し、強力なベースラインを大幅に上回り、現在の最先端の結果に匹敵またはそれを超える性能を示した。さらに、φ_rの増加がTransformer内部での一般化回路の形成をどのように促進するかについて詳細な分析を提供する。我々の知見は、grokkingに基づくデータ拡張が暗黙的な多段階推論能力を解き放ち、大規模言語モデルにおけるより堅牢で解釈可能な事実推論への扉を開く可能性を示唆している。
English
Transformers have achieved great success in numerous NLP tasks but continue
to exhibit notable gaps in multi-step factual reasoning, especially when
real-world knowledge is sparse. Recent advances in grokking have demonstrated
that neural networks can transition from memorizing to perfectly generalizing
once they detect underlying logical patterns - yet these studies have primarily
used small, synthetic tasks. In this paper, for the first time, we extend
grokking to real-world factual data and address the challenge of dataset
sparsity by augmenting existing knowledge graphs with carefully designed
synthetic data to raise the ratio phi_r of inferred facts to atomic facts
above the threshold required for grokking. Surprisingly, we find that even
factually incorrect synthetic data can strengthen emergent reasoning circuits
rather than degrade accuracy, as it forces the model to rely on relational
structure rather than memorization. When evaluated on multi-hop reasoning
benchmarks, our approach achieves up to 95-100% accuracy on 2WikiMultiHopQA -
substantially improving over strong baselines and matching or exceeding current
state-of-the-art results. We further provide an in-depth analysis of how
increasing phi_r drives the formation of generalizing circuits inside
Transformers. Our findings suggest that grokking-based data augmentation can
unlock implicit multi-hop reasoning capabilities, opening the door to more
robust and interpretable factual reasoning in large-scale language models.