用可学习的内存机制提升注意力模型效率与性能。
An Evolved Universal Transformer Memory
- 设计神经注意力记忆模型,自动优化各层注意力头的上下文
- 在长文本任务上显著提升性能,输入长度压缩至原大小的1/10
- 训练一次即可跨模态迁移,适用于语言、视觉和强化学习
现有方法通过人工规则丢弃上下文来降低大模型成本,但会损害性能。本文提出神经注意力记忆模型(NAMM),一种可学习的内存管理机制,在不损失性能的前提下提升Transformer效率。通过在预训练模型上进化NAMM,使其为每一层和注意力头生成聚焦关键信息的潜在上下文。该方法仅依赖注意力矩阵中的值进行条件控制,具备通用性,可适配任意自注意力模型。在少量问题上训练后,NAMM在多个长上下文基准测试中实现显著性能提升,同时将输入上下文压缩至原始长度的约十分之一。实验表明,仅在语言任务上训练的NAMM可零样本迁移到全新架构甚至跨模态任务(如视觉与强化学习),其优势仍能有效保留。
原文摘要 · Abstract (English)
Prior methods propose to offset the escalating costs of modern foundation models by dropping specific parts of their contexts with hand-designed rules, while attempting to preserve their original performance. We overcome this trade-off with Neural Attention Memory Models (NAMMs), introducing a learned network for memory management that improves both the performance and efficiency of transformers. We evolve NAMMs atop pre-trained transformers to provide different latent contexts focusing on the most relevant information for individual layers and attention heads. NAMMs are universally applicable to any model using self-attention as they condition exclusively on the values in the produced attention matrices. Learning NAMMs on a small set of problems, we achieve substantial performance improvements across multiple long-context benchmarks while cutting the model's input contexts up to a fraction of the original sizes. We show the generality of our conditioning enables zero-shot transfer of NAMMs trained only on language to entirely new transformer architectures even across input modalities, with their benefits carrying over to vision and reinforcement learning.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。