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

Federico Danieli (Apple), Pau Rodriguez, Miguel Sarabia, Xavier Suau, Luca Zappella

International Conference on Learning Representations 2026 · Oral

Overview

In this ICLR talk, Federico Danieli from Apple MLR presented ParaRNN, a novel framework designed to overcome the long-standing challenge of parallelizing the training of nonlinear Recurrent Neural Networks (RNNs). While Transformers have dominated the large language model (LLM) landscape due to their inherent parallelism during training, they suffer from quadratic computational costs during inference, particularly with increasing sequence lengths. Conversely, traditional RNNs offer constant-time inference, making them highly attractive for latency-sensitive applications, but their sequential nature has historically rendered their training prohibitively slow for large-scale deployments. ParaRNN aims to bridge this critical gap, enabling researchers and practitioners to leverage the best of both worlds: the expressive power and fast inference of nonlinear RNNs, combined with the efficient, parallel training capabilities previously exclusive to attention-based architectures.

Watch on SlidesLive

Visual summary for ParaRNN: Unlocking Parallel Training of Nonlinear RNNs for Large Language Models by Federico Danieli, Pau Rodriguez, Miguel Sarabia, Xavier Suau, Luca Zappella
Visual summary for ParaRNN: Unlocking Parallel Training of Nonlinear RNNs for Large Language Models by Federico Danieli, Pau Rodriguez, Miguel Sarabia, Xavier Suau, Luca Zappella

Key moments

  1. 0:00 Why RNNs? Generation speed vs. Transformer training.
  2. 2:00 Mamba's linear recurrence for parallel RNN training.
  3. 4:00 ParaRNN: Parallelizing nonlinear RNNs with Newton's method.
  4. 6:00 ParaRNN codebase and fused CUDA kernel optimization.
  5. 7:45 ParaRNN training and inference speed compared.
  6. 8:40 ParaRNN LLM performance and nonlinearity benefits.
  7. 10:30 Q&A: Addressing the RNN 'oversquashing' problem.

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

Speakers: Federico Danieli (Apple); Pau Rodriguez; Miguel Sarabia; Xavier Suau; Luca Zappella

Conference: ICLR 2026

YouTube: https://slideslive.com/39062161

Overview

In this ICLR talk, Federico Danieli from Apple MLR presented ParaRNN, a novel framework designed to overcome the long-standing challenge of parallelizing the training of nonlinear Recurrent Neural Networks (RNNs). While Transformers have dominated the large language model (LLM) landscape due to their inherent parallelism during training, they suffer from quadratic computational costs during inference, particularly with increasing sequence lengths. Conversely, traditional RNNs offer constant-time inference, making them highly attractive for latency-sensitive applications, but their sequential nature has historically rendered their training prohibitively slow for large-scale deployments. ParaRNN aims to bridge this critical gap, enabling researchers and practitioners to leverage the best of both worlds: the expressive power and fast inference of nonlinear RNNs, combined with the efficient, parallel training capabilities previously exclusive to attention-based architectures.

The core innovation of ParaRNN lies in reinterpreting the sequential recurrence relationship of an RNN as a massive system of nonlinear equations. By employing an iterative Newton's method to solve this system, ParaRNN effectively linearizes the problem at each step. Critically, these linearized sub-problems exhibit the same structure as linear State Space Models (SSMs), which can be efficiently solved in parallel using algorithms like prefix sum. This mathematical reformulation, coupled with significant engineering efforts including highly optimized fused CUDA kernels, allows ParaRNN to achieve training speeds competitive with modern linear SSMs like Mamba 2, while retaining the architectural flexibility and expressivity of nonlinear recurrences. This work represents a significant step towards diversifying the architectural options for LLMs, particularly for scenarios where inference efficiency is paramount.

Background

▶ Watch: Why RNNs? Generation speed vs. Transformer training. (0:00)

The evolution of neural network architectures for sequential data has seen a dynamic interplay between Recurrent Neural Networks (RNNs) and Transformer models. For nearly a decade, Transformers, powered by their self-attention mechanism, have been the undisputed champions of the LLM revolution. The fundamental advantage of Transformers in the context of large-scale training stems from the fact that their attention mechanism, which contextualizes tokens by comparing each token with every other token in the sequence, can be computed in parallel across the entire input sequence. This parallelism has been instrumental in scaling LLMs to billions of parameters and vast datasets. However, this power comes at a significant cost: the computational complexity of attention scales quadratically with the sequence length ($O(L^2)$), impacting both memory and throughput, especially during inference or when generating very long sequences.

