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

“一刀切”行不通!通过混合专家模型(MoE)增强漏洞检测

One-for-All Does Not Work! Enhancing Vulnerability Detection by Mixture-of-Experts (MoE)

Xu Yang, Shaowei Wang, Jiayuan Zhou, Wenhan Zhu

AI总结:

针对“一刀切”漏洞检测模型性能欠佳的问题,提出采用混合专家(MoE)框架的MoEVD方法,将任务分解为CWE类型分类和特定检测,显著提升F1分数及长尾漏洞检测性能。

摘要:

基于深度学习的漏洞检测(DLVD)技术因能从已受攻击的代码中自动学习漏洞模式而备受关注。尽管早期工具展现出显著准确率,但DLVD方法在现实场景的广泛应用仍面临重大挑战。主要问题是“一刀切”设计,即单一模型被训练处理所有类型漏洞,无法捕捉不同漏洞类型的模式,导致性能欠佳,尤其对训练数据中代表性不足的少见漏洞。为此,我们提出MoEVD,采用混合专家(MoE)框架进行漏洞检测,将其分解为CWE类型分类和CWE特定漏洞检测两个任务,让特定专家处理不同漏洞类型而非单一模型全包。结果显示,MoEVD的F1分数达0.44,比所有研究的最先进(SOTA)基线至少高出12.8%;在几乎所有CWE类型上表现优异,召回率比最佳SOTA基线提升9%至77.8%;且未牺牲长尾CWE类型的性能,其MoE设计使这些类型的F1分数至少提升7.3%,有效解决长尾问题。

英文摘要:

Deep Learning-based Vulnerability Detection (DLVD) techniques have garnered significant interest due to their ability to automatically learn vulnerability patterns from previously compromised code. Despite the notable accuracy demonstrated by pioneering tools, the broader application of DLVD methods in real-world scenarios is hindered by significant challenges. A primary issue is the "one-for-all" design, where a single model is trained to handle all types of vulnerabilities. This approach fails to capture the patterns of different vulnerability types, resulting in suboptimal performance, particularly for less common vulnerabilities that are often underrepresented in training datasets. To address these challenges, we propose MoEVD, which adopts the Mixture-of-Experts (MoE) framework for vulnerability detection. MoEVD decomposes vulnerability detection into two tasks, CWE type classification and CWE-specific vulnerability detection. By splitting the task, in vulnerability detection, MoEVD allows specific experts to handle distinct types of vulnerabilities instead of handling all vulnerabilities within one model. Our results show that MoEVD achieves an F1-score of 0.44, significantly outperforming all studied state-of-the-art (SOTA) baselines by at least 12.8%. MoEVD excels across almost all CWE types, improving recall over the best SOTA baseline by 9% to 77.8%. Notably, MoEVD does not sacrifice performance on long-tailed CWE types; instead, its MoE design enhances performance (F1-score) on these by at least 7.3%, addressing long-tailed issues effectively.

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

↑