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

Research output: Journal Publications and Reviews › RGC 21 - Publication in refereed journal › peer-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 retrievalaugmented 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. © 2005-2012 IEEE.
Original languageEnglish
Pages (from-to)5017-5030
Number of pages14
JournalIEEE Transactions on Information Forensics and Security
Volume21
Online published18 May 2026
DOIs
Publication statusPublished - 2026

Funding

This work was supported in part by the National Natural Science Foundation of China (NSFC) under Grant 62572132, Grant U22A2054, Grant 62402029, and Grant 62202398; in part by Guangdong Provincial Natural Science Foundation General Program under Grant 2025A1515010137; in part by Guangdong Basic and Applied Basic Research Foundation under Grant 2023A1515140137 and Grant 2023A151514013; in part by Guangdong and Hong Kong Universities 1+1+1 Joint Research Collaboration Scheme; in part by the National Cryptologic Science Fund of China under Grant 2025NCSF02030; and in part by Beijing Natural Science Foundation under Grant L251041.

Research Keywords

  • gated verification
  • hybrid RAG
  • LLMs
  • Okapi BM25
  • SLoRA
  • Smart contract
  • 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