How to Speculate about Uncertainty in Agentic Coding? A Draft-Model Gate Method
Abstract
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.
Create a lesson
Metadata
- Comments
- 11 pages, 2 figures, EMNLP 2026, Industry track
Related papers
LinearSpec: Drafting from the Target's Memory for Long-Context Speculative Decoding in Hybrid Vision-Language Models
Shared title terminologycs.LGHaiyu Wang, Sai Qian Zhang, Steven Li
Online Draft Co-Training for Speculative Decoding in Large-Scale, Long-Context RL Post-Training
Shared title terminologycs.LGZili Wang, Zhaopeng Qiu, Yuekai Zhang et al.
CONMAN: Steering LLM Agent Actions via Contrastive World Model Manipulation
Shared title terminologycs.LGHaoyu He, Fengqing Jiang, Radha Poovendran et al.
ReAgent: Closed-Loop Self-Healing for Open-Weight Tool-Calling Agents, from Structural Hallucinations to Decision Errors
Shared title terminologycs.LGCharlie Galvin, Katie Kitchen, Chiara Picardi
Electrode-level artifact simulation and corruption-aware gated reconstruction of the 12-lead ECG, with real-noise and paper-ECG external validation
Shared title terminologycs.LGSanjoy Das Joy, Arfatul Islam Asif, Unayes Ahmed Khan et al.
Accelerating Complex-valued Uncertainty Estimation via Sparsity Exploration and Exploitation
Shared title terminologycs.LGZehuan Zhang, Quan Deng, Wenxi Gao et al.