arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2607.01953cs.SE
收藏

欠指定并不意味着不一致:编码模型中语义坍缩的风险

Underspecification does not imply Incoherence: The Risks of Semantic Collapse in Coding Models

SnT, University of Luxembourg(卢森堡大学 SnT 研究中心)

Cedric Richter, Mike Papadakis

AI总结:

研究发现LLM在任务描述欠指定时,常坍缩到单一错误解释,生成一致但行为错位的代码,称为有害语义坍缩,影响多个基准测试。

摘要:

大型语言模型(LLM)在任务描述清晰明确时生成代码的能力日益增强。然而,在实践中,用户提供的任务描述往往模糊、不完整或矛盾,使得预期程序行为的关键方面欠指定。在这种情况下,多个行为上不同的解释可能同样满足描述,但在语义上却以影响用户意图的方式存在差异。研究人员通常假设,提示欠指定表现为不一致:当多次询问时,LLM会产生多个语义不同的实现,反映任务描述的模糊性。在本文中,我们挑战了这一假设。我们发现LLM经常坍缩到任务描述的单一错误解释,一致地生成一致但行为错位的代码。我们将这种失败模式称为有害语义坍缩,并发现它影响了MBPP中超过10%的任务、HumanEval中3%的任务以及LiveCodeBench中32%的任务,这些基准都被认为是良好指定的。通过故意在基准提示中注入欠指定问题,该比率上升到5倍以上,暴露了依赖不一致作为提示欠指定代理的消歧和正确性估计技术中的根本盲点。

英文摘要:

Large Language Models (LLMs) have become increasingly effective at generating code when task descriptions are clear and precise. Yet, in practice, user-provided task descriptions are often ambiguous, incomplete, or contradictory, leaving critical aspects of the intended program behavior underspecified. In such cases, multiple behaviorally distinct interpretations may satisfy the description equally well, yet semantically differ in ways that matter/affect the user intent. A natural expectation, often assumed by researchers, is that prompt underspecification manifests as incoherence: When asked multiple times, an LLM produces multiple semantically distinct implementations reflecting the ambiguity of the task description. In this paper, we challenge this assumption. We find that LLMs frequently collapse onto a single incorrect interpretation of the task description, consistently generating coherent but behaviorally misaligned code. We term this failure mode detrimental semantic collapse and find that it affects over 10% of tasks in MBPP, 3% in HumanEval, and 32% of LiveCodeBench, all benchmarks assumed to be well-specified. By deliberately injecting underspecification issues in the benchmark prompts, the rate rises to over 5 times, exposing a fundamental blind spot in disambiguation and correctness estimation techniques that rely on incoherence as a proxy for prompt underspecification.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