ChatPaper.aiChatPaper

エージェンタイルコード推論

Agentic Code Reasoning

March 2, 2026
著者: Shubham Ugare, Satish Chandra
cs.AI

要旨

LLMエージェントは、コードを実行することなくコードベースを探索し、コードの意味論について推論できるか?我々はこの能力を「エージェント的コード推論」と呼び、半形式的推論を導入する。これは、エージェントが明示的な前提を構築し、実行パスをトレースし、形式的な結論を導出することを求める構造化プロンプティング手法である。非構造化の連鎖思考とは異なり、半形式的推論は証明書として機能する。すなわち、エージェントはケースを飛ばしたり、根拠のない主張をしたりすることができない。3つのタスク(パッチ等価性検証、故障箇所特定、コード質問応答)で評価を行い、半形式的推論が全てのタスクで精度を一貫して向上させることを示す。パッチ等価性では、精選された例において精度が78%から88%に向上し、実世界のエージェント生成パッチでは93%に達し、実行を伴わないRL報酬信号に必要な信頼性に迫る結果を示した。RubberDuckBench Mohammad et al. (2026) におけるコード質問応答では、半形式的推論は87%の精度を達成した。Defects4J Just et al. (2014) における故障箇所特定では、半形式的推論は標準的な推論と比べてTop-5精度を5ポイント向上させた。これらの結果は、構造化されたエージェント的推論が実行を伴わない有意義な意味的コード解析を可能にし、RLトレーニングパイプライン、コードレビュー、静的プログラム解析における実用的応用を開くことを実証している。
English
Can LLM agents explore codebases and reason about code semantics without executing the code? We study this capability, which we call agentic code reasoning, and introduce semi-formal reasoning: a structured prompting methodology that requires agents to construct explicit premises, trace execution paths, and derive formal conclusions. Unlike unstructured chain-of-thought, semi-formal reasoning acts as a certificate: the agent cannot skip cases or make unsupported claims. We evaluate across three tasks (patch equivalence verification, fault localization, and code question answering) and show that semi-formal reasoning consistently improves accuracy on all of them. For patch equivalence, accuracy improves from 78% to 88% on curated examples and reaches 93% on real-world agent-generated patches, approaching the reliability needed for execution-free RL reward signals. For code question answering on RubberDuckBench Mohammad et al. (2026), semi-formal reasoning achieves 87% accuracy. For fault localization on Defects4J Just et al. (2014), semi-formal reasoning improves Top-5 accuracy by 5 percentage points over standard reasoning. These results demonstrate that structured agentic reasoning enables meaningful semantic code analysis without execution, opening practical applications in RL training pipelines, code review, and static program analysis.
PDF50March 4, 2026