acceptodds
Under review as a conference paper at ICLR 2027

Length-Independent State Tracking Under a Parallel Scan

Abstract

Learning robust and scalable finite-state tracking is fundamental to sequence processing. While linear recurrent neural networks (RNNs), linear attention, and state space models enable scalable parallel training through affine recurrences, their theoretical expressivity guarantees assume idealized arithmetic and do not extend to finite precision, where the parallel scan that makes them fast is itself a source of perturbation. We formalize finite-state tracking at finite precision and characterize *length independence*: tracking that stays correct at every sequence length, at a precision cost that does not grow with the length. We show that length-independent state tracking requires two competing dynamics within a single map: *contraction* to suppress numerical perturbations and *separation* to keep distinct states apart. We prove that affine recurrences, which offer a single rate at each step to serve both roles, realize at most *definite* automata at finite precision. Instead of treating scan compatibility as a restriction on the update map, we reinterpret it as a computational budget and introduce the *Neural Finite-State Machine* (NFSM): a non-affine, scan-compatible RNN built for length-independent finite-state tracking. On synthetic benchmarks spanning abelian and non-abelian groups, non-invertible monoids, and textual state-tracking tasks, affine baselines fail on every non-definite task, most of them within a few hundred steps. A single NFSM layer instead learns the exact transition tables of every algebraic task, which certifies correctness beyond the tested lengths, and a stack of NFSMs keeps perfect accuracy on the textual tasks at every tested length.

Then back it, or bet against it.

Related papers

Open the market on this paper to see 7 more related papers.