Pre-training by Predicting Program Dependencies for Vulnerability Analysis Tasks
Zhongxin Liu, Zhijie Tang, Junwei Zhang, Xin Xia, Xiaohu Yang
Abstract
Vulnerability analysis is crucial for software security. Inspired by the success of pre-trained models on software engineering tasks, this work focuses on using pre-training techniques to enhance the understanding of vulnerable code and boost vulnerability analysis. The code understanding ability of a pre-trained model is highly related to its pre-training objectives. The semantic structure, e.g., control and data dependencies, of code is important for vulnerability analysis. However, existing pre-training objectives either ignore such structure or focus on learning to use it. The feasibility and benefits of learning the knowledge of analyzing semantic structure have not been investigated. To this end, this work proposes two novel pre-training objectives, namely Control Dependency Prediction (CDP) and Data Dependency Prediction (DDP), which aim to predict the statement-level control dependencies and token-level data dependencies, respectively, in a code snippet only based on its source code. During pre-training, CDP and DDP can guide the model to learn the knowledge required for analyzing fine-grained dependencies in code. After pre-training, the pre-trained model can boost the understanding of vulnerable code during fine-tuning and can directly be used to perform dependence analysis for both partial and complete functions. To demonstrate the benefits of our pre-training objectives, we pre-train a Transformer model named PDBERT with CDP and DDP, fine-tune it on three vulnerability analysis tasks, i.e., vulnerability detection, vulnerability classification, and vulnerability assessment, and also evaluate it on program dependence analysis. Experimental results show that PDBERT benefits from CDP and DDP, leading to state-of-the-art performance on the three downstream tasks. Also, PDBERT achieves F1-scores of over 99% and 94% for predicting control and data dependencies, respectively, in partial and complete functions.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
7 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- SymRadar: PoC-Centered Bounded Verification for Vulnerability Repair cites Top Score on the Wrong Exam: On Benchmarking in Machine Learning for Vulnerability Detection
- CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation cites ELECTRA: Pre-training Text Encoders as Discriminators Rather Than Generators
- Top Score on the Wrong Exam: On Benchmarking in Machine Learning for Vulnerability Detection cites CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation
- Chasing Shadows: Pitfalls in LLM Security Research cites CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation
- Chasing Shadows: Pitfalls in LLM Security Research cites Top Score on the Wrong Exam: On Benchmarking in Machine Learning for Vulnerability Detection
- Chasing Shadows: Pitfalls in LLM Security Research cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- Chasing Shadows: Pitfalls in LLM Security Research cites GraphCodeBERT: Pre-training Code Representations with Data Flow
- CodeBERT: A Pre-Trained Model for Programming and Natural Languages cites ELECTRA: Pre-training Text Encoders as Discriminators Rather Than Generators
- Towards More Trustworthy Deep Code Models by Enabling Out-of-Distribution Detection cites A Simple Framework for Contrastive Learning of Visual Representations
- Towards More Trustworthy Deep Code Models by Enabling Out-of-Distribution Detection cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- Towards More Trustworthy Deep Code Models by Enabling Out-of-Distribution Detection cites GraphCodeBERT: Pre-training Code Representations with Data Flow
- Large Language Model-Aided Partial Program Dependence Analysis cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
Cited by top-tier papers7
- Chasing Shadows: Pitfalls in LLM Security ResearchJonathan Evertz, Niklas Risse, Nicolai Neuer, Andreas Müller et al.NDSS 2026 · 17 citations
- Top Score on the Wrong Exam: On Benchmarking in Machine Learning for Vulnerability DetectionNiklas Risse, Jing Liu, Marcel BöhmeISSTA 2025 · 8 citations
- SymRadar: PoC-Centered Bounded Verification for Vulnerability RepairSeungheon Han, YoungJae Kim, Yeseung Lee, Jooyong YiICSE 2026 · 1 citation
- Towards More Trustworthy Deep Code Models by Enabling Out-of-Distribution DetectionYanfu Yan, Viet Duong, Huajie Shao, Denys PoshyvanykICSE 2025 · 1 citation
- Large Language Model-Aided Partial Program Dependence AnalysisXiaokai Rong, Aashish Yadavally, Tien N. NguyenICSE 2026 · 1 citation
Builds on27
- A Simple Framework for Contrastive Learning of Visual RepresentationsTing Chen, Simon Kornblith, Mohammad Norouzi, Geoffrey E. HintonICML 2020 · 24,064 citations
- CodeBERT: A Pre-Trained Model for Programming and Natural LanguagesZhangyin Feng, Daya Guo, Duyu Tang, Nan Duan et al.EMNLP Findings 2020 · 2,828 citations
- GraphCodeBERT: Pre-training Code Representations with Data FlowDaya Guo, Shuo Ren, Shuai Lu, Zhangyin Feng et al.ICLR 2021 · 1,644 citations
- CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and GenerationYue Wang, Weishi Wang, Shafiq R. Joty, Steven C. H. HoiEMNLP 2021 · 1,224 citations
- ELECTRA: Pre-training Text Encoders as Discriminators Rather Than GeneratorsKevin Clark, Minh-Thang Luong, Quoc V. Le, Christopher D. ManningICLR 2020 · 541 citations
Related papers
- Coding-PTMs: How to Find Optimal Code Pre-trained Models for Code Embedding in Vulnerability Detection?Yu Zhao, Lina Gong, Zhiqiu Huang, Yongwei Wang et al.ASE 2024 · 10 citations
- CodeArt: Better Code Models by Attention Regularization When Symbols Are LackingZian Su, Xiangzhe Xu, Ziyang Huang, Zhuo Zhang et al.FSE 2024 · 1 citation
- Learning to Locate and Describe VulnerabilitiesJian Zhang, Shangqing Liu, Xu Wang, Tianlin Li et al.ASE 2023 · 8 citations
- SCALE: Constructing Structured Natural Language Comment Trees for Software Vulnerability DetectionXin-Cheng Wen, Cuiyun Gao, Shuzheng Gao, Yang Xiao et al.ISSTA 2024 · 17 citations
- DOBF: A Deobfuscation Pre-Training Objective for Programming LanguagesMarie-Anne Lachaux, Baptiste Rozière, Marc Szafraniec, Guillaume LampleNeurIPS 2021 · 174 citations
