arXiv cs.AI· Rui Melo, Andre Catarino, Claudia Mamede, Corina Pasareanu, Rui Abreu·· 12 小时前AI 评分31
模型知道却说不清:关系编码限制代码 LLM 的线性漏洞分类能力
When Models Know but Can't Linearly Say: Relational Encoding Limits Linear Vulnerability Classification in Code LLMs
AI 导读
研究分析 8 个 6.7B-15B 参数的代码模型在 C 程序上的表现,发现漏洞信息更适合以配对关系信号(代码 A 是否比代码 B 风险更高)的形式提取,而非全局可分的类别标签。模型能可靠排序代码风险高低,但标准分类器在孤立样本上准确率有限,因为漏洞与安全样本在表示空间中分布重叠。
正文 · 原文
Abstract:Large language models can detect vulnerable code, yet the form of vulnerability encoding in their representations remains unclear. We analyze 8 code models spanning 6.7B-15B parameters on C programs using three datasets (DELTASECOMMITS, SVEN, and PRECISE-BUGS), comparing two diagnostic tasks on the same representations: identifying what patterns the code instantiates, and determining whether it is vulnerable. Models encode the first with high fidelity. Under the studied paired C-code datasets and linear-probing setup, vulnerability information is more accessible as a paired relational signal-whether code A is riskier than code B-than as a globally separable categorical label. This structural difference has implications for classification: the model reliably ranks which code is riskier but standard classifiers on isolated samples achieve limited accuracy because vulnerable and secure samples form overlapping distributions in representation space.
| Comments: | Accepted at EMNLP Findings |
| Subjects: | Cryptography and Security (cs.CR); Artificial Intelligence (cs.AI) |
| Cite as: | arXiv:2610.27257 [cs.CR] |
| (or arXiv:2610.27257v1 [cs.CR] for this version) | |
| https://doi.org/10.48550/arXiv.2610.27257 arXiv-issued DOI via DataCite (pending registration) |
Submission history
From: Rui Melo [view email]
[v1]
Mon, 19 Oct 2026 20:26:32 UTC (172 KB)
来源:arXiv cs.AI · arxiv.org