Traditional RNNs, on the other hand, operate on a fundamentally different principle. They process input sequences token by token, iteratively updating a hidden state that encapsulates the sequence's history. This sequential processing means that RNNs exhibit constant throughput during inference ($O(1)$ per token after the initial setup), making them incredibly efficient for generation tasks where latency is critical. However, this very sequential nature has historically been their Achilles' heel during training. Even when the entire input sequence is available, the iterative update rule necessitates processing tokens one after another in the forward pass, leading to extremely slow training times and preventing their widespread adoption for large-scale language modeling. This dichotomy—fast inference for RNNs versus parallel training for Transformers—has presented a significant architectural dilemma.

In recent years, there has been a renewed interest in "revamping" RNNs to address their training limitations, aiming to unlock their inference advantages for modern LLMs. A notable breakthrough in this direction has been Mamba, which introduced a mechanism to parallelize the training of a specific class of RNNs known as State Space Models (SSMs). Mamba achieves this by simplifying the recurrence relationship to one that is purely linear in the hidden state. This linearization allows for the "unrolling" of the sequence, revealing that the evolution of the hidden state can be expressed as a sum of terms. Crucially, this sum contains redundancies that can be exploited by specialized parallel algorithms, such as the prefix sum (or scan) operation, enabling efficient, parallel computation of the hidden states across the entire sequence. While Mamba's approach successfully enables parallel training, it inherently imposes a limitation: by simplifying the recurrence to a purely linear form, it potentially trades off some of the model's expressivity. Nonlinearities are often crucial for capturing complex patterns and relationships in data, and sacrificing them could limit the model's overall capacity. ParaRNN emerges from this context, seeking to retain the full expressivity of nonlinear RNNs while still achieving parallel training, thus aiming to get "the best of both worlds."

Key Findings

▶ Watch: ParaRNN: Parallelizing nonlinear RNNs with Newton's method. (4:00)

ParaRNN introduces a groundbreaking approach that successfully enables the parallel training of nonlinear Recurrent Neural Networks (RNNs), offering a compelling alternative to Transformers and linear State Space Models (SSMs) like Mamba. The key findings of this research are multi-faceted, demonstrating both theoretical elegance and practical efficacy.

Firstly, ParaRNN showcases that the sequential nature of nonlinear RNNs can be fundamentally re-framed as a large system of nonlinear equations. By applying an iterative Newton's method to solve this system, the framework effectively linearizes the problem at each iteration. This linearization yields a system that possesses the identical mathematical structure as a linear SSM, which can then be efficiently solved in parallel using the prefix sum algorithm, akin to Mamba's core parallelization strategy. This mathematical innovation is the bedrock of ParaRNN's ability to parallelize training without sacrificing the inherent nonlinearity of the recurrence.

Secondly, the project demonstrates that this sophisticated mathematical approach can be translated into highly efficient practical implementations. Through significant engineering efforts, including the development of fully fused CUDA kernels for specific nonlinear RNN cells (e.g., adaptations of GRU and LSTM), ParaRNN achieves training throughput that is not only significantly faster than traditional sequential RNN training but also remarkably competitive with state-of-the-art linear SSMs like Mamba 2. This performance parity during training is a critical validation of the framework's viability for large-scale applications.

Thirdly, ParaRNN successfully preserves the desirable inference characteristics of RNNs. During generation, both ParaRNN-based models and Mamba exhibit constant throughput regardless of sequence length, a stark contrast to the decaying throughput observed in Transformer models as sequences grow longer. This confirms ParaRNN's potential for applications requiring low-latency, high-speed inference.

Fourthly, in terms of language model performance, ParaRNN-based architectures, specifically those using ParaGRU and ParaLSTM cells, demonstrate strong capabilities. When substituted into a standard Transformer backbone (replacing the attention module), these models achieve perplexity scores that are "on par capable of beating Transformers" on standard benchmarks. While acknowledging that they "still lag a little bit behind Mamba 2" in current iterations, this result is highly encouraging, indicating that nonlinear RNNs can indeed compete in complex language modeling tasks.

Finally, a crucial finding that highlights the specific advantage of retaining nonlinearity is observed on synthetic tasks. On these controlled experiments, the presence of nonlinearity within the ParaRNN definition significantly boosts performance and accuracy compared to purely linear models such as Mamba 2. This provides empirical evidence that the expressivity gained from nonlinearity is not merely theoretical but translates into tangible performance benefits for certain types of problems, justifying the added complexity of the ParaRNN approach. The open-source release of the ParaRNN codebase further contributes to these findings by making the technology accessible for broader experimentation and development.

