CGP-Tuning: Structure-Aware Soft Prompt Tuning for Code Vulnerability Detection
Ruijun Feng, Hammond Pearce, Pietro Liguori, Yulei Sui

TL;DR
CGP-Tuning introduces a structure-aware soft prompt tuning method that leverages code graph semantics to improve vulnerability detection in large language models, achieving better accuracy and efficiency.
Contribution
It proposes a novel type-aware embedding and an efficient cross-modal alignment module for graph-enhanced prompt tuning tailored to code vulnerability detection.
Findings
Outperforms baseline by 4 percentage points in accuracy
Outperforms zero-shot prompting by 15 percentage points
Maintains practical inference speed
Abstract
Large language models (LLMs) have been proposed as powerful tools for detecting software vulnerabilities, where task-specific fine-tuning is typically employed to provide vulnerability-specific knowledge to the LLMs. However, existing fine-tuning techniques often treat source code as plain text, losing the graph-based structural information inherent in code. Graph-enhanced soft prompt tuning addresses this by translating the structural information into contextual cues that the LLM can understand. However, current methods are primarily designed for general graph-related tasks and focus more on adjacency information, they fall short in preserving the rich semantic information (e.g., control/data flow) within code graphs. They also fail to ensure computational efficiency while capturing graph-text interactions in their cross-modal alignment module. This paper presents CGP-Tuning, a new…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Testing and Debugging Techniques · Advanced Malware Detection Techniques · Security and Verification in Computing
MethodsFocus
