paperbot · PL 论文追踪

全部论文 待读 收藏

P2 When Prompts Go Wrong: Evaluating Code Model Robustness to Ambiguous, Contradictory, and Incomplete Task Descriptions

当提示出错:评估代码模型对歧义、矛盾和不完整任务描述的鲁棒性
ICSE Proceedings of the 2026 IEEE/ACM 48th International Conference on Software Engineering2026匹配度 3/10 · 论文研究LLM代码生成对歧义/矛盾/不完整任务描述的鲁棒性,属于以LLM本身为研究目标的评测工作;虽涉及代码生成与benchmark构建,但未涉及静态分析、形式化验证、浮点程序分析或贝叶斯程序分析,与用户核心方向匹配度较低。引用 19 inbox
Maya Larbi, Amal Akli, Mike Papadakis, Rihab Bouyousfi, Maxime Cordy, Federica Sarro, Yves Le Traon
crossref: 2026-09-12

AI 速览

一句话:首次实证研究LLM代码生成对歧义、矛盾与不完整任务描述的鲁棒性,揭示微小表述缺陷即可显著降低功能正确性。

该论文关注大语言模型在代码生成中面对不清晰任务描述时的鲁棒性问题。作者扩展 HumanEval 和 MBPP 基准,通过引导式变异策略系统注入歧义、不完整和自相矛盾等现实缺陷,构建更贴近非正式开发者指令的数据集。随后评估多种不同规模与架构的 LLM,按缺陷类别分析功能正确性与失败模式。结果表明,即使任务描述措辞存在微小缺陷也会导致性能显著下降,矛盾描述尤其引发大量逻辑错误;更大模型虽相对更稳健,但仍无法免疫。研究进一步分析语义错误模式,发现描述清晰度、模型行为与错误类型之间的关联,并强调需要提升模型对自然任务缺陷的鲁棒性,改进训练策略与更现实的评测基准。

问题
LLM 在理想化清晰描述下代码生成表现良好,但真实开发指令常含歧义、不完整或矛盾,模型对此的鲁棒性尚缺乏系统实证。
方法
扩展 HumanEval 与 MBPP,用引导式变异系统注入三类任务描述缺陷,构建数据集并评测多种规模与架构的 LLM,分析功能正确性与失败模式。
评估
按任务描述缺陷类别比较功能正确性,分析语义错误模式及描述清晰度、模型行为与错误类型的相关性;结果显示微小缺陷显著降性能,矛盾描述导致大量逻辑错误,大模型更稳健但不免疫。
原文摘要(Abstract)

Large Language Models (LLMs) have demonstrated impressive performance in code generation tasks under idealized conditions, where task descriptions are clear and precise. However, in practice, task descriptions frequently exhibit ambiguity, incompleteness, or internal contradictions. In this paper, we present the first empirical study examining the robustness of state-of-the-art code generation models when faced with such unclear task descriptions. We extend the HumanEval and MBPP benchmarks by systematically introducing realistic task descriptions flaws through guided mutation strategies, producing a dataset that mirrors the messiness of informal developer instructions. We evaluate multiple LLMs of varying sizes and architectures, analyzing their functional correctness and failure modes across task description categories. Our findings reveal that even minor imperfections in task description phrasing can cause significant performance degradation, with contradictory task descriptions resulting in numerous logical errors. Moreover, while larger models tend to be more resilient than smaller variants, they are not immune to the challenges posed by unclear requirements. We further analyze semantic error patterns and identify correlations between description clarity, model behavior, and error types. Our results underscore the critical need for developing LLMs that are not only powerful but also robust to the imperfections inherent in natural user tasks, highlighting important considerations for improving model training strategies, designing more realistic evaluation benchmarks, and ensuring reliable deployment in practical software development environments.

链接与引用

DOI 原文 · arXiv · DBLP

BibTeX
@inproceedings{abs-2507-20439,
  title = {When Prompts Go Wrong: Evaluating Code Model Robustness to Ambiguous, Contradictory, and Incomplete Task Descriptions},
  author = {Maya Larbi and Amal Akli and Mike Papadakis and Rihab Bouyousfi and Maxime Cordy and Federica Sarro and Yves Le Traon},
  booktitle = {ICSE},
  year = {2026},
  doi = {10.1145/3744916.3773186}
}