CGP-Tuning: Structure-Aware Soft Prompt Tuning for Code Vulnerability Detection
Not on the map. Why?
Abstract (arXiv)
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 code graph-enhanced, structure-aware soft prompt tuning method for vulnerability detection. CGP-Tuning introduces type-aware embeddings to capture the rich semantic information within code graphs, along with an efficient cross-modal alignment module that achieves linear computational costs while incorporating graph-text interactions. It is evaluated on the latest DiverseVul dataset and three advanced open-source code LLMs, CodeLlama, CodeGemma, and Qwen2.5-Coder. Experimental results show that CGP-Tuning delivers model-agnostic improvements and maintains practical inference speed, surpassing the best graph-enhanced soft prompt tuning baseline by an average of four percentage points and outperforming non-tuned zero-shot prompting by 15 percentage points.
Key facts. Cited by 2 papers in the map (data through 7 Oct 2026). Builds on 34 of its 67 references that are in the map. First posted on arXiv 8 Jan 2025.
Builds on
34 of 67 references.
References · 34
- 2017Attention Is All You Needcited by 59,932
- 2015Deep Residual Learning for Image Recognitioncited by 51,809
- 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,084
- 2016Semi-Supervised Classification with Graph Convolutional Networkscited by 11,282
- 2017Graph Attention Networkscited by 8,854
- 2020Scaling Laws for Neural Language Modelscited by 6,411
- 2016Layer Normalizationcited by 5,579
- 2021Prefix-Tuning: Optimizing Continuous Prompts for Generationcited by 3,878
- 2021The Power of Scale for Parameter-Efficient Prompt Tuningcited by 3,769
- 2023Code Llama: Open Foundation Models for Codecited by 2,105
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
- 2024Qwen2.5-Coder Technical Reportcited by 1,151
22 more
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
- 2023WizardCoder: Empowering Code Large Language Models with Evol-Instructcited by 728
- 2023A Prompt Pattern Catalog to Enhance Prompt Engineering with ChatGPTcited by 612
- 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 600
- 2019Graph Transformer Networkscited by 520
- 2024StarCoder 2 and The Stack v2: The Next Generationcited by 484
- 2023GraphGPT: Graph Instruction Tuning for Large Language Modelscited by 223
- 2024G-Retriever: Retrieval-Augmented Generation for Textual Graph Understanding and Question Answeringcited by 217
- 2024LLaGA: Large Language and Graph Assistantcited by 177
- 2023Talk like a Graph: Encoding Graphs for Large Language Modelscited by 175
- 2019ASAP: Adaptive Structure Aware Pooling for Learning Hierarchical Graph Representationscited by 156
- 2024CodeGemma: Open Code Models Based on Gemmacited by 145
- 2020Deep Learning based Vulnerability Detection: Are We There Yet?cited by 142
- 2024Generalization or Memorization: Data Contamination and Trustworthy Evaluation for Large Language Modelscited by 119
- 2023DiverseVul: A New Vulnerable Source Code Dataset for Deep Learning Based Vulnerability Detectioncited by 98
- 2023Graph Neural Prompting with Large Language Modelscited by 64
- 2024Large Language Model for Vulnerability Detection: Emerging Results and Future Directionscited by 44
- 2022Transformer-Based Language Models for Software Vulnerability Detectioncited by 39
- 2024XRec: Large Language Models for Explainable Recommendationcited by 34
- 2024On Inter-dataset Code Duplication and Data Leakage in Large Language Modelscited by 10
- 2024GALLa: Graph Aligned Large Language Models for Improved Source Code Understandingcited by 7
- 2024Code Vulnerability Detection: A Comparative Analysis of Emerging Large Language Modelscited by 3
Built on by
Citing papers per year: 2025: 1; 2026: 1.
2 papers.