编程智能体失败后,是再用便宜模型试试还是直接上贵的?这篇论文搞了个路由器和校准方法,在GPT-5.4-nano上省了65%的钱还保证解决率不降。
该论文提出CodeRescue框架,用于编程智能体失败后的恢复路由决策。通过监督路由器从执行轨迹中学习,选择廉价恢复或升级到更强模型。添加Conformal Risk Control(CRC)层,无需重新训练即可适应不同预算,提供边际期望成本控制。在五个编程基准的失败案例上,校准前沿优于固定动作、仅提示路由器和二元级联基线。在GPT-5.4-nano/GPT-5.4设置下,一个CRC校准前沿点比始终升级的解决率更高,且平均恢复成本仅为其35%。
CodeRescue: Budget-Calibrated Recovery Routing for Coding Agents
Coding agents increasingly operate in executable environments where a failed attempt produces actionable feedback rather than merely an incorrect answer. Existing cost-aware systems typically treat such failures as cascade decisions: try a cheap model first, then escalate hard cases to a stronger and more expensive model. In coding, however, execution feedback can also make further cheap-model recovery worthwhile, raising a budgeted deployment question: when should an agent spend more cheap compute, and when should it escalate? We formulate this post-failure decision as recovery routing over heterogeneous actions and train a supervised router from execution rollouts. To make the same router usable under changing budgets, we add a Conformal Risk Control (CRC) layer that selects a deployment-time cost penalty without retraining and provides marginal expected-cost control under exchangeability. Across held-out failures from five coding benchmarks, cheap recovery and escalation exhibit complementary success patterns. The calibrated frontier improves over fixed actions, prompt-only routers, and a binary cascade baseline; in the main GPT-5.4-nano/GPT-5.4 setting, one CRC-calibrated frontier point exceeds always-escalate solve rate while using 35% of its mean recovery cost. Code is available at https://github.com/Qijia-He/agent-budget-control.