Papers1 provider Ā· 1 record
January 1, 2026Ā· SSRN Electronic Journal
preprint
Open access

Combining LLM-Based Semantic Analysis with Lightweight Deep Learning for Smart Contract Vulnerability Detection

Authors:Shuo ZhangZecheng LiShudan LinJiahai ZhangYuheng ZhouLulu WangBixin Li *

Abstract

Smart contracts have become an integral part of most modern blockchain systems, playing a pivotal role in their operation. However, security vulnerabilities in smart contracts can lead to significant financial losses. Given the remarkable capabilities of Large Language Models (LLMs) in code understanding and analysis, it is worthwhile to explore how state-of-the-art LLMs can enhance the detection of smart contract vulnerabilities.In this paper, we propose a collaborative detection method that combines semantic analysis performed by LLMs with a lightweight deep learning model. Rather than relying on LLMs for direct vulnerability detection, we engineer tailored prompts that guide the model to perform multidimensional semantic analysis of smart contract code, yielding structured insights. Subsequently, we utilize a pre-trained CodeBERT model to encode these insights into dense feature vectors, which facilitate vulnerability detection via a lightweight, efficient deep learning classifier.Experiments on real-world smart contract datasets show that our approach achieves accuracy rates of 99.85%, 93.2%, 99.33%, and 98.13% for four types of vulnerabilities: reentrancy, timestamp dependency, unchecked external calls, and strict equality to Ether, respectively. These results demonstrate that the synergy between LLM-based semantic analysis and a lightweight detection model offers a novel and effective solution for automated smart contract auditing. This approach requires no expert knowledge, remains intuitive and easy to implement, and exhibits strong scalability.

Community

0 comments
Use Connect Wallet in the navigation

No discussion yet

Be the first to share a question or observation.