MinMax Recurrent Neural Cascades
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.