Ambig-SWE: Interactive Agents to Overcome Underspecificity in Software Engineering

Paper · arXiv 2502.13069 · Published February 18, 2025
Conversation Architecture and Structure

AI agents are increasingly being deployed to automate tasks, often based on underspecified user instructions. Making unwarranted assumptions to compensate for the missing information and failing to ask clarifying questions can lead to suboptimal outcomes, safety risks due to tool misuse, and wasted computational resources. In this work, we study the ability of LLM agents to handle underspecified instructions in interactive code generation settings by evaluating proprietary and open-weight models on their performance across three key steps: (a) detecting underspecificity, (b) asking targeted clarification questions, and (c) leveraging the interaction to improve performance in underspecified scenarios. We introduce Ambig-SWE, an underspecified variant of SWE-Bench Verified, specifically designed to evaluate agent behavior under ambiguity and interaction. Our findings reveal that models struggle to distinguish between well-specified and underspecified instructions. However, when models interact for underspecified inputs, they effectively obtain vital information from the user leading to significant improvements in performance, up to 74% over the non-interactive settings, underscoring the value of effective interaction. Our study highlights critical gaps in how current state-of-the-art models handle missing information in complex software engineering tasks and structures the evaluation into distinct steps to enable targeted improvements1.

Introduction. Large Language Models (LLMs) are increasingly used as chatbots in task-oriented workflows to improve productivity (Peng et al., 2023; Brynjolfsson et al., 2023), with the user providing a task instruction which the model completes. Due to the interactive nature of chatbots, the performance depends on the information provided in the user’s prompt. Users often provide non-descriptive instructions, which poses critical challenges in successfully completing the task (Chowdhury et al., 2024). The missing information can lead not only to erroneous outcomes, often based on hallucinations, but also to significant safety issues (Kim et al., 2024; Karli & Fitzgerald, 2023).

This underspecificity can lead to severe consequences in task automation, where AI agents are equipped with powerful tools (Wang et al., 2024b; Lu et al., 2024; Huang et al., 2024; Zhou et al., 2024a). In software engineering settings, agents navigate complex codebases, make architectural decisions, and modify critical systems—all while operating with potentially incomplete instructions. When human developers face such lack of information, they engage in clarifying dialogue to gather context (Testoni & Fernández, 2024; Purver, 2004). However, current AI systems proceed with incomplete understanding, leading to costly mistakes and misaligned solutions.

In this work, we systematically evaluate the interaction capabilities of commonly used open and proprietary LLMs when addressing underspecified instructions in agentic code settings (§2). We define underspecificity as missing information that would prevent an expert from being able to create a successful solution, using the same definition as SWE-Bench Verified annotation rubric. Previous work on underspecificity (Chen et al., 2025; Kim et al., 2024) typically focuses on cases where only a single detail is missing. In contrast, real-world agentic tasks often involve multiple, interdependent gaps in specification that emerge over the course of a trajectory—spanning file locations, design decisions, and constraints—making the problem substantially harder and motivating new evaluation frameworks. Our work makes the following contributions:

Related work. Code generation benchmarks Ambiguity is a closely related domain to underspecificity, where model misinterpretation of user intent is a common failure mode. In both cases, clarification becomes necessary, though the causes differ. Ambiguity stems from vague or multi-interpretable inputs, while Interactive ML systems In interactive systems, ambiguity is often categorized and addressed via targeted clarification. Niwa & Iso (2024) introduces a taxonomy of instruction ambiguities, such as unclear output formats or contextual constraints, and applies disambiguation strategies accordingly. Similarly, Wang et al. (2024a) evaluates LLM behavior on ambiguous tool-use instructions, and Feng et al. (2024) uses reinforcement learning to optimize intervention. Although these systems successfully reduce ambiguity, underspecificity poses a subtler challenge, where there is missing context, leading to hallucinated assumptions and requires agents to clarify.

LLMs and ambiguity Modern LLMs are not explicitly trained to resolve ambiguity via interaction (Zhang et al., 2024), but instruction tuning improves their performance when guided by prompt engineering (White et al., 2023). Ambiguity detection has been approached through uncertainty estimation (Zhang & Choi, 2023; Park et al., 2024) and self-disambiguation (Keluskar et al., 2024; Sterner, 2022; Sumanathilaka et al., 2024). For example, Kim et al. (2024) quantifies ambiguity using information gain. Although inference-only methods are cost-effective, they are less robust than training-based approaches for handling ambiguity. Chen et al. (2025) address disambiguation in conversational settings, but typically with only a single missing detail. In contrast, we study underspecification in complex agentic tasks, where multiple interdependent gaps can arise dynamically, and agents may take many steps before recognizing missing information.

