arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2603.14360cs.LGcs.AI
收藏

M$^2$RNN:基于矩阵值状态的非线性RNN用于可扩展的语言建模

M$^2$RNN: Non-Linear RNNs with Matrix-Valued States for Scalable Language Modeling

MIT-IBM Watson Lab(MIT-IBM沃森实验室);Princeton University(普林斯顿大学);Together AI

Mayank Mishra, Shawn Tan, Ion Stoica, Joseph E. Gonzalez, Tri Dao

AI总结:

本文提出M$^2$RNN,通过矩阵值状态和非线性状态转移提升语言建模性能,实验证明其在长序列泛化和大规模语言建模中的优势。

摘要:

Transformers虽然具有高度并行性,但受限于TC$^0$复杂度类,无法处理需要更高表达能力的任务如实体跟踪和代码执行。受此限制启发,本文重新审视非线性RNN用于语言建模,引入矩阵到矩阵RNN(M$^2$RNN):一种具有矩阵值隐藏状态和表达性非线性状态转移的架构。本文证明非线性RNN的语言建模性能受限于其状态大小,并展示状态大小扩展机制如何实现对张量核心的高效利用。实验证明,M$^2$RNN在未见过的序列长度上实现完美的状态跟踪泛化。这些优势也适用于大规模语言建模。在混合设置中,Hybrid M$^2$RNN在7B MoE模型上优于等效的Gated DeltaNet混合结构,同时使用更小的状态大小。值得注意的是,在现有混合架构中替换单个递归层为M$^2$RNN可获得与Hybrid M$^2$RNN相当的精度提升,且对训练吞吐量影响较小。此外,单个M$^2$RNN层的Hybrid Gated DeltaNet模型在长上下文泛化上也优于最先进混合线性注意力架构,最高高出LongBench 8点。这些结果确立了非线性RNN层作为高效可扩展语言模型的重要构建块。

英文摘要:

Transformers are highly parallel but are limited to computations in the TC$^0$ complexity class, excluding tasks such as entity tracking and code execution that provably require greater expressive power. Motivated by this limitation, we revisit non-linear Recurrent Neural Networks (RNNs) for language modeling and introduce Matrix-to-Matrix RNN (M$^2$RNN): an architecture with matrix-valued hidden states and expressive non-linear state transitions. We demonstrate that the language modeling performance of non-linear RNNs is limited by their state size, and show how the state size expansion mechanism enables efficient use of tensor cores. Empirically, M$^2$RNN achieves perfect state tracking generalization at sequence lengths not seen during training. These benefits also translate to large-scale language modeling. In hybrid settings that interleave recurrent layers with attention, Hybrid M$^2$RNN outperforms equivalent Gated DeltaNet hybrids by $0.4$-$0.5$ perplexity points on a 7B MoE model, while using $3\times$ smaller state sizes for the recurrent layers. Notably, replacing even a single recurrent layer with M$^2$RNN in an existing hybrid architecture yields accuracy gains comparable to Hybrid M$^2$RNN with minimal impact on training throughput. Further, the Hybrid Gated DeltaNet models with a single M$^2$RNN layer also achieve superior long-context generalization, outperforming state-of-the-art hybrid linear attention architectures by up to $8$ points on LongBench. Together, these results establish non-linear RNN layers as a compelling building block for efficient and scalable language models.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