一句话:提出 MoEFix,用专家混合架构为各类漏洞训练专门专家,并由漏洞感知路由器动态分配修复,端到端生成安全合约。
智能合约的透明性与不可篡改性使其易受攻击并造成重大经济损失,而现有修复方法存在“一刀切”的设计局限:用单一模型处理多种漏洞类型,缺乏专门化导致性能欠佳。本文提出 MoEFix,一种面向智能合约特性的专家混合(MoE)框架:将漏洞划分为子空间,为每类漏洞(如重入、整数溢出)训练专门专家,并通过漏洞感知路由器动态分配修复。作者还重新设计修复工作流以适配大语言模型,实现端到端的安全合约生成而非局部补丁,并构建了覆盖五类关键漏洞的 1391 个合约数据集。实验在扩展的 PVD 测试集上进行,MoEFix 整体准确率超越现有最优方法 21.64%,其中重入漏洞提升 26.19%,delegatecall 提升 23.08%。
Smart contracts are a core component of blockchain ecosystems, but their transparency and immutability make them vulnerable to attacks, leading to significant financial losses. Thus, repairing vulnerabilities in smart contracts is crucial for establishing a trustworthy blockchain environment. Existing smart contract vulnerability repair methods suffer from a critical "one-for-all" design limitation, where a single model is tasked with fixing diverse vulnerability types, leading to suboptimal performance due to insufficient specialization. To address this, we propose MoEFix, a novel framework leveraging a Mixture-of-Experts (MoE) architecture tailored for smart contract characteristics. MoEFix partitions vulnerabilities into subspaces, trains specialized experts for each type (e.g., reentrancy, integer overflow), and employs a vulnerability-aware router to dynamically allocate repairs. We further redesign the repair workflow to align with large language models, enabling end-to-end secure contract generation instead of partial patches, and to achieve this, we curated a dataset of 1,391 contracts covering five critical vulnerability types.To validate our approach, we extend the benchmark PVD test suite. Experiments demonstrate that MoEFix outperforms state-of-the-art methods by 21.64% in overall accuracy, achieving improvements of 26.19% (reentrancy) and 23.08% (delegatecall) for specific vulnerabilities.
DOI 原文 ·
@inproceedings{paperbot9206,
title = {Leveraging Mixture-of-Experts Framework for Smart Contract Vulnerability Repair with Large Language Model},
author = {Hang Yuan and Xizhi Hou and Lei Yu and Li Yang and Jiayue Tang and Jiadong Xu and Yifei Liu and Fengjun Zhang and Chun Zuo},
booktitle = {ASE},
year = {2025},
doi = {10.1109/ase63991.2025.00140}
}