Escalate on Failure: A Single-Model Mode-Switching Cascade for Local Code Generation
Abstract
Preliminary report. We study escalation on failure for code generation with locally served open-weight models: one coder model tries fast, and when a test run fails the same model is switched to reasoning mode. On the 225 exercises of the public Aider Polyglot benchmark, each exercise gets a fixed schedule of tries and stops at the first passing test run. In-sample (stage boundaries were tuned on the same exercises), every escalation run solved 215 to 222, against 205 (91.1%) for a settings-matched baseline of ten fast tries. A second model was not needed to reach these solve counts: the two-model cascade (second model for the last two tries) solved 219 in each of two runs. The data neither show nor exclude a small benefit from the second model. At 4+4 (n+m: n fast tries, then m reasoning tries), starting the reasoning tries in a fresh conversation solved 222 and 219, against 215 to 217 with the conversation kept, a likely modest benefit of unestablished size; at 2+4 the comparison is mixed. Escalating earlier (after two or three fast tries) gave no accuracy gain distinguishable from run-to-run noise and took longer: 2+4 solved 220 and 216, 3+4 solved 219 and 221, against 216, 215 and 217 for 4+4. Run-to-run noise is a few exercises (identical 2+4 runs solved 220 and 216; identical 4+4 runs differed on nine exercises), so small differences are not established. The gain is more exercises solved, not speed: the median time to a passing solution is not lower (10.3 s for the baseline, 10.9 to 14.8 s for escalation runs), and wall clock is longer (2 h 17 min to 5 h 00 min against 2 h 07 min). These in-sample work-until-correct figures are not comparable with two-try leaderboard scores. Other limits: possible training-data overlap, a single baseline run and one to three runs per variant.
Create a lesson
Metadata
- Categories
- cs.SE, cs.AI, cs.LO
- Comments
- 20 pages, 1 figure, 19 tables. Preliminary report. Results data: https://github.com/AI-Development-Work/aimos-benchmark-results
Related papers
Solution or Skeleton? Distributional Alignment and Mode Switching in Code Language Models
Shared title terminologycs.SEShaojie Zhang, Yue Yu, Yu Zhang
RBioBench: an execution-based benchmark for biomedical R code generation
Shared title terminologycs.SEXihao Piao, Dong Wang, Ziwei Yang et al.
AI-Generated Code Issues: A Taxonomy from Repository Histories, AI Conversations, and Developer Interviews
Shared title terminologycs.SERosalia Tufano, Nargiz Humbatova, Daniele Bifolco et al.
Generating Property-Based Regression Tests from Source Code Semantics
Shared title terminologycs.SEClemens Bauer, Johann Glock, Martin Pinzger
fx(hash): Salvaging The Source Code of 28k Generative Artworks
Shared title terminologycs.SEBenoit Baudry, Valeriia Bezklynska, Martin Monperrus
Micro Operational Robustness of LLMs on Code Generation
Shared title terminologycs.SEDebalina Ghosh Paul, Hong Zhu, Ian Bayley