MinMax Recurrent Neural Cascades

truly for long-sequence processing

The goalTruly long-sequence processing: four properties needed

Any model for truly long-sequence processing needs the following four properties:

Description of the four properties

High Expressivity

Long-term memory & State tracking

Recognise rich temporal patterns: from simple ones, like “B happened after A”, up to everything a finite-memory system can recognise. The two fundamental abilities are:

  • Long-term memory: storing information reliably as long as needed;
  • State tracking: manipulating information in rich ways.
  • Latching: store a value when it is received, and keep it as long as demanded.
  • Sequence matching: detect patterns of several events that must occur in a given order, and may be scattered across the whole sequence.
  • Recall: when asked, return a token that has occurred in a specific context, however far back.
  • Parity: tell whether an event has occurred an even or odd number of times; every occurrence flips the answer.
  • State tracking: follow a sequence of rearrangements of n objects; every step can rearrange the objects, e.g., by swapping positions.

The patterns a finite-memory system can recognise are the regular languages, the ones recognised by finite automata. By the Krohn–Rhodes theorem, every automaton can be realised by a cascade of two kinds of building blocks:

  • Identity-reset machines, which store a value and keep it unchanged until it is overwritten (long-term memory).
  • Permutation machines, which rearrange information reversibly (state tracking).

The patterns that need only the first kind are the star-free languages, that are group-free.

Latching, sequence matching and recall are group-free, while parity and state tracking also need permutations group-based.

Computational Efficiency

Subquadratic in parallel & Constant per token

Process whole sequences efficiently in parallel, and be efficient also when processing them in multiple sequential steps. The computational cost should be:

  • Subquadratic in parallel: processing a whole sequence at once (say during training) costs less than quadratic time in its length, with only a short chain of steps that must wait for one another, so the work spreads across many processors;
  • Constant per token: processing a few tokens at a time (as when a language model responds to a prompt in a conversation) costs a fixed amount of time and memory, however many tokens have already been processed.

Subquadratic in parallel

  • Training on long sequences: to train in reasonable time, GPUs need work they can spread across the whole sequence, which a strictly step-by-step recurrence cannot offer.

Constant per token

  • Long contexts: today’s attention-based models compare every token with every other, so cost grows with the square of the context length: a context ten times longer needs a hundred times the compute. This is why long contexts are slow, expensive and capped.
  • Streaming and generation: an assistant or agent reading a live stream or writing a long output should not slow down, or need more memory, as the history grows; with attention, every new token looks back at the whole history, held in a cache that keeps growing.

Cost that grows only linearly with length, constant per token, is what makes truly long contexts affordable.

Two measures matter in parallel:

  • work: the total number of operations;
  • depth: the longest chain of steps that must wait for one another; it sets the runtime when there are enough processors.

For a sequence of length T, we want:

  • subquadratic in parallel: work that grows less than quadratically in T (ideally linearly), and depth far below T (for example, logarithmic);
  • constant per token: when tokens are processed one after another, each new token costs a fixed amount of time and memory, however many tokens came before it (this always holds for recurrent models, which keep a state of fixed size).

Guaranteed Stability

Independent of sequence length

Stay bounded at any length: as long as every input value and every parameter stays within a fixed range, activations and parameter-to-loss gradients (loss gradients, for short) admit a bound that does not depend on the length of input sequences.

In recurrent models, instability comes in two ways:

  • amplification: if each update can enlarge the state even a little, the state can grow without limit over a long sequence;
  • accumulation: even without amplification, inputs that are added at every step can pile up, so states drift away and loss gradients grow with sequence length.

This matters in practice:

  • divergent states may compromise accuracy: a model trained on thousands of tokens and run on millions would meet state values it never saw in training, where its outputs are no longer reliable;
  • divergent loss gradients may impair learning: updates become erratic as sequences get longer, which calls for workarounds such as clipping gradients or training only on short sequences.

