Tailored Prompts, Targeted Protection: Vulnerability-Specific LLM Analysis for Smart Contracts
Xing Zhang, Keyu Zhang, Taohong Zhu, Anbang Ruan
TLDR
An LLM framework detects smart contract vulnerabilities using tailored prompts, AST context, and a new large-scale dataset for high precision.
Key contributions
- Presents an LLM-based framework for practical smart contract vulnerability detection.
- Releases a large dataset of 31,165 annotated vulnerabilities from 3,200 projects across 15 platforms.
- Leverages AST-based context extraction and vulnerability-specific prompt design for 13 categories.
- Achieves strong detection effectiveness with 0.92 positive recall and 0.85 negative recall.
Why it matters
Smart contract vulnerabilities cause significant financial losses, and current detection methods often lack flexibility. This paper introduces a scalable and high-precision LLM-based framework that significantly improves smart contract security analysis.
Original 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.
📬 Weekly AI Paper Digest
Get the top 10 AI/ML arXiv papers from the week — summarized, scored, and delivered to your inbox every Monday.