SpecFirst: エージェントベースのゼロからのプログラム合成における第一級のステップとしての振る舞い仕様獲得
SpecFirst: Behavioral Specification Elicitation as a First-Class Step in Agent-Based Program Synthesis from Scratch
July 29, 2026
著者: Yihao Chen, Shi Chang, Feng Lin, Khaled Chawa, Boyuan Chen, Shaowei Wang, Ahmed E. Hassan
cs.AI
要旨
LLMベースのエージェントは、既存のコードベースが文脈を提供するソフトウェアエンジニアリングタスクでは優れているが、プログラムをゼロから構築することは根本的に難しい。ProgramBenchのような最近のベンチマークはこのギャップを定量化している。自然言語のドキュメントと実行専用のバイナリを行動オラクルとして与えられた場合、最先端のモデルでも1%未満のインスタンスしか解決できない。既存のフレームワークは、ドキュメントの読み取り、行動探索、コード合成を単一のパスに混同しており、エージェントが十分に探索できず、コンテキストのずれによって行動意図を失い、初期の誤解を最終的な実装に伝播させている。古典的な要件工学に着想を得て、我々は行動仕様の引き出しを実装に先立つ第一級のフェーズとすべきだと主張する。我々はSpecFirstを提案する。これはコード合成の前に仕様引き出しを強制する二段階フレームワークである。専用の仕様エージェントがまずバイナリを探索し、観察結果とドキュメントを組み合わせて構造化された仕様を作成する。次に、コード合成エージェントがこの仕様を使って実装を進める。この分解により、コーディング開始前にドキュメントの曖昧さが解消され、合成全体を通じて安定した行動参照が提供される。我々はSpecFirstを、2つのファミリーにまたがり能力が一桁異なる4つのモデルを用いて、ProgramBenchの全200インスタンスで評価した。SpecFirstは一貫してシングルループベースラインを上回り、テスト合格率を6.9%~21.3%、バイナリ探索カバレッジを9.4%~18.5%改善し、すべて統計的に有意である。コード合成の行動分析はさらに、事前の仕様により早期かつ持続的なコード構築が可能になることを示している。我々の結果は、明示的な要件工学フェーズがゼロからのプログラム構築に効果的なパラダイムであることを示している。
English
LLM-based agents excel at software engineering tasks where an existing codebase provides context, but constructing a program from scratch remains fundamentally harder. Recent benchmarks such as ProgramBench quantify this gap: given only natural-language documentation and an execute-only binary as a behavioral oracle, even frontier models solve fewer than 1% of instances. Existing frameworks conflate documentation reading, behavioral exploration, and code synthesis into a single pass, causing agents to probe insufficiently, lose behavioral intent as context drifts, and propagate early misinterpretations into the final implementation. Inspired by classical requirements engineering, we argue that behavioral specification elicitation should be a first-class phase that precedes implementation. We present SpecFirst, a two-stage framework that forces the specification elicitation before code synthesis. A dedicated spec agent first probes the binary and combines observations with documentation into a structured specification. Next, a code synthesis agent then uses this specification to drive implementation. This decomposition resolves documentation ambiguities before coding begins and provides a stable behavioral reference throughout synthesis. We evaluate SpecFirst on all 200 ProgramBench instances across four models spanning two families and an order of magnitude of capability. SpecFirst consistently outperforms the single-loop baseline, improving test pass rates by 6.9%-21.3% and binary exploration coverage by 9.4%-18.5%, all statistically significant. Behavioral analysis on code synthesis further shows that a prior specification enables earlier and more sustained code construction. Our results demonstrate that an explicit requirements-engineering phase is an effective paradigm for from-scratch program construction.