Frequency-Aware Continual Learning for Smart Contract Vulnerability Detection with Large Language Models

📄 arXiv: 2608.19680v1 📥 PDF

作者: Tenghui Huang, Jiawen Kang, Dongning Liu, Changyan Yi, Chengjun Cai, Anjia Yang, Li Li, Dong In Kim

分类: cs.AI

发布日期: 2026-08-20


💡 一句话要点

提出频率感知的持续学习方法以解决智能合约漏洞检测问题

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 智能合约 漏洞检测 持续学习 频率感知 低秩适应 遗忘感知重放 模型合并 区块链

📋 核心要点

  1. 智能合约漏洞检测面临新漏洞类别的快速适应、灾难性遗忘和适配器合并等挑战。
  2. 提出三阶段集成框架,分别解决适应、持续学习和部署问题,采用频率感知技术。
  3. 在DIVE数据集上,Micro-F1达到0.8085,接近独立任务的上限,显示出显著的性能提升。

📝 摘要(中文)

智能合约漏洞检测面临三个相互关联的挑战:新漏洞类别的参数高效适应、任务间的灾难性遗忘以及适配器的合并。为此,本文提出了一个三阶段的集成框架。适应阶段采用频率感知低秩适应(FA-LoRA),在傅里叶域中进行适应,仅需0.4%的可训练参数,且优于标准LoRA和QLoRA。持续学习阶段应用遗忘感知重放(FAR),通过损失动态评估每个样本的遗忘风险,优先重放脆弱知识,平均Micro-F1达到0.8022。部署阶段使用锚保护渐进合并(APPM),通过频率域门控竞争合并所有适配器,Micro-F1达到0.8085,合并成本为156毫秒且无额外运行时内存。实验结果表明,该框架有效应对了区块链生态系统的演变挑战。

🔬 方法详解

问题定义:本文旨在解决智能合约漏洞检测中的三个主要挑战:新漏洞类别的快速适应、任务间的灾难性遗忘以及适配器的有效合并。现有方法在处理这些问题时往往需要全量重训练,导致效率低下和性能下降。

核心思路:论文提出的解决方案是一个三阶段的集成框架,每个阶段针对一个特定挑战,确保信息的有效传递和利用。通过频率感知的适应方法,能够在保持模型性能的同时,显著减少可训练参数的数量。

技术框架:整体架构分为三个主要阶段:适应阶段使用FA-LoRA进行频率域适应,持续学习阶段应用FAR进行遗忘风险评估,部署阶段则通过APPM实现适配器的合并。每个阶段的输出为下一个阶段提供输入,形成闭环。

关键创新:最重要的创新在于引入频率感知低秩适应(FA-LoRA)和遗忘感知重放(FAR),这两者结合使得模型在适应新任务时能够有效保留旧知识,避免灾难性遗忘。

关键设计:FA-LoRA通过傅里叶域的门控机制进行适应,FAR则利用损失动态来评估遗忘风险,APPM则通过锚保护的加权合并策略实现适配器的有效整合。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

在DIVE数据集上的实验结果显示,本文提出的框架在Micro-F1指标上达到了0.8085,接近独立任务的上限,且合并过程的时间成本仅为156毫秒,未增加额外的运行时内存,展现了显著的性能优势。

🎯 应用场景

该研究的潜在应用领域包括区块链技术中的智能合约安全性检测、金融交易系统的漏洞防护以及其他需要高效持续学习的智能系统。通过提高漏洞检测的准确性和效率,能够有效降低智能合约的安全风险,促进区块链技术的广泛应用。

📄 摘要(原文)

Smart contract vulnerability detection with Large Language Models (LLMs) faces three causally linked challenges. First, new vulnerability categories demand parameter-efficient adaptation, since full retraining is prohibitive for sequentially arriving tasks. Second, training per-task adapters on a shared backbone causes catastrophic forgetting of previously learned vulnerabilities. Third, the resulting multiplicity of adapters must be consolidated into a single model, since task identity is unknown at inference time. Each challenge arises directly from the solution to its predecessor, making an integrated framework essential. We propose a three-stage pipeline in which each stage addresses one challenge and feeds into the next. The adaptation stage uses Frequency-Aware Low-Rank Adaptation (FA-LoRA), which performs adaptation in the Fourier domain with per-frequency importance gates, requiring only 0.4% trainable parameters while outperforming standard LoRA and QLoRA. The continual learning stage applies Forget-Aware Replay (FAR), which uses these frequency gates to estimate per-sample forgetting risk via loss dynamics and prioritizes vulnerable knowledge for rehearsal, achieving an average Micro-F1 of 0.8022 across sequential tasks. The deployment stage employs Anchor-Protected Progressive Merging (APPM), which exploits the asymmetric generalization produced by FAR training to identify the strongest-generalizing adapter as an anchor and consolidates all adapters into a single model via anchor-protected weighted merging with frequency-domain gate competition. APPM achieves a Micro-F1 of 0.8085, within 2.7% of the independent per-task upper bound, at a merge cost of 156 ms and no additional runtime memory. Experiments on DIVE confirm the framework effectively addresses all three challenges for evolving blockchain ecosystems.