Technical Deep Dive

▶ Watch: ParaRNN codebase and fused CUDA kernel optimization. (6:00)

The technical ingenuity of ParaRNN lies in its ability to transform an inherently sequential problem—the forward pass of a nonlinear RNN during training—into a parallelizable one. This transformation is achieved through a clever reinterpretation of the recurrence relation and the application of an iterative numerical solver.

At its core, an RNN's forward pass computes a sequence of hidden states $h_l$ based on the current input $x_l$ and the previous hidden state $h_{l-1}$ according to a recurrence relation: $h_l = f(h_{l-1}, x_l)$, where $f$ is a potentially nonlinear function. For a given input sequence of length $L$, this defines a system of $L$ equations, each relating a hidden state to its predecessor. ParaRNN interprets this entire sequence of recurrences as a single, massive nonlinear system of equations. The goal then becomes to solve this system in parallel to obtain all hidden states $h_1, \dots, h_L$ simultaneously.

To solve this nonlinear system, ParaRNN invokes Newton's method. Newton's method is an iterative algorithm for finding roots of functions or solutions to systems of equations. In this context, it works by starting with an initial guess for the sequence of hidden states and then iteratively refining this guess. Each iteration of Newton's method involves two primary steps:

  1. Linearization: At each iteration, the current nonlinear system is approximated by a linear system around the current guess of the hidden states. This linearization requires computing the Jacobian matrices of the recurrence function $f$ with respect to the hidden states. The Jacobian essentially captures the local linear behavior of the nonlinear function. While computing these Jacobians is not trivial, it is a well-defined mathematical operation.
  1. Solving the Linear System: The crucial insight of ParaRNN is that the resulting linear system, derived from the linearization of the original RNN recurrence, possesses the exact same structure as a linear State Space Model (SSM). This is a critical connection, as linear SSMs (like those underpinning Mamba) are known to be solvable efficiently in parallel using the prefix sum (also known as scan) algorithm. The prefix sum operation allows for the parallel computation of cumulative sums or products, which can be adapted to solve these linear recurrences in $O(L)$ time for sequential operations, but $O(\log L)$ time on parallel architectures.

After solving the linearized system, Newton's method uses this solution to update the initial guess for the nonlinear system. This process is then repeated for a few iterations until the solution for the hidden states converges to a satisfactory approximation of the true nonlinear RNN forward pass. The expectation is that convergence is achieved rapidly, typically within a small number of iterations.

Implementing this entire process efficiently poses significant engineering challenges. These include:

  • Ensuring fast convergence of Newton's method.
  • Efficiently assembling the linear system at each iteration, which involves computing and managing the Jacobian matrices.
  • Optimally solving the resulting linear SSM using prefix sum.

To address these challenges, the ParaRNN project provides an accompanying codebase. This framework aims to simplify implementation for users, requiring only the definition of the RNN's recurrence step. The framework then automatically handles the assembly and solution of the underlying nonlinear and linear systems.

For maximum efficiency and scalability, especially for large-scale deployments, ParaRNN introduces specific structural assumptions and hardware optimizations:

  • Structured Jacobians: The framework provides specific support for recurrent definitions that result in diagonal or block-diagonal Jacobian matrices. These structures, which are also common assumptions in Mamba, significantly reduce the computational cost of Jacobian computation and linear system solving.
  • Fused CUDA Kernels: For the specific nonlinear RNN cells studied in their work (adaptations of GRU and LSTM), the team developed fully fused CUDA kernels. These kernels combine the entire Newton iteration process—including system assembly, Jacobian computation, linear system solution via prefix sum, and guess updates—into a single, highly optimized kernel. This fusion minimizes memory transfers and maximizes GPU utilization, leading to substantial speedups. Users can leverage these optimized kernels by defining their recurrence relationships with small CUDA snippets, trading off some flexibility for peak performance.

Experimental Setup & Results

▶ Watch: ParaRNN LLM performance and nonlinearity benefits. (8:40)

To validate the efficacy and performance of ParaRNN, the researchers conducted a series of experiments, primarily focusing on its application to language modeling and synthetic tasks, benchmarked against established architectures like Transformers and Mamba 2.

