Skip to main navigation Skip to search Skip to main content

ParaVul: A Parallel Large Language Model and Retrieval-Augmented Framework for Smart Contract Vulnerability Detection

  • Tenghui Huang
  • , Jinbo Wen
  • , Jiawen Kang*
  • , Siyong Chen
  • , Zhengtao Li
  • , Tao Zhang
  • , Dongning Liu
  • , Jiacheng Wang
  • , Chengjun Cai
  • , Yinqiu Liu
  • *Corresponding author for this work
  • Guangdong University of Technology
  • City University of Hong Kong
  • Beijing Jiaotong University
  • Nanyang Technological University

Research output: Contribution to journalArticlepeer-review

Abstract

Smart contracts play a significant role in automating blockchain services. Nevertheless, vulnerabilities in smart contracts pose serious threats to blockchain security. Currently, traditional detection methods primarily rely on static analysis and formal verification, which can result in high false-positive rates and poor scalability. Large Language Models (LLMs) have recently made significant progress in smart contract vulnerability detection. However, they still face challenges such as high inference costs and substantial computational overhead. In this paper, we propose ParaVul, a parallel LLM and retrieval-augmented framework to improve the reliability and accuracy of smart contract vulnerability detection. Specifically, we first develop Sparse Low-Rank Adaptation (SLoRA), a technique for efficient LLM fine-tuning tailored to smart contract vulnerability detection. Distinct from existing LoRA methods, SLoRA inserts parallel sparse and low-rank branches after the attention projection and the feed-forward block, enabling LLMs to capture both global code semantics and localized vulnerability patterns while maintaining low training overhead. We then construct a vulnerability contract knowledge base and develop a hybrid Retrieval-Augmented Generation (RAG) system that integrates Okapi BM25 with dense retrieval to provide complementary lexical and semantic evidence for smart contract vulnerability verification. Furthermore, we propose a meta-learner-based gated verification module to fuse the outputs of the SLoRA detector and the two RAG-based detectors, thereby generating the final detection results. After completing vulnerability detection, we design chain-of-thought prompts to guide LLMs to generate comprehensive vulnerability detection reports. Simulation results demonstrate the superiority of ParaVul, especially in terms of F1 scores, achieving 0.9398 for single-label detection and 0.9930 for multi-label detection.

Original languageEnglish
Pages (from-to)5017-5030
Number of pages14
JournalIEEE Transactions on Information Forensics and Security
Volume21
DOIs
StatePublished - 2026

Keywords

  • LLMs
  • Okapi BM25
  • SLoRA
  • Smart contract
  • gated verification
  • hybrid RAG
  • vulnerability detection

Fingerprint

Dive into the research topics of 'ParaVul: A Parallel Large Language Model and Retrieval-Augmented Framework for Smart Contract Vulnerability Detection'. Together they form a unique fingerprint.

Cite this