arXiv:2507.15868cs.CLcs.AI2025-07被引 1

发现大模型对提示词微小改动反应迟钝,可能误判关键语义变化。

Small Edits, Big Consequences: Telling Good from Bad Robustness in Large Language Models

  • 设计三种极简提示扰动:删词、词义反转、术语替换
  • 90%提示缺失时仍正确率达85%,但关键词反转仅54%响应
  • 推理优化模型反而更不敏感,建议区分对待噪声与语义变更

大语言模型在代码生成等高风险场景中,常因忽略单个词语错误而引发严重后果。为探究模型鲁棒性的边界,研究者选取50道LeetCode题目,设计三类最小扰动:(i)逐步删减10%词汇的弱化提示;(ii)关键量词反转(如'最大'变'最小');(iii)常用词替换为生僻术语。六种前沿模型(含三个推理调优版本)对每种扰动生成代码,并通过原测试集验证是否复用基线解或自适应调整。在11,853次生成中,模型在90%提示缺失时仍保持85%正确率,表现出对弱化提示的过度鲁棒;但在量词反转时仅54%响应,推理调优版本甚至更低;术语替换则介于两者之间,通过率为56%。表明当前模型模糊了无害噪声与语义改变的界限,常将二者视为可忽略。若遮蔽函数名等关键锚点,可迫使模型重新评估。建议在评估与训练中引入差异化敏感机制:对良性噪声保持稳定,对语义真实变化应能适应或拒绝。

原文摘要 · Abstract (English)

Large language models (LLMs) now write code in settings where misreading a single word can break safety or cost money, yet we still expect them to overlook stray typos. To probe where useful robustness ends and harmful insensitivity begins, we compile 50 LeetCode problems and craft three minimal prompt perturbations that should vary in importance: (i) progressive underspecification deleting 10 % of words per step; (ii) lexical flip swapping a pivotal quantifier ("max" to "min"); and (iii) jargon inflation replacing a common noun with an obscure technical synonym. Six frontier models, including three "reasoning-tuned" versions, solve each mutated prompt, and their Python outputs are checked against the original test suites to reveal whether they reused the baseline solution or adapted. Among 11 853 generations we observe a sharp double asymmetry. Models remain correct in 85 % of cases even after 90 % of the prompt is missing, showing over-robustness to underspecification, yet only 54 % react to a single quantifier flip that reverses the task, with reasoning-tuned variants even less sensitive than their bases. Jargon edits lie in between, passing through 56 %. Current LLMs thus blur the line between harmless noise and meaning - changing edits, often treating both as ignorable. Masking salient anchors such as function names can force re - evaluation. We advocate evaluation and training protocols that reward differential sensitivity: stay steady under benign noise but adapt - or refuse - when semantics truly change.

大模型鲁棒性提示工程语义敏感性代码生成

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。