HiL-Bench (Human-in-Loop Benchmark): Do Agents Know When to Ask for Help?
| Authors | Mohamed Elfeki et al. |
| Year | 2026 |
| HF Upvotes | 4 |
| arXiv | 2604.09408 |
| Download | |
| HF Page | View on Hugging Face |
Abstract
Frontier coding agents solve complex tasks when given complete context but collapse when specifications are incomplete or ambiguous. The bottleneck is not raw capability, but judgment: knowing when to act autonomously and when to ask for help. Current benchmarks are blind to this failure mode. They supply unambiguous detailed instructions and solely reward execution correctness, so an agent that makes a lucky guess for a missing requirement will score identically to one that would have asked to be certain. We present HiL-Bench (Human-in-the-Loop Benchmark) to measure this selective escalation skill. Each task contains human-validated blockers (missing information, ambiguous requests, contradictory information) that surface only through progressive exploration, not upfront inspection. Our core metric, Ask-F1, the harmonic mean of question precision and blocker recall, captures the tension between over-asking and silent guessing; its structure architecturally prevents gaming through question spam. Evaluation across SWE and text-to-SQL domains reveals a large universal judgment gap: no frontier model recovers more than a fraction of its full-information performance when deciding whether to ask. Failure analysis identifies three key help-seeking patterns: overconfident wrong beliefs with no gap detection; high uncertainty detection yet persistent errors; broad, imprecise escalation without self-correction. These consistent patterns confirm poor help-seeking is a model-level flaw, not task-specific. RL training on shaped Ask-F1 reward shows judgment is trainable: a 32B model improves both help-seeking quality and task pass rate, with gains that transfer across domains. The model does not learn domain-specific heuristics for when to ask; it learns to detect unresolvable uncertainty and act on it.
Engineering Breakdown
Plain English
HiL-Bench is a new benchmark that tests whether AI coding agents know when to ask for help rather than guessing. Current benchmarks give agents complete information and only measure if they execute correctly, so an agent that gets lucky on ambiguous requirements scores the same as one that would have asked for clarification. This paper identifies a critical failure mode in frontier coding agents: they collapse when specifications are incomplete or ambiguous, not because they lack capability but because they lack judgment about when to escalate to humans. HiL-Bench embeds human-validated blockers (missing information, contradictions, ambiguities) that agents discover only through exploration, measuring their ability to recognize uncertainty and request help rather than hallucinate solutions.
Core Technical Contribution
The core novelty is reframing agent evaluation from pure execution correctness to selective escalation capability—measuring not just what agents do, but their metacognitive awareness of when they shouldn't act alone. Unlike existing benchmarks that surface all requirements upfront, HiL-Bench embeds blockers that only emerge through progressive task exploration, forcing agents to either discover gaps through reasoning or proceed with insufficient information. This shifts the evaluation paradigm from binary success/failure (did you execute?) to three-outcome assessment (did you execute correctly, did you recognize uncertainty and ask, or did you hallucinate?). The technical contribution is the methodology for creating tasks with progressive information revelation and human-validated blocker annotations, making it possible to measure a capability that traditional benchmarks systematically hide.
How It Works
HiL-Bench constructs tasks that begin with incomplete specifications intentionally designed to match real-world software development scenarios. As an agent explores the task—asking clarifying questions, reviewing documentation, writing initial code—it encounters human-validated blockers: contradictory requirements, missing context, or ambiguous terminology that cannot be resolved through inference alone. The benchmark framework tracks agent behavior across three decision paths: the agent correctly identifies the blocker and escalates to request help (success), the agent proceeds despite insufficient information and produces incorrect output (failure), or the agent luckily guesses the missing requirement and executes correctly (false positive, which traditional metrics would reward equally). Evaluation metrics distinguish between these outcomes by measuring escalation decisions at the moment of uncertainty, requiring agents to demonstrate explicit recognition of gaps rather than lucky execution on incomplete specifications.
Production Impact
This work directly addresses a critical production failure mode: AI agents confidently producing wrong outputs when specifications are genuinely incomplete rather than signaling uncertainty and requesting human input. In real software development, requirements are almost never perfectly specified upfront—teams rely on agents/developers recognizing ambiguities and asking questions before coding. Adopting HiL-Bench's methodology would change production validation from testing only correctness (does the code work?) to testing judgment (does the agent know what it doesn't know?). For teams deploying coding agents in enterprise environments, this means implementing explicit escalation mechanisms and training agents to recognize uncertainty signals, adding latency for human review but reducing hallucinated defects that reach production. The trade-off is straightforward: slower deployment cycles with better reliability versus fast but unreliable autonomous execution.
Limitations and When Not to Use This
The paper measures escalation on synthetically constructed tasks where blockers are pre-defined by humans; it doesn't demonstrate that agents can recognize novel, unlabeled ambiguities in the wild where ground truth uncertainty hasn't been pre-annotated. Real production scenarios involve far more nuanced forms of incomplete specifications than a benchmark can enumerate—implicit cultural context, legacy system quirks, and domain-specific conventions that even experienced engineers debate. The approach assumes a human reviewer is always available and willing to respond, which doesn't address resource constraints in some production environments or the problem of humans not catching subtle specification gaps either. Additionally, the benchmark likely requires careful task engineering to maintain consistency in blocker types; it's unclear how generalizable the evaluation methodology is across different domains, programming languages, or types of specifications.
Research Context
This work builds on recent research identifying that frontier LLM-based coding agents (Claude, GPT-4, etc.) have high execution capability but poor judgment under uncertainty, a gap that traditional benchmarks like HumanEval or SWE-Bench don't expose because they provide complete specifications. It addresses a limitation in existing evaluation frameworks that optimize purely for success rate without modeling the human-in-the-loop reality of software development. HiL-Bench contributes to the broader research direction of measuring alignment between AI behavior and human expectations—specifically the expectation that agents should recognize their own uncertainty and escalate rather than confabulate. The work opens a new evaluation dimension for agent benchmarks, likely to inspire follow-up research into training agents to recognize uncertainty signals, improving human-agent collaboration metrics, and studying how to calibrate agent confidence with actual task solvability.
:::tip Subscribe Get weekly breakdowns of papers like this in AI Letters - the newsletter for engineers building production AI systems. :::
