更少澄清,更优代码:编程助手中跨会话个性化歧义适应的基准测试
Fewer Clarifications, Better Code: Benchmarking Cross-Session Personalized Ambiguity Adaptation in Coding Assistants
July 29, 2026
作者: Zijian Xu, Wenshuo Zhang, Zisen Qin, Rui Sheng, Yushi Sun, Huamin Qu, Chuhan Shi
cs.AI
摘要
AI辅助编程日益将非正式的用户意图转化为可执行软件,然而编程请求中往往包含以用户特定方式在不同任务和会话间反复出现的歧义。现有消歧方法通常在当前编程会话中孤立地处理每个歧义请求,往往通过引出额外的澄清来实现。然而,来自同一用户的已解决会话历史是否可以作为记忆,用于在新开启的会话中解决反复出现的个性化歧义,这一方向仍未得到充分探索。我们将个性化歧义适应定义为一个新任务:给定用户先前已解决的编程会话和一个新的歧义请求,助手应当识别反复出现的歧义模式,生成预期的可执行解决方案,并尽量减少澄清次数。为对该任务进行基准测试,我们引入了CAPA,它通过六种机制刻画个性化编程歧义,并使用受控的三阶段生成流水线将这些机制注入到无歧义的可执行任务中。CAPA包含60个均衡的用户-歧义组合单元下的600个编程会话,其中包括300个留出的评估会话。我们在无历史和同用户历史两种条件下,使用可执行成功率、首轮成功率和完成所需轮次三个指标评估了12个近期大语言模型。我们的分析考察了任务难度、用户身份和基于记忆的历史使用情况,并进一步提出同用户历史门控作为一种轻量级推理时方法。CAPA为开发长期编程助手奠定了基础,使其能够更好地将生成代码与用户意图对齐,同时减少重复澄清。
English
AI-assisted coding increasingly translates informal user intent into executable software, yet coding requests often contain ambiguities that recur in user-specific ways across tasks and sessions. Existing disambiguation methods typically address each ambiguous request in isolation within the current coding session, often through eliciting additional clarification. However, whether resolved session history from the same user can serve as memory for resolving recurring personalized ambiguity in a newly opened session remains underexplored. We formulate personalized ambiguity adaptation as a new task: given a user's previously resolved coding sessions and a new ambiguous request, an assistant should identify the recurring ambiguity pattern, produce the intended executable solution, and minimize clarification. To benchmark this task, we introduce CAPA, which characterizes personalized coding ambiguity through six mechanisms and injects these mechanisms into unambiguous executable tasks using a controlled three-stage generation pipeline. CAPA contains 600 coding sessions across 60 balanced user--ambiguity cells, including 300 held-out evaluation sessions. We evaluate 12 recent LLMs under no-history and same-user-history conditions using executable success, first-turn success, and turns-to-completion. Our analyses examine task difficulty, user identity, and memory-based history use, and we further propose same-user history gating as a lightweight inference-time method. CAPA provides a foundation for developing long-term coding assistants that better align generated code with user intent while reducing repeated clarification.