betaFeedback

WorksComputer Science

Interactive Prompting Assistant: Just-in-Time Requirement Clarification for Agentic Software Development

Abstract

As LLM-based software agents increasingly generate code from natural-language requirements, developers need assistance not only in writing code, but also in writing the prompts that specify what the code should do. We introduce the Interactive Prompting Assistant (IPA), an IDE-like assistant that provides just-in-time requirement clarification while a developer is still composing a problem description. IPA continuously observes the evolving prompt and selectively surfaces clarification questions when potential omissions or inconsistencies become sufficiently evident. To provide timely assistance without invoking an expensive reasoning model at every token, IPA separates when to verify from what to ask. A lightweight interaction controller processes the prompt token by token and learns to Wait, Track, or Verify an emerging concern; a larger reasoning model is invoked only when verification is warranted to determine whether an issue is genuine and generate an evidence-grounded question. We evaluate IPA on 100 HiL-Bench software-engineering tasks containing 353 requirement blockers, using LLMs as simulated prompt authors. Across three author models, incorporating within-turn IPA before a matched post-hoc clarification stage improves blocker response by 4.5-13.0 percentage points over post-hoc clarification alone. Blocker-level transitions further show that IPA acts particularly strongly as a contextual reminder: recovery of previously omitted requirements occurs 2.3-5.0x more often than newly activated repairs of ambiguities or contradictions. These results demonstrate the complementary value of progressive, within-turn clarification for prompt authoring in agentic software development.

Introduction

Integrated development environments (IDEs) have long assisted programmers while they write code. Rather than waiting until an implementation is complete, modern IDEs provide contextual assistance, including code completion, API recommendations, diagnostics, and suggested edits [15, 17].

The emergence of LLM-based software agents is changing the artifact through which humans increasingly direct software development. Agentic software development systems can plan changes, navigate repositories, edit multiple files, execute programs, and test their implementations [21, 24]. Consequently, for many agent-driven development tasks, a developer expresses the desired software behavior through a natural-language prompt, often in the form of a problem description, feature request, or set of requirements, and delegates substantial implementation work to an agent. This shift raises a natural question: if traditional IDEs assist humans while they write code, what should assist humans while they write the prompts from which software agents generate code?

Such assistance is particularly important because natural-language requirements are rarely perfect when first written. Requirements may omit behavior that the author implicitly assumes, leave choices underspecified, or contain statements that conflict with one another. Ambiguity, incompleteness, and inconsistency have long been fundamental concerns in requirements engineering [7, 10]. Their consequences become especially important in LLM-based development: when an implementation is generated directly from a problem description, information left implicit in the prompt must often be guessed by the model. Recent work has shown increasing interest in detecting and repairing ambiguous natural-language requirements for code generation [9, 14].

The Interactive Prompting Assistant (IPA) is an IDE-like assistant that provides just-in-time requirement clarification while a developer is still composing a problem description. IPA continuously observes the evolving prompt and selectively surfaces clarification questions when potential omissions or inconsistencies become sufficiently evident. To provide timely assistance without invoking an expensive reasoning model at every token, IPA separates when to verify from what to ask. A lightweight interaction controller processes the prompt token by token and learns to Wait, Track, or Verify an emerging concern; a larger reasoning model is invoked only when verification is warranted to determine whether an issue is genuine and generate an evidence-grounded question. We evaluate IPA on 100 HiL-Bench software-engineering tasks containing 353 requirement blockers, using LLMs as simulated prompt authors. Across three author models, incorporating within-turn IPA before a matched post-hoc clarification stage improves blocker response by 4.5–13.0 percentage points over post-hoc clarification alone. Blocker-level transitions further show that IPA acts particularly strongly as a contextual reminder: recovery of previously omitted requirements occurs 2.3–5.0× more often than newly activated repairs of ambiguities or contradictions. These results demonstrate the complementary value of progressive, within-turn clarification for prompt authoring in agentic software development. We therefore envision an interactive prompting assistant (IPA): an analogue of an IDE coding assistant for the prompt-writing stage of agentic software development. Instead of primarily completing the user’s natural-language text, our current focus is to help the user make the intended software behavior sufficiently explicit and internally consistent. As a developer writes a problem description, the assistant observes the evolving prompt and identifies points at which an important requirement appears to be missing, underspecified, or inconsistent with information already stated. It can then pose a targeted clarification question, for example, asking which behavior is intended in a boundary case or which of two conflicting constraints should take precedence. The user’s answer becomes part of the evolving prompt, allowing the problem description to be corrected before code generation is committed to an unintended interpretation.

Existing clarification approaches demonstrate the value of asking users about incomplete or ambiguous requirements, but generally operate after a complete requirement or conversational turn has been submitted. For example, a submitted requirement is analyzed and a human is asked clarification questions before generating code, while recent benchmarks evaluate clarification through multi-turn question-answer interaction [6, 14]. These approaches address the important problem of what should be clarified, but leave a complementary interaction point underexplored: assisting the author while the requirement itself is still being composed.

To be complementary to the post-hoc approach, we advocate progressive requirement clarification, in which issues are addressed as they become sufficiently evident. We realize this principle through just-in-time clarification: continuously observing the evolving prompt while selectively invoking deeper verification at appropriate points during authoring. The central research problem is how to interact with a human during his/her prompting for clarification questions.

To address that, we propose a two-model architecture, which separates the problem of when to verify from the more expensive problems of whether a genuine requirement issue exists and what should be asked. A lightweight interaction model continuously processes the evolving prompt and determines whether to wait, track, or verify. Wait indicates that the current prefix provides insufficient evidence of an issue; track indicates that a potential issue has begun to emerge but more context is needed; and verify indicates that sufficient evidence has accumulated to justify invoking a larger verification model. The interaction model therefore does not itself determine the missing requirement, resolve an inconsistency, or generate a clarification question. Instead, it acts as an online controller that decides when deeper semantic reasoning becomes worthwhile.

To keep interaction inexpensive, the controller uses frozen Gemma 4 12B token embeddings rather than running the full transformer during authoring. A lightweight GRU with causal attention tracks the evolving prefix, while separate issue and verification heads estimate whether a concern is emerging and whether enough evidence has accumulated to invoke the verifier. A small stateful automaton constrains transitions among Wait, Track, and Verify. When the interaction model emits Verify, the larger verification model examines the current problem-description prefix to determine whether the suspected omission, underspecification, or inconsistency is genuine and, when appropriate, generates a targeted clarification question. After the human responds or revises the description, the updated prompt re-enters the incremental interaction process. By learning where in the token stream deeper verification should be triggered, our approach turns requirement clarification from a post-hoc operation into assistance integrated directly into prompt authoring. In this sense, the interaction model plays a role analogous to an IDE mechanism that decides when to surface a completion, warning, or recommendation while a human is writing code.

In summary, this paper makes the following contributions:

  1. Just-in-time requirement clarification. We formulate interactive prompting a new setting for requirements clarification, in which potential omissions/inconsistencies are identified progressively from an evolving description.

2. Decoupled interaction and verification. We introduce a two-layer architecture that separates low-cost, continuous interaction control from expensive verification and question generation. This enables selective verification without executing the larger reasoning model at every token.

3. Empirical evaluation. We evaluate IPA and compare with unassisted, post-hoc, chunked-interaction, and token-level interaction settings. Our evaluation separates downstream authoring outcomes, clarification-question quality, and intervention timing, allowing us to study both the benefits and limitations of within-turn clarification.

Motivation

Consider a developer incrementally composing a requirement for an online checkout system, as shown in Figure 1. Under interactive prompting (right), IPA observes the prefix as it is typed and can surface a lightweight question as soon as an issue becomes evident.

Composing a checkout-system prompt under two interaction styles

Figure 1. Composing a checkout-system prompt under two interaction styles. Left: turn-based prompting waits until the description is complete. By then, a missing payment-failure requirement [1], a guest-checkout versus account-bound-order inconsistency [2], and an implicit no-fee cancellation assumption [3] have all accumulated. Right: IPA operates within the human turn and surfaces each issue as soon as the evolving prefix makes it evident. After these in-situ revisions, the prompt is completed with no remaining issues.

1. IPA as a reminder of missing requirements. At the point [1] in the prompt in Figure 1 (Left), nothing already written is incorrect. The developer has specified payment methods and begun describing checkout, but has not said what should happen if payment fails. IPA surfaces a reminder:

What should happen if payment fails or is not confirmed?

Still in the context of checkout, the developer adds:

If payment fails or times out, the cart remains unchanged and no order is created.

IPA here is a timely reminder of a boundary case that is easy to overlook while the prompt still focuses on the successful usage flow. Because the question appears while that design context is still salient, the missing behavior can be added with a local edit. If the same reminder is deferred the end, the developer must return to an earlier topic after attention has already moved on. Later requirements may then silently assume that payment always succeeds, and an implementation generated from the incorrect, yet completed prompt must guess the failure behavior.

