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% 미만의 인스턴스만 해결한다. 기존 프레임워크는 문서 읽기, 행동 탐색, 코드 합성을 단일 패스로 혼합하여 에이전트가 충분히 탐색하지 못하고, 맥락이 변화함에 따라 행동 의도를 잃어버리며, 초기 해석 오류를 최종 구현으로 전파하게 만든다. 고전적 요구공학에서 영감을 받아, 우리는 행동 명세 도출이 구현에 앞선 일급 단계가 되어야 한다고 주장한다. 본 논문에서는 명세 도출이 코드 합성 전에 수행되도록 강제하는 2단계 프레임워크인 SpecFirst를 제시한다. 전용 명세 에이전트가 먼저 바이너리를 탐색하고 관찰 결과를 문서와 결합하여 구조화된 명세를 생성한다. 그런 다음 코드 합성 에이전트가 이 명세를 사용하여 구현을 진행한다. 이러한 분해는 코딩이 시작되기 전에 문서의 모호성을 해결하고 합성 전반에 걸쳐 안정적인 행동 참조를 제공한다. 우리는 두 패밀리와 한 자릿수 이상의 성능 차이를 보이는 네 가지 모델에서 모든 200개 ProgramBench 인스턴스에 대해 SpecFirst를 평가했다. 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.