Method. Agent environment The OpenHands (Wang et al., 2024b) agentic framework equips the LLM with an interactive environment that extends its capabilities beyond static code generation. The agent operates within a structured execution environment where it can iteratively refine code, plan tasks, and run commands using integrated tools. It has the ability to edit files, break down complex instructions into executable steps, and execute both Bash and Python scripts within a secure sandbox. This controlled environment enables the agent to analyze execution outputs, detect and debug errors, and refine its approach based on observed results, ensuring adaptability and correctness in solving complex programming tasks.

Selected models We evaluate two proprietary models from the same family—Claude Sonnet 3.5 and its successor Claude Sonnet 4 (Anthropic, 2024b; PBC, 2025)—to study how improvements in model capabilities influence interaction behavior. We also include Claude Haiku 3.5 (Anthropic, 2024a), which shares similar training methodology but differs substantially in parameter count, allowing us to examine the effect of model scale.

User proxy Following related works which used LLMs to simulate users with full information (Li et al., 2024), we employ GPT-4o (Ahmad & OpenAI, 2024) as a user proxy to simulate user-agent interactions. This design choice is informed by prior work showing that LLMs can approximate simple user behaviors and produce natural-sounding responses in controlled settings (Xu et al., 2024; Zhou et al., 2024a). The goal is not to simulate real users but provide the information injection to the trajectory and analyze model behaviors. The proxy receives the full issue and responds only using information explicitly present in it, preserving the original knowledge boundaries of the issue reporter. If a queried detail is missing, the proxy responds with I don’t have that information, thereby avoiding hallucinations. This conservative design makes it possible to isolate the agent’s ability to detect and recover from missing information. The full prompt is provided in §A.2.2.

We use three distinct settings to evaluate models across the 500 issues from SWE-Bench Verified shown in Figure 2 and described below.

• Full: This is the traditional SWE-Bench setting. The coding agent is provided with the fully specified task and the interaction is disabled. It represents the agent’s performance in an ideal scenario, where the agent has access to full information. • Hidden: A summarized version of the issue is provided to the coding agent with the user-agent interaction disabled to mimic the lack of detail that can occur in task descriptions. We do not give any interaction-related instructions, and all models default to non-interactive behavior. Specific details are hidden from the coding agent. • Interaction: The coding agent receives a summarized task, while the user proxy model receives the fully specified task. Interaction is enabled through prompting, allowing the agent to query the proxy for specific details. The models do not interact without an explicit prompt. In addition to the full issue, the proxy has access to file locations that need modification and can provide them when queried. This setup allows us to evaluate which models proactively seek navigational information and examine how this interaction influences the success of the solution process across models.

Discussion. This hints towards better training practices that can lead to better integration of the new information.

This experiment highlights the importance of interaction in handling underspecificity. Since many real-world software engineering problems are underspecified, interactive systems are essential for ensuring alignment and reducing safety risks. However, current models default to non-interactive behavior even when faced with severe lack of information and struggle to match the performance seen in well-specified settings. While interactive trajectories show performance gains over non-interactive approaches for underspecified inputs, there is a wide gap to the full performance, indicating strong potential for improvement.

Takeaway: Proprietary models such as Claude Sonnet 3.5 and Haiku 3.5 effectively leverage interaction, recovering up to 80% of the performance gap, and newer high-capability models (e.g., Claude Sonnet 4 and Qwen 3 Coder) further improve in combining interaction with stronger underlying competencies. However, Qwen 3 Coder often rigidly follows predetermined protocols despite explicit corrective guidance, and interaction yields no efficiency gains, as higher effectiveness is not accompanied by fewer steps. These trends suggest that, as capability scales, current training paradigms may insufficiently promote adaptive integration of interactive feedback, highlighting the need for training approaches that do not prioritize task completion alone.