2. IPA as early recognition of a root inconsistency. A different situation arises at [2]. The developer has allowed guest checkout, but then requires every order to be associated with the customer’s account and shown in My Orders. These two statements cannot both hold. When this first clash appears, it is still local, so both the issue and its root cause—whether a purchaser must have an account—are easy to see. IPA can intervene as soon as the clash is sufficiently evident:

You previously allowed guest checkout, but orders are now required to be associated with an account. Should customers be required to sign in or create an account before completing checkout?

The developer revises the earlier requirement to: “Customers may browse and add products to the cart without signing in, but they must sign in or create an account before completing checkout.”

This early correction does more than repair the visible issue. The remainder of the prompt is written under the corrected assumption that every purchaser has an account, making later account-dependent behaviors naturally consistent rather than further symptoms of the same conflict. Fixing the root early can therefore avoid downstream issues.

3. IPA as correction of an implicit assumption the developer still treats as correct. Not every problematic statement is an omission or a contradiction with prior text. After the guest-checkout decision has been repaired, a developer continues and writes that customers may cancel an order with no fee, and that canceled orders should be refunded immediately ([3]). From his view, these statements are still reasonable: they express a preferred policy, not an error. If the assumption is left unchallenged, they will keep elaborating the prompt as if it were correct. IPA can intervene while this is still being authored, not by asserting a contradiction, but by questioning the implicit assumption:

Have you considered how the order’s processing stage and seller involvement affect cancellation fees and refunds?

The developer then updates the current prompt: “Customers should be able to sign in later and cancel an order with a restocking fee. Canceled orders should be refunded after seller confirmation and returned to inventory…” Subsequent text is then written under a corrected policy rather than under an unexamined default. Without such as a reminder, the author will not self-correct, as (s)he does not recognize any issue. In the interactive path of Figure 1, the correction happens in place and the developer finishes with no remaining issues. Without IPA, the biased policy is fully spelled out before any question is asked, and is entangled with [1] and [2].

The three cases are different in kind—an omission, a root inconsistency, and a biased assumption—but each is cheapest to resolve at the moment it first becomes evident. A reminder is useful while the relevant context is still being authored. A root inconsistency is easiest to localize when only the first clash is visible, and cheapest to repair before later requirements are written on top of it. An implicit assumption is most effectively challenged before the developer has elaborated it into further statements that still look correct from their point of view. This demonstrates the benefit of an IPA: observes the prompt as it is written and decides when a question is worth asking.

Interactive Prompting Assistant (IPA)

IPA assists a developer while a prompt is being written. The focused part is not only what to ask, but when. Asking too late allows issues to accumulate, whereas invoking semantic reasoning after every token is unnecessarily expensive and risks premature interaction. We thus separate IPA into an interaction layer and a reasoning layer (Figure 2). The lightweight interaction layer continuously follows the evolving prompt and decides when deeper analysis is warranted. Only then is the larger reasoning model invoked to decide whether an issue is genuine and, if so, what clarification to ask.

Figure 2. Two-layer IPA Architecture. The interaction layer stays with the author as they type and either passes or calls reasoning on the current prefix. Reasoning may ask a question; the author may revise; interaction continues on the updated text.

Two-Layer Architecture

Let the prompt be an online stream x1,x2,…x_1, x_2, \ldots. At time tt only the prefix p1:t=x1⋯xtp_{1:t} = x_1 \cdots x_t exists (or ptp_t for short). That prefix is incomplete: a gap that looks missing now may be written at t+kt+k, and a clash may appear only after the next sentence. The interaction layer is an online controller:

I(pt,st−1)=(dt,st),dt∈{hold,process},(1)I(p_t, s_{t-1}) = (d_t, s_t), \qquad d_t \in\{\text{hold}, \text{process}\}, \tag*{(1)}

where ptp_t is the current prompt, sts_t is the controller’s internal state, and dtd_t determines whether deeper verification should be invoked.

Section 3.2.2 refines this binary interface into Wait, Track, and Verify, where Wait and Track both correspond to dt=holdd_t = \text{hold} and Verify to dt=processd_t = \text{process}.

A hold decision allows authoring to continue without calling the reasoning layer. A process decision invokes the reasoning layer on the current prompt:

