arXiv:2609.05274cs.LG2026-09

用草稿模型评估大模型编程的不确定性,提前发现错误风险

How to Speculate about Uncertainty in Agentic Coding? A Draft-Model Gate Method

  • 用小模型快速评估大模型生成代码的可靠性,仅需一次前向传播
  • 在部署中降低6-8%的执行错误率,节省14-19%的令牌开销
  • 适用于多种编程代理,无需重新训练即可跨模型通用

部署于软件工程的大语言模型代理会因过度自信而犯错,且错误只能在高成本执行后才被发现。本文提出推测性不确定性(SU)方法,仅通过代理输出的词元,无需访问对数几率、权重、激活或重复采样,即可恢复预测性失败信号。通过反向推测解码,一个小型开源草稿模型在单次前向传播中对已生成的推理轨迹进行评分。从这些推测交叉似然中,分离推理与动作阶段并提取相位感知特征,再与可验证目标校准。SU生成可直接被下游策略(如路由、人工干预或额外测试时计算)使用的失败概率分数。为验证信号可操作性,我们实现了一个预执行否决门,在Qwen3-Coder-480B和Claude 3.5 Sonnet上,将执行错误率降低6-8个百分点,令牌成本减少14-19%,且在未见基准上无需重训即可迁移,跨代理模型泛化良好。

原文摘要 · Abstract (English)

LLM agents deployed for software engineering fail expensively: they act confidently wrong, and bad actions are recognized only after costly execution and retry. We present Speculative Uncertainty (SU), a method that recovers a predictive failure signal for a black-box agent from its output tokens alone, with no access to logits, weights, activations, or repeated sampling. Inverting speculative decoding, a small open-weight draft model scores the agent's already-generated trajectory in a single forward pass. From these speculative cross-likelihoods we extract phase-aware features by separating the reasoning and action spans, and calibrate them against a verifiable objective. SU produces a failure-likelihood score that any downstream policy, such as routing, human intervention, or extra test-time compute, can consume directly. To show the signal is actionable, we instantiate one such policy, a pre-execution veto gate, on software engineering agents Qwen3-Coder-480B and closed-source Claude 3.5 Sonnet, cutting execution error rate by 6-8 percentage points and token cost by 14-19% in deployment, transferring to out-of-distribution benchmarks without retraining, and generalizing across agent models.

大模型推理不确定性估计编程代理纠错机制

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。