Tailored Prompts, Targeted Protection: Vulnerability-Specific LLM Analysis for Smart Contracts

📅 2026-05-05
📈 Citations: 0
✨ Influential: 0
📄 PDF
🤖 AI Summary
This work addresses the vulnerability of smart contracts to diverse security threats stemming from their immutability and the limited generalizability and automation of existing detection approaches. To overcome these limitations, the authors propose a tailored vulnerability detection framework leveraging large language models (LLMs), which incorporates vulnerability-specific prompting strategies for thirteen common vulnerability types. The framework integrates abstract syntax tree (AST) context extraction and is trained on a large-scale, real-world annotated dataset, thereby circumventing the constraints of traditional rule-based methods. Experimental results demonstrate that the proposed approach achieves an average true positive recall of 0.92 and a true negative recall of 0.85 across all thirteen vulnerability categories, significantly enhancing both detection accuracy and scalability.
📝 Abstract
Smart contracts on blockchains are prone to diverse security vulnerabilities that can lead to significant financial losses due to their immutable nature. Existing detection approaches often lack flexibility across vulnerability types and rely heavily on manually crafted expert rules. In this paper, we present an LLM-based framework for practical smart contract vulnerability detection. We construct and release a large-scale dataset comprising 31,165 professionally annotated vulnerability instances collected from over 3,200 real-world projects across 15 major blockchain platforms. Our approach leverages precise AST-based context extraction and vulnerability-specific prompt design to instantiate customized detectors for 13 prevalent vulnerability categories. Experimental results demonstrate strong effectiveness, achieving an average positive recall of 0.92 and an average negative recall of 0.85, highlighting the potential of carefully engineered contextual prompting for scalable and high-precision smart contract security analysis.
Problem

Research questions and friction points this paper is trying to address.

smart contracts
security vulnerabilities
vulnerability detection
blockchain
LLM
Innovation

Methods, ideas, or system contributions that make the work stand out.

LLM-based vulnerability detection
vulnerability-specific prompting
AST-based context extraction
smart contract security
large-scale annotated dataset
🔎 Similar Papers
No similar papers found.
💼 Related Jobs
No related jobs found.
X
Xing Zhang
NetX Foundation, Zug, Switzerland
K
Keyu Zhang
Department of Computer Science, University of Oxford, Oxford, UK
T
Taohong Zhu
Department of Computer Science, The University of Manchester, Manchester, UK
Anbang Ruan
Anbang Ruan
Department of Computer Science, University of Oxford
Cloud ComputingTrusted ComputingRemote AttestationReputation System