通过负特征值解锁线性 RNN 的状态跟踪能力
Unlocking State-Tracking in Linear RNNs Through Negative Eigenvalues
AI总结:
本文证明仅含正特征值的线性 RNN 无法完成奇偶校验等状态跟踪,并通过将 Mamba 与 DeltaNet 的特征值范围扩展至负值,实现正则语言学习及 1.3B 参数稳定预训练。
摘要:
诸如 Mamba、RWKV、GLA、mLSTM 和 DeltaNet 之类的线性循环神经网络(LRNN)已成为 Transformer 在长序列上的高效替代方案。然而,Transformer 和 LRNN 都难以执行状态跟踪,这可能损害其在代码评估等任务中的性能。在一次前向传播中,当前架构甚至无法解决奇偶校验这一最简单的状态跟踪任务,而非线性 RNN 却能有效处理它。最近,Sarrof 等人(2024)证明,Mamba 等 LRNN 无法解决奇偶校验,原因在于其对角状态转移矩阵的取值范围被限制在 [0,1],而引入负值可以解决该问题。我们将这一结果扩展到 DeltaNet 等非对角 LRNN。我们证明,状态转移矩阵仅具有正特征值的有限精度 LRNN 无法解决奇偶校验,而模 3 计数则需要非三角矩阵。值得注意的是,我们还证明,当 LRNN 的状态转移矩阵是若干“单位矩阵减去向量外积矩阵”的乘积,且每个矩阵的特征值均位于 [-1,1] 范围内时,LRNN 可以学习任意正则语言。我们的实验证实,将 Mamba 和 DeltaNet 的特征值范围扩展到包含负值,不仅使它们能够解决奇偶校验,还能持续提升其在状态跟踪任务上的性能。我们还表明,具备状态跟踪能力的 LRNN 可以大规模(13 亿参数)稳定且高效地进行预训练,在语言建模上取得有竞争力的性能,并在代码和数学任务上展现出前景。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。