The experimental setup for language modeling involved a straightforward architectural substitution. A standard Transformer architecture was taken off the shelf, and its Attention module, typically responsible for contextualization, was entirely removed. In its place, the team inserted their newly designed ParaGRU and ParaLSTM cells, which are adaptations of the well-known Gated Recurrent Unit and Long Short-Term Memory networks, but equipped with ParaRNN's parallel training capabilities. This allowed for a direct comparison of the recurrent cells' ability to capture linguistic patterns within a familiar LLM framework.

The models were then subjected to extensive training, described as "a lot of GPU hours," indicating a significant computational investment typical for modern LLM research. While specific datasets and exact GPU configurations (e.g., number and type of GPUs, batch sizes) were not detailed in the presentation, the scale of training implies use of common large language modeling benchmarks and high-performance computing clusters.

Metrics used for evaluation included:

  • Perplexity: The standard metric for evaluating language models, measuring how well a probability model predicts a sample. Lower perplexity indicates better performance.
  • Accuracy: Used for synthetic tasks, measuring the correctness of predictions.
  • Throughput: Measured in tokens per second, to assess training and inference speed.

Baselines for comparison included:

  • Transformers: Representing the current state-of-the-art for parallel training and strong language modeling performance, but with quadratic inference costs.
  • Mamba 2: A leading linear State Space Model that enables parallel training for recurrent architectures while maintaining constant-time inference, offering a direct comparison for ParaRNN's parallelization efficiency.

The experimental results yielded several key insights:

  1. Training Speed: ParaRNN achieved impressive training speeds. The framework, leveraging its parallelization strategy and highly optimized fused CUDA kernels, proved to be "quite competitive with Mamba itself." This means the computational cost of applying a ParaRNN layer during training is not significantly higher than applying a Mamba 2 layer, validating the parallelization approach. This is a significant achievement, transforming a traditionally sequential and slow operation into a fast, parallel one.
  1. Inference Speed: Consistent with the theoretical advantages of RNNs, ParaRNN-based models demonstrated constant throughput during inference, irrespective of the sequence length. This mirrors the behavior of Mamba and stands in stark contrast to Transformers, whose throughput "decays as the sequence length increases" due to their quadratic complexity. This confirms ParaRNN's suitability for latency-sensitive applications.
  1. Language Model Performance (Perplexity): On language modeling tasks, the ParaGRU and ParaLSTM models, when integrated into the Transformer backbone, showed strong performance. They achieved "perplexity which is... on par capable of beating Transformers." This indicates that nonlinear RNNs, when trained efficiently, can compete effectively with attention-based models in complex language understanding and generation. However, the speaker noted that ParaRNN "still lag a little bit behind Mamba 2" in its current iteration, suggesting ongoing optimization efforts are needed to close this gap.
  1. Synthetic Task Performance: A crucial result highlighting the benefit of nonlinearity came from synthetic tasks. On these controlled experiments, a single ParaRNN layer with its inherent nonlinearity demonstrated a clear advantage. The presence of "extra complexity in the definition of the recurrence itself actually boosts the performance the accuracy on this sample synthetic task," significantly "beating that of the purely linear Mamba 2." This provides compelling evidence that retaining nonlinearity offers tangible expressive power that can be critical for certain types of problems, justifying ParaRNN's more complex approach compared to purely linear SSMs.

In summary, the experimental results confirm that ParaRNN successfully addresses the challenge of parallelizing nonlinear RNN training, achieving competitive speeds while maintaining efficient inference. Furthermore, it demonstrates that the preserved nonlinearity translates into performance advantages on specific tasks, positioning ParaRNN as a powerful new tool in the LLM architectural toolbox.

Practical Implications

▶ Watch: Q&A: Addressing the RNN 'oversquashing' problem. (10:30)

ParaRNN represents a significant advancement with practical implications for a wide range of stakeholders in the AI/ML ecosystem, including practitioners, infrastructure teams, model builders, and deployers. Its core promise is to unlock the benefits of nonlinear Recurrent Neural Networks (RNNs)—specifically their constant-time inference throughput—for large-scale applications, without sacrificing the parallel training efficiency that has made Transformers dominant.

For practitioners and model builders, ParaRNN offers a powerful new architectural primitive. Where fast, low-latency inference is a critical requirement, such as in real-time conversational AI, on-device models, or applications with strict throughput demands, ParaRNN-based models could become the preferred choice over Transformers. While Transformers excel at handling long contexts during inference due to their direct access to all tokens, their quadratic scaling ($O(L^2)$) can lead to prohibitive latency and memory usage for very long sequences. ParaRNN provides an alternative that maintains $O(1)$ inference cost per token, making it highly suitable for streaming data or continuous generation tasks.

