Skip to main content
CenXiv.org
此网站处于试运行阶段,支持我们!
我们衷心感谢所有贡献者的支持。
贡献
赞助
cenxiv logo > cs > arXiv:2507.22371v1

帮助 | 高级搜索

计算机科学 > 密码学与安全

arXiv:2507.22371v1 (cs)
[提交于 2025年7月30日 ]

标题: SAEL:利用自适应专家混合的大语言模型进行智能合约漏洞检测

标题: SAEL: Leveraging Large Language Models with Adaptive Mixture-of-Experts for Smart Contract Vulnerability Detection

Authors:Lei Yu, Shiqi Cheng, Zhirong Huang, Jingyuan Zhang, Chenjie Shen, Junyi Lu, Li Yang, Fengjun Zhang, Jiajia Ma
摘要: 随着区块链中安全问题的增加,智能合约漏洞检测已成为研究重点。 现有的漏洞检测方法各有其局限性:1)静态分析方法在复杂场景中表现不佳。 2)基于专用预训练模型的方法在特定数据集上表现良好,但泛化能力有限。 相比之下,通用大语言模型(LLMs)在适应新的漏洞模式方面表现出色。 然而,与基于专用预训练模型的方法相比,它们在特定漏洞类型上的表现通常较差。 我们还发现,通用LLMs生成的解释可以提供细粒度的代码理解信息,有助于提高检测性能。 受这些观察的启发,我们提出了SAEL,一种基于LLM的智能合约漏洞检测框架。 我们首先设计了针对性的提示,引导LLMs识别漏洞并生成解释,这些解释作为预测特征。 接下来,我们在CodeT5和T5上应用提示调优,处理合约代码和解释,提升任务特定性能。 为了结合各种方法的优势,我们引入了一种自适应专家混合架构。 该架构通过门控网络动态调整特征权重,使用TopK过滤和Softmax归一化选择相关特征,并引入多头自注意力机制以增强跨特征关系。 这种设计通过梯度优化实现了LLM预测、解释特征和代码特征的有效集成。 损失函数同时考虑独立特征性能和整体加权预测。 实验表明,SAEL在多种漏洞上优于现有方法。
摘要: With the increasing security issues in blockchain, smart contract vulnerability detection has become a research focus. Existing vulnerability detection methods have their limitations: 1) Static analysis methods struggle with complex scenarios. 2) Methods based on specialized pre-trained models perform well on specific datasets but have limited generalization capabilities. In contrast, general-purpose Large Language Models (LLMs) demonstrate impressive ability in adapting to new vulnerability patterns. However, they often underperform on specific vulnerability types compared to methods based on specialized pre-trained models. We also observe that explanations generated by general-purpose LLMs can provide fine-grained code understanding information, contributing to improved detection performance. Inspired by these observations, we propose SAEL, an LLM-based framework for smart contract vulnerability detection. We first design targeted prompts to guide LLMs in identifying vulnerabilities and generating explanations, which serve as prediction features. Next, we apply prompt-tuning on CodeT5 and T5 to process contract code and explanations, enhancing task-specific performance. To combine the strengths of each approach, we introduce an Adaptive Mixture-of-Experts architecture. This dynamically adjusts feature weights via a Gating Network, which selects relevant features using TopK filtering and Softmax normalization, and incorporates a Multi-Head Self-Attention mechanism to enhance cross-feature relationships. This design enables effective integration of LLM predictions, explanation features, and code features through gradient optimization. The loss function jointly considers both independent feature performance and overall weighted predictions. Experiments show that SAEL outperforms existing methods across various vulnerabilities.
评论: 被ICSME 2025接收
主题: 密码学与安全 (cs.CR) ; 人工智能 (cs.AI); 软件工程 (cs.SE)
引用方式: arXiv:2507.22371 [cs.CR]
  (或者 arXiv:2507.22371v1 [cs.CR] 对于此版本)
  https://doi.org/10.48550/arXiv.2507.22371
通过 DataCite 发表的 arXiv DOI

提交历史

来自: Lei Yu [查看电子邮件]
[v1] 星期三, 2025 年 7 月 30 日 04:28:00 UTC (1,421 KB)
全文链接:

获取论文:

    查看标题为《》的 PDF
  • 查看中文 PDF
  • 查看 PDF
  • HTML(实验性)
  • TeX 源代码
  • 其他格式
许可图标 查看许可
当前浏览上下文:
cs.CR
< 上一篇   |   下一篇 >
新的 | 最近的 | 2025-07
切换浏览方式为:
cs
cs.AI
cs.SE

参考文献与引用

  • NASA ADS
  • 谷歌学术搜索
  • 语义学者
a 导出 BibTeX 引用 加载中...

BibTeX 格式的引用

×
数据由提供:

收藏

BibSonomy logo Reddit logo

文献和引用工具

文献资源探索 (什么是资源探索?)
连接的论文 (什么是连接的论文?)
Litmaps (什么是 Litmaps?)
scite 智能引用 (什么是智能引用?)

与本文相关的代码,数据和媒体

alphaXiv (什么是 alphaXiv?)
CatalyzeX 代码查找器 (什么是 CatalyzeX?)
DagsHub (什么是 DagsHub?)
Gotit.pub (什么是 GotitPub?)
Hugging Face (什么是 Huggingface?)
带有代码的论文 (什么是带有代码的论文?)
ScienceCast (什么是 ScienceCast?)

演示

复制 (什么是复制?)
Hugging Face Spaces (什么是 Spaces?)
TXYZ.AI (什么是 TXYZ.AI?)

推荐器和搜索工具

影响之花 (什么是影响之花?)
核心推荐器 (什么是核心?)
IArxiv 推荐器 (什么是 IArxiv?)
  • 作者
  • 地点
  • 机构
  • 主题

arXivLabs:与社区合作伙伴的实验项目

arXivLabs 是一个框架,允许合作伙伴直接在我们的网站上开发和分享新的 arXiv 特性。

与 arXivLabs 合作的个人和组织都接受了我们的价值观,即开放、社区、卓越和用户数据隐私。arXiv 承诺这些价值观,并且只与遵守这些价值观的合作伙伴合作。

有一个为 arXiv 社区增加价值的项目想法吗? 了解更多关于 arXivLabs 的信息.

这篇论文的哪些作者是支持者? | 禁用 MathJax (什么是 MathJax?)
  • 关于
  • 帮助
  • contact arXivClick here to contact arXiv 联系
  • 订阅 arXiv 邮件列表点击这里订阅 订阅
  • 版权
  • 隐私政策
  • 网络无障碍帮助
  • arXiv 运营状态
    通过...获取状态通知 email 或者 slack

京ICP备2025123034号