LPASS: Linear Probes as Stepping Stones for vulnerability detection using compressed LLMs

📄 arXiv: 2505.24451v1 📥 PDF

作者: Luis Ibanez-Lissen, Lorena Gonzalez-Manzano, Jose Maria de Fuentes, Nicolas Anciaux

分类: cs.CR, cs.AI

发布日期: 2025-05-30


💡 一句话要点

提出LPASS以提高压缩LLM在漏洞检测中的效率

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 大型语言模型 漏洞检测 线性探针 压缩技术 网络安全 模型评估 计算效率

📋 核心要点

  1. 现有的压缩和微调技术在提高LLM性能的同时,消耗了大量的计算资源,效率较低。
  2. 本文提出了LPASS方法,通过线性探针在微调前评估压缩LLM的性能,降低计算成本。
  3. 实验结果表明,LPASS方法在多类漏洞检测中达到了86.9%的准确率,并显著提高了训练和推理效率。

📝 摘要(中文)

大型语言模型(LLMs)在网络安全领域被广泛应用,尤其是在检测脆弱代码方面。为了提高效率和有效性,研究者们开发了压缩和微调技术。然而,这些方法通常需要大量的计算资源。本文分析了如何利用线性探针(LPs)在微调之前对压缩LLM的性能进行早期评估,并展示了其在应用层修剪压缩时的适用性。我们的方法LPASS在BERT和Gemma上应用于检测MITRE 25个最危险漏洞中的12个,结果显示,LPs计算时间为142.97秒,且可以在不损失精度的情况下去除33.3%和72.2%的层。LPASS基于的LLMs在多类漏洞检测中达到了86.9%的准确率,且Gemma的压缩版本在F1分数上比原始版本提高了1.6%。

🔬 方法详解

问题定义:本文旨在解决在使用压缩大型语言模型(LLM)进行漏洞检测时,现有方法在效率和计算资源消耗上的不足。现有的微调和压缩技术通常需要大量的计算资源,导致效率低下。

核心思路:论文提出的核心思路是利用线性探针(LPs)在微调之前对压缩LLM的性能进行早期评估,从而减少计算成本并提高效率。通过这种方式,研究者能够在不进行全面微调的情况下,快速判断模型的有效性。

技术框架:LPASS方法的整体架构包括几个主要模块:首先,使用线性探针对压缩后的模型进行性能评估;其次,基于评估结果进行层修剪;最后,验证修剪后的模型在漏洞检测任务中的表现。

关键创新:最重要的技术创新点在于将线性探针应用于压缩LLM的早期性能评估,这一方法与传统的微调方法相比,显著降低了计算资源的消耗,并提供了有效的性能预测。

关键设计:在设计中,研究者设置了特定的参数以优化线性探针的性能,并选择了适当的损失函数和网络结构,以确保在压缩过程中不损失模型的精度。

📊 实验亮点

实验结果显示,LPASS方法在多类漏洞检测中达到了86.9%的准确率,且基于LPASS的Gemma压缩版本在F1分数上比原始版本提高了1.6%。此外,该方法在训练和推理时间上分别节省了29.4%和23.8%,模型大小减少了42.98%。

🎯 应用场景

该研究的潜在应用领域包括网络安全、代码审查和自动化漏洞检测等。通过提高压缩LLM在漏洞检测中的效率,LPASS方法能够帮助开发者更快速地识别和修复安全漏洞,从而提升软件的安全性和可靠性。未来,随着LLM技术的不断发展,LPASS方法可能会在更多的安全应用中发挥重要作用。

📄 摘要(原文)

Large Language Models (LLMs) are being extensively used for cybersecurity purposes. One of them is the detection of vulnerable codes. For the sake of efficiency and effectiveness, compression and fine-tuning techniques are being developed, respectively. However, they involve spending substantial computational efforts. In this vein, we analyse how Linear Probes (LPs) can be used to provide an estimation on the performance of a compressed LLM at an early phase -- before fine-tuning. We also show their suitability to set the cut-off point when applying layer pruning compression. Our approach, dubbed $LPASS$, is applied in BERT and Gemma for the detection of 12 of MITRE's Top 25 most dangerous vulnerabilities on 480k C/C++ samples. LPs can be computed in 142.97 s. and provide key findings: (1) 33.3 \% and 72.2\% of layers can be removed, respectively, with no precision loss; (2) they provide an early estimate of the post-fine-tuning and post-compression model effectiveness, with 3\% and 8.68\% as the lowest and average precision errors, respectively. $LPASS$-based LLMs outperform the state of the art, reaching 86.9\% of accuracy in multi-class vulnerability detection. Interestingly, $LPASS$-based compressed versions of Gemma outperform the original ones by 1.6\% of F1-score at a maximum while saving 29.4 \% and 23.8\% of training and inference time and 42.98\% of model size.