arXivDaily arXiv每日学术速递 周一至周五更新
​通知:联邦节假日调休:哥伦布日 / 原住民日(Columbus Day / Indigenous Peoples' Day),今日(13日)无更新。
arXiv 2506.06971cs.CLcs.CR

Chain-of-Code Collapse:代码生成中通过对抗性提示引发的大语言模型推理失败

Chain-of-Code Collapse: Reasoning Failures in LLMs via Adversarial Prompting in Code Generation

Jaechul Roh, Varun Gandhi, Shivani Anilkumar, Arin Garg

AI总结:

该研究提出Chain-of-Code Collapse方法,通过多种语义忠实的对抗性提示扰动测试推理型LLM的鲁棒性,发现模型性能对表层提示动态高度敏感,暴露了现有推理系统的脆弱性,同时发布相关数据集与框架以推动可信LLM推理研究。

摘要:

大语言模型(LLM)在代码生成、数学问题求解、算法综合等需要复杂推理的任务中已取得显著成功,尤其是在推理令牌和思维链提示的辅助下。但一个核心问题依然存在:这些模型是真的在推理,还是仅仅在利用浅层统计模式?本文提出Chain-of-Code Collapse(代码链崩溃)方法,通过引入一组语义忠实但具有对抗性结构的提示扰动,系统研究推理型LLM的鲁棒性。我们的评估涵盖700个源自LeetCode风格问题的扰动后代码生成样本,应用了叙事重构、无关约束注入、示例重排序、数值扰动等变换。我们观察到,虽然某些修改会严重降低性能(准确率下降最高达-42.1%),但另一些修改却出人意料地将模型准确率提升了最高35.3%,这表明模型不仅对语义敏感,还对表层提示动态敏感。这些发现暴露了当前推理系统的脆弱性和不可预测性,凸显了需要更具原则性的推理对齐和提示鲁棒性方法。我们发布了扰动数据集和评估框架,以推动可信且有韧性的LLM推理领域的进一步研究。

英文摘要:

Large Language Models (LLMs) have achieved remarkable success in tasks requiring complex reasoning, such as code generation, mathematical problem solving, and algorithmic synthesis -- especially when aided by reasoning tokens and Chain-of-Thought prompting. Yet, a core question remains: do these models truly reason, or do they merely exploit shallow statistical patterns? In this paper, we introduce Chain-of-Code Collapse, where we systematically investigate the robustness of reasoning LLMs by introducing a suite of semantically faithful yet adversarially structured prompt perturbations. Our evaluation -- spanning 700 perturbed code generations derived from LeetCode-style problems -- applies transformations such as storytelling reframing, irrelevant constraint injection, example reordering, and numeric perturbation. We observe that while certain modifications severely degrade performance (with accuracy drops up to -42.1%), others surprisingly improve model accuracy by up to 35.3%, suggesting sensitivity not only to semantics but also to surface-level prompt dynamics. These findings expose the fragility and unpredictability of current reasoning systems, underscoring the need for more principles approaches to reasoning alignments and prompting robustness. We release our perturbation datasets and evaluation framework to promote further research in trustworthy and resilient LLM reasoning.

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

↑