Recent work applies Large Language Models (LLMs) to source-code vulnerability detection, but most evaluations still rely on random train-test splits that ignore time and overestimate real-world performance. In practice, detectors are deployed on evolving code bases and must recognise future vulnerabilities under temporal distribution shift. This paper investigates continual fine-tuning of a decoder-style language model (microsoft/phi-2 with LoRA) on a CVE-linked dataset spanning 2018-2024, organised into bi-monthly windows. We evaluate eight continual learning strategies, including window-only and cumulative training, replay-based baselines and regularisation-based variants. We propose Hybrid Class-Aware Selective Replay (Hybrid-CASR), a confidence-aware replay method for binary vulnerability classification that prioritises uncertain samples while maintaining a balanced ratio of VULNERABLE and FIXED functions in the replay buffer. On bi-monthly forward evaluation Hybrid-CASR achieves a Macro-F1 of 0.667, improving on the window-only baseline (0.651) by 0.016 with statistically significant gains ($p = 0.026$) and stronger backward retention (IBR@1 of 0.741). Hybrid-CASR also reduces training time per window by about 17 percent compared to the baseline, whereas cumulative training delivers only a minor F1 increase (0.661) at a 15.9-fold computational cost. Overall, the results show that selective replay with class balancing offers a practical accuracy-efficiency trade-off for LLM-based temporal vulnerability detection under continuous temporal drift.


翻译:近期研究将大语言模型应用于源代码漏洞检测,但多数评估仍采用忽略时间维度的随机训练-测试划分方法,从而高估了实际性能。在实践中,检测器需部署于持续演化的代码库中,并必须在时序分布偏移下识别未来漏洞。本文基于2018-2024年跨度的CVE关联数据集(按双月窗口组织),研究了解码器式语言模型的持续微调方法(采用microsoft/phi-2模型与LoRA技术)。我们评估了八种持续学习策略,包括仅窗口训练、累积训练、基于重放的基线方法及基于正则化的变体。本文提出混合类感知选择性重放方法,这是一种面向二元漏洞分类的置信度感知重放方法,其通过优先选择不确定性样本,同时在重放缓冲区中维持漏洞函数与修复函数的平衡比例。在双月前向评估中,Hybrid-CASR取得了0.667的宏观F1值,较仅窗口基线(0.651)提升0.016,且具有统计学显著增益($p = 0.026$)与更强的后向保持能力(IBR@1达0.741)。与基线相比,Hybrid-CASR还将每个窗口的训练时间降低约17%,而累积训练仅带来微小的F1提升(0.661)却需付出15.9倍的计算成本。总体而言,研究结果表明:在持续时序漂移条件下,采用类别平衡的选择性重放策略能为基于大语言模型的时序漏洞检测提供精度与效率的实用权衡方案。

0
下载
关闭预览

相关内容

《大型语言模型持续学习》综述
专知会员服务
93+阅读 · 2024年4月26日
大型语言模型在预测和异常检测中的应用综述
专知会员服务
70+阅读 · 2024年2月19日
【Google-BryanLim等】可解释深度学习时序预测
专知会员服务
64+阅读 · 2021年12月19日
「知识增强预训练语言模型」最新研究综述
专知
18+阅读 · 2022年11月18日
综述:深度学习时代的目标检测算法
极市平台
27+阅读 · 2018年3月17日
展望:模型驱动的深度学习
人工智能学家
12+阅读 · 2018年1月23日
国家自然科学基金
4+阅读 · 2017年12月31日
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
6+阅读 · 2017年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
31+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
VIP会员
最新内容
KDD 2026 | MixRAGRec:面向LLM推荐的混合专家KG-RAG框架
BES:让语言模型通过双向进化搜索自我改进
专知会员服务
3+阅读 · 5月30日
以色列-美国-伊朗战争中的无人机:关键要点
专知会员服务
4+阅读 · 5月30日
《Palantir任务保障性软件安全标准(MA-S2)》
专知会员服务
14+阅读 · 5月30日
基于声学的无人机检测技术综述
专知会员服务
8+阅读 · 5月30日
《当代混合战争分析框架:俄乌战争经验教训》
战略前沿人工智能的再思考(中文)
专知会员服务
8+阅读 · 5月29日
《量化地基防空系统间接效应的博弈论方法》
专知会员服务
6+阅读 · 5月29日
相关基金
国家自然科学基金
4+阅读 · 2017年12月31日
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
6+阅读 · 2017年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
31+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员