CLeVeR: Multi-modal Contrastive Learning for Vulnerability Code Representation

Automated vulnerability detection has become increasingly important.Many existing methods utilize deep learning models to obtain code representations for vulnerability detection.However, these approaches predominantly capture the overall semantics of the code rather than its intrinsic vulnerability-specific semantics.To address this issue, we propose CLeVeR, the first approach that leverages contrastive learning to generate precise vulnerability code representations under the supervision of vulnerability descriptions.Specifically, we introduce an Adapter, a Representation Refinement module, and a Description Simulator to mitigate the challenges of semantic misalignment and imbalance between code and descriptions, and input data inconsistency between pre-training and fine-tuning stages, respectively.For vulnerability detection and classification tasks, CLeVeR achieves F1 scores of 72.82% (real-world dataset) and 80.34%, outperforming state-of-the-art methods (SOTAs) by 11.85% and 13.61%.Additionally, CLeVeR also outperforms SOTAs in zero-shot inference, demonstrating the transferability of its generated vulnerability code representations.

Authors

Publication Details

Published
2025-01-01
DOI
https://doi.org/10.18653/v1/2025.findings-acl.414
Citations
2
Primary Topic
Web Application Security Vulnerabilities
Type
article
Field-Weighted Citation Impact
6.49
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

CLeVeR: Multi-modal Contrastive Learning for Vulnerability Code Representation

Hongsong Zhu, Lun Li, Lei Cui, Sen Zhao et al.
2 citations
Web Application Security Vulnerabilities
6.49
article

CLeVeR: Multi-modal Contrastive Learning for Vulnerability Code Representation

Hongsong Zhu, Lun Li, Lei Cui, Sen Zhao, Yun Yang, Jiayuan Li
article en
2 citations

Abstract

Automated vulnerability detection has become increasingly important.Many existing methods utilize deep learning models to obtain code representations for vulnerability detection.However, these approaches predominantly capture the overall semantics of the code rather than its intrinsic vulnerability-specific semantics.To address this issue, we propose CLeVeR, the first approach that leverages contrastive learning to generate precise vulnerability code representations under the supervision of vulnerability descriptions.Specifically, we introduce an Adapter, a Representation Refinement module, and a Description Simulator to mitigate the challenges of semantic misalignment and imbalance between code and descriptions, and input data inconsistency between pre-training and fine-tuning stages, respectively.For vulnerability detection and classification tasks, CLeVeR achieves F1 scores of 72.82% (real-world dataset) and 80.34%, outperforming state-of-the-art methods (SOTAs) by 11.85% and 13.61%.Additionally, CLeVeR also outperforms SOTAs in zero-shot inference, demonstrating the transferability of its generated vulnerability code representations.

Reduced inequalities
Openalex Percentile: Top 3%
Web Application Security Vulnerabilities
6.49
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.