Takeaway: Models default to non-interactive behavior unless explicitly prompted, yet prompt engineering alone proves insufficient for reliable underspecificity detection. While Claude Sonnet 4 demonstrates partial success, most models struggle to distinguish well-specified from underspecified tasks. Particularly concerning is Qwen 3 Coder’s complete non-responsiveness to interaction prompts (100% FNR), suggesting fundamental limitations in certain training approaches. These findings indicate that handling underspecified tasks requires dedicated training than prompt engineering alone. information (0.136 vs 0.135) despite vastly different task performance (39.6% vs 26.8%). These disconnects reveal that how models integrate information matters as much as how much they extract.

Qualitative analysis of question-answer pairs (Figure 4) reveals three distinct approaches with different tradeoffs:

(1) Question quantity and user burden. Llama asks too few questions (2.61 avg.) with overly general phrasing ("Are there any existing workarounds?"), yielding minimal information. Qwen 3 asks the most (6.02 avg.), extracting maximum information but risking user overwhelm. As Table 1 shows, this high volume does not translate to better performance. Qwen’s resolve rate actually worsens with navigational information, suggesting rigid protocol-following rather than adaptive integration.

(2) Exploration efficiency. Claude Sonnet models (3.80-4.03 questions) achieve information gain comparable to Deepseek and Qwen (4.57-6.02 questions) by exploring the codebase first, then asking only what cannot be independently discovered. This exploration-first strategy produces nearly identical questions across Claude Sonnet 3.5 and 4 for some issues (Table 7), indicating consistent training. In contrast, Deepseek and Qwen ask immediately, including questions about implementation details recoverable from code.

(3) Answerability and specificity. Deepseek’s highly specific implementation questions often exceed user knowledge, wasting interaction turns. Claude targets behavioral aspects and concrete failure modes instead, better matching realistic user knowledge.

Conclusion. Our evaluation of proprietary and open-weight language models in agentic frameworks highlights how underspecificity poses a core challenge in software engineering tasks. Effective performance requires (i) detecting missing information, and (ii) acquiring it through precise, targeted interaction before (iii) attempting a solution with the full information.

Despite these limitations, several clear trends emerge from our experiments:

• With a brief round of clarification, leading proprietary models recover much of their fully-specified performance, while earlier open-weight models lag. Recent capable models blur this distinction. However, although interaction improves task success as capability scales, it does not yield efficiency gains, indicating that current training practices insufficiently optimize for effective integration of interactive feedback. • LLMs rarely initiate clarification unprompted, and their sensitivity to prompt framing makes them brittle in noisy, real-world contexts. • The most effective questions are specific, actionable, and task-level, while vague prompts or implementation details recoverable from the codebase add little value.

Overall, a gap remains between underspecified and fully specified resolution rates. Closing it will require open-weight models to adopt stronger interaction strategies and proprietary models to engage more proactively. As models are trained to perform longer horizon tasks, they must still be trained to appropriately incorporate user inputs into the overall solution effectively and efficiently. Ambig-SWE provides a blueprint for decomposing resolution into multiple steps, enabling finer-grained analysis of where models succeed or fail. While we focus on software engineering, the methods and insights can extend to other complex, real-world agentic tasks. Thus, our work offers both a diagnostic framework for agent evaluation and a roadmap toward more robust, adaptive, and user-aligned agents that can thrive in underspecified and dynamic environments.

Limitations. Our analysis is subject to a few scope constraints. Underspecificity detection is measured only within the first three turns, as models rarely recover if they fail to engage early. Question quality is approximated via latent vector changes that weigh all information equally, though models may prioritize details differently. Finally, our simulated user proxy may be more cooperative than real users, though we mitigate this by limiting interaction turns and focusing them tightly on the task.

Lines of inquiry this paper opens 24

Research framings built by reading the notes related to this paper — the questions it feeds into.

Do language models learn genuine linguistic structure or just surface patterns? How reliably can detectors distinguish human from AI-generated text? Why does expressing understanding diverge from achieving genuine comprehension? What determines whether models prioritize training knowledge over retrieved context? How susceptible are language models to adopting and maintaining false beliefs? How much do LLMs rely on surface-level prompt characteristics rather than semantic meaning? Why do language models systematically fail at ambiguity recognition? Does language meaning require embodied interaction to properly emerge? Should LLMs ask clarifying questions when faced with ambiguous inputs? How can language models build genuine communicative grounding rather than presume it? Do language models learn true linguistic principles or just surface patterns? What drives human overreliance on confident but inaccurate LLM outputs? What psychological and functional roles do emotions play in dialogue?