arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2610.28871cs.LG
收藏

循环Transformer中截断反向传播会损失多少梯度?

How Much Gradient Does Truncated Backprop Lose in Looped Transformers?

Aur Shalev Merin

AI总结:

本研究测量循环Transformer截断反向传播的梯度损失,发现损失梯度集中在近输出处、微调时下降,且无法更好预测截断训练成本。

摘要:

循环Transformer会重复使用同一层模块多次,通常仅通过最后k个循环进行反向传播训练。我们在9个循环语言模型上,针对每次反向传播的k值(从1开始),精确测量了这种做法会损失多少权重梯度,并报告了三项发现。第一,在训练好的模型中,损失的梯度集中在靠近输出的位置:当循环数远大于k时,其随循环数的变化极小(在我们测试的三个模型中,从32到64个循环的变化在0.03以内,这是针对Parcae模型的预注册测试所预测的)。当反向传播信号按ρ^k收缩(其中ρ为每次循环的拟合收缩率)时,它在中等循环数下能近似该信号,但在长循环数下会高估,因为拟合的ρ会随纳入更多循环而上升。在Ouro模型上,该信号会增长,保留4个循环中的2个仍会损失最终输出梯度的81%。第二,损失的梯度在微调期间会下降,在4个模型中的3个上,300步内下降了0.07-0.22,在保留的问题上也是如此。这种下降不仅是读出部分在梯度中的占比;仅训练循环外的层就能重现多达一半的下降,且在截断训练下也会出现。因此,训练好的模型的价值被高估了,而截断后续会移除的部分。第三,我们无法证明它比无需测量的规则更能预测截断的训练成本:在两个新模型上,它在相同k值下与Parcae的成本相当,而测试规模太小无法区分它们。

英文摘要:

Looped transformers reuse one block of layers many times and are often trained by backpropagating through only the last k loops. We measure how much of the weight gradient this throws away, exactly and for every k from one backward pass, on nine looped language models, and report three findings. First, on a trained model this lost gradient is set near the output: once the loop count is well above k, it barely changes with the loop count (within about 0.03 from 32 to 64 loops on the three models we tested, as a pre-registered test predicted for Parcae). Where the backward signal shrinks, $ρ^k$, with $ρ$ the signal's fitted shrink per loop, approximates it at moderate loop counts but overstates it at long ones, because the fitted $ρ$ drifts up as the fit takes in more loops. On Ouro the signal grows, and keeping two of four loops still loses 81% of the final output's gradient. Second, the lost gradient falls during fine-tuning, by 0.07-0.22 within 300 steps on three of four models, on held-out problems too. The fall is not just the read-out's share of the gradient; training only the layers outside the loop reproduced up to half of it, and it also falls under truncated training. So a trained model's value overstates what truncation removes later. Third, we could not show that it predicts the training cost of truncation better than rules that need no measurement: on two new models it tied Parcae's cost at the same k, in a test too small to separate them.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