让Transformer在在线学习中动态选路,不遗忘旧知识。
Routing without Forgetting
- 用能量驱动的联想检索机制,实时生成输入对应的动态提示。
- 在分割图像数据集上,比现有方法显著提升,少样本下也表现优异。
- 适合在线持续学习场景,无需重复训练或任务标识符。
Transformer在持续学习中通常采用参数高效适配方法:为每个任务定制提示、适配器或LoRA模块,而主干网络保持冻结。尽管在多轮控制环境下有效,这些方法依赖渐进式基于梯度的专化,在在线持续学习(OCL)中表现不佳,因为数据以非平稳流形式到达,且每条样本仅出现一次。本文将Transformer中的持续学习重构为路由问题:在严格在线约束下,模型必须动态选择每个输入的合适表征子空间,无需显式任务标识或重复优化。为此提出路由无遗忘(RwF)架构,引入受现代霍普菲尔德网络启发的能量基关联检索层。RwF不存储或合并任务特定提示,而是通过单步关联检索各层Transformer标记嵌入,生成动态提示。检索对应于严格凸自由能泛函的闭式最小化,实现前向传播中输入条件化的路由,独立于迭代梯度优化。在挑战性的类别增量基准测试中,RwF优于现有提示方法。在Split-ImageNet-R和Split-ImageNet-S上,其性能大幅超越先前提示方法,即使在少样本学习条件下亦然。结果表明,直接将嵌入能量基关联路由融入Transformer主干,为OCL提供了原则性且高效的框架。
原文摘要 · Abstract (English)
Continual learning in transformers is commonly addressed through parameter-efficient adaptation: prompts, adapters, or LoRA modules are specialized per task while the backbone remains frozen. Although effective in controlled multi-epoch settings, these approaches rely on gradual gradient-based specialization and struggle in Online Continual Learning (OCL), where data arrive as a non-stationary stream and each sample may be observed only once. We recast continual learning in transformers as a routing problem: under strict online constraints, the model must dynamically select the appropriate representational subspace for each input without explicit task identifiers or repeated optimization. We thus introduce Routing without Forgetting (RwF), a transformer architecture augmented with energy-based associative retrieval layers inspired by Modern Hopfield Networks. Instead of storing or merging task-specific prompts, RwF generates dynamic prompts through single-step associative retrieval over the transformer token embeddings at each layer. Retrieval corresponds to the closed-form minimization of a strictly convex free-energy functional, enabling input-conditioned routing within each forward pass, independently of iterative gradient refinement. Across challenging class-incremental benchmarks, RwF improves over existing prompt-based methods. On Split-ImageNet-R and Split-ImageNet-S, RwF outperforms prior prompt-based approaches by a large margin, even in few-shot learning regimes. These results indicate that embedding energy-based associative routing directly within the transformer backbone provides a principled and effective foundation for OCL.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。