MinMax Recurrent Neural Cascades

Alessandro Ronca

TL;DR

Sequence models usually force you into a painful compromise: Transformers scale quadratically with length, traditional RNNs can't be parallelized, and modern linear RNNs (like Mamba or DeltaNet) either forget early tokens over long contexts or risk numerical blow-ups. By simply swapping standard addition and multiplication for max and min operations, MinMax Recurrent Neural Cascades (MinMax RNCs) unlock parallel training, maximum finite-memory expressivity, and unattenuated memory retention across million-token sequences—all without exploding states or vanishing gradients.

What Problem Does This Paper Address?

Processing ultra-long sequences involves a tug-of-war between computational efficiency, expressivity, stability, and memory. Standard Transformers have quadratic cost in sequence length. Traditional nonlinear RNNs (like LSTMs) run in linear time and have high expressivity, but they must run sequentially step-by-step and suffer from vanishing gradients.

Recent linear RNNs (like Mamba, xLSTM, and DeltaNet) offer a clever middle ground: because linear updates are associative, they can be evaluated rapidly in parallel using a parallel scan algorithm. However, keeping a linear system stable over millions of steps is tricky:

  • Contractive models (e.g., Mamba) multiply states by factors strictly less than 1. This guarantees stability, but causes exponential memory decay—sufficiently long suffixes inevitably wash away the influence of early inputs.
  • Expansive or non-expansive models (e.g., RWKV-7, DeltaNet) avoid shrinking the state, which stops memory decay, but allows states to amplify or additively accumulate inputs over time until trajectories and gradients diverge.

The challenge is finding a recurrence mechanism that is associative (for parallelization) and propagates states indefinitely without attenuation, amplification, or additive accumulation.

Methods

The author replaces ordinary arithmetic $(+, \times)$ in affine recurrences with MinMax algebra $(\oplus, \otimes)$, where $a \oplus b = \max(a, b)$ and $a \odot b = \min(a, b)$.

In a MinMax Neuron, an input $u_t$ is fed into standard MLPs to generate a "reset" matrix $R(u_t)$ and a "set" vector $s(u_t)$. The state $x_t$ updates via MinMax matrix-vector multiplication: $$x_t = (R(u_t) \otimes x_{t-1}) \oplus s(u_t)$$ Intuitively, min and max act as clean routing switches: depending on the bounds set by $R$ and $s$, the neuron either overwrites the state with a new value, holds onto the old state untouched, or permutes state coordinates.

Diagram of a two-unit MinMax Recurrent Layer

Multiple neurons run side-by-side to form a layer, and layers are stacked sequentially to create a MinMax Recurrent Neural Cascade (MinMax RNC). Because min and max preserve associativity, the recurrence can still be computed in $O(\log T)$ parallel time via parallel scan, while standard PyTorch AutoDiff handles backpropagation using bounded pseudo-gradients.

Datasets

  • Group-free synthetic tasks: Latching(n) (remembering the very first token), InductionHeads(n) (associative recall after a marker), and Sequences(n)—a newly introduced benchmark requiring the model to simultaneously track and match two multi-event sequential patterns scattered across long horizons, with reset triggers.
  • Group-based synthetic tasks: Word problems on the symmetric groups $S_3$ and $S_4$ (tracking permutations, such as parity).
  • Real-world language modeling: OpenWebText (OWT) for GPT-2-scale next-token prediction.

Key Insights and Ideas

  • Selection beats accumulation: Ordinary linear recurrences blend numbers together, risking overflow or decay. Because min and max merely select existing coordinates from the previous state or current input, states remain strictly bounded regardless of sequence length, and floating-point updates are numerically exact (zero rounding drift!).
  • Exposing the "vanishing margin" loophole: Prior theory claimed models like Mamba can recognize all star-free regular languages, but relied on output separation margins that shrink toward zero as sequences grow. Under a realistic positive-margin requirement, contractive linear RNNs fail, whereas scalar-state MinMax RNCs succeed across all star-free languages (and vector-state RNCs capture all regular languages).
  • Exact gradient preservation: In the regimes where MinMax Neurons hold or permute states, their state-to-state Jacobians act as exact identity or permutation matrices. Error signals can travel back across 100,000+ steps with unit norm—neither vanishing nor exploding.

Key Results

  • Zero-shot length generalization to 1M tokens: Trained on sequences of length $\le 512$ (or 128 for group tasks) and tested at length 1,000,000, MinMax RNCs achieved 100% accuracy across all synthetic benchmarks (Latching, Sequences, InductionHeads, $S_3$, and $S_4$).
  • Outperforming SOTA baselines: On million-token evaluations, Mamba, xLSTM-L, mLSTM, sLSTM, and DeltaNet degraded sharply with length, dropping to random guessing by 100k–200k steps on several tasks (e.g., scoring 3%–8% on InductionHeads(30) vs. MinMax's 100%).
  • Competitive speed and language modeling: MinMax achieved the highest evaluation throughput and second-highest training throughput among tested baselines. On OpenWebText, a 112M-parameter MinMax RNC reached a 3.12 validation loss, matching OpenAI's 124M GPT-2 baseline.

Limitations and Future Work

  • Empirical scale: Real-world testing is currently limited to a single 112M-parameter language model; larger-scale evaluations are needed.
  • Theoretical width/depth bounds: Because corresponding questions in algebraic automata theory remain open, the paper cannot prescribe exact layer width and depth requirements for arbitrary target languages.
  • Future directions: Scaling up real-world experiments and integrating MinMax recurrence as a drop-in memory module inside existing hybrid architectures.

Summary updated

Abstract

We introduce *MinMax Recurrent Neural Cascades (MinMax RNCs)*, a class of recurrent neural networks based on a novel form of recurrence in the MinMax algebra. MinMax RNCs are a first in simultaneously enjoying the key properties for truly long-context processing: strong formal expressivity with long-term memory, efficient inference both in recurrent and parallel form, stable dynamics and gradients, and long-range sensitivity ensured by non-vanishing state gradients. First, they can store and retain information arbitrarily long, and manipulate it in a rich way, with a formal expressivity corresponding the regular languages—arguably the maximal expressivity for finite-memory systems. Second, in addition to linear-time inference via recurrence, they also admit log-depth–linear-work inference via parallel scan. Third, their states and activations are uniformly bounded independently of sequence length. Fourth, although not everywhere-differentiable, they admit pseudo-gradients that are uniformly bounded independently of sequence length and coincide with ordinary gradients almost everywhere. Fifth, they do not suffer from vanishing state gradients: the pseudo-gradient of a state with respect to an arbitrarily-distant past state can retain unit norm, while coinciding with the ordinary gradient. Empirically, we find that the theoretical properties translate to strong practical performance. We evaluate MinMax RNCs on a suite of fundamental synthetic tasks, and observe they solve all tasks perfectly, generalising seamlessly on longer sequences when tested up to length 1M, and outperforming a selection of baselines that well-represent the state of the art. We train a 112M-parameter MinMax RNC for next-token prediction in OWT, obtaining competitive performance for its size, and hence initial evidence of the potential of MinMax RNCs for real-world sequence-modelling tasks.
BibTeX
@inproceedings{ronca2026minmax,
  author = {Alessandro Ronca},
  title = {{MinMax Recurrent Neural Cascades}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=8sPcuoX2cj},
}
Figure