arXiv:2411.12537cs.LGcs.CL2024-11ICLR被引 97

让线性RNN学会状态追踪,只需放开特征值范围到负数

Unlocking State-Tracking in Linear RNNs Through Negative Eigenvalues

  • 突破性发现:线性RNN需负特征值才能解决奇偶性追踪任务
  • 实验验证:扩展Mamba和DeltaNet的特征值范围后,奇偶性任务准确率显著提升
  • 适合关注高效长序列建模与代码/数学任务的开发者

线性循环神经网络(LRNN)如Mamba、RWKV、GLA、mLSTM和DeltaNet已成为处理长序列的高效替代方案。然而,这类模型在状态追踪任务上表现不佳,影响代码评估等应用性能。现有架构在单次前向传播中无法解决最简单的奇偶性追踪问题,而非线性RNN可有效处理。近期研究指出,该失败源于对对角状态转移矩阵取值范围限制在[0,1],引入负值可解决此问题。本文将结论扩展至非对角的LRNN(如DeltaNet),证明有限精度下仅含正特征值的LRNN无法解决奇偶性问题,且计数模3需非三角矩阵。进一步证明:当状态转移矩阵为单位阵减去向量外积矩阵的乘积,且每个矩阵特征值位于[-1,1]区间时,LRNN可学习任意正则语言。实验表明,将Mamba和DeltaNet的特征值范围扩展至包含负数后,不仅能解决奇偶性任务,还在状态追踪任务中持续提升性能。同时,具备状态追踪能力的LRNN可在大规模(13亿参数)下稳定高效预训练,语言建模表现优异,并在代码与数学任务中展现潜力。

原文摘要 · Abstract (English)

Linear Recurrent Neural Networks (LRNNs) such as Mamba, RWKV, GLA, mLSTM, and DeltaNet have emerged as efficient alternatives to Transformers for long sequences. However, both Transformers and LRNNs struggle to perform state-tracking, which may impair performance in tasks such as code evaluation. In one forward pass, current architectures are unable to solve even parity, the simplest state-tracking task, which non-linear RNNs can handle effectively. Recently, Sarrof et al. (2024) demonstrated that the failure of LRNNs like Mamba to solve parity stems from restricting the value range of their diagonal state-transition matrices to $[0, 1]$ and that incorporating negative values can resolve this issue. We extend this result to non-diagonal LRNNs such as DeltaNet. We prove that finite precision LRNNs with state-transition matrices having only positive eigenvalues cannot solve parity, while non-triangular matrices are needed to count modulo $3$. Notably, we also prove that LRNNs can learn any regular language when their state-transition matrices are products of identity minus vector outer product matrices, each with eigenvalues in the range $[-1, 1]$. Our experiments confirm that extending the eigenvalue range of Mamba and DeltaNet to include negative values not only enables them to solve parity but consistently improves their performance on state-tracking tasks. We also show that state-tracking enabled LRNNs can be pretrained stably and efficiently at scale (1.3B parameters), achieving competitive performance on language modeling and showing promise on code and math tasks.

线性RNN状态追踪特征值代码生成

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