[论文解读] ClarEval: A Benchmark for Evaluating Clarification Skills of Code Agents under Ambiguous Instructions
ClarEval 引入一个基于歧义的基准,用于通过单轮与多轮交互评估代码代理的协作澄清能力,衡量意图推断、前提识别与对话效率。
To integrate seamlessly into real-world software engineering, Code Agents must evolve from passive instruction followers into proactive collaborative partners. However, current evaluation paradigms predominantly reward "guessing" user intent under ideal conditions, neglecting the agent's ability to align with users through dialogue--a critical trait for collaborative intelligence. In this work, we propose a paradigm shift in evaluation to drive this transition. We introduce ClarEval, a framework designed to assess an agent's "Collaborative Quotient" by simulating the inherent ambiguity of human communication. By systematically injecting three types of realistic ambiguity (missing goals, premises, and ambiguous terminology) into standard tasks, we force agents to step out of their "generator" role and engage in requirement elicitation. To quantify this capability, we propose a metric suite led by Average Turns to Clarify (ATC) and Key Question Coverage (KQC), which measure not just the correctness of the generated code, but the efficiency and precision of the collaboration. Our experiments on eleven state-of-the-art agents reveal a stark reality: while models like GPT-5-Coder excel at coding, they often lack the strategic communication skills required for efficient partnership. ClarEval thus serves as a crucial roadmap for bridging the gap between strong coders and capable collaborators.The code is available at https://github.com/JialinLi13/ClarEval
研究动机与目标
- 推动从被动代码生成向主动协作伙伴关系转变在代码代理中的应用。
- 系统性地在标准任务中注入三种歧义类型以压力测试澄清能力。
- 开发并验证量化协作效率与诊断能力的指标(ATC、KQC、PIR、MPR、EAR)。
提出的方法
- 通过将 750 个源任务(HumanEval + LiveCodeBench)转化为 2,250 个含歧义的实例,构建带歧义注入的任务。
- 定义三种歧义类型:缺失目标、缺失前提、术语歧义,并给出形式化转换规则。
- 使用 GPT-4o 提示进行歧义注入,并采用两阶段人工验证以提升真实性。
- 在单轮和多轮设置下评估 11 个代码代理,使用确定性用户模拟器以实现可重复性。
- 引入指标:关键问题覆盖度(KQC)、缺失前提召回率(MPR)、澄清平均轮次(ATC),以及以效率调整的召回率(EAR)。
实验结果
研究问题
- RQ1代码代理是否能在单轮内从不完整提示中推断出高层意图(KQC)?
- RQ2代理是否能够揭示缺失的技术前提并通过对话将其召回(多轮中的 PIR 与 MPR)?
- RQ3歧义类型(缺失目标、缺失前提、术语歧义)如何影响澄清效果与效率(ATC),在不同模型间是否存在差异?
- RQ4顶级编码代理在代码正确性与协作效率之间是否存在平衡?单轮与多轮设置之间有何差异?
主要发现
- 顶级编码器 GPT5-Coder 在 11 个代理中实现了最高的单轮 KQC(0.867)和 MPR(0.661)。
- 多轮结果显示 Claude-Opus 4.1 实现最高的 KQC(0.754),GPT5-Coder 在 MPR(0.951)方面领先,且 ATC 最低(1.493)。
- 术语歧义对各模型构成最强挑战,在消融测试中的 Ambiguity 条件下通过率最低。
- 单独的强意图推断并不保证长期澄清的有效性;单轮与多轮表现之间存在弱相关(r = 0.32)。
- ClarEval 揭示编码能力与协作效率之间的差距,强调需要自适应澄清策略。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。