arXiv:2505.19059cs.SEcs.AI2025-05

用小模型微调检测智能合约重入漏洞,效果堪比大模型。

An Initial Exploration of Fine-tuning Small Language Models for Smart Contract Reentrancy Vulnerability Detection

  • 微调小型语言模型处理智能合约漏洞检测任务。
  • 在Solidity代码上达到与大模型相当的检测准确率。
  • 适合资源有限的开发者快速部署漏洞检测工具。

大型语言模型(LLMs)在编程任务中应用日益广泛,包括帮助开发者识别漏洞,是支持漏洞检测的有前景方向,尤其因其生成式AI模型的灵活性。然而,对于许多任务,使用大模型并不合适,更优选择是使用可在开发者本地设备上轻松运行和训练的小型语言模型。本文探索并评估了小型语言模型是否可通过微调,在特定领域——即检测Solidity智能合约中的重入漏洞——取得合理效果。

原文摘要 · Abstract (English)

Large Language Models (LLMs) are being used more and more for various coding tasks, including to help coders identify bugs and are a promising avenue to support coders in various tasks including vulnerability detection -- particularly given the flexibility of such generative AI models and tools. Yet for many tasks it may not be suitable to use LLMs, for which it may be more suitable to use smaller language models that can fit and easily execute and train on a developer's computer. In this paper we explore and evaluate whether smaller language models can be fine-tuned to achieve reasonable results for a niche area: vulnerability detection -- specifically focusing on detecting the reentrancy bug in Solidity smart contracts.

智能合约漏洞检测小模型微调

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。