近零词元嵌入在门控序列模型中悄然停滞训练
研究论文 · 2026/11/04
在291个开放权重语言模型仓库(280个不同嵌入表)中,52.6%的未绑定门控与混合检查点(20/38)包含范数低于10^{-6}的可达输入嵌入,而权重绑定模型为0%。这种近零行可能在预训练中出现:当未见过的稀有或模板令牌获得零输入梯度,而AdamW权重衰减收缩未绑定嵌入时。在测试的Transformer配置中,非初始位置或BOS令牌可防止此故障模式。在门控序列模型(Mamba、Gated DeltaNet、xLSTM)中,近零令牌可将输入嵌入梯度放大超过30个数量级(高达35)。在零输入时,当前令牌读出因子(SiLU门或线性查询)消失,抑制历史状态读出。残差RMS值可能连续层低于RMSNorm下限的平方根,导致Pre-RMSNorm每层将反向梯度放大高达10^3。当梯度条目超过1.84×10^{19}时,PyTorch、Hugging Face Trainer和FSDP2中的FP32全局范数裁剪可能溢出为无穷大,并将当前批次的梯度置零。在Nemotron-3-Nano-4B的泰卢固语持续预训练中,这丢弃了约20%步骤的更新,并使触发行冻结。我们提出两种补救措施。对于已发布检查点,GroupClip使用64位或重新缩放范数解耦输入嵌入裁剪;其重新缩放实现消除更新损失,并在一步内修复触发行,测得端到端开销可忽略。对于预训练,GateFloor(SiLU(z) + δ,δ∈[0.01, 0.1])在零输入时保持门为正,在高达370M参数的实验中将近零梯度减少28个数量级,困惑度与基线相当。
该研究揭示了门控序列模型中近零令牌嵌入导致训练停滞的隐蔽问题,并提出了实用的解决方案,对大规模语言模型预训练和微调具有重要指导意义。
Among 291 surveyed open-weight language model repositories (280 distinct embedding tables), 52.6% of untied gated and hybrid checkpoints (20/38) contain reachable input embeddings with norms below 10^{-6}, compared with 0% of weight-tied models. Such near-zero rows can arise during pretraining when unseen rare or template tokens receive zero input gradients while AdamW weight decay shrinks untied embeddings. In tested Transformer configurations, non-initial positions or a BOS token prevent this failure mode. In gated sequence models (Mamba, Gated DeltaNet, xLSTM), a near-zero token can amplify input-embedding gradients by more than 30 orders of magnitude (up to 35). At zero input, current-token readout factors (SiLU gates or linear queries) vanish, suppressing historical-state readout. Residual RMS values can then fall below the square root of the RMSNorm floor across consecutive layers, causing Pre-RMSNorm to amplify backward gradients by up to 10^3 per layer. When a gradient entry exceeds 1.84 times 10^{19}, FP32 global-norm clipping in PyTorch, Hugging Face Trainer, and FSDP2 can overflow to infinity and zero the current batch's gradients. In Telugu continual pretraining of Nemotron-3-Nano-4B, this discards updates on approximately 20% of steps and leaves triggered rows frozen. We propose two remedies. For released checkpoints, GroupClip decouples input-embedding clipping using a 64-bit or rescaled norm; its rescaled implementation eliminates update loss and heals triggered rows in one step with negligible measured end-to-end overhead. For pretraining, GateFloor (SiLU(z) + δ, δin [0.01, 0.1]) keeps the gate positive at zero input, reducing near-zero gradients by 28 orders of magnitude in experiments up to 370M parameters, with perplexity comparable to the baseline.