SpecFirst: Behavioral Specification Elicitation as a First-Class Step in Agent-Based Program Synthesis from Scratch
On the map: LLM agents and tool use → Software engineering coding agents
Abstract (arXiv)
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.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Placed in Software engineering coding agents, one of 16 directions in LLM agents and tool use. Builds on 21 of its 39 references that are in the map. First posted on arXiv 29 Jul 2026.
Builds on
21 of 39 references.
Closest ancestors · 4
Same direction, newest first
- 2025Lingxi: Repository-Level Issue Resolution Framework Enhanced by Procedural Knowledge Guided Scaling13 Oct
- 2025Trae Agent: An LLM-based Agent for Software Engineering with Test-time Scaling31 Jul
- 2024OpenHands: An Open Platform for AI Software Developers as Generalist Agents23 Jul
- 2024SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering6 May
Other references · 17
- 2025Qwen3 Technical Reportcited by 8,820
- 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,695
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2021Program Synthesis with Large Language Modelscited by 3,637
- 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,373
- 2023Code Llama: Open Foundation Models for Codecited by 2,139
- 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,181
- 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 885
- 2023StarCoder: may the source be with you!cited by 799
- 2025LLMs Get Lost In Multi-Turn Conversationcited by 429
- 2020Unsupervised Translation of Programming Languagescited by 263
- 2017RobustFill: Neural Program Learning under Noisy I/Ocited by 126
5 more
- 2026ProgramBench: Can Language Models Rebuild Programs From Scratch?cited by 59
- 2024LLM4Decompile: Decompiling Binary Code with Large Language Modelscited by 39
- 2025Drift No More? Context Equilibria in Multi-Turn LLM Interactionscited by 22
- 2025Solving Context Window Overflow in AI Agentscited by 4
- 2025Quantifying Laziness, Decoding Suboptimality, and Context Degradation in Large Language Modelscited by 1
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2026SpecPath: Testing Coding Agents Across Contract-Equivalent Specification Histories
- 2026Verus-SpecGym: An Agentic Environment for Evaluating Specification Autoformalization
- 2026Grounding AI Agents in Contracts: An Empirical Evaluation of Spec-Driven Test Generation
- 2026SpecBench: Evaluating Specification-Level Reasoning for Software Engineering LLM Agents
- 2026LiveFMBench: Unveiling the Power and Limits of Agentic Workflows in Specification Generation
- 2026The Specification Gap: Coordination Failure Under Partial Knowledge in Code Agents
- 2024SpecRover: Code Intent Extraction via LLMs
- 2026SpecForge: Recursive Self-Improvement for Coding Agents via Behavioral Specifications