SpecFirst: Behavioral Specification Elicitation as a First-Class Step in Agent-Based Program Synthesis from Scratch
Summary
SpecFirst proposes making behavioral specification elicitation a first-class step in agent-based program synthesis, separating it from exploration and coding. Evaluated on 200 program instances, it significantly improves test pass rates and binary exploration coverage across multiple models.
View Cached Full Text
Cached at: 07/30/26, 09:50 PM
Paper page - SpecFirst: Behavioral Specification Elicitation as a First-Class Step in Agent-Based Program Synthesis from Scratch
Source: https://huggingface.co/papers/2607.27167 SpecFirst: Behavioral Specification Elicitation as a First-Class Step in Agent-Based Program Synthesis from Scratch
We believe behavioral specification elicitation should be a first-class step in program synthesis from scratch, rather than being implicitly mixed with exploration and coding. With SpecFirst, we:
π Separate synthesis into two stages: a specification agent first probes an execute-only binary and combines its observations with the documentation into a structured behavioral specification π Give a second agent this specification as a stable reference for implementation, instead of requiring it to continually recover behavioral intent from a growing interaction history π Resolve documentation ambiguities before coding begins and decouple behavioral exploration from code construction
We evaluate SpecFirst on all 200 ProgramBench instances, using four models across two model families spanning nearly an order of magnitude in agentic coding capability. We compare it against a controlled single-loop Direct-Synthesis baseline using the same model, official mini-SWE-agent scaffold, and otherwise matched experimental settings.
The result: π Improves test pass rates by 6.9%β21.3% over Direct-Synthesis across all four evaluated models π Increases binary exploration coverage by 9.4%β18.5%, showing that the dedicated specification phase leads to more extensive behavioral probing π Produces statistically significant improvements across every evaluated model, suggesting that the benefit extends across model families and capability levels
Perhaps most interesting: the specification changes how agents code. Behavioral analysis shows that agents equipped with a prior specification begin code construction earlier and sustain it for longer, rather than repeatedly switching between behavioral exploration and implementation. Our results suggest that introducing an explicit requirements-engineering phase into the agent loop is a simple but effective paradigm for building programs from scratch.
Similar Articles
Agent Seer: Synthesizing Scenarios from Specification Understanding
Agent Seer is a pipeline that synthesizes realistic evaluation scenarios for AI agents from tool specifications without manual curation, improving tool-calling correctness and conversational coherence in multi-turn dialogues.
AgentSpec: Understanding Embodied Agent Scaffolds Through Controlled Composition
Introduces AgentSpec, a modular specification framework for systematically composing and analyzing embodied LLM agent scaffolds, revealing that performance depends on scaffold compatibility and interaction effects rather than isolated module strength.
Beyond Recall: Behavioral Specification as an Interpretive Layer for AI Personalization
This paper introduces representational accuracy and a Behavioral Specification as an interpretive layer for AI personalization, showing that it improves representational accuracy at about 25Γ less context cost compared to raw data retrieval, especially for interpretation-required questions.
FVSpec: Real-World Property-Based Tests as Lean Challenges
This paper presents FVSpec, a benchmark for AI-assisted formal verification that translates real-world property-based tests from Python into Lean 4 specifications using a multi-agent LLM pipeline, aiming to drive progress on formal verification of real-world software.
People who write specs for AI coding agents?
The article discusses varying approaches to writing specifications for AI coding agents and asks for community input on effective methods.