让循环模型处理超长序列更稳定,仅需少量微调
Understanding and Improving Length Generalization in Recurrent Models
- 通过扩大训练时状态覆盖范围提升泛化能力
- 500步微调即可实现从2k到128k的长度泛化
- 适合需要处理长序列的模型优化场景
近期,状态空间模型和线性注意力等循环模型因序列长度复杂度线性而受到青睐。尽管理论上可处理任意长序列,但其性能常在超出训练上下文长度后显著下降,即缺乏长度泛化能力。本文提出并验证了‘未探索状态假说’:模型在训练中仅接触有限的状态分布,导致无法泛化到更长序列。我们研究了简单训练干预方法,如用高斯噪声或另一序列的终态初始化状态。仅需500次后训练步骤(约预训练预算的0.1%),这些方法便使模型在序列长度达训练长度数倍时仍保持性能(如2k→128k),并在长上下文任务中表现更优,为通用循环模型提供了一种高效、简单的长度泛化增强方案。
原文摘要 · Abstract (English)
Recently, recurrent models such as state space models and linear attention have become popular due to their linear complexity in the sequence length. Thanks to their recurrent nature, in principle they can process arbitrarily long sequences, but their performance sometimes drops considerably beyond their training context lengths-i.e. they fail to length generalize. In this work, we provide comprehensive empirical and theoretical analysis to support the unexplored states hypothesis, which posits that models fail to length generalize when during training they are only exposed to a limited subset of the distribution of all attainable states (i.e. states that would be attained if the recurrence was applied to long sequences). Furthermore, we investigate simple training interventions that aim to increase the coverage of the states that the model is trained on, e.g. by initializing the state with Gaussian noise or with the final state of a different input sequence. With only 500 post-training steps ($\sim 0.1\%$ of the pre-training budget), these interventions enable length generalization for sequences that are orders of magnitude longer than the training context (e.g. $2k\longrightarrow 128k$) and show improved performance in long context tasks, thus presenting a simple and efficient way to enable robust length generalization in general recurrent models.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。