arXiv:2605.28769cs.LG2026-05被引 1

让模型在序列中灵活切换注意力与线性循环,兼顾效率与长上下文能力。

Multi-Mixer Models: Flexible Sequence Modeling with Shared Representations

论文配图:Multi-Mixer Models: Flexible Sequence Modeling with Shared Representations
图 1 · 摘自论文原文
  • 在序列处理中动态切换注意力与线性循环模块,实现混合计算策略。
  • 1.4B规模下,平均语言建模任务性能优于基线至少0.7个百分点。
  • 共享内部表示,仅用不足10%的注意力计算即可达到Transformer水平的检索效果。

Softmax注意力是现代大语言模型的核心,但其内存随序列长度线性增长,计算量呈平方增长。线性递归模型(如线性注意力和状态空间模型)因其线性计算与常数内存而成为替代方案。尽管这些次二次复杂度的混合作用器在多个基准上表现良好,但在需要长上下文检索或上下文学习的任务中仍落后。现有工作尝试通过静态交织或合并注意力与递归块来缓解这一权衡。本文提出一种新思路:在序列轴上实现灵活混合。Oryx模型可在整个序列中动态切换不同混合作用器,例如在需要丰富上下文时使用二次注意力,在生成阶段使用线性递归。该模型至少90%的参数在不同混合作用器间共享,使注意力与递归模式能在共享内部表示上运行。我们在Mamba-2和Gated DeltaNet基础上验证设计,模型规模达1.4B。在固定令牌预算与混合训练策略下,Oryx性能与单一路由基线相当或更优。在1.4B规模下,所有Oryx实例在平均语言建模任务上均优于对应基线至少0.7个百分点。在检索任务中,即使仅以注意力模式处理少于10%的令牌,其性能仍可媲美Transformer基线。结果表明,注意力与线性递归模型可共享内部表示,支持序列轴混合化作为有前景的方向。

原文摘要 · Abstract (English)

Softmax attention is the cornerstone of modern large language models, but its memory scales linearly and compute quadratically with sequence length. Linear recurrent models, such as linear attention and state space models, have become widely studied as alternatives to attention due to their linear compute and constant memory. While these sub-quadratic token mixing methods, or mixers, achieve promising efficiency gains and competitive results on a wide range of benchmarks, current linear recurrent models still lag behind on tasks that require long-context retrieval or in-context learning. A growing body of work studies hybrid architectures that attempt to mitigate these trade-offs by statically interleaving or merging attention and recurrent blocks. In this work, we explore a new axis of developing hybrid models: across the token sequence. We propose Oryx, a hybrid model that can, throughout a sequence, flexibly switch between different mixers, for example quadratic attention for rich context utilization and linear recurrences for efficient generation. Oryx ties at least 90% of its parameters across mixers, enabling attention and recurrent modes to operate over shared internal representations. We validate our design with Mamba-2 and Gated DeltaNet variants, up to 1.4B models. Under fixed token budgets and a mixed-training strategy, Oryx achieves comparable or better performance than its single-mixer baselines. At the 1.4B scale, all instances of Oryx outperform their respective baselines by at least 0.7 percentage points on averaged language modeling tasks. On retrieval tasks, Oryx achieves performance comparable to the Transformer baseline even when processing only a tiny fraction (<10%) of the tokens in attention mode. These results suggest that attention and linear recurrent models can share internal representations, and motivate sequence-axis hybridization as a promising direction.

混合模型序列建模高效推理长上下文

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