For any bound on the inputs and parameters, there are constants, independent of sequence length, that bound:

  • activations: every internal activation and every output, at every position (bounded inputs/parameters → bounded activations);
  • loss gradients: the gradient of the loss with respect to the parameters, which drives training (bounded inputs/parameters → bounded gradients).

Long-Range Sensitivity

Error signal can reach distant steps

Learn long-range dependencies: when a late output is wrong, the error signal must flow back to the early inputs that caused it, without fading over the steps in between.

  • A switch set early: to learn that a flag at the first token decides an output a million tokens later, the error at that output must reach back to the first token.
  • Tracking a state: to learn to follow parity, or a shuffle of items, the error at the end must reach every earlier input, since each one can change the answer.

Without it, learning stalls: when the error signal shrinks with distance, a late output hardly informs the training of early inputs, so such dependencies are not learned, even by a model that could represent them.

How fast the signal shrinks depends on the architecture:

  • recurrent models: it passes through a product of one factor per step, and vanishes if every factor shrinks;
  • attention-based models: it flows through attention weights, which can thin out as the context grows.

Gradient decomposition. Let zt be the model’s internal representation of the input at step t (in a Transformer, the token’s hidden vectors; in a recurrent model, its state), and let yT and ℓT be the output and the loss at a later step T. By the chain rule, the gradient of the loss with respect to the parameters θ collects one term per earlier step, through which the parameters act at that step:

∂ℓT∂θ=∑t≤T∂ℓT∂yT∂yT∂zt∂zt∂θ

Sensitivity. The sensitivity is the middle factor:

γt≔∂yT∂zt

It measures how much the late output reacts to the early input’s representation, across a distance of T−t steps. The sensitivity to the input ut itself only adds a local factor ∂zt∂ut, which does not depend on distance. So the learning signal for an early input is as large as the late output’s sensitivity to it.

Long-range sensitivity. A model is long-range sensitive if, with inputs and parameters kept within a fixed bound, there are inputs for which γt stays above a constant that does not depend on T−t: early inputs keep their influence on late outputs, however far apart they are. By the decomposition above, the learning signal for such inputs then does not vanish with distance (non-vanishing gradients).

In recurrent models, the term zt is the state xt, and the sensitivity γt is a product of one factor per step:

γt=∂yT∂xt=∂yT∂xT∏s=t+1T∂xs∂xs−1

It stays away from zero only if the factors do not all shrink.

The gapToday’s architectures trade the four properties off

Nonlinear RNNs such as LSTMs and GRUs led sequence modelling through the 2010s. Since 2017, Transformers have taken over, and in the last few years Linear RNNs, such as Mamba, mLSTM and DeltaNet, have emerged as efficient alternatives.

Nonlinear RNNs. Elman networks (1990), LSTMs (1997) and GRUs (2014) update their state through squashing nonlinearities such as tanh and sigmoid, so each update depends nonlinearly on the previous one.

Transformers. Introduced in 2017, they replace recurrence with attention, which compares every token with every earlier one.

Linear RNNs. They return to recurrence with a linear state update, which can be run one step at a time or, since updates compose associatively, over a whole sequence with a parallel scan. They come in two kinds: contractive ones, such as Mamba, mLSTM and Gated DeltaNet, shrink the state at every step; non-expansive ones, such as DeltaNet and DeltaProduct, use transitions that preserve the state’s size, such as reflections.

References

Yet each of these architectures gives up at least one of the four properties.

MinMax RNCs have all four properties at once.

Architecture Expressivity Efficiency Stability Sensitivity
MinMax RNCs Yes Yes Yes Yes
  • Yes. Maximal expressivity Their neurons provide both long-term memory and state-tracking capabilities. Together they cover every pattern a finite-state machine can recognise.
  • Yes. Efficient Each step is computed from the previous one at a fixed cost per token, like any recurrent network. Steps can also be combined associatively, so a whole sequence can be processed via parallel scan.
  • Yes. Guaranteed stability Each update only chooses among values the neuron already has, and never amplifies them. States and activations stay bounded at every length, and so do the gradients used in training.
  • Yes. Long-range sensitivity A neuron can carry its state unchanged, or rearranged, across any number of steps, so the learning signal from a late output reaches early inputs at full strength instead of fading away.
