VulStyle:一种多模态预训练用于代码风格度量增强的漏洞检测
VulStyle: A Multi-Modal Pre-Training for Code Stylometry-Augmented Vulnerability Detection
AI总结:
VulStyle通过融合函数级源代码、非终端AST结构和代码风格度量特征,提升漏洞检测性能,实现BigVul和VulDeePecker上的F1指标提升。
摘要:
我们提出了VulStyle,一种多模态软件漏洞检测模型,联合编码函数级源代码、非终端抽象语法树(AST)结构和代码风格度量(CStyle)特征。先前的工作主要依赖于令牌级模型或完整的AST树,常常遗漏指示高风险编程实践的风格线索,或导致高结构开销。我们的方法选择仅非终端AST节点,减少输入复杂性同时保持语义层次,并将语法和词汇CStyle特征作为辅助漏洞信号。VulStyle通过在七种编程语言中490万个函数上进行掩码语言建模预训练,并在Devign、BigVul、DiverseVul、REVEAL和VulDeePecker五个基准数据集上进行微调。VulStyle在BigVul和VulDeePecker上实现了最先进的性能,比强大的Transformer基线提高了4-48%的F1指标,并在所有基准上取得了竞争或最佳的平均性能。我们贡献了隔离CStyle和AST结构影响的消融研究、错误案例分析以及将检测任务置于攻击者现实场景中的威胁模型。
英文摘要:
We present VulStyle, a multi-modal software vulnerability detection model that jointly encodes function-level source code, non-terminal Abstract Syntax Tree (AST) structure, and code stylometry (CStyle) features. Prior work in code representation primarily leverages token-level models or full AST trees, often missing stylistic cues indicative of risky programming practices, or incurring high structural overhead. Our approach selects only non-terminal AST nodes, reducing input complexity while preserving semantic hierarchy, and integrates syntactic and lexical CStyle features as auxiliary vulnerability signals. VulStyle is pre-trained using masked language modeling on 4.9M functions across seven programming languages, and fine-tuned across five benchmark datasets: Devign, BigVul, DiverseVul, REVEAL, and VulDeePecker. VulStyle achieves state-of-the-art performance on BigVul and VulDeePecker, improving F1 by 4-48% over strong transformer baselines, and attains competitive or best-average performance across all benchmarks. We contribute an ablation study isolating the effect of CStyle and AST structure, error case analysis, and a threat model situating the detection task in attacker-realistic scenarios.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。