arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2510.21450cs.LG
收藏

ParaRNN:解锁大型语言模型中非线性 RNN 的并行训练

ParaRNN: Unlocking Parallel Training of Nonlinear RNNs for Large Language Models

Apple(苹果公司)

Federico Danieli, Pau Rodriguez, Miguel Sarabia, Xavier Suau, Luca Zappella

AI总结:

本文提出 ParaRNN 框架,通过将非线性递归转化为方程组并利用 Newton 迭代法进行并行求解,打破了非线性 RNN 的序列训练限制,实现了最高 665 倍加速,成功训练 7B 参数模型并开源。

摘要:

循环神经网络(RNN)为序列建模奠定了基础,但其固有的序列特性限制了并行计算,构成了扩展的根本障碍。这导致了 Transformer 等可并行架构的主导地位,以及最近的 State Space Models (SSMs)。虽然 SSMs 通过结构化线性递归实现了高效并行化,但这种线性约束限制了其表达能力,无法建模复杂的非线性序列依赖关系。为解决此问题,我们提出了 ParaRNN,这是一个打破非线性 RNN 序列并行化障碍的框架。基于先前工作,我们将非线性递归关系序列转化为单一方程组,结合 Newton 迭代法和自定义并行归约进行并行求解。我们的实现比朴素顺序应用实现了高达 665 倍的加速,允许以前所未有的规模训练非线性 RNN。为此,我们将 ParaRNN 应用于 LSTM 和 GRU 架构的变体,成功训练了 7B 参数的模型,其困惑度与同等规模的 Transformer 和 Mamba2 架构相当。为加速高效序列建模研究,我们发布了 ParaRNN 代码库,作为非线性 RNN 自动训练并行化的开源框架,使研究人员和从业者能够大规模探索新的非线性 RNN 模型。

英文摘要:

Recurrent Neural Networks (RNNs) laid the foundation for sequence modeling, but their intrinsic sequential nature restricts parallel computation, creating a fundamental barrier to scaling. This has led to the dominance of parallelizable architectures like Transformers and, more recently, State Space Models (SSMs). While SSMs achieve efficient parallelization through structured linear recurrences, this linearity constraint limits their expressive power and precludes modeling complex, nonlinear sequence-wise dependencies. To address this, we present ParaRNN, a framework that breaks the sequence-parallelization barrier for nonlinear RNNs. Building on prior work, we cast the sequence of nonlinear recurrence relationships as a single system of equations, which we solve in parallel using Newton's iterations combined with custom parallel reductions. Our implementation achieves speedups of up to 665x over naive sequential application, allowing training nonlinear RNNs at unprecedented scales. To showcase this, we apply ParaRNN to adaptations of LSTM and GRU architectures, successfully training models of 7B parameters that attain perplexity comparable to similarly-sized Transformers and Mamba2 architectures. To accelerate research in efficient sequence modeling, we release the ParaRNN codebase as an open-source framework for automatic training-parallelization of nonlinear RNNs, enabling researchers and practitioners to explore new nonlinear RNN models at scale.

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

↑