用可学习掩码动态调整预训练Transformer,避免遗忘且保持高效推理。
Soft-TransFormers for Continual Learning
- 通过实值掩码动态调整注意力层,从预训练模型直接优化。
- 在多个数据集上显著优于提示、适配器等方法,参数量相当但性能更优。
- 适合需要持续学习且不想增加推理成本的场景,如边缘设备部署。
受良好初始化彩票假设(WLTH)启发,我们提出Soft-TransFormers(Soft-TF),一种通过任务特异性软子网络适应冻结预训练Transformer的持续学习框架。该方法在选定自注意力层的查询、键、值和输出投影上引入实值乘性掩码,初始值设为1,使优化从预训练解开始;掩码空间梯度下降天然偏向调节主干网络的关键路径。我们在标准凸-Lipschitz假设下证明:掩码仅微调时,收敛速率与参数漂移由预训练权重到任务最优配置的距离控制。这种受控漂移带来两个性质:由于主干与任务掩码永不被覆盖,遗忘被结构性消除;且每个任务子网络始终靠近共享预训练解,即使掩码错误仍能评估近似通用函数,因此任务推断误差影响小,分类增量准确率与推断可靠性解耦。作为插件,Soft-TF可兼容L2P、DualPrompt、HiDe-Prompt和NoRGa,通过任务键匹配、熵-梯度准则或学习的任务身份分类器选择掩码。在Split-CIFAR100、Split-ImageNet-R、CUB-200及5-Datasets等类增量学习基准上,Soft-TF始终优于提示、适配器及LoRA风格基线,在可比可训练参数预算下表现更优,同时推理开销与原始主干一致。
原文摘要 · Abstract (English)
Inspired by the Well-initialized Lottery Ticket Hypothesis (WLTH), we introduce Soft-TransFormers (Soft-TF), a continual learning framework that adapts a frozen pre-trained Transformer through task-specific soft subnetworks: real-valued multiplicative masks over the query, key, value, and output projections of selected self-attention layers. The masks are initialized at one, so optimization starts exactly at the pre-trained solution, and mask-space gradient descent is intrinsically biased toward modulating the backbone's dominant pathways; we prove that, under standard convex-Lipschitz assumptions, both the convergence rate and the parameter drift of mask-only fine-tuning are controlled by the distance from the pre-trained weights to a task-optimal configuration. This bounded drift yields two properties. Since the backbone and per-task masks are never overwritten, forgetting is structurally eliminated. And since every task subnetwork stays near the shared pre-trained solution, a wrong mask still evaluates a near-generalist function, so task-inference errors are largely harmless and class-incremental accuracy is decoupled from task-inference reliability. As a plug-in, Soft-TF couples with L2P, DualPrompt, HiDe-Prompt, and NoRGa, selecting masks by task-key matching, an entropy-gradient criterion, or a learned task-identity classifier. Across class-incremental learning benchmarks -- Split-CIFAR100, Split-ImageNet-R, CUB-200, and 5-Datasets -- Soft-TF consistently outperforms prompt-based, adapter-based, and LoRA-style baselines at comparable trainable-parameter budgets, while keeping inference cost identical to the unmodified backbone.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。