Combining Fine-Tuning and LLM-Based Agents for Intuitive Smart Contract Auditing with Justifications

审计 计算机科学 智能合约 计算机安全 互联网隐私 人机交互 业务 会计 块链
作者
Wei Ma,Daoyuan Wu,Yuqiang Sun,Tianwen Wang,Shangqing Liu,Jian Zhang,Yue Xue,Yang Liu
标识
DOI:10.1109/icse55347.2025.00027
摘要

Smart contracts are decentralized applications built atop blockchains like Ethereum. Recent research has shown that large language models (LLMs) have potential in auditing smart contracts, but the state-of-the-art indicates that even GPT-4 can achieve only 30% precision (when both decision and justification are correct). This is likely because off-the-shelf LLMs were primarily pre-trained on a general text/code corpus and not fine-tuned on the specific domain of Solidity smart contract auditing. In this paper, we propose iAudit, a general framework that combines fine-tuning and LLM-based agents for intuitive smart contract auditing with justifications. Specifically, iAudit is inspired by the observation that expert human auditors first perceive what could be wrong and then perform a detailed analysis of the code to identify the cause. As such, iAudit employs a two-stage fine-tuning approach: it first tunes a Detector model to make decisions and then tunes a Reasoner model to generate causes of vulnerabilities. However, fine-tuning alone faces challenges in accurately identifying the optimal cause of a vulnerability. Therefore, we introduce two LLM-based agents, the Ranker and Critic, to iteratively select and debate the most suitable cause of vulnerability based on the output of the fine-tuned Reasoner model. To evaluate iAudit, we collected a balanced dataset with 1,734 positive and 1,810 negative samples to fine-tune iAudit. We then compared it with traditional fine-tuned models (CodeBERT, GraphCodeBERT, CodeT5, and UnixCoder) as well as prompt learning-based LLMs (GPT4, GPT-3.5, and CodeLlama-13b/34b). On a dataset of 263 real smart contract vulnerabilities, iAudit achieves an F1 score of 91.21% and an accuracy of 91.11%. The causes generated by iAudit achieved a consistency of about 38% compared to the ground truth causes.
最长约 10秒,即可获得该文献文件

科研通智能强力驱动
Strongly Powered by AbleSci AI
科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
TiAmo完成签到 ,获得积分10
2秒前
keyaner完成签到 ,获得积分10
2秒前
沐雨完成签到,获得积分10
3秒前
自觉冷之完成签到 ,获得积分10
6秒前
缥缈的飞荷完成签到 ,获得积分10
6秒前
未来完成签到 ,获得积分10
11秒前
11秒前
爱看电影的真诚完成签到 ,获得积分10
12秒前
Shuang完成签到 ,获得积分10
16秒前
xiaolizi的应助被简单采纳,获得20
16秒前
19秒前
normankasimodo完成签到,获得积分10
21秒前
JJZ完成签到,获得积分10
23秒前
南攻完成签到,获得积分10
24秒前
zyy发布了新的文献求助10
26秒前
behemoth完成签到 ,获得积分10
30秒前
Cold-Drink-Shop完成签到,获得积分0
31秒前
Eric完成签到,获得积分10
31秒前
牛魔王完成签到,获得积分10
33秒前
元意完成签到 ,获得积分10
33秒前
怕黑的驳完成签到,获得积分10
35秒前
43秒前
zyy完成签到,获得积分10
44秒前
俊逸吐司完成签到 ,获得积分10
47秒前
RaeganWehe完成签到,获得积分10
48秒前
50秒前
拉长的诗蕊完成签到,获得积分10
50秒前
狞风妖完成签到 ,获得积分10
52秒前
学fei了吗完成签到 ,获得积分10
56秒前
大意的山水完成签到,获得积分10
58秒前
志在丙甬完成签到 ,获得积分10
1分钟前
1分钟前
DrHHB完成签到 ,获得积分0
1分钟前
锂电说完成签到 ,获得积分10
1分钟前
小猪完成签到 ,获得积分10
1分钟前
研友_nqv5WZ完成签到 ,获得积分10
1分钟前
1分钟前
dwdwdw完成签到 ,获得积分10
1分钟前
纪靖雁完成签到 ,获得积分10
1分钟前
亚亚完成签到 ,获得积分10
1分钟前
高分求助中
(应助此贴封号)【重要!!请各用户(尤其是新用户)详细阅读】【科研通的精品贴汇总】 10000
Energie-Contracting 1500
Spec 401: Standards for Jet Fuel Facility and Equipment Commissioning and Flushing at Airports, 2026.1 (Original Issue) 1000
Spec 103: Standard for Jet Fuel Quality Control at Airports, Revision 2026.1 1000
Mathematical models in hydrology 1000
Klimaschutzrecht durch den Energiesektor im Mehrebenensystem – Ein Rechtsvergleich 1000
Introduction to Industrial/Organizational Psychology 800
热门求助领域 (近24小时)
化学 材料科学 医学 生物 纳米技术 计算机科学 工程类 有机化学 化学工程 生物化学 物理 复合材料 内科学 催化作用 光电子学 人工智能 细胞生物学 无机化学 物理化学 数学
热门帖子
关注 科研通微信公众号,转发送积分 8091628
求助须知:如何正确求助?哪些是违规求助? 9503959
关于积分的说明 21437965
捐赠科研通 7663843
什么是DOI,文献DOI怎么找? 3405041
关于科研通互助平台的介绍 2533396
邀请新用户注册赠送积分活动 2443707