Fewer Clarifications, Better Code: Benchmarking Cross-Session Personalized Ambiguity Adaptation in Coding Assistants

Zijian Xu, Wenshuo Zhang, Zisen Qin, Rui Sheng, Yushi Sun, Huamin Qu, Chuhan ShiarXiv 2026

TL;DR

This paper introduces personalized ambiguity adaptation, a new task where AI coding assistants leverage a user's past resolved coding sessions to infer their intent in new, underspecified requests. To evaluate this capability, the authors present CAPA, a benchmark of 600 coding sessions mapping personalized ambiguity patterns, and propose a lightweight history gating method that significantly reduces unnecessary clarification questions while improving code correctness.

What Problem Does This Paper Address?

When you ask a coding assistant to "normalize a feature," do you mean min-max scaling or z-score standardization? A human colleague who knows your habits would instantly know your preference based on past projects. Current AI coding assistants, however, treat every session as an isolated blank slate. They either guess blindly (often incorrectly) or repeatedly ask for clarification, increasing the user's cognitive load.

While existing research tackles ambiguity resolution locally within a single session, or explores long-term memory for retrieving user facts, it largely ignores how patterns of ambiguity recur in user-specific ways across different tasks. This paper bridges that gap by formalizing cross-session personalized ambiguity adaptation.

Figure 1: Overview of the history-conditioned personalized ambiguity adaptation task. The assistant receives the public dialogue traces of (n) resolved same-user coding sessions and a new ambiguous request that initiates held-out session (τi,k). It uses cross-session evidence to infer the user’s re- curring ambiguity pattern, requests clarification only when necessary, and generates code for held-out task (Pi,k).

Methods

The authors formalize the task by providing an LLM with a user's past resolved multi-turn coding history alongside a new, ambiguous request. The model must infer the underlying ambiguity-resolution pattern and apply it to generate the correct code in as few turns as possible.

The 6 Ambiguity Mechanisms

The paper adapts linguistic ambiguity types into six coding-specific mechanisms:

  1. Domain-cognitive polysemy: Using project-specific jargon instead of standard CS terms.
  2. Structural logic misalignment: Omitting explicit logical relations, scopes, or thresholds.
  3. Habitual context omission: Leaving out established conventions (e.g., specific schemas or defaults).
  4. System-boundary misconception: Assuming the LLM can directly interact with the user's local environment or file system.
  5. Conversational context misalignment: Relying on ambiguous pronouns or context-dependent references.
  6. Implicit constraint under-specification: Omitting secondary constraints like edge-case validation or security hardening.

Same-User History Gating

To help models better exploit past context, the authors propose a lightweight, parameter-free history gating method. A "gate LLM" reviews past sessions to check for consistent ambiguity-resolution evidence. If found, it highlights the relevant history; if not, it generates explicit clarification guidance for the base model.

Figure 3: Overview of same-user history gating.

Datasets

The authors introduce CAPA (Cross-Session Adaptation to Personalized Ambiguity), a benchmark built on top of HumanEval tasks.

Figure 2: Overview of the CAPA data generation pipeline. Stage One combines task requirements with a user profile and an instantiated ambiguity–resolution assignment to create an ambiguous request. Stage Two uses AmbiSimu to produce a coding session through iterative dialogue and execution-based evaluation. Stage Three checks cross-session personalization consistency and assembles accepted sessions into a user trajectory.

CAPA features a controlled three-stage generation pipeline:

  • Structure: 600 coding sessions organized into 60 balanced user-ambiguity cells. Each cell contains 10 sessions (5 for history, 5 for evaluation) matching 10 distinct simulated user profiles (e.g., "The Over-Engineering Architect", "The Deadline Scripter") with pairs of the 6 ambiguity mechanisms.
  • Validation: Includes an execution-based evaluation environment and a cross-session consistency check to ensure the simulated user's behavior remains stable over time.

Key Insights and Ideas

  • Efficiency Over Accuracy: Providing same-user history improves eventual Executable Success (ES) modestly, but drastically boosts First-Turn Executable Success (FT-ES) and reduces Turns-to-Completion (TTC). History helps models get the code right the first time, cutting down on tedious back-and-forth clarification.
  • Generic vs. Personalized Learning: Using "shuffled history" (past sessions from other users) improves performance due to generic in-context learning of coding patterns. However, correctly matched same-user history provides a substantial additional boost, proving models can successfully decode personalized intent.
  • The Failure of General Memory Systems: Standard memory frameworks like Mem0 or A-mem actually underperformed raw history. This is because they focus on extracting static facts or notes, whereas personalized disambiguation requires recognizing procedural, recurring patterns of omission.

Key Results

The authors evaluated 12 recent LLMs (including closed-source frontier, open-access frontier, and compact models).

Table 1: Main results under no history and same-user history. ES, FT-ES, and TTC are computed over all sessions; ∆ES and ∆FT-ES denote same-user history minus no history; ∆TTC denotes no-history TTC minus same-user-history TTC.
  • Top Performer: Claude Opus 4.8 achieved the highest performance, with its first-turn success (FT-ES) skyrocketing from 24.3% (no history) to 60.3% (with same-user history).
  • History Gains: GPT-5.5 saw its FT-ES increase by 28.7 percentage points and its average turns-to-completion drop by 1.447 turns when given access to user history.
  • Gating Method Success: The proposed history gating workflow consistently improved first-turn success across models. For instance, it raised GPT-5.5's FT-ES from 31.00% (raw history) to 44.33% (gated history) while maintaining overall success rates.

Limitations and Future Work

  • Scope of Code Base: CAPA is built on HumanEval, which focuses on standalone, function-level Python tasks. Real-world software engineering involves complex multi-file repositories where ambiguities span across large codebases.
  • Simulated Users: The benchmark relies on LLM-simulated user personas and synthetic ambiguities. Validating these patterns against real-world developer telemetry remains an open challenge.
  • In-Context Constraints: History is currently fed entirely into the prompt context window. Future work should explore how models can adapt via parameter updates or long-term episodic retrieval without exhausting context limits.

Summary updated

BibTeX
@misc{xu2026fewer,
  author = {Zijian Xu and Wenshuo Zhang and Zisen Qin and Rui Sheng and Yushi Sun and Huamin Qu and Chuhan Shi},
  title = {{Fewer Clarifications, Better Code: Benchmarking Cross-Session Personalized Ambiguity Adaptation in Coding Assistants}},
  year = {2026},
  eprint = {2607.26611},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2607.26611},
}
Figure