paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Coding-PTMs: How to Find Optimal Code Pre-trained Models for Code Embedding in Vulnerability Detection?

Coding-PTMs:如何为漏洞检测中的代码嵌入寻找最优代码预训练模型?
ASE Proceedings of the 39th IEEE/ACM International Conference on Automated Software Engineering2024匹配度 3/10 · 论文关注代码预训练模型选择对漏洞检测的影响,属于 ML+SE/安全方向,但与用户核心的静态分析、Agentic 程序分析、LLM 与形式化验证/浮点/贝叶斯程序分析交叉均无明显关联。其使用随机森林做模型推荐,也不是以当前强 LLM/Agent 为基础改进静态分析的工作。引用 26 inbox
Yu Zhao, Lina Gong, Zhiqiu Huang, Yongwei Wang, Mingqiang Wei, Fei Wu
crossref: 2026-09-12dblp: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:实证表明不同代码预训练模型的嵌入对漏洞检测性能影响显著,并提出基于嵌入指标与随机森林推荐最优模型的 Coding-PTMs 框架。

漏洞检测中常直接复用 CodeBERT、CodeT5、CodeGen 等代码预训练模型生成代码嵌入,却缺乏选择依据,并默认不同模型嵌入对性能影响相似。本文系统研究十种代码预训练模型的嵌入对漏洞检测性能的影响,发现上述假设不成立:不同模型嵌入会显著影响性能,且依据参数规模与嵌入维度选择并不可靠。为量化差异,作者从统计、范数和分布三个维度定义十三种嵌入指标,构建代码预训练模型推荐数据集,并训练随机森林分类器为具体漏洞检测任务从候选模型库中推荐最优模型。结果支持使用 Coding-PTMs 评估候选模型嵌入特征并辅助选择。

问题
漏洞检测实践中常无充分依据地复用不同代码预训练模型生成代码嵌入,且默认不同 PTM 的嵌入对性能影响相似;本文质疑并检验这一前提。
方法
系统比较十种代码 PTM 的嵌入对漏洞检测性能的影响,分析嵌入的数值表示与数据分布,定义统计、范数、分布三维度共十三种指标,构建推荐数据集并用随机森林训练推荐模型。
评估
通过十种代码 PTM 的实证实验验证不同嵌入会影响性能、参数规模与嵌入维度选择不可靠,并评估所提推荐框架从候选模型库中推荐最优 PTM 的效果。
原文摘要(Abstract)

Vulnerability detection is garnering increasing attention in software engineering, since code vulnerabilities possibly pose significant security. Recently, reusing various code pre-trained models (e.g., CodeBERT, CodeT5, and CodeGen) has become common for code embedding without providing reasonable justifications in vulnerability detection. The premise for casually utilizing pre-trained models (PTMs) is that the code embeddings generated by different PTMs would generate a similar impact on the performance. Is that TRUE? To answer this important question, we systematically investigate the effects of code embedding generated by ten different code PTMs on the performance of vulnerability detection, and get the answer, i.e., that is NOT true. We observe that code embedding generated by various code PTMs can indeed influence the performance and selecting an embedding technique based on parameter scales and embedding dimension is not reliable. Our findings highlight the necessity of quantifying and evaluating the characteristics of code embedding generated by various code PTMs to understand the effects. To achieve this goal, we analyze the numerical representation and data distribution of code embedding generated by different PTMs to evaluate differences and characteristics. Based on these insights, we propose Coding-PTMs, a recommendation framework to assist engineers in selecting optimal code PTMs for their specific vulnerability detection tasks. Specifically, we define thirteen code embedding metrics across three dimensions (i.e., statistics, norm, and distribution) for constructing a specialized code PTM recommendation dataset. We then employ a Random Forest classifier to train a recommendation model and identify the optimal code PTMs from the candidate model zoo. We encourage engineers to use our Coding-PTMs to evaluate the characteristics of code embeddings generated by candidate code PTMs on the performance and recommend optimal code PTMs for code embedding in their vulnerability detection tasks.CCS Concepts• Software and its engineering → Empirical software validation; Software defect analysis.

链接与引用

DOI 原文 · arXiv · DBLP

BibTeX
@inproceedings{ZhaoGHWW024,
  title = {Coding-PTMs: How to Find Optimal Code Pre-trained Models for Code Embedding in Vulnerability Detection?},
  author = {Yu Zhao and Lina Gong and Zhiqiu Huang and Yongwei Wang and Mingqiang Wei and Fei Wu},
  booktitle = {ASE},
  year = {2024},
  doi = {10.1145/3691620.3695539}
}