长序列训练时,局部密集依赖会导致注意力数值爆炸,引发训练不稳定。
Dense Local Dependencies Induce Attention-Logit Explosion and Training Instability During Long-Sequence Transformer Training
- 发现局部密集依赖使注意力结构变高秩,需用更大注意力数值逼近。
- 序列越长,注意力数值增长越明显,低精度计算下更易崩溃。
- 显式建模局部依赖可显著缓解数值膨胀,适合长文本生成场景。
自回归Transformer语言模型在长序列训练中常出现训练不稳定,尤其在低精度算术下更为明显。尽管该现象常伴随注意力数值爆炸,其根本原因尚不明确。本文通过分析与实验证明,局部密集依赖是导致注意力数值爆炸的关键因素。密集的局部依赖模式产生高秩注意力结构,而自注意力的低秩参数化只能通过不断增大的注意力数值来逼近,随序列长度增长导致数值膨胀,进而引发低精度下的训练不稳定性。我们在合成数据和语言建模任务上进行了大量实验,结果一致显示:注意力数值随序列长度增加,可通过增大注意力维度缓解,且显式建模局部依赖能大幅降低数值增长。此外,数值增长由依赖密度驱动,而非仅由局部性引起。本研究揭示,显式建模局部密集依赖是构建稳定、高效、可扩展的长上下文Transformer架构的重要设计原则。
原文摘要 · Abstract (English)
Autoregressive transformer language models frequently exhibit training instability when trained on long sequences, particularly under low-precision arithmetic. Although this instability is often accompanied by attention-logit explosion, its underlying cause remains poorly understood. In this work, we present analytical insights and empirical evidence that dense local dependencies are a major contributor to attention-logit explosion. We demonstrate that dense local dependency patterns yield an effectively high-rank attention structure, which the low-rank parameterization of self-attention can only approximate with increasingly large logits as the sequence length grows. This logit inflation ultimately leads to training instability under low-precision arithmetic. We support this explanation through extensive experiments on synthetic and language modeling tasks. Our results consistently show that attention-logit growth increases with sequence length, is mitigated by increasing the attention dimension, and is substantially reduced by explicitly modeling dense local dependencies. Furthermore, we show that this growth is driven by the density of local dependencies rather than by locality alone. More broadly, our findings suggest that explicitly modeling dense local dependencies constitutes an important design principle for developing stable, efficient, and scalable long-context transformer architectures for autoregressive language modeling.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。