Almost-Linear RNNs: Design and Tradeoffs
- Almost-Linear RNNs are recurrent models that maintain a linear state transition with controlled, sparse nonlinearity to enable efficient computation and parallelization.
- They include architectures like RWKV and LMN, which balance linear memory cores with minimal nonlinear components for fast inference and dynamical systems analysis.
- Key trade-offs involve managing information bottlenecks and over-fragmentation while exploiting linear recurrence to improve scalability and interpretability.
Searching arXiv for recent and foundational papers on Almost-Linear RNNs and related architectures. Search query: "Almost-Linear RNNs RWKV linear RNN parallelizable fixed-point recurrent neural networks" Almost-Linear RNNs (AL-RNNs) are a class of recurrent sequence models in which the dominant recurrent computation remains linear, affine, or piecewise linear, while nonlinearity is either restricted to carefully delimited components or made sparse enough to preserve tractable computation and analysis. Across recent literature, the term has at least three closely related uses: architectures with transformer-like parallel training and RNN-like linear-time, constant-memory decoding; linear-core recurrent models whose updates admit associative prefix-scan evaluation; and piecewise linear recurrent models with only a small number of nonlinear units, yielding parsimonious symbolic decompositions of dynamical systems (Peng et al., 2023, Merrill et al., 4 Mar 2026, Brenner et al., 2024). This shared emphasis on restricted recurrence places AL-RNNs at the intersection of efficient language modeling, circuit complexity, interpretable dynamical-systems reconstruction, and mechanistic studies of memory and nonlinearity.
1. Terminological scope and defining principles
The term AL-RNN does not denote a single canonical architecture. In the language-modeling and linear-RNN literature, AL-RNNs are recurrent architectures whose core state evolution remains linear in the previous state, thereby admitting parallel prefix-scan evaluation, while allowing carefully placed, limited nonlinearity that does not destroy the associativity required for scan (Merrill et al., 4 Mar 2026). In the RWKV formulation, AL-RNNs are sequence models whose memory and compute scale linearly, or almost linearly, with sequence length during inference, while retaining the expressive capacity and parallelizable training typical of transformer architectures (Peng et al., 2023). In the dynamical-systems literature, AL-RNNs are recurrent neural networks whose state update is piecewise linear but uses only a small number of nonlinear (ReLU) units while the remaining units are linear, so that the dynamics decompose into linear subregions (Brenner et al., 2024).
A concise comparison of these usages is given below.
| Research strand | Defining recurrent structure | Primary emphasis |
|---|---|---|
| RWKV | Exact linear attention with learned per-channel decay and constant-size state | time and space at inference |
| Linear-core AL-RNN theory | with associative composition | Parallel prefix-scan and circuit complexity |
| PWL AL-RNNs for DSR | Linear units plus sparse ReLU switching units | Parsimony, symbolic coding, topological analysis |
| LMN-style models | Strictly linear memory with nonlinear functional transform | Separation of memory and nonlinear computation |
This diversity creates a common misconception that AL-RNNs are simply “linear RNNs.” The literature is more specific. The linearity requirement is usually imposed on the recurrent state transition itself, not necessarily on input parameterization, normalization, readout, feedforward sublayers, or piecewise switching structure (Merrill et al., 4 Mar 2026, Bacciu et al., 2018). Conversely, another misconception is that any use of sparse nonlinearity preserves scanability; the theoretical literature explicitly distinguishes safe local nonlinearity from branched dependence on , which breaks associativity and defeats parallel prefix (Merrill et al., 4 Mar 2026).
2. RWKV as a modern AL-RNN for language modeling
RWKV, “Receptance Weighted Key Value,” is the most explicit large-scale language-model instantiation of the AL-RNN idea. It combines the efficient parallelizable training of transformers with the efficient inference of RNNs by reformulating attention as a linear attention mechanism with learned per-channel time decay (Peng et al., 2023). The architecture is built from stacked residual blocks, each containing a time-mixing sub-block that performs attention-like temporal aggregation with learned time decay and a channel-mixing sub-block that acts as an MLP-like component with gating.
RWKV uses token-shift time mixing before projection. For time mixing,
and for channel mixing,
Its attention-free WKV operator uses per-channel decay weights satisfying
0
with aggregation
1
The output applies a receptance gate,
2
while channel mixing uses squared ReLU and gating,
3
The central AL-RNN property is that the time-mixing block admits an exact recurrent formulation with constant-size state. Defining per-channel states 4,
5
A numerically stable version introduces normalized states 6 and a shared exponent 7 to prevent overflow while preserving exactness. Per layer, the recurrent state consists of the current time-mix input 8, the current channel-mix input 9, numerator 0, denominator 1, and auxiliary exponent 2, for a total state of 3 per layer, or 4 if 5 is ignored in infinite precision (Peng et al., 2023).
The complexity profile is the clearest operational marker of RWKV’s AL-RNN status. At inference, RWKV achieves 6 time and 7 space per layer, compared with 8 time and 9 space for a transformer, 0 time and 1 space for Reformer, and 2 time with 3 space for linear transformers (Peng et al., 2023). During training, the 4 projections over all tokens are parallelizable with cost 5, while the WKV scan is 6 and can be implemented with a custom CUDA kernel; future work noted in the paper suggests parallel scan could reduce the WKV step to 7.
Empirically, RWKV models from 8M to 9B parameters were trained on The Pile (0B tokens), with Adam, bfloat16, context length 1, exponential learning-rate decay, and an auxiliary PaLM loss encouraging the softmax normalizer to be near zero (Peng et al., 2023). Across twelve tasks—ARC Easy/Challenge, BoolQ, COPA, HeadQA, HellaSwag, LAMBADA, OpenBookQA, PIQA, ReCoRD, SciQ, and Winogrande—RWKV is reported as competitive with similarly sized transformers in matched-FLOP regimes. On Long Range Arena, it performs second only to S4 on five datasets, with strong text-task results including ListOps 2, Text 3, and Retrieval 4, while underperforming S4 on Image, Pathfinder, and Path-X. The paper also reports linear scaling of cumulative generation time and lower CPU/GPU memory usage during generation, as well as favorable Enwik8 bits-per-character behavior in small configurations.
The main limitation stated for RWKV is information funneling: compressing the past into a single per-channel vector can limit exact recall of fine-grained details over very long contexts relative to quadratic self-attention. The same source also notes prompt sensitivity and weaker performance on some non-text long-range tasks (Peng et al., 2023).
3. Associative linear cores, circuit complexity, and the parallelization frontier
A second line of work formalizes why certain almost-linear recurrent models can be parallelized nearly as well as transformers. In this account, a linear RNN updates its recurrent state by
5
where 6 and 7 may depend on the current token through closed-form arithmetic functions, but the update remains affine in 8 (Merrill et al., 4 Mar 2026). An AL-RNN preserves this associative linear core while permitting limited local nonlinearity—such as layer normalization implemented via closed-form arithmetic at bounded precision, feedforward sublayers between LRNN blocks, or output thresholding—provided that such operations do not make the transition depend on the current state in a branched way.
The crucial algebraic object is the associative combine operator on transition pairs: 9 Associativity follows directly from matrix associativity, and it yields a closed-form prefix solution
0
where 1. Because prefixes can be computed by a balanced binary tree or Blelloch scan, all states can be evaluated in depth 2 with total work 3 (Merrill et al., 4 Mar 2026). This is the sense in which linear-core AL-RNNs are “easy to parallelize in practice as transformers”: the recurrent computation is reducible to a scan over an associative monoid, and scan is a standard primitive on GPUs and TPUs.
The complexity-theoretic results place this observation on a sharper footing. The paper proves that LRNNs over 4 lie in 5, namely bounded fan-in, poly-size arithmetic circuits of depth 6 with positivity test at the output. It further states that transformers are in 7, so LRNNs incur at most an additional 8 factor in depth relative to transformers (Merrill et al., 4 Mar 2026). Under log precision, the upper bound sharpens to 9.
This paper’s negative results are equally central to the AL-RNN concept. A general nonlinear RNN with state-dependent branching can recognize much harder languages. Under polynomial precision, a one-layer MLP-gated RNN can simulate multi-stack machines; the paper states a Turing-completeness theorem and a corollary that there exists a one-layer MLP RNN whose language is 0-complete under FO reductions. Under log precision, a one-layer log-precision MLP RNN can solve sorted deterministic graph connectivity, an 1-complete problem (Merrill et al., 4 Mar 2026). This yields a precise barrier: nonlinear recurrence may be more expressive, but that same state-dependent branching is what resists efficient parallelization.
The same framework distinguishes common linear variants. Permutation-diagonal LRNNs, with 2, are shown to be 3-complete and, in the single-layer case, exactly equivalent to deterministic weighted finite automata. Diagonal-plus-low-rank LRNNs, exemplified by DeltaNet and RWKV-7 forms, are shown to be 4-complete; the paper gives 4-layer RWKV-7 and 4-layer DeltaNet constructions for iterated 5 matrix multiplication, and states that DPLR LRNNs can simulate weighted finite automata in four layers (Merrill et al., 4 Mar 2026). This suggests a principled AL-RNN design rule: preserve the affine associative core, but enrich 6 structurally—PD for exact state tracking with minimal overhead, DPLR for stronger arithmetic aggregation.
4. Piecewise-linear AL-RNNs for dynamical-systems reconstruction
In a distinct but related usage, AL-RNNs are introduced as parsimonious piecewise-linear recurrent models for reconstructing nonlinear dynamical systems from time-series data. Here the latent state 7 evolves according to
8
where 9 is diagonal, 0 is dense, 1 is a bias, and only the last 2 coordinates of 3 are nonlinear: 4 Thus the state update is piecewise linear, but the nonlinearity budget is explicitly controlled by 5 (Brenner et al., 2024).
The induced partition of state space is defined by the sign pattern of the 6 ReLU coordinates. If 7 is the diagonal indicator matrix of active coordinates, then
8
There are at most 9 distinct diagonal patterns, each corresponding to a linear subregion. The switching manifolds are the hyperplanes
0
for the ReLU coordinates, and the regions 1 are indexed by binary sign codes 2 (Brenner et al., 2024).
A major contribution of this formulation is a symbolic encoding of dynamics. Assigning a symbol 3 to each region 4, a trajectory 5 induces a symbolic sequence 6 with 7 iff 8, and the left-shift map 9 acts on these sequences. Under assumptions of uniform hyperbolicity in each subregion and non-global divergence, the paper states that asymptotically fixed orbits correspond exactly to eventually fixed symbolic sequences, asymptotically 0-periodic orbits correspond to eventually 1-periodic sequences, and asymptotically aperiodic orbits correspond to aperiodic symbolic sequences (Brenner et al., 2024). This makes the sparse switching structure not only interpretable but topologically meaningful.
Training uses identity teacher forcing with a simple observation model, 2, and an MSE loss
3
An optional parsimony regularizer replaces ReLU with leaky-ReLU slopes 4 and penalizes deviations from linearity,
5
Optimization uses RADAM; initialization sets 6 Gaussian with 7, 8, and 9 from a normalized positive-definite random matrix, with the initial state 00 and learned 01 (Brenner et al., 2024).
Empirically, this AL-RNN formulation is reported to discover topologically minimal piecewise-linear reconstructions for chaotic systems. For Lorenz-63, 02 effectively yields three key subregions: two unstable spirals in the lobes separated by a saddle region near the origin. For Rössler, two subregions suffice: one unstable spiral in the 03 plane and a “half-spiral” in 04 (Brenner et al., 2024). On long Rössler simulations with 05, the paper reports 06 and 07, with visited regions saturating well below 08. On ECG, with 09, the model captures nearly periodic yet chaotic patterns and yields a maximum Lyapunov estimate 10 versus ground truth 11. On fMRI, with 12 and approximately 13 regions, the model captures local dynamics, while a task-alignment setting with 14 and readouts reset every 15 steps achieves average classification accuracy 16 across subjects (Brenner et al., 2024).
The paper contrasts this formulation with SLDS, classical piecewise-affine identification, standard PLRNNs, reservoir computing, Neural ODE/SDE models, Koopman approaches, and SINDy. Its main claim is not merely that sparse ReLU recurrence is sufficient for reconstruction, but that few nonlinearities make the switching structure explicit, reduce the number of visited regions, and facilitate fixed-point, cycle, and symbolic-graph analysis (Brenner et al., 2024).
5. Linear memory networks and the separation of memory from nonlinear computation
An earlier precursor to the AL-RNN design philosophy is the Linear Memory Network (LMN), which explicitly separates nonlinear input-output transformation from strictly linear recurrent memory. The functional component computes
17
while the memory component follows the strictly linear recurrence
18
Two output variants are defined: 19 The paper states that “the memory is entirely linear while the feedforward component allows to model nonlinear dependencies” (Bacciu et al., 2018).
The memory mechanism is derived from a linear autoencoder for sequences. Given inputs 20, the autoencoder state satisfies
21
with reconstruction
22
Training proceeds by forming a matrix of reversed subsequences, performing a truncated SVD, and constructing 23, 24, and 25 in closed form. The paper states that “the training algorithm guarantees an optimal encoding when 26” (Bacciu et al., 2018). In LMNs, this autoencoder is trained on hidden-state sequences rather than raw inputs, so the linear memory stores a compressed history of nonlinear functional activations.
A dedicated pretraining scheme exploits equivalence between unfolded feedforward networks and recurrent networks. First, an unfolded finite-horizon model is trained to produce hidden activations 27. Second, a linear autoencoder is fitted to the sequence of hidden states. Third, the LMN parameters are initialized by transferring unfolded and autoencoder parameters, with
28
and corresponding formulas for 29 and 30 (Bacciu et al., 2018). This is an important historical design lesson for AL-RNNs: the recurrence can remain linear and analyzable, while the nonlinearity is concentrated in tokenwise or feedforward maps that consume the memory rather than redefining it.
The empirical results reported for polyphonic music datasets show that LMN-B is competitive with gated recurrent networks and other state-of-the-art models. Test frame-level accuracies include JSB Chorales 31 for LMN-B and 32 for pret-LMN-B, MuseData 33 and 34, Nottingham 35 and 36, and Piano MIDI 37 and 38 (Bacciu et al., 2018). The paper further states that, for a fixed total hidden size, LMN requires fewer parameters than LSTM or GRU, and highlights the absence of “unwanted exponential decay effects due to the presence of gates.” A stated limitation is that if the memory component is trained only with backpropagation, there are no theoretical guarantees on memorization properties; burn-in behavior at the beginning of sequences is also observed (Bacciu et al., 2018).
6. Minimal nonlinearity as a computational resource
Later work uses AL-RNNs not only as models but as probes for the functional role of nonlinearity in memory. In this formulation, the state update is
39
where the first 40 units are linear, the last 41 units are ReLU, and
42
The principal measure of nonlinearity is the number 43 of PWL units. Effective use of nonlinearity is quantified by a bitcode
44
so that small support of 45 indicates that the model uses few subregions (Brenner et al., 9 Jun 2025).
This work introduces Manifold Attractor Regularization (MAR),
46
to encourage near-perfect integrators and long time scales. Within a given bitcode-defined subregion, the masked interaction matrix is 47, the local Jacobian is
48
fixed points satisfy
49
and local stability is determined by 50. The same paper analyzes Lyapunov exponents and gradient flow through 51 powers, making the piecewise-linear structure a direct vehicle for mechanistic interpretation (Brenner et al., 9 Jun 2025).
Across tasks, the reported findings support a “minimal nonlinearity” thesis. On IMDb, performance is minimally affected by 52 and dynamics are dominated by a single slow mode. On sequential MNIST, linear models are already strong, with maximum eigenvalues slightly above 53, specifically 54; accuracy improves with intermediate 55 and reaches up to 56, while fully nonlinear models degrade. The paper states that for 57, final states within a class share nearly identical bitcodes, with average variation 58 (Brenner et al., 9 Jun 2025).
Tasks that require explicit routing show a sharper need for nonlinearity. On the copy task with 59, 60, and 61, purely linear models perform above chance but are fragile; 62 often yields perfect recall, and the mechanism is described as a two-subregion separation between encoding/decoding and autonomous delay-phase transients, with a 63-step global 64-cycle and neutral Lyapunov exponent 65 (Brenner et al., 9 Jun 2025). On the addition problem, linear models fail, while 66 drastically reduces error and performance plateaus near 67. On contextual multistability, linear models remain at 68, whereas 69 solves the task nearly perfectly, up to 70 accuracy. In a joint task-plus-spiking model for CRCNS PFC-1, nonlinearity improves both task accuracy and spike reconstruction, with mean spike correlation 71 close to a Poisson upper bound of 72 (Brenner et al., 9 Jun 2025).
A related development, Fixed-Point RNNs, addresses a different expressive bottleneck: dense state mixing. The target dense linear RNN
73
is realized as the fixed point of a parallelizable diagonal recurrence
74
If 75, then 76, recovering a dense transition from diagonal scans plus channel mixing (Movahedi et al., 13 Mar 2025). Bedouin accelerates the iteration by letting each fixed-point step sweep through time,
77
The paper states that a single-layer Bedouin solves 78 and 79, succeeds on copying with 80 length generalization where Mamba and Mamba-2 struggle, and that a 2-layer Bedouin with 81 reaches 82 scaled accuracy on modular arithmetic with brackets (Movahedi et al., 13 Mar 2025). This line extends the AL-RNN program from sparse nonlinearity to dense expressivity emerging from fixed-point solutions of linear scan operators.
7. Limitations, design tradeoffs, and emerging synthesis
Across these strands, AL-RNNs are defined less by a single architecture than by a recurring tradeoff: preserve a recurrent core that is linear, affine, piecewise linear, or otherwise scan-compatible, and use nonlinearity sparingly enough that parallelism, stability, or interpretability are not lost. The major benefit is computational. RWKV yields 83 inference with constant per-layer state (Peng et al., 2023). Linear-core AL-RNN theory yields 84 scan depth and a near-transformer parallel depth overhead (Merrill et al., 4 Mar 2026). Piecewise-linear AL-RNNs yield explicit symbolic partitions and tractable local linear analysis (Brenner et al., 2024). LMNs yield closed-form memory training and an explicit separation of memory from nonlinear transformation (Bacciu et al., 2018). Minimal-nonlinearity AL-RNNs expose when gating, attractor switching, neutral cycles, or context-dependent routing are computationally necessary (Brenner et al., 9 Jun 2025).
The limitations are similarly consistent. Linear or compressed state summaries can create information bottlenecks, as stated explicitly for RWKV (Peng et al., 2023). Piecewise-linear approaches can overfragment when 85 is too large and underfit when 86 is too small (Brenner et al., 2024). Minimal-nonlinearity studies report degraded generalization in fully nonlinear regimes because fragmented subregion usage destabilizes learning (Brenner et al., 9 Jun 2025). Circuit-theoretic work emphasizes that the very source of extra power in nonlinear RNNs—state-dependent branching—is also what blocks efficient parallelization under standard complexity conjectures (Merrill et al., 4 Mar 2026). Fixed-point linear densification introduces its own tradeoff between contraction and capacity, and its convergence speed remains an open issue in the worst case (Movahedi et al., 13 Mar 2025).
A reasonable synthesis suggested by these papers is that AL-RNNs define an expressivity/parallelism/interpretablity frontier rather than a single model family. One end of that frontier is occupied by exact linear-recurrence scan models such as RWKV and other LRNNs; another by sparse-switching PWL systems for dynamical reconstruction; another by architectures such as LMNs and Fixed-Point RNNs that preserve linear memory or linear scans while relocating or restructuring nonlinearity (Peng et al., 2023, Merrill et al., 4 Mar 2026, Brenner et al., 2024, Bacciu et al., 2018, Movahedi et al., 13 Mar 2025). This suggests that “almost-linear” is best understood as a design discipline: keep the recurrent backbone as close as possible to associative linear evolution, and spend nonlinearity only where gating, switching, compositional routing, or task-dependent context truly require it.