How Do LLMs Perform Two-Hop Reasoning in Context?

要約

「ソクラテスは人間です。
すべての人間は致命的です。
したがって、ソクラテスは致命的です。」この形式の議論は、2ホップの推論の典型的なパターンを示しています。
正式には、2ホップの推論とは、最終的な結論が両方のステップの統合に依存するように、2つの論理的なステップを作成することにより、結論を推測するプロセスを指します。
これは、人間の推論の最も基本的な要素の1つであり、正式な論理と日常の意思決定の両方において重要な役割を果たしています。
大規模な言語モデル(LLMS)の最近の進歩にもかかわらず、驚くべきことに、ディストラクタが存在するときに簡単な2ホップ推論の問題を解決することに失敗する可能性があることがわかりました。
合成データセットでは、事前に訓練されたLLMSがしばしばすべてのもっともらしい結論の中でランダムな推測に頼ることがあることを観察します。
ただし、微調整の数段階の後、モデルはほぼ完璧な精度を実現し、強い長さの一般化を示します。
基礎となるメカニズムを理解するために、合成2ホップの推論タスクで3層トランスをゼロから訓練し、内部情報フローをリバースエンジニアリングします。
トレーニング中の注意ロジッツの明確な進行を観察します。
これは、ランダム推測の初期段階から構造化されたシーケンシャルクエリメカニズムの出現への鋭い位相遷移を描いています。ここでは、モデルが最初に前のレイヤーの前の概念とブリッジの概念を最初に取得し、次に最終回答を推測します。
最後に、これらのダイナミクスは、最小限の3パラメーターの注意のみネットワークによってキャプチャできることを示します。

要約(オリジナル)

“Socrates is human. All humans are mortal. Therefore, Socrates is mortal.” This form of argument illustrates a typical pattern of two-hop reasoning. Formally, two-hop reasoning refers to the process of inferring a conclusion by making two logical steps, each connecting adjacent concepts, such that the final conclusion depends on the integration of both steps. It is one of the most fundamental components of human reasoning and plays a crucial role in both formal logic and everyday decision-making. Despite recent progress in large language models (LLMs), we surprisingly find that they can fail at solving simple two-hop reasoning problems when distractors are present. We observe on a synthetic dataset that pre-trained LLMs often resort to random guessing among all plausible conclusions. However, after few steps of fine-tuning, models achieve near-perfect accuracy and exhibit strong length generalization. To understand the underlying mechanisms, we train a 3-layer Transformer from scratch on a synthetic two-hop reasoning task and reverse-engineer its internal information flow. We observe a clear progression in the attention logits throughout training. This pictures a sharp phase transition from an initial stage of random guessing to the emergence of a structured sequential query mechanism, where the model first retrieves the preceding and the bridge concepts in the early layers and then uses them to infer the final answer. Finally, we show that these dynamics can be captured by a minimal three-parameter attention-only network.

arxiv情報

著者 Tianyu Guo,Hanlin Zhu,Ruiqi Zhang,Jiantao Jiao,Song Mei,Michael I. Jordan,Stuart Russell
発行日 2025-05-28 15:25:29+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.AI, cs.CL パーマリンク