Infrastructure teams will find that ParaRNN, with its parallel training capability, can be integrated into existing distributed training pipelines designed for Transformers or linear SSMs. The development of fused CUDA kernels is particularly relevant here, as it demonstrates a path to extreme efficiency on GPU hardware. Deploying these highly optimized kernels will require expertise in low-level CUDA programming, but the provided ParaRNN codebase aims to abstract much of this complexity, allowing teams to leverage the performance gains without necessarily rewriting everything from scratch. However, for maximum scale, the need for injecting specific structural information (e.g., diagonal or block-diagonal Jacobians) into the RNN definition implies a level of architectural design consideration that goes beyond simply stacking off-the-shelf layers.

One of the inherent tradeoffs and limitations of any recurrent architecture, including ParaRNN, is the "oversquashing problem." As highlighted in the Q&A, RNNs compress the entire sequence history into a finite-dimensional hidden state vector. This means the amount of information that can be retained about a very long sequence is fundamentally limited by the hidden state's size. While Transformers can access the entire raw sequence context, RNNs might struggle with perfect recall over extremely long dependencies. ParaRNN does not magically eliminate this limitation; rather, it argues that for many applications, the benefit of fast inference outweighs the need for perfect, unbounded context recall. Practitioners must carefully consider this tradeoff based on their specific application's requirements. If the application demands precise long-range factual recall, Transformers might still be superior, but if it requires quick, contextually relevant generation, ParaRNN could be a strong contender.

Furthermore, while ParaRNN demonstrates competitive performance with Transformers and Mamba 2, the talk acknowledges that it still "lags a little bit behind Mamba 2" in current language model perplexity benchmarks. This suggests there is ongoing research and optimization needed to fully unlock its potential. The complexity introduced by Newton's method and Jacobian computations means that careful architectural design and hyperparameter tuning will be crucial for achieving optimal results. The framework's current reliance on specific Jacobian structures (diagonal/block-diagonal) for efficiency also implies that not all arbitrary nonlinear RNNs might be equally amenable to this parallelization scheme without further optimization.

In essence, ParaRNN expands the toolkit for AI engineers, offering a robust option for building expressive, high-performance models where inference speed is paramount. It encourages a re-evaluation of architectural choices, moving beyond a "Transformer-or-nothing" mentality and opening avenues for exploring the rich design space of nonlinear recurrent models in the era of large-scale AI.

Key Takeaways

  • Parallel Training for Nonlinear RNNs: ParaRNN successfully enables parallel training for nonlinear Recurrent Neural Networks (RNNs) by reinterpreting the recurrence as a nonlinear system of equations.
  • Leverages Newton's Method and Prefix Sum: The core innovation involves solving this nonlinear system using an iterative Newton's method. Each step linearizes the system, which then can be solved efficiently in parallel using the prefix sum algorithm, similar to how linear State Space Models (SSMs) like Mamba are parallelized.
  • Competitive Training and Constant Inference Speeds: ParaRNN achieves training speeds competitive with Mamba 2 and significantly faster than traditional sequential RNN training. Crucially, it maintains the characteristic constant throughput during inference, unlike Transformers which suffer from quadratic scaling.
  • Nonlinearity Boosts Expressivity: Experiments on synthetic tasks demonstrate that the retained nonlinearity in ParaRNN provides a tangible boost in performance and accuracy over purely linear models like Mamba 2, showcasing its enhanced expressive power.
  • Strong Language Model Performance: When used to replace the attention module in a Transformer, ParaGRU and ParaLSTM cells achieve language model perplexity scores comparable to or even surpassing Transformers, positioning them as viable contenders for LLM applications.
  • Open-Source Codebase and Engineering Efforts: The project includes an open-source ParaRNN codebase to facilitate implementation and provides highly optimized fused CUDA kernels for specific cell types (e.g., GRU, LSTM) to ensure maximum efficiency and scalability.

About the Speaker(s)

The talk was presented by Federico Danieli, who is a researcher at Apple MLR (Machine Learning Research). He is credited alongside Pau Rodriguez, Miguel Sarabia, Xavier Suau, and Luca Zappella, indicating a collaborative research effort within Apple. Federico's presentation highlighted his team's focus on fundamental research to make nonlinear RNNs viable for large-scale training, demonstrating a deep expertise in neural network architectures, optimization, and high-performance computing for machine learning.

Reviews

→ Top-rated talks at International Conference on Learning Representations 2026

All talks from International Conference on Learning Representations 2026