跳到正文
arXiv (AI + Vision + Imaging)· Simon Dr\"ager·· 9 天前AI 评分18

循环序列模型如何决定输出EOS:tanh RNN与线性SSM的停机机制研究

Halting in Recurrent Sequence Models

AI 导读

研究用“按指定次数复制输入序列后输出EOS”的最小任务,发现tanh RNN将剩余token数编码在线性子空间中,两个主成分即可捕捉大部分变化。在序列边界对隐状态施加仿射变换后,网络提前一次复制输出EOS,并在94.4%的新序列上正确复现缩短后的目标序列。线性SSM的停机时间则取决于二维旋转平面的相对相位。

正文 · 原文

arXiv:2611.20377v1 Announce Type: new Abstract: 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.

来源:arXiv (AI + Vision + Imaging) · arxiv.org