cs.LGMar 15, 2026

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

Authors: Mayank Mishra, Shawn Tan, Ion Stoica, Joseph Gonzalez, Tri Dao

Organizations: UC Berkeley · Learning Machine · MIT-IBM Watson Lab · Princeton University · Together AI

Abstract

Transformers are highly parallel but are limited to computations in the TC0^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 (M2^2RNN): 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, M2^2RNN 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 M2^2RNN outperforms equivalent Gated DeltaNet hybrids by 0.40.4-0.50.5 perplexity points on a 7B MoE model, while using 3×3\times smaller state sizes for the recurrent layers. Notably, replacing even a single recurrent layer with M2^2RNN in an existing hybrid architecture yields accuracy gains comparable to Hybrid M2^2RNN with minimal impact on training throughput. Further, the Hybrid Gated DeltaNet models with a single M2^2RNN layer also achieve superior long-context generalization, outperforming state-of-the-art hybrid linear attention architectures by up to 88 points on LongBench. Together, these results establish non-linear RNN layers as a compelling building block for efficient and scalable language models.

Figures & tables

Appendix figures & tables1 asset

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. Olmo Hybrid: From Theory to Practice and Back

    Apr 3, 2026William Merrill, Yanhong Li, Tyler Romero +19Language ModelingHybrid Attention

  2. Triadic Linear Attention: Three-Dimensional Recurrent States for Long-Context Sequence Modeling

    Sep 29, 2026Oliver Sieberling, Bharat Runwal, David Jin +3Linear AttentionLong-Context Language Modeling

  3. 2Mamba2Furious: Linear in Complexity, Competitive in Accuracy

    Feb 19, 2026Gabriel Mongaras, Eric C. LarsonLinear AttentionState Space Models