Transformers No: cannot express some basic languages No: quadratic work Yes No: limited-range sensitivity
  • No. Limited expressivity They cannot express simple common patterns that a finite-state machine recognises easily.
  • No. Quadratic cost Attention compares every token with every earlier one, so work grows quadratically with sequence length.
  • Yes. Stable Activations and gradients stay bounded as sequences grow.
  • No. Limited-range sensitivity The influence of a single early input is diluted as the context grows, so sensitivity over long ranges is limited.
Contractive Linear RNNsMamba, mLSTM, Gated DeltaNet No: limited expressivity, no long-term memory Yes Yes No: limited-range sensitivity
  • No. Limited expressivity The state shrinks at every step, so old information fades: no long-term memory, and hence limited expressivity.
  • Yes. Efficient Linear updates can be run one step at a time, like any recurrent network. They also compose associatively, so a whole sequence can be processed with a parallel scan.
  • Yes. Stable Contraction keeps states and gradients bounded.
  • No. Limited-range sensitivity Because each step shrinks the state, the effect of early inputs decays exponentially with distance.
Non-expansive Linear RNNsDeltaNet, DeltaProduct Yes Yes No: unstable Yes
  • Yes. Strong expressivity Transitions that preserve the state’s size, such as reflections, let them keep information and track state over long spans.
  • Yes. Efficient Linear updates can be run one step at a time, like any recurrent network. They also compose associatively, so a whole sequence can be processed with a parallel scan.
  • No. Unstable Gradients can diverge: for DeltaNet, on some inputs, they grow at least linearly with the sequence length.
  • Yes. Long-range sensitivity Information can be carried across long distances without fading.
Nonlinear RNNsElman, LSTM, GRU, sLSTM Yes No: strictly sequential, cannot be parallelised over the sequence Yes No: gradients vanish over long distances
  • Yes. Strong expressivity Nonlinear updates can implement finite-state machines, giving long-term memory and rich temporal patterns.
  • No. Not parallelisable Each update depends nonlinearly on the previous one, preventing parallelisation.
  • Yes. Stable Squashing nonlinearities such as tanh and sigmoid keep activations bounded.
  • No. Vanishing gradients Squashing nonlinearities suffer from vanishing state gradients, so the error signal fails to propagate back to distant inputs.

The ideaReinterpret Linear Recurrence:  arithmetic +,× → MinMax ⊕,⊗

At the heart of MinMax RNCs is MinMax recurrence: it is linear recurrence but with sum and product being those of the MinMax algebra

MinMax Recurrence

xt=(rt⊗xt−1)⊕st

The new state is the larger of st and the previous state capped at rt, exclusively via min and max.

xt=(at×xt−1)+bt

The previous state is scaled by at and shifted by bt, via multiplication × and addition +.

MinMax RNCs are cascades of layers of MinMax recurrent neurons, each maintaining its state through MinMax recurrence, using feedforward networks R and s to compute, from the current input ut, the values Rt=R(ut) and st=s(ut) that drive its recurrence.

Diagram A MinMax RNC of one layer with two neurons.layers, each with two neurons.

ut
R1
s1
R2
s2
Rt1
st1
Rt2
st2
(Rt1⊗xt−11)⊕st1
(Rt2⊗xt−12)⊕st2
xt−11
xt−12
xt1
xt2
h
yt

Each neuron i has its own feedforward networks Ri and si, which compute Rt[i] and st[i] from the input ut, and updates its state by MinMax recurrence. A further feedforward network h, such as an MLP, computes the layer’s output yt from the neurons’ new states xti; residual connections also feed h the input ut and the previous states xt−1i.

Why it worksMinMax RNCs have all four properties

