ICASSP 2025accepted0 citations

Steering Large Language Models for Vulnerability Detection

Jiayuan Li, Lei Cui, Jie Zhang, Haiqiang Fei, Yu Chen, Hongsong Zhu

Abstract

Vulnerability detection remains a critical challenge in the field of security. Many existing approaches extract code representations for vulnerability detection. However, these methods often focus on the overall semantics of the code, neglecting to specifically target vulnerability-related semantics. To address this limitation, we propose a novel LLM steering method designed to steer LLMs to focus on vulnerability concepts, thereby enhancing their performance in vulnerability detection. Specifically, we introduce a vulnerability steering vector that represents the concept of vulnerability in the representation space. This vector is generated using a paired vulnerability-patch function dataset, effectively capturing the essence of vulnerabilities. Experimental results demonstrate that the proposed method significantly improves LLMs' performance and notably outperforms existing SOTA methods in vulnerability detection tasks. Furthermore, we validate the cross-language transferability of the steering vector and explore the explainability of vulnerability detection.

BibTeX
@inproceedings{icassp2025_steeringlargelan,
  title = {Steering Large Language Models for Vulnerability Detection},
  author = {Jiayuan Li and Lei Cui and Jie Zhang and Haiqiang Fei and Yu Chen and Hongsong Zhu},
  booktitle = {ICASSP 2025},
  year = {2025}
}