arXiv:2608.19680cs.AI2026-08

用频域感知方法让大模型持续学习新漏洞,避免遗忘且部署高效。

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

论文配图:Frequency-Aware Continual Learning for Smart Contract Vulnerability Detection with Large Language Models
图 1 · 摘自论文原文
  • 在频域中通过重要性门控实现低参数微调,仅需0.4%可训练参数。
  • 基于遗忘风险重放缓冲,连续任务平均Micro-F1达0.8022。
  • 通过锚点保护融合策略,合并多适配器仅耗时156毫秒。

大型语言模型(LLMs)用于智能合约漏洞检测面临三大因果关联挑战:一是新漏洞类别需参数高效适应,全量重训代价过高;二是共享主干上逐任务训练适配器导致先前知识灾难性遗忘;三是推理时任务身份未知,需将多适配器合并为单一模型。为此,提出三阶段框架:第一阶段采用频域感知低秩微调(FA-LoRA),在傅里叶域通过频率重要性门控实现微调,仅需0.4%可训练参数,性能优于标准LoRA和QLoRA;第二阶段引入遗忘感知重放缓冲(FAR),利用频率门控估计样本级遗忘风险,优先重演高危漏洞知识,跨序列任务平均Micro-F1达0.8022;第三阶段采用锚点保护渐进合并(APPM),利用FAR训练产生的不对称泛化能力识别最强泛化适配器作为锚点,通过锚点保护的加权合并与频域门控竞争,将所有适配器合并为单模型,实现0.8085的Micro-F1,较独立任务上限低2.7%,合并耗时仅156毫秒,无额外运行内存。DIVE数据集实验验证该框架有效应对区块链生态演化中的持续学习挑战。

原文摘要 · Abstract (English)

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.

漏洞检测持续学习大模型智能合约

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