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

SAGE:基于LLM的漏洞检测中的信号增强引导嵌入

SAGE: Signal-Amplified Guided Embeddings for LLM-based Vulnerability Detection

Shandong University(山东大学);Quancheng Laboratory(泉城实验室);Nanjing University(南京大学)

Zhengyang Shan, Xu Qian, Jiayun Xin, Minghui Xu, Yue Zhang, Zhen Yang, Hao Wu, Xiuzhen Cheng

AI总结:

SAGE通过引入稀疏自编码器增强漏洞信号,提升LLM在漏洞检测中的性能,实验显示其在多个数据集上表现优异,显著提升 Matthews Correlation Coefficient。

摘要:

软件漏洞是现代基础设施的主要威胁。尽管静态分析和图神经网络长期作为漏洞检测的基础,但大语言模型(LLM)的出现引入了由强大语义推理和跨环境泛化能力驱动的新范式。然而,在基于LLM的漏洞检测中,我们发现了一个根本性的瓶颈,称为信号淹没:漏洞相关的特征在内部被激活,但被主导的功能语义数值压制。为此,我们提出了SAGE(信号增强引导嵌入)框架,从被动信号淹没转向主动信号恢复。SAGE整合任务条件的稀疏自编码器(SAEs)以隔离并放大这些微弱的漏洞信号。在BigVul、PrimeVul和PreciseBugs上的广泛评估表明,SAGE实现了最先进的性能。值得注意的是,SAGE通过稀疏流形投影将内部信号噪声比(SNR)提高12.7倍,从而在未见分布上使7B模型的Matthews Correlation Coefficient(MCC)提升达318%,在经典数据集上提升319%。通过在13种编程语言上保持稳健性能并超越34B基准,SAGE建立了比简单参数扩展更高效和可扩展的软件安全路径。

英文摘要:

Software vulnerabilities are a primary threat to modern infrastructure. While static analysis and Graph Neural Networks have long served as the foundation for vulnerability detection, the emergence of Large Language Models (LLMs) has introduced a transformative paradigm driven by superior semantic reasoning and cross-environment generalization. However, in the context of LLM-based vulnerability detection, we identify a fundamental bottleneck in these models termed \textbf{Signal Submersion}: a state where features related to vulnerability are activated internally but numerically overwhelmed by dominant functional semantics. To address this, we propose \textbf{SAGE} (\textbf{S}ignal-\textbf{A}mplified \textbf{G}uided \textbf{E}mbeddings), a framework that shifts from passive signal submersion to active signal recovery. SAGE integrates task-conditional Sparse Autoencoders (SAEs) to isolate and amplify these faint vulnerability signals. Extensive evaluations on BigVul, PrimeVul, and PreciseBugs demonstrate that SAGE achieves state-of-the-art performance. Notably, SAGE mitigates Signal Submersion by increasing the internal Signal-to-Noise Ratio (SNR) by 12.7$\times$ via sparse manifold projection. This mechanistic intervention enables a 7B model to achieve up to 318\% Matthews Correlation Coefficient (MCC) gains on unseen distributions and a 319\% gain on classic datasets. By maintaining robust performance across 13 programming languages and outperforming 34B baselines, SAGE establishes a more efficient and scalable path to software security than simple parameter scaling.

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

↑