Swapping +,× for ⊕,⊗ is a simple change, but it is enough to guarantee all four properties.

The properties of MinMax RNCs

High Expressivity

Long-term memory & State tracking

Exactly the regular languages: MinMax RNCs capture all regular languages and nothing beyond. Both fundamental abilities come from MinMax recurrence itself:

  • Long-term memory: a neuron holding a single number can keep its value exactly, or overwrite it, depending on the input; such neurons already suffice to capture the star-free languages;
  • State tracking: a neuron with a vector state can reorder its entries at every step, which is what tracking a permutation of objects requires.

Regular functions. A function from input sequences to outputs is regular when a finite automaton computes it: the output depends on the input read so far only through one of finitely many states. Recognising a regular language is the special case of a yes/no output.

An exact match. Every regular function can be implemented by a MinMax RNC, and nothing else can: over a finite alphabet, a MinMax RNC behaves like a finite automaton.

State size. How many entries the neurons’ states need is governed by the function’s degree: roughly, how many objects the largest rearrangement it must track acts on. A regular function of degree n can be implemented with states of n entries, and scalar states suffice exactly for the group-free functions, which include the star-free languages.

With a margin. All of this holds with outputs that stay a fixed distance apart, however long the input, so they can be read off reliably at any length.

  • Long-term memory: in the update xt=(rt⊗xt−1)⊕st, setting st≤rt keeps any state between the two inputs unchanged, while setting st>rt overwrites it with st;
  • State tracking: in each row of Rt, the entry for the position to copy from is set high and the others low, so ⊗ keeps that entry and ⊕ discards the rest.

Scalar neurons cannot reorder: with fixed inputs, their state settles in at most two steps. That is why they stop at the star-free languages.

Computational Efficiency

Linear in parallel & Constant per token

Nonlinear, yet parallelisable: unlike classic nonlinear RNNs, MinMax recurrence composes associatively, despite ⊕,⊗ being nonlinear. This meets both requirements:

  • Linear in parallel: a parallel scan processes a whole sequence with work linear in its length and only logarithmically many steps that must wait for one another;
  • Constant per token: the state has a fixed size, so each new token involves a single MinMax update, whatever the length of the history.

Each update is a map x↦(Rt⊗x)⊕st, so it is described by the pair (Rt,st). Composing two such maps, first (Ri,si) and then (Rj,sj), gives a map of the same form, with pair

(Ri,si)(Rj,sj)=(Rj⊗Ri,(Rj⊗si)⊕sj)

The composition operator is associative, so the pairs (R1:t,s1:t)=(R1,s1)⋯(Rt,st), which give every state as xt=(R1:t⊗x0)⊕s1:t, can all be computed with a parallel scan: depth O(logT·logd), work O(T·d3).

Each update costs one matrix–vector product, so a neuron with d-dimensional state processes T tokens in time O(T·d2): constant per token, as for any recurrent network.

Guaranteed Stability

Independent of sequence length

Stability by value selection: since ⊕,⊗ only select values from their operands, MinMax recurrence ensures that states, outputs and loss pseudo-gradients stay below a bound that does not depend on sequence length.

Each entry xt[i] of the new state is either the set value st[i] or an entry of the previous state capped by a reset value. So, whatever the reset values, it is at least st[i] and at most the largest entry of xt−1 or st[i]. In terms of the infinity norm:§

xt∞≤max{xt−1∞,st∞}

By induction on t, no state ever exceeds the initial state or the largest set value seen so far:

xt∞≤max{x0∞,maxk≤tsk∞}

Since st is computed by feedforward networks, it is bounded on bounded inputs and parameters; so are all states and outputs, layer after layer, with a bound that does not depend on sequence length.

v∞ is the largest absolute value among the entries of a vector v.

Training follows the gradient of the loss with respect to the parameters, computed as MinMax pseudo-gradients.

