arXiv:2502.13685cs.CLcs.AI2025-02被引 35

用多个记忆状态提升线性序列模型的回忆能力。

MoM: Linear Sequence Modeling with Mixture-of-Memories

  • 引入多记忆路由机制,分派输入到不同记忆单元。
  • 在长序列任务上超越现有线性模型,接近Transformer性能。
  • 保持线性计算复杂度,适合高效推理与训练。

线性序列建模方法(如线性注意力、状态空间模型和线性RNN)通过降低训练与推理复杂度,带来显著效率提升。然而,这些方法通常将整个输入序列压缩为单一固定大小的记忆状态,导致在依赖回忆的任务上表现不佳。为此,我们提出新型架构Mixture-of-Memories(MoM),利用多个独立记忆状态,并通过路由器网络将输入标记分配至特定记忆状态。该方法大幅增强整体记忆容量,同时最小化记忆干扰。MoM可无缝融合多种线性模型的记忆更新机制,成为通用框架。实验表明,MoM在下游语言任务中,尤其在回忆密集型任务上表现优异,超越现有线性序列模型,甚至达到与Transformer相当的性能。尽管包含多个记忆状态,每个记忆状态的计算仍保持线性复杂度,训练时维持线性复杂度,推理时为常数复杂度。代码已开源于https://github.com/OpenSparseLLMs/MoM,亦作为https://github.com/OpenSparseLLMs/Linear-MoE的一部分发布。

原文摘要 · Abstract (English)

Linear sequence modeling methods, such as linear attention, state space modeling, and linear RNNs, offer significant efficiency improvements by reducing the complexity of training and inference. However, these methods typically compress the entire input sequence into a single fixed-size memory state, which leads to suboptimal performance on recall-intensive tasks. To address this limitation, we introduce a novel architecture called Mixture-of-Memories (MoM). MoM utilizes multiple independent memory states, with a router network directing input tokens to specific memory states. This approach greatly enhances the overall memory capacity while minimizing memory interference. MoM serves as a general framework that can be seamlessly combined with diverse memory update mechanisms across linear models. As a result, MoM performs exceptionally well on recall-intensive tasks, surpassing existing linear sequence modeling techniques. Despite incorporating multiple memory states, the computation of each memory state remains linear in complexity, allowing MoM to retain the linear-complexity advantage during training, while constant-complexity during inference. Our experimental results show that MoM outperforms current linear sequence models on downstream language tasks, particularly recall-intensive tasks, and even achieves performance comparable to Transformer models. The code is released at https://github.com/OpenSparseLLMs/MoM and is also released as a part of https://github.com/OpenSparseLLMs/Linear-MoE.

序列建模记忆机制线性复杂度高效推理

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