arXiv:2604.25599cs.SEcs.LG2026-04

对比多种模型组合,找出代码分类与漏洞检测中真正关键的要素。

PLMGH: What Matters in PLM-GNN Hybrids for Code Classification and Vulnerability Detection

论文配图:PLMGH: What Matters in PLM-GNN Hybrids for Code Classification and Vulnerability Detection
图 1 · 摘自论文原文
  • 系统性测试三种PLM与三种GNN的组合效果
  • 大PLM不必然更好,且PLM选择比GNN更重要
  • 为代码安全分析提供可落地的设计建议

代码理解模型越来越多地依赖预训练语言模型(PLMs)和图神经网络(GNNs),二者分别捕捉语义与结构信息。本文通过系统性实验,将三种代码专用PLM与三种基础GNN架构进行配对,在Java250和Devign数据集上评估其在代码分类与漏洞检测任务中的表现,包括标识符混淆场景。结果表明,混合模型在两项任务中均优于仅用GNN的基线,且常优于冻结的PLM。在Devign数据集上,性能与鲁棒性更依赖于PLM特征来源而非GNN主干。研究还发现,更大的PLM未必是更好的特征提取器,且PLM的选择影响力大于GNN选择。最后,基于这些发现提炼出面向代码分类与漏洞检测的PLM-GNN设计实用指南。

原文摘要 · Abstract (English)

Code understanding models increasingly rely on pretrained language models (PLMs) and graph neural networks (GNNs), which capture complementary semantic and structural information. We conduct a controlled empirical study of PLM-GNN hybrids for code classification and vulnerability detection tasks by systematically pairing three code-specialized PLMs with three foundational GNN architectures. We compare these hybrids against PLM-only and GNN-only baselines on Java250 and Devign, including an identifier-obfuscation setting. Across both tasks, hybrids consistently outperform GNN-only baselines and often improve ranking quality over frozen PLMs. On Devign, performance and robustness are more sensitive to the PLM feature source than to the GNN backbone. We also find that larger PLMs are not necessarily better feature extractors in this pipeline, and that the PLM choice has more impact than the GNN choice. Finally, we distill these findings into practical guidelines for PLM-GNN design choices in code classification and vulnerability detection.

代码理解GNNPLM漏洞检测

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。