qt={R(pt),dt=process,ε,dt=hold.(2)q_t = \begin{cases} R(p_t), & d_t = \text{process},\\ \varepsilon, & d_t = \text{hold}. \end{cases} \tag*{(2)}

The reasoning layer returns either a clarification question or ε\varepsilon, indicating that no question is warranted. A question is displayed only when qt≠εq_t \ne\varepsilon. This separation distinguishes three events: recognizing a potential issue, invoking semantic verification, and displaying a clarification question. The first two need not interrupt the author; only the third creates a visible interaction. When the author revises an earlier portion of the prompt, the controller state is updated to reflect the revised text rather than continuing from the old prefix. Interaction then resumes using the updated prompt.

Key Idea 1 (Interaction and reasoning). While someone is writing, a good partner does two different things. They follow the utterance, and they ask only when a question would help. IPA splits those stances. Interaction decides when to look; reasoning decides whether to ask and what.

The rest of this section instantiates II. We first describe a simple chunked controller in the spirit of current turn-like assistance, then show why surface-form chunks do not match how ideas are produced, and finally propose a token-level controller that listens as a human listener would.

Interaction Layer

Eq. (1) only requires a decision dt∈{hold,process}d_t \in\{\text{hold}, \text{process}\}. How that decision is made is the design of the interaction layer. We consider two controllers that share the same reasoning layer R. The first is a simple, training-free schedule that invokes reasoning at surface-form boundaries. The second is our learned token-level controller, which continuously observes the evolving prefix and invokes reasoning only when the available evidence indicates that a potential concern has become sufficiently mature for verification. Figure 3 contrasts the two strategies.

Figure 3. Two ways to implement the interaction layer on the same prefix. (a) Chunking waits for a surface-complete span, as current clarification pipelines wait for a finished requirement or turn, then calls reasoning—possibly while an idea is unfinished, or after a clash is already written. (b) Token-level interaction follows the evolving prefix, tracks an emerging concern, and invokes reasoning once sufficient evidence has accumulated.

Chunked Interaction

Current clarification methods already decide when in a coarse way: they wait for a finished requirement, then analyse it. ClarifyGPT takes a complete problem statement, tests whether it is ambiguous, and only then asks the user [14]. Repair of ambiguous descriptions [9] and multi-turn benchmarks such as ClarifyCodeBench [6] likewise treat a user turn—a submitted requirement or message—as the unit that is ready to be examined. The shared assumption is: once a surface-complete span has arrived, it is time to reason.

Chunked interaction is that assumption, moved into the typing loop. Instead of waiting for the whole prompt, we wait for a small span of prose—a reproducible proxy for “a finished thought.” We segment p1:tp_{1:t} into units at sentence-final punctuation or a blank line (abbreviations and file suffixes are not sentence ends). A unit longer than WW words is split every WW words, so a run-on paragraph cannot defer looking forever. Let btb_t indicate whether a chunk ends at token tt, and let Nt=∑i=1tbiN_t = \sum_{i=1}^{t} b_i denote the number of completed chunks. Given a checkpoint stride KK, the chunked controller is

dt={process⁡,bt=1∧Nt mod K=0,process⁡,if prompt submission occurs at t,hold⁡,otherwise.(3)d_t = \begin{cases} \operatorname{process}, & b_t = 1 \land N_t \bmod K = 0, \\ \operatorname{process}, & \text{if prompt submission occurs at } t, \\ \operatorname{hold}, & \text{otherwise.} \end{cases} \tag*{(3)}

The controller invokes the same reasoning layer as IPA. Thus, the two approaches differ in their verification schedules rather than their semantic verification capabilities.

Why chunking is not enough. A period is not the end of an idea. The author may have closed a sentence while the thought—a condition, an exception, the other half of a policy—is still being formed. Chunking does not see that: Eq. (3) fires because a surface span ended, so reasoning is asked to analyse a prefix the human does not yet consider finished (the first process in Figure 3a). The dual failure is just as important. An omission or contradiction can become locally visible inside a sentence, before the next chunk boundary. Until that boundary, interaction holds, and the author may keep writing under the unexamined assumption (the clash at “account” in Figure 3 is visible before the second checkpoint). In short, chunks follow punctuation, not meaning. They are simple and reproducible, and they reflect how current systems wait for a completed turn [6, 9, 14], but they do not capture when the evolving prompt contains sufficient evidence to justify deeper verification.

Token-Level Interaction

We therefore let interaction run on every token, in step with typing (Figure 3b). The analogue is ordinary conversation: one person speaks, the other hears proactively—they follow each word, notice a concern as it starts to form, keep listening until the concern is clear enough, and only then take a turn. They do not wait for a paragraph break, and they do not interrupt at the first unclear word. Figure 4 is the network we train for that policy.

Figure 4. Token-level controller. Each token’s frozen Gemma embedding is encoded by a GRU with causal attention. The two heads choose ata_t, and reasoning runs only on VERIFY.

The controller chooses among three actions at∈{WAIT,TRACK,VERIFY}a_t \in\{\text{WAIT},\text{TRACK},\text{VERIFY}\}:

  • WAIT: The available prefix does not currently provide sufficient evidence of a concern. No reasoning call is made (dt=holdd_t = \text{hold}).

  • TRACK: A potential concern is emerging, but the available evidence is not sufficient to justify deeper verification. The controller continues observing the evolving prompt (dt=holdd_t = \text{hold}).

  • VERIFY: The accumulated evidence warrants invoking the reasoning model on the current prompt prefix (dt=processd_t = \text{process}).

Neither WAIT nor TRACK produces a user-visible interaction. A VERIFY action invokes the reasoning model, which may either return a clarification question or remain silent (qt=εq_t = \varepsilon). Consequently, verification and interruption are separate events. Multiple concerns may therefore contribute to the controller’s decision to invoke verification. When verification is triggered, the reasoning layer examines the available prefix and selects at most one sufficiently grounded clarification question.

State-transition constraints. Figure 5 constrains the action sequence so the controller does not jump straight to a question or ask twice in a row. From WAIT, it may stay when there is no issue, or enter TRACK on a concern. From TRACK, it returns to WAIT when the prefix is normal, or enters VERIFY when the evidence is clear enough. After VERIFY, it returns to WAIT if no issue, or to TRACK when more detail is needed. Illegal transitions are masked during training and inference:

Figure 5. Allowed transitions of the token-level controller.

at=arg⁡max⁡a∈A(at−1)  ℓt(a),(4)a_t = \underset{a \in\mathcal{A}(a_{t-1})}{\arg\max}\; \ell_t(a), \tag*{(4)}

where A(⋅)\mathcal{A}(\cdot) is the allowed-next set in Figure 5 and ℓt\ell_t are the action logits below.

Architecture. Calling a 12B transformer on every keystroke would defeat the layer split. Each token xtx_t is represented by a frozen Gemma 4 12B embedding et∈R3840e_t \in\mathbb{R}^{3840}, looked up from the embedding table (no LM forward pass). A projection et↦e~t∈R512e_t \mapsto\tilde{e}_t \in\mathbb{R}^{512} is consumed by a two-layer GRU with causal attention, yielding a state hth_t that may use p1:tp_{1:t} but not the future:

ht,  st=Enc⁡(e~t,st−1).(5)h_t,\;s_t = \operatorname{Enc}(\tilde{e}_t,s_{t-1}). \tag*{(5)}

Two heads share hth_t. The issue head ztissz_t^{\mathrm{iss}} asks whether a concern is becoming visible (leave WAIT for TRACK). The verify head ztverz_t^{\mathrm{ver}} asks whether that concern is mature enough to process. We assemble

ℓt(WAIT)=−ztiss,ℓt(TRACK)=ztiss,ℓt(VERIFY)=ztiss+ztver,(6)\begin{aligned} \ell_t(\mathrm{WAIT}) &= -z_t^{\mathrm{iss}},\\ \ell_t(\mathrm{TRACK}) &= z_t^{\mathrm{iss}},\\ \ell_t(\mathrm{VERIFY}) &= z_t^{\mathrm{iss}} + z_t^{\mathrm{ver}}, \tag*{(6)} \end{aligned}

We then apply the transition mask in Eq. (4). The issue head controls the relative evidence for remaining in WAIT versus tracking a concern, while the verification head increases the score of VERIFY relative to TRACK. Because VERIFY is reachable only from TRACK, verification requires the controller to have entered the tracking state on a preceding token. The previous action at−1a_{t-1} and track age τt\tau_t additionally condition the action prediction, allowing the controller to distinguish a newly emerging signal from a concern that has persisted as the prefix grows.

3.2.3 Interaction Policy. The interaction controller must distinguish between the point at which a potential requirement concern first emerges and the later point at which the available evidence is sufficient to justify semantic verification. We supervise the controller using two token positions for each annotated issue jj: the concern onset tjonsett_j^{\mathrm{onset}} and the verification point tjverifyt_j^{\mathrm{verify}}, where tjonset≤tjverifyt_j^{\mathrm{onset}} \le t_j^{\mathrm{verify}}. The concern onset marks the first token at which the evolving prompt provides evidence of a potential issue. The verification point marks the token at which that concern has become sufficiently clear to warrant invoking the reasoning layer. These positions induce the token-level actions used for training: tokens before tjonsett_j^{\mathrm{onset}} are labeled WAIT; tokens from tjonsett_j^{\mathrm{onset}} up to, but not including, tjverifyt_j^{\mathrm{verify}} are labeled TRACK; and tjverifyt_j^{\mathrm{verify}} receives a one-token VERIFY label. When multiple concerns are active at the same token, we assign the highest-priority action, with VERIFY > TRACK > WAIT.

The two positions differ by issue type. For potentially missing information, onset occurs once the relevant functional context is available, while verification waits until the prefix provides sufficient evidence that the behavior or constraint remains unspecified. For an inconsistency, onset marks the emergence of potentially conflicting requirements, while verification occurs once the prefix provides sufficient evidence of the conflict.

We train the controller on the resulting WAIT–TRACK–VERIFY action sequences while applying the transition constraints of Eq. (4). Although the training labels are constructed from annotated authoring traces, the controller at token tt receives only the prefix available through tt and cannot access future text. It therefore learns from the evolving prefix both when a concern begins to emerge and when sufficient evidence has accumulated to justify deeper semantic reasoning. § 4.2.3 describes the annotation procedure and evaluates the learned verification timing.

Reasoning Layer

The interaction layer determines when deeper analysis is warranted, but it does not determine whether a requirement issue is genuine or what clarification should be presented. These responsibilities belong to the reasoning layer. When invoked, the reasoning model receives the current prompt prefix and applicable clarification history. It does not have access to future prompt content. Its task is to determine whether the available evidence supports a useful clarification question.

We distinguish two principal issue categories.

Potentially missing information. The prompt leaves an important behavior, constraint, or design choice unspecified. Because the prompt is still being written, absence alone does not establish an error. The reasoner must determine whether the available context supports a timely reminder.

Inconsistent information. Two or more requirements express conflicting constraints or assumptions. The reasoner identifies the conflicting statements and formulates a question that allows the developer to clarify the intended behavior.

Evidence-grounded clarification. For each invocation, the reasoning model returns either ε\varepsilon, indicating that no sufficiently grounded clarification is warranted, or a structured clarification qt=(κt,Et,Qt)q_t = (\kappa_t, E_t, Q_t), where κt\kappa_t denotes the issue category, EtE_t identifies the supporting evidence in the current prompt, and QtQ_t is the user-visible clarification question. For an inconsistency, the evidence identifies the conflicting requirements. For potentially missing information, it identifies the existing functional context that makes the unspecified behavior relevant. The reasoner must ground its question in the available prefix rather than infer that an unstated requirement is necessarily erroneous. When the evidence is insufficient, it returns ε\varepsilon.

Revision and continuation. A displayed question is nonmodal: the author may answer, dismiss, or defer it. If the author answers or edits the requirement, the resulting prompt becomes the new input to the interaction layer, whose state is recomputed from the revised text as needed. IPA surfaces clarification opportunities without automatically modifying the author’s requirements.

Empirical Evaluation

RQ1. [Simulated Authoring] How does within-turn clarification affect simulated authors’ responses to requirement blockers, particularly beyond matched post-hoc clarification?

RQ2. [Question Quality in Issue Detection] How relevant are the clarification questions generated by IPA and post-hoc clarification, and how completely do they cover the registered blockers?

RQ3. [Latency] How soon after an issue appears in the prompt can IPA return a question?

Models. We use DeepSeek-V4-Flash, Kimi-K2.5 and Grok 4.1-Fast as candidate models, GPT-5.6 Luna as the judgement model, Gemma-4-12B embeddings for the interaction layer (§ 3.4).

LLM-as-Human Simulation (RQ1)

4.1.1 Dataset. We evaluate on the software-engineering portion of HiL-Bench [18], which is constructed from SWE-Bench Pro tasks and introduces human-validated information gaps that require clarification. We use all of the eligible 100 publicly available SWE tasks (swe_0–swe_99). These tasks contain 353 registered blockers, corresponding to an average of 3.53 blockers per task.

A blocker represents information that cannot be safely resolved by guessing. HiL-Bench distinguishes three types: missing information, where information needed to determine the intended behavior is absent; ambiguous requests, where multiple plausible interpretations remain possible; and contradictory information, where two stated requirements cannot simultaneously be satisfied.

Each blocker bb is associated with a structured registry entry containing its type, a description of the information gap, an exact intended resolution rbr_b, and example trigger questions. For example, if HiL-Bench says that the required behavior for a failed payment is genuinely missing, and IPA asks: “What should happen if the payment fails?” then the question matches a registered blocker. The resolution is hidden from the models during normal authoring and is used only by the experimental environment to simulate information that would normally reside with the human. This distinction is important for our study. Asking the simulated author to invent details that are intentionally absent would not faithfully model clarification, since the answer should come from the requirement author rather than from the assistant. We thus treat the registered HiL-Bench resolution rbr_b as a controlled proxy for the author’s latent intent. It remains hidden during normal authoring and is revealed only after a clarification question has successfully targeted the corresponding blocker.

4.1.2 LLM-Based Author Simulation. We separate four model roles in the experimental pipeline. The author model MAM_A plays the role of a developer writing and revising the problem description. We instantiate MAM_A using multiple model families to reduce dependence on any single simulated author. The verification model MVM_V performs IPA’s semantic reasoning. When invoked, it examines the available problem-description text and determines whether a clarification question is warranted. The same MVM_V is used in both the IPA and post-hoc conditions. The blocker oracle O\mathcal{O} is an evaluation-only component backed by the HiL-Bench blocker registry. It determines whether a question targets a registered blocker and, when appropriate, provides that blocker’s gold resolution. Neither the interaction controller nor MVM_V has access to O\mathcal{O} when deciding whether or what to ask. Finally, the judgment model MJM_J evaluates the completed problem descriptions against the gold blockers. It is used only after authoring and does not participate in the interaction. Separating these roles prevents direct exposure of the blocker registry to IPA while allowing the experimental environment to provide the simulated author with the latent information represented by a gold resolution.

Why Simulate Authoring with an LLM? RQ1 requires controlled, paired authoring trajectories in which the same initial prompt is exposed to different clarification conditions and, after an intervention, regenerated from the same earlier prefix. Such counterfactual control is difficult with human participants because once a person has seen or written a continuation, that knowledge cannot be removed before replaying another condition. LLM-based authors allow us to hold the initial text, model, decoding configuration, and latent resolution fixed while varying the interaction condition. This simulation is intended as a controlled evaluation of the interaction mechanism, not as evidence about human usability or cognitive behavior.

A conventional autonomous coding agent is also unsuitable because its repository navigation, tool calls, code modification, and execution cannot be controlled at the granularity needed to study interventions at particular locations in a textual requirement.

LLM-based simulation provides this control but introduces another limitation: once a continuation has been generated, current interfaces do not allow us to erase that suffix, revise an earlier prefix, and resume as if the discarded continuation had never been produced. We therefore design a rewind-and-resume simulation, which approximates the authoring process in which a developer receives feedback, revises earlier requirements, and continues under the updated context.

4.1.3 Evaluation Procedure. Initial Authoring. For each defective HiL-Bench problem statement SS, the author model MAM_A is instructed to rewrite the statement as a developer preparing a problem description for a coding agent. The author may clarify wording, repair issues it notices, and add information it believes is missing, but it is not shown the gold blockers or their resolutions. The initial rewrite is as follows: P(0)=(x1,x2,…,xn)P^{(0)} = (x_1, x_2, \ldots, x_n). For each task and author model, we cache this initial rewrite and use exactly the same P(0)P^{(0)} to initialize all experimental conditions. Thus, differences between conditions cannot be attributed to independently sampled initial prompts. We generate one P(0,r)P^{(0,r)} for each run rr and fork that same initial prompt across all conditions. The resulting unit of paired comparison is therefore author model ×\times task ×\times run ×\times blocker.

NoAssist. In NoAssist, the candidate receives no clarification assistance. The initial rewrite P(0)P^{(0)} is treated as the completed problem description.

PostHoc. In PostHoc, clarification occurs only after the initial rewrite has been completed. The verification model MVM_V receives the entire prompt P(0)P^{(0)} and may generate clarification questions.

For an accepted question that targets a registered blocker bb, the oracle O\mathcal{O} returns the corresponding resolution rbr_b. This response represents information that would normally be supplied by the human requirement author. The author can then use the clarification to revise the prompt. Questions that do not correspond to a registered blocker receive no privileged gold answer; if accepted, the author responds using only the information available in its current context.

The author model may then revise any part of the completed prompt based on the accepted clarifications. The resulting text is the final PostHoc prompt.

IPA: Rewind-and-Resume Authoring. IPA begins from the same initial rewrite P(0)P^{(0)}, but exposes it incrementally to the interaction mechanism. The interaction controller, simulating our interaction model, processes the prompt token by token and decides when there is sufficient evidence to invoke MVM_V. Suppose verification is invoked after token xtx_t. The verification model receives only the currently available prefix P≤t=(x1,…,xt)P_{\leq t} = (x_1, \ldots, x_t) together with the applicable clarification history. It has no access to the unobserved suffix (xt+1,…,xn)(x_{t+1}, \ldots, x_n).

If the verifier returns a question qtq_t, the author decides whether it is useful based only on the currently available authoring context. This decision is made before any gold resolution is revealed.

If the author rejects qtq_t, no revision is forced. The interaction is recorded as rejected and processing continues along the current authoring trajectory.

If the author accepts qtq_t, and the question targets a registered blocker bb, the experimental oracle provides the blocker’s hidden intended resolution rbr_b. We then rewind the simulated authoring process to the intervention point xtx_t. All text following tt is discarded: (xt+1,…,xn)←∅(x_{t+1}, \ldots, x_n) \leftarrow\varnothing. The author may revise any portion of the existing prefix using the newly clarified information, producing P~≤t\widetilde{P}_{\leq t}. It then generates a new continuation conditioned on that revised prompt: P′=P~≤t∘MA(P~≤t)P' = \widetilde{P}_{\leq t} \circ M_A(\widetilde{P}_{\leq t}). Because resumed generation uses a fresh LLM API call, the discarded suffix is omitted from the model context and cannot influence the continuation through conversational memory. This allows the simulation to approximate a clean rewind that would be impossible to guarantee with the same human author, who may still remember the discarded text. Subsequent requirements are therefore generated from the revised context rather than from the obsolete continuation. After a revision, the interaction-controller states derived from obsolete text are invalidated and reconstructed from the updated prompt. Clarification history is retained so that already resolved issues can be recognized as such during subsequent verification. The procedure repeats until the author completes the prompt, no further clarification is triggered, or the common interaction budget is exhausted. Thus, rewind-and-resume approximates the revise-and-continue dynamics of within-turn clarification while preserving controlled counterfactual comparison across conditions.

4.1.4 Controlled Comparison and Metrics. We aim to compare two authoring pipelines, NoAssist+PostHoc (or PostHoc for short) and IPA+PostHoc, so that the principal experimental difference is whether clarification can occur during authoring. PostHoc clarification is a common final stage rather than a competing approach: both pipelines are allowed to refine the completed description after authoring, while only IPA+PostHoc can intervene before completing description.

For each task and author model, the two pipelines share the same initial authoring process, MAM_A, MVM_V, clarification-response mechanism, revision instructions, and decoding configuration. Neither model sees the gold blocker registry before a question is accepted, and in both pipelines a gold resolution is revealed only after the accepted question is matched to the corresponding blocker.

The two pipelines therefore differ primarily in the timing and context of clarification. In NoAssist+PostHoc, clarification occurs only after the problem description is complete. In IPA+PostHoc, MVM_V can reason over intermediate prefixes, allowing clarified/revised context to influence subsequent requirements. Both pipelines then undergo the same PostHoc refinement after authoring. Thus, improvements on description quality by IPA+PostHoc over NoAssist+PostHoc reflect the benefit of progressive clarification during authoring rather than simply receiving more clarification.

We report three complementary metrics.

1. Blocker Response Rate (BRR). Let BB be the registered blockers for a task. After authoring, MJM_J independently assigns each blocker one of three labels: keep_same if the blocker remains unaddressed, try_to_fix if the author makes an observable attempt to resolve an issue, and add_needed_info if previously missing requirement information is introduced. We define BRR = 100⋅ntry_to_fix+nadd_needed_infonblockers100 \cdot\frac{n_{\mathrm{try\_to\_fix}}+n_{\mathrm{add\_needed\_info}}}{n_{\mathrm{blockers}}}. BRR measures whether the author responds to a blocker, not whether the repair is correct.

2. Candidate Acceptance. Let QQ be the questions posed by a condition and QaccQ_{\mathrm{acc}} those the simulated author chooses to act upon. We report AcceptRate =∣Qacc∣∣Q∣= \frac{\lvert Q_{\mathrm{acc}}\rvert}{\lvert Q\rvert}. Acceptance reflects the author’s perceived usefulness of the question rather than its correctness against a gold resolution.

3. Blocker-Level Transitions. We pair judgments for the same gold blocker under NoAssist and IPA: LbN→LbIL_b^N \to L_b^I. For missing-information blockers, keep_same→add_needed_info is a reminder-driven recovery, measured as ReminderRate =nkeep→addI/nkeepN= n_{\mathrm{keep}\to\mathrm{add}}^I/n_{\mathrm{keep}}^N. For ambiguous and contradictory blockers, keep_same→try_to_fix is a repair activation, measured as RepairRate =nkeep→fixI/nkeepN= n_{\mathrm{keep}\to\mathrm{fix}}^I/n_{\mathrm{keep}}^N. These metrics distinguish whether IPA improves by recovering missing requirements, triggering repairs, or both.

Judgment Protocol

All final prompts from the four authoring conditions are evaluated using the same judgment model MJM_J and structured rubric. For each blocker, the judge receives the original defective statement, the final rewritten statement, the blocker description, and its gold resolution. Condition identity is withheld from the judge.

The judge assigns a response label Lb∈{keep_same,try_to_fix,add_needed_info}L_b \in\{\mathrm{keep\_same}, \mathrm{try\_to\_fix}, \mathrm{add\_needed\_info}\}. For blockers that are addressed, it also assigns Cb∈{correct,incorrect}C_b \in\{\mathrm{correct}, \mathrm{incorrect}\}, indicating whether the resulting requirement is consistent with the gold resolution. Separating LbL_b from CbC_b prevents an attempted repair from being automatically counted as a correct one. To assess judgment reliability, we manually audited a stratified sample of 340 blocker-level judgments, with 10 judgments sampled from each combination of blocker type, author model, and condition. This sample size provides a 95% confidence level with a ±5 percentage-point margin of error for estimating overall agreement. The manual annotations agreed with MJM_J on 91.7% of response labels (κ=0.86\kappa= 0.86) and 94.4% of correctness labels (κ=0.89\kappa= 0.89), indicating substantial agreement between the automated and manual judgments.

Empirical Results

Table 1 reports the results.

Candidate modelNoAssistPostHocIPAIPA+PostHocAcceptRateReminderRateRepairRate
DeepSeek-V4-Flash15.662.637.175.693.629.010.2
Grok-4-1-fast23.575.129.279.698.519.58.5
Kimi-K2.531.271.652.478.295.043.18.7

Table 1. Blocker response of three simulated authors under four authoring pipelines on HiL-Bench tasks containing 353 gold blockers. BRR measures the fraction of gold blockers addressed in the final description. AcceptRate is the fraction of IPA questions accepted by the author. ReminderRate measures keep_same→add_needed_info transitions among initially unaddressed missing-info blockers; RepairRate measures keep_same→try_to_fix transitions among initially unaddressed ambiguity and contradiction blockers.

1. Early clarification provides complementary gains beyond post-hoc clarification. IPA and PostHoc operate at different stages of prompting. IPA interacts within a turn, while the problem description is still being written, whereas PostHoc operates after the turn is complete. They are therefore complementary: IPA can clarify issues early enough to influence subsequent authoring, while PostHoc addresses issues that remain in the completed description. This complementarity is reflected in the results. The consistently higher BRR of IPA+PostHoc over PostHoc alone shows that incorporating within-turn IPA adds value beyond post-hoc clarification by itself. Relative to PostHoc alone, BRR increases from 62.6% to 75.6% for DeepSeek (+13.0 pp), from 75.1% to 79.6% for Grok (+4.5 pp), and from 71.6% to 78.2% for Kimi (+6.6 pp). In fact, IPA+PostHoc achieves highest BRR for all three simulated authors. Because the two conditions use the same clarification budget, author and verification models, and post-hoc procedure, the comparison isolates the effect of using clarification during authoring rather than only after completion.

2. Clarification substantially increases blocker response. Without clarification, the three simulated authors address only 15.6–31.2% of the gold blockers: 15.6% for DeepSeek-V4-Flash, 23.5% for Grok-4-1-fast, and 31.2% for Kimi-K2.5. Thus, many requirement issues remain unaddressed when the author rewrites the defective statement independently.

Adding clarification improves BRR for every author model. IPA raises BRR to 37.1% for DeepSeek (+21.5 pp), 29.2% for Grok (+5.7 pp), and 52.4% for Kimi (+21.2 pp). Post-hoc clarification achieves higher BRR (62.6–75.1%) than IPA alone. This is consistent with the harder online setting faced by IPA: IPA observes an evolving prefix and must decide both whether and when to invoke clarification, whereas PostHoc reasons over the completed problem description. This result indicates the complementary nature between IPA and PostHoc, consistent with the above results.

Finding 1. Clarification substantially increases blocker response, and within-turn IPA complements post-hoc clarification. Under the same total clarification budget, IPA+PostHoc improves BRR by an additional +4.5 to +13.0 percentage points over PostHoc alone across the three simulated authors. BRR also rises from 15.6–31.2% under unassisted rewriting to 75.6–79.6% under IPA+PostHoc.

3. IPA more frequently recovers missing information than activates repairs. Blocker-level transitions reveal where IPA’s gains originate. Among missing-information blockers left unaddressed under NoAssist, IPA causes 43.1% for Kimi, 29.0% for DeepSeek, and 19.5% for Grok to transition from keep_same to add_needed_info. In contrast, among initially unaddressed ambiguity and contradiction blockers, only 8.7%, 10.2%, and 8.5%, respectively, transition to try_to_fix.

Thus, across the three author models, reminder-driven recovery is consistently higher than newly activated repair, by approximately 2.3×–5.0×. This result supports IPA’s role as a contextual reminder: its strongest effect is prompting simulated authors to supply detailed requirements that they did not include independently, rather than inducing additional repairs of already expressed conflicts.

4. IPA questions are frequently accepted by simulated authors. The simulated authors accept most IPA clarification questions before seeing any gold resolution: 93.6% for DeepSeek, 98.5% for Grok, and 95.0% for Kimi. For example, DeepSeek accepts 249 of 266 questions, while Grok accepts 334 of 339. Rejected questions are skipped and do not force a revision. Thus, most IPA questions are judged actionable by the simulated authors before the gold resolution is revealed.

AcceptRate measures the author’s perceived usefulness of a question, not its objective correctness or selectivity. We therefore interpret it with question precision, blocker recall, AskF1, and the number of questions posed. A high AcceptRate indicates that most questions are considered worth acting on, but does not by itself show that IPA avoids excessive questioning.

AcceptRate and BRR capture complementary outcomes. An author may accept a question without ultimately changing a registered blocker, or may make only a partial or ineffective revision. This distinction is visible for Grok: it has the highest AcceptRate (98.5%) but the smallest IPA BRR gain (+5.7 pp). Thus, AcceptRate reflects whether the simulated author chooses to act on a clarification, whereas BRR measures whether the final description responds to benchmarked requirement issues.

Finding 2

Among initially unaddressed missing-info blockers, IPA produces keep_same → add_needed_info transitions 2.3×–5.0× more frequently than keep_same → try_to_fix transitions among initially unaddressed ambiguity and contradiction blockers. This suggests a particularly strong role for IPA as a contextual reminder, while the two rates concern different blocker populations.

Finding 3

Simulated authors accept 93.6–98.5% of IPA’s clarification questions before receiving any gold resolution. This indicates that most questions are judged actionable by the simulated authors; objective question quality and interaction burden are evaluated separately through question precision, blocker recall, AskF1, and the number of questions posed.

Question Quality in Issue Detection (RQ2)

RQ1 evaluates IPA from the simulated author’s perspective: whether clarification questions are perceived as useful and whether acting on them improves the final problem description. Both signals are indirect: acceptance is author-dependent, while BRR measures the resulting text rather than the intrinsic quality of the clarification. RQ2 therefore evaluates the quality of IPA’s interactive issue-detection process, examining how effectively its clarification questions surface registered blockers and contextually valid concerns during authoring. A question can be useful in two ways. It may target a registered blocker, or it may be a valid reminder about the prefix available when it was asked. We apply this contextual-validity judgment to all methods: interactive questions are judged against the prefix P≤tP_{\leq t} available at the time of interaction, whereas PostHoc questions are judged against the completed problem description. For interactive methods, a valid non-blocker question is designated a prefix-grounded reminder. Otherwise, a question valid at an intermediate prefix could be incorrectly counted as a false positive once the missing detail is supplied later.

Compared Methods.

As with RQ1, we study the following methods:

PostHoc applies the same reasoning layer after the complete problem description is available and corresponds to the final clarification stage used in RQ1.

IPA (Chunked) follows the surface-form schedule of Eq. (3) with stride K=2K = 2. The learned interaction controller is disabled, and verification is triggered only at the sentence checkpoints.

IPA (Token+Fallback) uses the learned Wait–Track–Verify controller (§ 3.4) to determine, token by token, when the current prefix warrants verification. As a safety fallback, if the controller does not verify for two consecutive sentences, the chunked schedule triggers verification at that checkpoint, preventing extended passages from delaying semantic inspection.

IPA (Token+Fallback)+PostHoc applies the token-level interactive assistant in IPA and then performs the same PostHoc clarification after the description is complete. This mirrors the paired comparison in RQ1 and measures whether within-turn issue detection provides complementary coverage beyond a final post-hoc stage.

Within each model setting, all methods share MVM_V, MJM_J, the oracle O\mathcal{O}, the question budget, the revision procedure, and the repeat-suppression rule. They differ only in the verification schedule and, consequently, in how much of the evolving description is available as clarification is requested.

Evaluation Procedure. Streaming and when to verify.

Interactive methods parse the description token by token and observe only the current prefix P≤tP_{\leq t}, while PostHoc receives the completed description. At each verification, the reasoning model receives P≤tP_{\leq t} and returns one question.

What happens when a question is right. Each generated question goes to the judgment model, which sees the blocker descriptions and decides whether the question asks about any of the blockers (Section 4.2.3). If it does, the oracle O\mathcal{O} returns that blocker’s gold resolution rbr_b, and a separate model revises the text written so far to incorporate it, exactly as the accepted questions were applied in RQ1. Streaming then continues over the remaining description from the revised text. Revising immediately prevents an issue from cascading: once a blocker’s resolution replaces the prefix, later verification calls analyze text in which that issue no longer exists, avoiding repeated credit or penalty. This also reflects the intended interaction, where a developer answers a question, revises the text, and continues writing. Resolved blockers and prior irrelevant questions are included in later verification prompts to discourage repetition. Each call may return at most one question.

4.2.3 Question Judgment. MJM_J first receives the registered blockers with their gold resolutions and decides which of them, if any, a question qq requests. Semantically equivalent phrasings count as matches, and one question may cover several blockers. Following HiL-Bench, a blocker can be credited to at most two questions, so restating a successful question earns nothing. If qq matches no blocker and was asked during streaming, a second judgment sees only the prefix P≤tP_{\leq t} that was available at the time and decides whether qq is still a valid clarification there: grounded in the current text, and asking about something that remains meaningfully unspecified. Future text is never shown, so qq can be a valid reminder even if the description later supplies the answer. Each question receives one label, J(q)∈{Blocker,Reminder,Irrelevant}J(q) \in\{\text{Blocker}, \text{Reminder}, \text{Irrelevant}\}.

PostHoc questions are not evaluated as reminders because they are asked only after the problem description is complete. At that point, there is no future authoring context. A question that does not match a registered blocker is treated as unmatched by the benchmark. The registry and these labels are used only for evaluation; the interaction and reasoning layers see gold information only through a resolution that an accepted question has earned.

4.2.4 Metrics. Let QQ be the questions scored for a task, BB its registered blockers, and QR⊆QQ_R \subseteq Q the questions labeled Reminder. We first report reminders separately, then exclude them when computing blocker-detection metrics. Let Qeval=Q∖QRQ_{\mathrm{eval}} = Q \setminus Q_R be the remaining questions, and Bdet⊆BB_{\mathrm{det}} \subseteq B be the registered blockers covered by at least one question in QevalQ_{\mathrm{eval}}. For PostHoc, QR=∅Q_R = \varnothing, so Qeval=QQ_{\mathrm{eval}} = Q.

1. Reminder Share measures, among questions that do not cover any registered blocker, how many are valid given the prefix available when they are asked. Let Qmiss⊆QQ_{\mathrm{miss}} \subseteq Q denote questions that match no registered blocker. We define Rem=100⋅∣QR∣∣Qmiss∣\mathrm{Rem} = 100 \cdot\frac{|Q_R|}{|Q_{\mathrm{miss}}|}. A blocker-matching question is excluded from both the numerator and denominator. Thus, Rem quantifies how often an otherwise unmatched interactive question is still a useful prefix-grounded reminder. It is reported separately from the blocker-detection metrics below and from the blocker-level ReminderRate in § 4.1.

2. Ask Recall measures the fraction of blockers surfaced by the non-reminder questions: AskR=100⋅∣Bdet∣∣B∣\mathrm{AskR} = 100 \cdot\frac{|B_{\mathrm{det}}|}{|B|}. Each blocker is counted at most once regardless of how many questions target it.

3. Ask Precision measures the fraction of evaluated questions that correctly target at least one registered blocker. Let QB={q∈Qeval:q covers at least one registered blocker}Q_B = \{q \in Q_{\mathrm{eval}} : q \text{ covers at least one registered blocker}\}. We define AskP=100⋅∣QB∣∣Qeval∣\mathrm{AskP} = 100 \cdot\frac{|Q_B|}{|Q_{\mathrm{eval}}|}. Because reminders are removed before computing AskP, the metric measures blocker-targeting precision under the same criterion for interactive and PostHoc methods.

4. Ask F1 is the harmonic mean of AskP and AskR: AskF1=2⋅AskP⋅AskRAskP+AskR\mathrm{AskF1} = 2 \cdot\frac{\mathrm{AskP}\cdot\mathrm{AskR}}{\mathrm{AskP}+\mathrm{AskR}}. It summarizes the trade-off between asking questions targeting blockers and covering a large fraction of them.

5. Tokens at a correct question measure how early the assistant surfaces a registered blocker during authoring. We compute the mean prefix length, in tokens, over questions in QBQ_B. For a question generated at token tt, the corresponding prefix contains t+1t+1 tokens. PostHoc observes the completed problem description, so its value corresponds to the full prompt length. A smaller value indicates that the model asks a question about a blocker earlier, using less authoring context.

4.2.5 Empirical Results. Table 2 reports the question-quality results.

MethodDeepSeek-V4-Flash AskRAskPAskF1Rem.TokKimi-K2.5 AskRAskPAskF1Rem.TokGrok-4-1-fast AskRAskPAskF1Rem.Tok
PostHoc54.837.344.4–765.860.639.948.1–791.669.228.340.2–817.2
IPA (Chunked)69.251.258.942.9438.571.548.157.540.2453.375.051.561.136.1467.9
IPA (Token+Fallback)72.150.259.239.8463.474.450.460.142.7477.673.155.663.240.1482.6
+ PostHoc76.040.953.2––76.043.155.0––81.742.055.5––

Table 2. Question quality in issue detection. Rem. is the fraction of questions that miss every blocker and are still valid reminders. Tok is the mean prefix length, in tokens, at a question that covers a blocker.

  1. Interactive clarification improves issue detection over PostHoc. Both IPA variants outperform PostHoc in AskR, AskP, and AskF1 across all three models. IPA (Token+Fallback) improves AskF1 from 44.4 to 59.2 for DeepSeek, 48.1 to 60.1 for Kimi, and 40.2 to 63.2 for Grok, corresponding to gains of 12.0–23.0 percentage points. The same pattern holds for IPA (Chunked), indicating that intermediate clarification is associated with higher blocker-detection performance than clarification performed only after the completed description under this evaluation protocol.

  1. Token+Fallback provides the highest standalone AskF1. IPA (Token+Fallback) achieves the highest standalone AskF1 point estimate for all three models. Compared with IPA (Chunked), it increases recall for DeepSeek and Kimi. These results suggest that combining learned token-level verification with the safety fallback provides a favorable precision–coverage balance.

  1. IPA surfaces useful clarifications beyond the registered blocker set earlier, while PostHoc improves final coverage. Across the interactive methods, 36.1–42.9% of questions that match no registered blocker are nevertheless judged valid given the prefix available when they are asked. These prefix-grounded reminders capture a form of interactive assistance not reflected in blocker recall alone. Adding a final PostHoc stage further increases blocker coverage, although its additional questions reduce blocker-targeting precision. Moreover, IPA asks questions much earlier than PostHoc: at roughly 438–483 tokens on average, compared with 766–817 tokens for PostHoc.

Finding 4. Interactive clarification improves both the quality and timeliness of issue detection. IPA (Token+Fallback) achieves the best standalone AskF1 across all three models, improving over PostHoc by 12.0–23.0 percentage points while surfacing blocker-related questions substantially earlier. A final PostHoc stage increases recall further, but at the cost of lower precision.

Accuracy of the Trained Interaction Model

The preceding comparison evaluates each interaction schedule end to end, combining when verification is invoked with downstream question generation. We next isolate the trained interaction model and evaluate how accurately it places VERIFY actions when the current prefix contains sufficient evidence for clarification. This separates the learned timing policy from the reasoning model and the fallback chunking policy in Table 2.

Label construction: how do we obtain gold token-level actions? HiL-Bench specifies each blocker but not token-level controller actions. For each blocker, a LLM annotator marks two positions: the word of the issue onset and the word at which the evidence is sufficient to call reasoning. Tokens before onset are labeled WAIT, tokens from onset to verification are TRACK, and the verification token is VERIFY. Annotated positions must be word tokens. We annotate a description 3 times independently and use full agreement to decide the gold positions, with a referee pass for unresolved cases. Higher agreement on VERIFY than on issue onset motivates the tolerance window used below.

Split. We use a fixed 70:30 split by problem description, yielding 70 training descriptions (249 blockers, 63,183 tokens) and 30 test descriptions (104 blockers). Because multiple blockers may share a verification token, the test set contains 96 distinct gold VERIFY events.

Why VERIFY is scored with a window. Because VERIFY is a one-token event, exact-token matching is overly strict. We therefore allow a tolerance window of 4 tokens before and 12 after the gold event; neighboring events are a median of 53 tokens apart. We score VERIFY by one-to-one event matching within this window, preferring the closest pair. Unmatched pulses are false positives, so repeated pulsing receives no extra credit.

Protocol. We replay each test description token by token using only the current prefix. The controller thus conditions on the text seen so far and its previous action, matching the intended inference setting without access to gold labels. We compare the trained controller with the chunked schedule (Eq. (3), K=2K=2), which places VERIFY only at sentence checkpoints. This protocol allows us to measure whether the learned token-level timing better matches the annotated checking points than the fixed sentence-based checkpoints.

Results. Table 3 shows that the trained interaction model better identifies when semantic verification should be triggered than the fixed chunked schedule. Its VERIFY F1 reaches 0.184, compared with 0.119 for chunking, a 54.6% relative improvement. The model also achieves a TRACK F1 of 0.537, indicating that it can recognize emerging concerns before verification is warranted. Its slightly lower WAIT F1 is expected because the trained controller introduces the additional TRACK state, causing some tokens that would otherwise be treated as WAIT to be classified as TRACK. The main objective is the accurate placement of VERIFY events, where the trained controller achieves a higher Verify-F1 than the fixed chunked schedule.

MethodWaitF1TrackF1VerifyF1
Chunked schedule (K=2K=2)0.827–0.119
Trained interaction model0.7970.5370.184

Table 3. Trained interaction model on the test split.

Question Latency Analysis (RQ3)

RQ2 shows that IPA can surface requirement issues from substantially less context than PostHoc. RQ3 asks what this delay corresponds to in estimated author-facing time: once an issue becomes sufficiently evident, how long until IPA returns a clarification question?

Not every concern can be verified when it first appears. In the checkout example of § 2, allowing guest checkout is a reasonable requirement by itself. The inconsistency becomes evident only later, when the prompt additionally requires every order to be associated with an account. IPA should therefore not be penalized for waiting for needed information to establish the issue. We use the annotated gold verification point from § 4.2.3 as the start of the latency measurement: the point at which the available prefix contains sufficient evidence to justify verification.

Latency Measurement

Latency Measurement. For each correctly detected blocker, we measure latency from its gold verification point to the return of the first clarification question that correctly covers that blocker. We decompose this latency into two components.

Layer 1 measures the authoring delay from the gold verification point to the verification call that first produces a correct question. We count the intervening tokens and convert this distance to estimated typing time. We use the free-form composition rate reported by Vertanen and Kristensson [19], where participants composed original text at an average of 48 words per minute. On our test descriptions, this is about 0.81 seconds per token.

Layer 2 measures the reasoning latency after verification is invoked. It is the wall-clock time from sending the current prefix to the reasoning model until the question is returned. Total is the sum of Layer 1 and Layer 2 for each blocker, and we report the mean of these per-blocker totals.

We further separate correctly detected blockers according to how much additional text IPA requires after the issue becomes verifiable. Context needed before the gold verification point is not counted as latency. We classify a blocker as Easy when the first correct question is raised within 50 additional tokens (tbq−tbverify≤50t_b^{q} - t_b^{\mathrm{verify}} \le50), and as Hard otherwise. Under our typing-rate estimate, 50 tokens correspond to approximately 41 seconds of additional typing.

ModelGroupShareLayer 1 (s)Layer 2 (s)Total (s)
DeepSeekEasy72.0%4.71.66.3
DeepSeekHard28.0%204.99.6214.5
KimiEasy69.4%3.911.014.9
KimiHard30.6%198.021.3219.3
GrokEasy65.4%2.725.227.9
GrokHard34.6%187.439.2226.6

Table 4. Latency on successful blocker detection by IPA (Token+Fallback). Share is the percentage of detected blockers.

Empirical Results

Table 4 reports the latency result.

  1. Most detected blockers are surfaced soon after they become verifiable. Easy blockers account for 65.4–72.0% of correctly detected blockers. Their average latency ranges from 6.3 seconds for DeepSeek to 27.9 seconds for Grok. Layer 1 contributes only 2.7–4.7 seconds, showing that for most detected blockers, the first correct question is initiated shortly after sufficient evidence.

  1. Long-delay cases are dominated by additional authoring time. The remaining 28.0–34.6% of correctly detected blockers require 214.5–226.6 seconds on average. Within this group, the estimated authoring delay to the successful verification call accounts for 187.4–204.9 seconds, substantially more than the reasoning latency. Thus, long-delay cases arise primarily because the correct question is triggered substantially after the issue has become verifiable, rather than because question generation itself is slow. These long-delay cases also help explain the token-position results in Table 2. Although most correctly detected blockers are questioned close to their gold check point, a smaller set requires substantially more authoring before IPA asks the correct question.

Finding 5

For 65.4–72.0% of correctly detected blockers, IPA returns a question within 6.3–27.9 seconds on average after the issue becomes verifiable. The remaining long-delay cases take 215–227 seconds, with most of the delay caused by more authoring before verification rather than reasoning latency.

Threats to Validity

External validity. Although HiL-Bench covers multiple blocker types in SE tasks and model families, the results may not generalize to other domains, requirement styles, or humans. The LLM-as-human study provides controlled authoring trajectories rather than evidence of human usability.

Internal validity. LLM generation and judgment are stochastic and may vary across runs. We mitigate this via paired comparisons sharing the same initial prompt, models, decoding configuration, clarification mechanism, and interaction budget. Rewind-and-resume approximates revise-and-continue authoring but may not exactly reproduce human behavior. Automated judgments may also introduce error; our manual audit shows high agreement with the judgment model. Verification-point annotations may vary. We mitigate via repeated annotation and a tolerance window.

Construct validity. AcceptRate reflects perceived usefulness to a simulated author rather than objective question quality. AskR, AskP, and AskF1 depend on the HiL-Bench blocker registry and may miss useful clarifications, partly addressed via prefix-grounded reminders. RQ3 converts token delay from an annotated verification point to estimated typing time, so authoring latency is estimated rather than directly observed, while reasoning latency may depend on networks. We do not use revision correctness as an outcome metric because it conflates IPA’s intervention behavior with the downstream capabilities of the reasoning model (e.g., a weak one) and simulated author.

Related Work

_Requirement Clarification for Code Generation._ CodeClarQA studies code generation through clarification questions [13], while TiCoder resolves user intent through distinguishing test cases [5]. ClarifyGPT detects ambiguous requirements from behavioral inconsistencies and asks targeted questions [14], whereas HumanEvalComm evaluates whether models recognize incomplete, ambiguous, and inconsistent requirements and respond appropriately [23]. Other work detects requirement ambiguity or repairs ambiguous specifications automatically [2, 9].

Recent work increasingly evaluates clarification in interactive coding. Ambig-SWE studies whether agents can detect underspecification, ask targeted questions, and use the answers [20], while Ask or Assume and HiL-Bench focus on selective clarification and help-seeking [4, 18]. ClarifyCoder and ClarifyCodeBench further study learned clarification behavior and clarification quality [6, 22]. Unlike these approaches, which start from an already presented task, IPA targets _within-turn clarification_ while the requirement is still being composed.

_Proactive Programming Assistance._ IPA also relates to mixed-initiative systems, where assistance is from users or system [8]. Chen et al. study proactive coding assistance [3], while Kuo et al. show that developer receptivity depends strongly on intervention timing and context [12]. Related studies further emphasize context awareness and user control in IDE-based AI assistance [11, 16].

Concluding Remark

We introduced IPA, a just-in-time assistant that clarifies requirements while they are being written. By separating interaction control from semantic verification, IPA complements post-hoc clarification, particularly by helping surface missing information. More broadly, IPA points toward a new class of prompt assistants. Beyond clarification, such assistants could provide prompt completion, consistency checking, missing-requirement diagnostics, contextual recommendations, and prompt refactoring, opening a broader research agenda on intelligent prompt assistant for agentic SE.

Data Availability Statement

Data/code is available in project’s website [1].

References

  1. [1][n.d.] . https://interactive-pa.site
  2. [2]Sarmad Bashir, Alessio Ferrari, Abbas Khan, Per Erik Strandberg, Zulqarnain Haider, Mehrdad Saadatmand, and Markus Bohlin. 2025. Requirements Ambiguity Detection and Explanation with LLMs: An Industrial Study. In 2025 IEEE International Conference on Software Maintenance and Evolution (ICSME). IEEE, 620–631. doi:10.1109/ICSME64153.2025.00063
  3. [3]Valerie Chen, Alan Zhu, Sebastian Zhao, Hussein Mozannar, David Sontag, and Ameet Talwalkar. 2025. Need Help? Designing Proactive AI Assistants for Programming. In Proceedings of the 2025 CHI Conference on Human Factors in Computing Systems (CHI ’25). Association for Computing Machinery, New York, NY, USA, Article 881, 18 pages. doi:10.1145/3706598.3714002DOI
  4. [4]Nicholas Edwards and Sebastian Schuster. 2026. Ask or Assume? Uncertainty-Aware Clarification-Seeking in Coding Agents. arXiv:2603.26233 [cs.CL]. https://arxiv.org/abs/2603.26233
  5. [5]Sarah Fakhoury, Aaditya Naik, Georgios Sakkas, Saikat Chakraborty, and Shuvendu K. Lahiri. 2024. LLM-Based Test-Driven Interactive Code Generation: User Study and Empirical Evaluation. IEEE Transactions on Software Engineering 50, 9 (2024), 2254–2268. doi:10.1109/TSE.2024.3428972DOI
  6. [6]Zheng Fang, Dongming Jin, Yihong Dong, Yongmin Li, Kechi Zhang, Zhi Jin, and Ge Li. 2026. ClarifyCodeBench: Evaluating LLMs on Clarifying Ambiguous Requirements for Code Generation. arXiv preprint arXiv:2607.00711 (2026). arXiv:2607.00711 [cs.SE] doi:10.48550/arXiv.2607.00711DOI
  7. [7]Vincenz Gervasi, Alessio Ferrari, Didar Zowghi, and Paola Spoletini. 2019. Ambiguity in Requirements Engineering: Towards a Unifying Framework. In From Software Engineering to Formal Methods and Tools, and Back: Essays Dedicated to Stefania Gnesi on the Occasion of Her 65th Birthday, Maurice H. ter Beek, Alessandro Fantechi, and Laura Semini (Eds.). Lecture Notes in Computer Science, Vol. 11865. Springer, 191–210. doi:10.1007/978-3-030-30985-5_12DOI
  8. [8]Eric Horvitz. 1999. Principles of mixed-initiative user interfaces. In Proceedings of the SIGCHI Conference on Human Factors in Computing Systems (Pittsburgh, Pennsylvania, USA) (CHI ’99). Association for Computing Machinery, New York, NY, USA, 159–166. doi:10.1145/302979.303030DOI
  9. [9]Haoxiang Jia, Robbie Morris, He Ye, Federica Sarro, and Sergey Mechtaev. 2025. Automated Repair of Ambiguous Problem Descriptions for LLM-Based Code Generation. In Proceedings of the 40th IEEE/ACM International Conference on Automated Software Engineering, 367–379. doi:10.1109/ASE63991.2025.00038DOI
  10. [10]Erik Kamsties and Barbara Paech. 2000. Taming Ambiguity in Natural Language Requirements. In Proceedings of the 13th International Conference on Software and Systems Engineering and their Applications, Vol. 2. Centre d’Etude pour la Maitrise des Systemes et du Logiciel (CMSL-CNAM).
  11. [11]Ekaterina Koshchenko, Jovana Stankovic, Ilya Zakharov, and Agnia Seryguek. 2026. Configurable AI Coding Assistants: Designing For Developers Who Like to Be in Control. In Proceedings of the 34th ACM International Conference on the Foundations of Software Engineering Companion. Association for Computing Machinery, 1823–1831. doi:10.1145/3803437.3806709DOI
  12. [12]Nadine Kuo, Agnia Seryguek, Valerie Chen, and Maliheh Izadi. 2026. Developer Interaction Patterns with Proactive AI: A Five-Day Field Study. In Proceedings of the 31st International Conference on Intelligent User Interfaces (IUI ’26). Association for Computing Machinery, New York, NY, USA, 349–362. doi:10.1145/3742413.3789148DOI
  13. [13]Haau-Sing (Xiaocheng) Li, Mohsen Mesgar, André Martins, and Iryna Gurevych. 2023. Python Code Generation by Asking Clarification Questions. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), Anna Rogers, Jordan Boyd-Graber, and Naoaki Okazaki (Eds.). Association for Computational Linguistics, Toronto, Canada, 14287–14306. doi:10.18653/v1/2023.acl-long.799DOI
  14. [14]Fangwen Wu, Lin Shi, Song Wang, Zhuohao Yu, Bingnan Zhang, Chenxue Wang, Shichao Liu, and Qing Wang. 2024. ClarifyGPT: A Framework for Enhancing LLM-Based Code Generation via Requirements Clarification. Proceedings of the ACM on Software Engineering 1, FSE (2024), 2332–2354. doi:10.1145/3660810
  15. [15]Martin P. Robillard, Robert J. Walker, and Thomas Zimmermann. 2010. Recommendation Systems for Software Engineering. IEEE Software 27, 4 (2010), 80–86. doi:10.1109/MS.2009.161DOI
  16. [16]Agnia Seryguek, Ekaterina Koshchenko, Ilya Zakharov, Timofey Bryksin, and Maliheh Izadi. 2026. Developer Needs and Feasible Features for AI Assistants in IDEs. In 2026 IEEE/ACM 48th International Conference on Software Engineering: Software Engineering in Practice. Association for Computing Machinery, 406–416. doi:10.1145/3786583.3786883
  17. [17]Alexey Syv atkovskiy, Ying Zhao, Shengyu Fu, and Neel Sundaresan. 2019. AI-Assisted Code Completion System. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, 2727–2735. doi:10.1145/3292500.3330699
  18. [18]Tu Trinh, Mohamed Elfeki, Guangze Luo, Kelvin Luu, Nathan Hunt, Ernesto Hernandez, Nandan Marwaha, Yannis Yiming He, Charles Wang, Fernando Carabedo, Alessa Castillo, and Bing Liu. 2026. HiL-Bench (Human-in-Loop Benchmark): Do Agents Know When to Ask for Help? arXiv:2604.09408 [cs.AI] https://arxiv.org/abs/2604.09408
  19. [19]Keith Vertanen and Per Ola Kristensson. 2014. Completion Text Entry evaluation with a composition task. ACM Trans. Comput.-Hum. Interact. 21, 2, Article 8 (Feb. 2014), 33 pages. doi:10.1145/2555691DOI
  20. [20]Sanidhya Vijayvargiya, Xuhui Zhou, Akhila Yerukola, Maarten Sap, and Graham Neubig. 2026. Ambig-SWE: Interactive Agents to Overcome Underspecificity in Software Engineering. In The Fourteenth International Conference on Learning Representations. https://openreview.net/forum?id=Xz2yXzTH4wparxiv.org/abs/2502.13069
  21. [21]Xingyao Wang, Bowen Li, Yufan Song, Frank F. Xu, Xiangru Tang, Mingchen Zhuge, Jiayi Pan, Yueqi Song, Bowen Li, Jaskirat Singh, Hoang H. Tran, Fuqiang Li, Ren Ma, Mingzhang Zheng, Bill Qian, Yanjun Shao, Niklas Muennighoff, Yizhe Zhang, Binyuan Hui, Junyang Lin, Robert Brennan, Hao Peng, Heng Ji, and Graham Neubig. 2025. OpenHands: An Open Platform for AI Software Developers as Generalist Agents. In The Thirteenth International Conference on Learning Representations.arxiv.org/abs/2407.16741
  22. [22]Jie JW Wu, Manav Chaudhary, Davit Abrahamyan, Arhaan Khaku, Anjiang Wei, and Fatemeh H. Fard. 2025. Can Code Language Models Learn Clarification-Seeking Behaviors? arXiv:2504.16331 [cs.SE] https://arxiv.org/abs/2504.16331
  23. [23]Jie JW Wu and Fatemeh H. Fard. 2025. HumanEvalComm: Benchmarking the Communication Competence of Code Generation for LLMs and LLM Agents. ACM Transactions on Software Engineering and Methodology 34, 7, Article 189 (2025), 42 pages. doi:10.1145/3715109DOI
  24. [24]John Yang, Carlos E. Jimenez, Alexander Wettig, Kilian Lieret, Shunyu Yao, Karthik Narasimhan, and Ofir Press. 2024. SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering. In Advances in Neural Information Processing Systems, Vol. 37. doi:10.52202/079017-1601

Paper details

vlnc:W_3bqe9xyn
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents