Halting in Recurrent Sequence Models
Not on the map. Why?
Abstract (arXiv)
Recurrent sequence models, such as recurrent neural networks (RNNs) and state space models (SSMs), are often trained to emit an end-of-sequence (EOS) token when their output sequence is complete. During training, EOS is treated as another token without a special loss term or incentive. Although this training paradigm is widely used, it is not understood how models decide to output EOS. We study a minimal version of the EOS halting problem in which networks are trained to emit a given input sequence an instructed number of times, followed by EOS. We train tanh RNNs and linear SSMs on this task, finding that the RNNs encode the number of tokens left to copy in a linear subspace, of which two principal components capture most of the variation. Hidden states with the same remaining count converge to a shared representation regardless of their instructed repeat count. By modulating the hidden state using an affine transformation at the boundary between copied sequences, we shift the RNN's state to the representation shared by states with one fewer copy remaining. The unchanged network emits EOS one copy earlier while reproducing the shortened target sequence in 94.4% of new sequences, revealing that this representation causally determines the stopping time. In the SSMs, the difference between trajectories with different repeat counts is separated across two-dimensional rotation planes whose contributions to the EOS comparison cancel during copying and align near the stopping time. Rotating the planes independently removes most of the intended stopping while preserving the copied content, which shows that the stopping time depends on the planes' relative phases. These results identify two candidate primitives of EOS halting in recurrent models: a shared encoding of the number of remaining tokens in tanh RNNs and phase alignment across fixed rotations in linear SSMs.
Key facts. No citing papers in the map yet (data through 24 Nov 2026). Builds on 27 of its 33 references that are in the map. Submitted 16 Nov 2026.
Builds on
27 of 33 references.
References · 27
- 2023Mamba: Linear-Time Sequence Modeling with Selective State Spacescited by 5,111
- 2021Efficiently Modeling Long Sequences with Structured State Spacescited by 2,611
- 2022Simplified State Space Layers for Sequence Modelingcited by 818
- 2018Universal Transformerscited by 769
- 2019Designing and Interpreting Probes with Control Taskscited by 736
- 2014Neural Turing Machinescited by 693
- 2016Adaptive Computation Time for Recurrent Neural Networkscited by 578
- 2021Causal Abstractions of Neural Networkscited by 461
- 2023Resurrecting Recurrent Neural Networks for Long Sequencescited by 441
- 2019Depth-Adaptive Transformercited by 256
- 2021PonderNet: Learning to Pondercited by 197
- 2015Visualizing and Understanding Recurrent Networkscited by 172
15 more
- 2018Correcting Length Bias in Neural Machine Translationcited by 126
- 2015Inferring Algorithmic Patterns with Stack-Augmented Recurrent Netscited by 78
- 2015Learning to Transduce with Unbounded Memorycited by 57
- 2024Recurrent Neural Networks Learn to Store and Generate Sequences using Non-Linear Representationscited by 51
- 2020The EOS Decision and Length Extrapolationcited by 48
- 2019Reverse engineering recurrent networks for sentiment classification reveals line attractor dynamicscited by 42
- 2016Recurrent Orthogonal Networks and Long-Memory Taskscited by 40
- 2018Breaking the Beam Search Curse: A Study of (Re-)Scoring Methods and Stopping Criteria for Neural Machine Translationcited by 30
- 2021Reverse engineering recurrent neural networks with Jacobian switching linear dynamical systemscited by 20
- 2022Low-Rank Softmax Can Have Unargmaxable Classes in Theory but Rarely in Practicecited by 18
- 2016Length bias in Encoder Decoder Models and a Case for Global Conditioningcited by 15
- 2025Emergent Symbol-like Number Variables in Artificial Neural Networkscited by 8
- 2017Probabilistic Adaptive Computation Timecited by 5
- 2019Understanding and Controlling Memory in Recurrent Neural Networkscited by 3
- 2019Learning to Stop in Structured Prediction for Neural Machine Translationcited by 2
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2023State space models can express n-gram languages
- 2025ParaRNN: Unlocking Parallel Training of Nonlinear RNNs for Large Language Models
- 2024State Soup: In-Context Skill Learning, Retrieval and Mixing
- 2024Recurrent neural networks: vanishing and exploding gradients are not the end of the story
- 2025Advancing Intelligent Sequence Modeling: Evolution, Trade-offs, and Applications of State-Space Architectures from S4 to Mamba
- 2024State-Space Modeling in Long Sequence Processing: A Survey on Recurrence in the Transformer Era
- 2026Exploration of Fast-Slow Latent Recurrence for Train-Short, Test-Long Generalization
- 2023State-space Models with Layer-wise Nonlinearity are Universal Approximators with Exponential Decaying Memory