言语胜于代码:探究LLM在代码漏洞检测中的认知启发式偏差
评分
59精选理由
论文首次填补认知启发式在代码漏洞检测中的研究空白,实验设计严谨且揭示重大安全风险,具有高度创新性和实践价值。
AI 点评
「该研究揭示了LLM在代码安全任务中不仅会出错,还会受认知偏见影响,这对依赖AI进行安全审计的实践具有重大警示意义。」
速览
这篇论文首次系统探索了大型语言模型(LLM)在代码漏洞检测中是否受认知启发式偏差影响。作者设计了一个控制框架,在固定代码的前提下,仅改变周围语境来触发晕轮效应、框架效应和锚定效应等三种启发式。实验评估了8种LLM在三种编程语言上的表现,结果表明所有模型均易受这些偏差影响,其中框架效应影响最大(33.2%),其次是锚定效应(23.5%)和晕轮效应(18.4%)。代码级分析显示,需要语义推理的漏洞比模式匹配可识别的漏洞更易受启发式影响。此外,模型常常在认知条件下将安全判定改为脆弱,且未能准确识别实际漏洞。作者还展示了概念验证的黑盒认知攻击,可抑制高达97%之前检测到的漏洞。结论表明认知易感性是LLM漏洞检测的一致且可利用的特性。
- 首次系统研究LLM在代码漏洞检测中的认知启发式偏差。
- 框架效应影响最大(33.2%),锚定效应次之(23.5%),晕轮效应最小(18.4%)。
- 需要语义推理的漏洞比模式匹配漏洞更易受启发式影响。
- 概念验证黑盒攻击可抑制97%之前检测到的漏洞。
正文
Computer Science > Cryptography and Security
arXiv:2606.30587v1 (cs) [Submitted on 29 Jun 2026]Title:Words Speak Louder Than Code: Investigating Cognitive Heuristics in LLM-Based Code Vulnerability Detection
Authors:Asif Shahriar, Hongyu Cai, Hadjer Benkraouda, Gang Wang, Z. Berkay Celik View a PDF of the paper titled Words Speak Louder Than Code: Investigating Cognitive Heuristics in LLM-Based Code Vulnerability Detection, by Asif Shahriar and 4 other authors View PDFAbstract:Researchers and practitioners increasingly apply Large Language Models (LLMs) for automated vulnerability detection. Recent work has shown that LLMs are susceptible to the same cognitive heuristics that bias human judgment. Yet, no work has investigated whether these heuristics affect a model's assessment of code vulnerabilities. In this paper, we present the first systematic exploration of cognitive heuristics in LLM-driven code vulnerability detection. We introduce a controlled framework that holds the code fixed and only varies the surrounding context to trigger three cognitive heuristics: the halo effect through author attribution, the framing effect through task objectives and consequences, and the anchoring effect through prior analysis results. Within this framework, we evaluate eight LLMs across three programming languages and perform both quantitative and code-level analyses. Our findings demonstrate that all evaluated models are susceptible to these heuristics. Cross-model average susceptibility is highest for framing at 33.2%, followed by anchoring at 23.5% and halo at 18.4%. Code-level analysis reveals that vulnerabilities that require semantic reasoning for detection are more susceptible to cognitive heuristics than those identifiable through pattern matching. Furthermore, models often change their verdict from safe to vulnerable based on the cognitive condition, without accurately identifying the actual vulnerability. To highlight the practical impact, we demonstrate a proof-of-concept black-box cognitive attack that can suppress up to 97% of previously detected vulnerabilities. These findings indicate that cognitive susceptibility is a consistent and exploitable property of LLM-based vulnerability detection.
| Subjects: | Cryptography and Security (cs.CR); Artificial Intelligence (cs.AI) |
| Cite as: | arXiv:2606.30587 [cs.CR] |
| (or arXiv:2606.30587v1 [cs.CR] for this version) | |
| https://doi.org/10.48550/arXiv.2606.30587 Focus to learn more arXiv-issued DOI via DataCite |
Submission history
From: Asif Shahriar [view email][v1] Mon, 29 Jun 2026 17:31:10 UTC (804 KB)
Full-text links:
Access Paper:
-
View a PDF of the paper titled Words Speak Louder Than Code: Investigating Cognitive Heuristics in LLM-Based Code Vulnerability Detection, by Asif Shahriar and 4 other authors
- View PDF
- TeX Source
Current browse context:
cs.CR < prev | next >new | recent | 2026-06 Change to browse by: cs
cs.AI
References & Citations
export BibTeX citation Loading...BibTeX formatted citation
× Data provided by:Bookmark
Bibliographic and Citation Tools
Bibliographic Explorer Toggle Bibliographic Explorer (What is the Explorer?) Connected Papers Toggle Connected Papers (What is Connected Papers?) Litmaps Toggle Litmaps (What is Litmaps?) scite.ai Toggle scite Smart Citations (What are Smart Citations?) Code, Data, MediaCode, Data and Media Associated with this Article
alphaXiv Toggle alphaXiv (What is alphaXiv?) Links to Code Toggle CatalyzeX Code Finder for Papers (What is CatalyzeX?) DagsHub Toggle DagsHub (What is DagsHub?) GotitPub Toggle Gotit.pub (What is GotitPub?) Huggingface Toggle Hugging Face (What is Huggingface?) ScienceCast Toggle ScienceCast (What is ScienceCast?) DemosDemos
Replicate Toggle Replicate (What is Replicate?) Spaces Toggle Hugging Face Spaces (What is Spaces?) Spaces Toggle TXYZ.AI (What is TXYZ.AI?) Related PapersRecommenders and Search Tools
Link to Influence Flower Influence Flower (What are Influence Flowers?) Core recommender toggle CORE Recommender (What is CORE?) About arXivLabsarXivLabs: experimental projects with community collaborators
arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.
Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.
Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs.
Which authors of this paper are endorsers? | Disable MathJax (What is MathJax?)相关条目
精选DeepSeek V4 在 OpenRouter 上的代币份额翻倍,智能体工作负载成主要驱动力
DeepSeek V4 的快速采用表明市场对高性能、低成本推理模型的强烈偏好,尤其是智能体场景将重塑 AI 部署格局。
91
精选启用两项设置使ARC-AGI-3基准测试分数提升三倍
这项发现太关键了!它表明模型的性能不仅取决于训练,还取决于推理时的配置。对于AI工程师和研究者来说,这是一个必须注意的优化方向。特别是那些在资源受限设备上部署模型的团队,可能会因此找到低成本提升能力的方法。
91
精选GPT-5.6:前沿智能与前沿效率的融合
这条消息值得关注,因为它标志着大模型竞争从单纯拼参数转向拼效率。对于AI开发者和企业决策者来说,GPT-5.6意味着可以用更少预算获得更高性能,尤其适合那些被推理成本挡在门外的长上下文或Agent场景。OpenAI这一步,可能重新定义‘前沿’的标准。
91
精选LFM2.5-Encoder:面向CPU快速长上下文推理的新模型
这篇博文让我眼前一亮,因为它直接解决了大模型在CPU上跑长上下文的痛点。对于没有高端GPU的团队或个人开发者,LFM2.5-Encoder系列提供了可立即使用的开源方案。尤其推荐给做RAG、文档搜索或代码分析的朋友——现在用普通服务器就能处理百万级token的文档了。
91
精选GPT-Red:OpenAI通过自我对弈实现AI红队自动化,提升模型鲁棒性
GPT-Red 是红队测试从人工到自动化的里程碑,特别适合安全工程师和对齐研究者关注。它直接降低了测试成本,但也引发了对“自动攻击”本身的伦理讨论——值得所有关注AI治理的人深入思考。
91
精选OpenAI推出GPT-5.5生物漏洞赏金计划
这个计划值得关注,因为它首次将AI漏洞赏金制度拓展到生物安全领域,不仅为安全社区提供了新的研究方向,也为AI风险治理提供了实际演练场。对模型安全研究者、生物安全专家以及关心AI双重用途的从业者尤其重要。
91
精选vLLM推出原生速度Transformers建模后端,大幅提升推理性能
这项更新对于AI工程团队非常关键:无需格式转换意味着能更快地迭代模型,而2-5倍的速度提升直接降低GPU成本。如果你正在做LLM在线服务或者批量推理,这几乎是必读的技术更新。
90
精选Google DeepMind 发布手语转文本模型 SL2T,助力聋人用户
这则消息的意义不仅在于技术突破,更在于AI开始真正关注边缘群体的需求。对开发者而言,SL2T的架构思路和技术路径值得深入研究;对无障碍倡导者来说,这是推动行业标准的重要案例。