The bound below comes from one fact: every max and min puts non-negative weights summing to one on its arguments. For MinMax operations on vectors, such as ⊕ or ⊗, the pseudo-gradients are thus row sub-stochastic matrices: their entries are non-negative and each row sums to at most one. Such a matrix never enlarges a vector in max norm, and a product of such matrices is again one of them. So, by the chain rule, the pseudo-gradient of each entry of a state spreads weights summing to one over everything that entry was computed from.

Followed back to everything xT is selected from, namely the initial state x0, the reset values R1,...,RT and the set values s1,...,sT, the weights sum to exactly one, across all steps together. The parameters θ enter only through Rt and st, computed by feedforward networks at each step. So the pseudo-gradient of each entry of xT with respect to θ is a convex combination of theirs, and no larger than the largest of them, whatever the number of steps:§

∂~xT∂~θmax≤maxt≤Tmax{∂~Rt∂~θmax,∂~st∂~θmax}

Each term on the right is the pseudo-gradient of a feedforward network, on bounded inputs (the input sequence, or the outputs of the layer below; see Bounded states) and bounded parameters; so it is bounded by a constant that does not depend on t or T. Applying this layer after layer, and then to the output network and a smooth loss function, the pseudo-gradient of the loss with respect to the parameters is bounded, with a bound that does not depend on sequence length.

Amax is the largest sum of absolute values along a row of a matrix A: the matrix norm induced by the infinity norm v∞ of vectors, the largest absolute value among the entries of v.

Long-Range Sensitivity

via non-vanishing pseudo-gradients

State pseudo-gradients need not vanish: a neuron can carry its state unchanged, or with its entries reordered, across any number of steps, so pseudo-gradients between distant steps keep full strength and the model can learn dependencies spanning arbitrarily long ranges.

The neurons behind the expressivity of MinMax RNCs can act on their states exactly as the identity, for long-term memory, or as a permutation of the entries, for state tracking. On inputs that make each step such a permutation Pt (the identity included), and on states with distinct entries, no ties ever occur among the arguments of max and min. So the MinMax pseudo-gradient coincides with the ordinary gradient, and across any number of steps it is the product of these permutation matrices:

∂~xT∂~xt=∂xT∂xt=PT⋯Pt+1

A permutation matrix has norm exactly one, so this pseudo-gradient neither vanishes nor explodes, however many steps apart xt and xT are: the training signal from a late output reaches arbitrarily early states at full strength.

The evidenceOnly MinMax RNCs score 100% on core long-sequence tasks

Four core abilities, each learned on sequences of ~500 steps, and tested on one million steps.

Each card is titled with the benchmark’s name, with the ability it tests beside it, coloured by the kind of task: group-free or group-based.

Evaluation accuracy (%), means of 99% confidence intervals with max margin 1.7.

MinMax RNCs match GPT-2 on next-token prediction

Loss
3.12
on OWT

On OpenWebText, a MinMax RNC with 112M parameters and scalar-state neurons reaches a validation loss of 3.12, the same as GPT-2 with 124M parameters.

How to cite

NeurIPS 2026 paperRonca, NeurIPS 2026
@inproceedings{ronca2026minmax,
  title={{MinMax} Recurrent Neural Cascades},
  author={Alessandro Ronca},
  booktitle={NeurIPS 2026},
  year={2026},
  url={https://openreview.net/forum?id=8sPcuoX2cj}
}
OpenReview
Extended arXiv paperRonca, arXiv:2605.06384, 2026
@misc{ronca2026minmax-arxiv,
  title={{MinMax} Recurrent Neural Cascades},
  author={Alessandro Ronca},
  year={2026},
  eprint={2605.06384},
  archivePrefix={arXiv},
  primaryClass={cs.LG},
  url={https://arxiv.org/abs/2605.06384},
}
arXiv
CodeRonca, GitHub, 2026
@software{ronca2026minmax-code,
  author  = {Alessandro Ronca},
  title   = {{MinMax} Recurrent Neural Cascades},
  year    = {2026},
  url     = {https://github.com/minmaxrnc/model},
}
GitHub