Saturday 01 March 2025
A team of researchers has developed a new approach to detecting vulnerabilities in smart contracts, the self-executing programs that power many blockchain-based applications. The method uses large language models (LLMs) to analyze the code and identify potential weaknesses.
Smart contracts are designed to automate certain tasks, such as transferring funds or executing business logic, but they can also be exploited by hackers if they contain vulnerabilities. Detecting these vulnerabilities is a complex task, requiring a deep understanding of both computer programming and blockchain technology.
The researchers used two LLMs, DistilBERT and BERT, to analyze the code of 100 smart contracts and identify potential vulnerabilities. The models were trained on a dataset of labeled smart contract data, which included information about known vulnerabilities.
The results showed that the LLMs were able to detect many of the same vulnerabilities as traditional machine learning algorithms, but with greater accuracy. The DistilBERT model, for example, achieved an accuracy of 87% in detecting vulnerabilities, while the BERT model achieved an accuracy of 89%.
The researchers also tested the models on a dataset of unlabeled smart contract data and found that they were able to identify new vulnerabilities not previously detected by traditional methods.
This approach has significant implications for the development and deployment of secure blockchain-based applications. By using LLMs to analyze smart contract code, developers can identify potential vulnerabilities early in the development process and take steps to fix them before deploying their application.
In addition, this method could be used to improve the security of existing smart contracts by analyzing their code and identifying potential vulnerabilities that may not have been previously detected.
The use of LLMs to detect vulnerabilities in smart contracts is a promising area of research with significant potential for improving the security of blockchain-based applications.
Cite this article: “Large Language Models Detect Vulnerabilities in Smart Contracts”, The Science Archive, 2025.
Smart Contracts, Blockchain Technology, Large Language Models, Vulnerability Detection, Machine Learning Algorithms, Distilbert, Bert, Code Analysis, Security, Cryptography







