Coding Agents are Strong Prompt Optimizers
Agamdeep Singh, Srishti Gautam, Priyanshu Gupta, Nikita Mehrotra, Tanmay Bakshi, Sumit Gulwani
Abstract
Search-based prompt optimizers improve prompts through iterative search: they propose edits, execute fresh rollouts, score the resulting trajectories, and retain only edits that improve a validation metric. We show that this optimization loop is unnecessary. Given only a static corpus of agent trajectories, an off-the-shelf coding agent can directly synthesize an optimized prompt, requiring neither environment access nor validation data. We call this approach \textit{Coding-Agent Skill Distillation} (CASD). The key insight is reflection scope. Rather than reasoning over a small batch of trajectories at each optimization step, the coding agent writes and executes analysis code to compute corpus-wide statistics, identifies systematic failure modes, inspects representative episodes, and distills the resulting insights into behavioral rules. Across four agentic benchmarks (ALFWorld, -bench retail and telecom, and SpreadsheetBench-Verified), under matched data access, a single CASD pass outperforms GEPA, a state-of-the-art reflective prompt optimizer, on three of four benchmarks and outperforms validation-gated reflective search (SkillOpt) on all four, improving the unoptimized baseline by 16.6 percentage points on average versus 10.9 for GEPA and 5.3 for SkillOpt. Because CASD performs a single offline analysis pass rather than iterative search, producing an optimized prompt costs approximately \$1.60---over cheaper than validation-gated search. Even when competing methods are granted additional validation data and unrestricted environment access, CASD remains ahead on two of four benchmarks. These results suggest that corpus-scale statistical reflection is a viable alternative to iterative search for prompt optimization.
Create a lesson
Metadata
- Comments
- Preprint
Related papers
RadOncGym: An Agent-Based Framework for Radiotherapy Dose-Mimicking Optimization
Shared title terminologycs.AITong Miao, Shupeng Cheng, Xiwen Chen et al.
Asset4D-Bench: Benchmarking Coding Agents for Editable 3D and 4D Reconstruction
Shared title terminologycs.AIChengyi Sun, Deyuan Liu, Lei Zhao et al.
MetaFORGE: A Meta-Learning Framework for Harness Optimization in Automated Code Generation for Parallel Computing
Shared title terminologycs.AIScott Piersall, Yang Gao, Shenyang Liu et al.
Coding4Games: Can Modern Coding Agents Play Modern Video Games?
Shared title terminologycs.AIShifang Zhao, Haoyu Wang, Yuyang Yin et al.
Anatomy of a Quantized Agent: VRAM Stability and Forecasting in Code-Synthesis Agentic Workloads
Shared title terminologycs.AIAnubhab Banerjee
SCOPE: Score-Isolated Agentic Optimization for Video World Models
Shared title terminologycs.AIYuhua Jiang, Jiaming Wang, Qingbin Liu et al.