残差Koopman谱分析用于预测和防止Transformer训练不稳定性
Residual Koopman Spectral Profiling for Predicting and Preventing Transformer Training Instability
AI总结:
残差Koopman谱分析通过预测和防止Transformer训练不稳定性,显著降低发散率并提升学习率
摘要:
Transformer训练中的发散现象浪费了计算资源,然而从业者往往在昂贵的运行开始后才发现不稳定性。因此,他们需要在训练开始前为Transformer估计一个故障概率。我们对残差Koopman谱分析(RKSP)的研究提供了这样的估计。通过在初始化时进行一次前向传递,RKSP通过将白化动态模式分解应用于层间残差快照来提取Koopman谱特征。我们的核心诊断,即近单位谱质量,量化了集中在单位圆附近的模式比例,这捕捉了不稳定性风险。为了预测广泛配置中的发散,该估计器实现了0.995的AUROC,优于最佳梯度基线。我们进一步通过Koopman谱塑造(KSS)使该诊断变得可行,该方法在训练期间重塑谱。我们实证验证了我们的方法在实际中的有效性:RKSP在初始化时预测发散,当RKSP标记高风险时,开启KSS成功防止发散。在具有挑战性的高学习率范围内没有归一化层时,KSS将发散率从66.7%降低到12.5%,并使学习率提高了50%至150%。这些发现适用于WikiText-103语言建模、CIFAR-10上的视觉Transformer、以及预训练语言模型,包括GPT-2和LLaMA-2(7B)以及新兴架构如MoE、Mamba-style SSMs和KAN。
英文摘要:
Training divergence in transformers wastes compute, yet practitioners discover instability only after expensive runs begin. They therefore need an expected probability of failure for a transformer before training starts. Our study of Residual Koopman Spectral Profiling (RKSP) provides such an estimate. From a single forward pass at initialization, RKSP extracts Koopman spectral features by applying whitened dynamic mode decomposition to layer-wise residual snapshots. Our central diagnostic, the near-unit spectral mass, quantifies the fraction of modes concentrated near the unit circle, which captures instability risk. For predicting divergence across extensive configurations, this estimator achieves an AUROC of 0.995, outperforming the best gradient baseline. We further make this diagnostic actionable through Koopman Spectral Shaping (KSS), which reshapes spectra during training. We empirically validate that our method works in practice: RKSP predicts divergence at initialization, and when RKSP flags high risk, turning on KSS successfully prevents divergence. In the challenging high learning rate regime without normalization layers, KSS reduces the divergence rate from 66.7% to 12.5% and enables learning rates that are 50% to 150% higher. These findings generalize to WikiText-103 language modeling, vision transformers on CIFAR-10, and pretrained language models, including GPT-2 and LLaMA-2 up to 7B, as well as emerging architectures such as MoE, Mamba-style SSMs, and KAN.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。