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 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 be the model’s internal representation of the input at step (in a Transformer, the token’s hidden vectors; in a recurrent model, its state), and let and be the output and the loss at a later step . 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:
Sensitivity. The sensitivity is the middle factor:
It measures how much the late output reacts to the early input’s representation, across a distance of steps. The sensitivity to the input itself only adds a local factor , 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 stays above a constant that does not depend on : 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 is the state , and the sensitivity is a product of one factor per step:
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
- Elman: Elman, Cognitive Science 1990
- LSTM: Hochreiter and Schmidhuber, Neural Computation 1997
- GRU: Cho et al., EMNLP 2014
- Transformers: Vaswani et al., NeurIPS 2017
- Mamba: Gu and Dao, COLM 2024
- mLSTM: Beck et al., NeurIPS 2024
- Gated DeltaNet: Yang et al., ICLR 2025
- DeltaNet: Yang et al., NeurIPS 2024
- DeltaProduct: Siems et al., NeurIPS 2025
Yet each of these architectures gives up at least one of the four properties.
MinMax RNCs have all four properties at once.
| Architecture | ||||
|---|---|---|---|---|
| MinMax RNCs | Yes | Yes | Yes | Yes |
|
||||
| Transformers | No: cannot express some basic languages | No: quadratic work | Yes | No: limited-range sensitivity |
|
||||
| Contractive Linear RNNsMamba, mLSTM, Gated DeltaNet | No: limited expressivity, no long-term memory | Yes | Yes | No: limited-range sensitivity |
|
||||
| Non-expansive Linear RNNsDeltaNet, DeltaProduct | Yes | Yes | No: unstable | Yes |
|
||||
| Nonlinear RNNsElman, LSTM, GRU, sLSTM | Yes | No: strictly sequential, cannot be parallelised over the sequence | Yes | No: gradients vanish over long distances |
|
||||
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
The new state is the larger of and the previous state capped at , exclusively via and .Entry of the new state is the largest among entry of and the old entries, each capped at its entry in row of , exclusively via and .
The previous state is scaled by and shifted by , via multiplication and addition .Entry of the new state is a weighted sum of the old entries, with weights from row of , shifted by entry of , via multiplication and addition .
MinMax RNCs are cascades of layers of MinMax recurrent neurons, each maintaining its state through MinMax recurrence, using feedforward networks and to compute, from the current input , the values and that drive its recurrence.
Diagram A MinMax RNC of one layer with two neurons.layers, each with two neurons.
Each neuron has its own feedforward networks and , which compute and from the input , and updates its state by MinMax recurrence. A further feedforward network , such as an MLP, computes the layer’s output from the neurons’ new states ; residual connections also feed the input and the previous states . With two layers, the first layer’s network outputs , which is the input of the second layer, whose network outputs .
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 can be implemented with states of 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 , setting keeps any state between the two inputs unchanged, while setting overwrites it with ;
- State tracking: in each row of , 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 , so it is described by the pair . Composing two such maps, first and then , gives a map of the same form, with pair
The composition operator is associative, so the pairs , which give every state as , can all be computed with a parallel scan: depth , work .
Each update costs one matrix–vector product, so a neuron with -dimensional state processes tokens in time : 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 of the new state is either the set value or an entry of the previous state capped by a reset value. So, whatever the reset values, it is at least and at most the largest entry of or . In terms of the infinity norm:§
By induction on , no state ever exceeds the initial state or the largest set value seen so far:
Since 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.
is the largest absolute value among the entries of a vector .
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 and 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 is selected from, namely the initial state , the reset values and the set values , the weights sum to exactly one, across all steps together. The parameters enter only through and , computed by feedforward networks at each step. So the pseudo-gradient of each entry of with respect to is a convex combination of theirs, and no larger than the largest of them, whatever the number of steps:§
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 or . 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.
is the largest sum of absolute values along a row of a matrix : the matrix norm induced by the infinity norm of vectors, the largest absolute value among the entries of .
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 (the identity included), and on states with distinct entries, no ties ever occur among the arguments of and . So the MinMax pseudo-gradient coincides with the ordinary gradient, and across any number of steps it is the product of these permutation matrices:
A permutation matrix has norm exactly one, so this pseudo-gradient neither vanishes nor explodes, however many steps apart and 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.
Average training and evaluation tokens per second, relative to MinMax (dashed line = 1×); means of 99% confidence intervals with max margin 0.4.
MinMax RNCs match GPT-2 on next-token prediction
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}
}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},
}CodeRonca, GitHub, 2026
@software{ronca2026minmax-code,
author = {Alessandro Ronca},
title = {{MinMax} Recurrent Neural Cascades},
year = {2026},
url = {https://github.com/minmaxrnc/model},
}