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

ParaTTT:用深度记忆并行化测试时训练层

ParaTTT: Parallelizing Test-Time Training Layers with Deep Memories

MIT CSAIL(麻省理工学院计算机科学与人工智能实验室);Liquid AI;Max Planck Institute for Intelligent Systems(马克斯·普朗克智能系统研究所)

Noel Loo, Neehal Tumma, T. Konstantin Rusch, Mathias Lechner, Alexander Amini, Daniela Rus

AI总结:

提出ParaTTT算法并行化TTT层的深度非线性记忆,通过分块并行传递实现加速,在匹配误差下评估速度达TTT-MLP的32倍,模型性能优于或媲美Gated DeltaNet、Mamba-2及同规模Transformer。

摘要:

测试时训练(TTT)层将现代循环架构的线性快速权重记忆替换为通过梯度下降在线训练的小型神经网络。这种非线性记忆比Gated DeltaNet和Mamba-2的线性记忆更具表达力,但难以并行化:现有实现如TTT-MLP依赖顺序的分块权重更新,其运行速度比分块并行的线性递归慢数倍。此外,它们的分块执行仅近似逐token的在线递归,而线性递归允许精确的分块并行评估。我们提出ParaTTT(PTTT),一种通过迭代优化内循环梯度轨迹估计来并行化任意深度非线性记忆的算法。从隐藏层梯度的初始猜测开始,每次优化包含三次分块并行传递:评估所得特征轨迹的前向传递、计算读出轨迹及其特征梯度的精确门控delta规则传递,以及将这些梯度传播到新估计的后向传递。精确的在线梯度下降递归是该迭代的不动点,而解码无需优化迭代。我们证明了两层变体在充分收缩条件下的几何收敛性,实践中两次迭代即足够。在4K上下文下进行两次优化步骤时,PTTT在匹配误差的情况下评估内循环轨迹的速度是采用分块近似的TTT-MLP的32倍,而完整的3.4亿参数模型的训练速度快4.9倍。参数规模为3.4亿和13亿的模型在语言建模困惑度和零样本准确率上与Gated DeltaNet、Mamba-2相当或更优,且与同规模Transformer相比仍具竞争力,同时比线性递归具有更好的召回率。

英文摘要:

Test-time training (TTT) layers replace the linear fast-weight memory of modern recurrent architectures with a small neural network trained online by gradient descent. This nonlinear memory is more expressive than the linear memories of Gated DeltaNet and Mamba-2, but is difficult to parallelize: existing implementations such as TTT-MLP rely on sequential, block-wise weight updates that run several times slower than chunkwise-parallel linear recurrences. Their block-wise execution only approximates the token-by-token online recurrence, whereas linear recurrences admit an exact chunkwise-parallel evaluation. We introduce ParaTTT (PTTT), an algorithm for parallelizing arbitrarily deep nonlinear memories by iteratively refining estimates of the inner-loop gradient trajectory. Each refinement consists of three chunkwise-parallel passes: a forward pass that evaluates the resulting feature trajectory, an exact gated-delta-rule pass that computes the readout trajectory and its feature gradients, and a backward pass that propagates these gradients into a new estimate. The exact online gradient descent recurrence is a fixed point of the iteration. Training and prefill approximate this recurrence with a finite number of iterations, while decoding applies the exact token-by-token update without refinement. We prove geometric convergence for a two-layer variant under sufficient contraction conditions. With two refinement steps at 4K context, PTTT evaluates the inner-loop trajectory $32\times$ faster than TTT-MLP with the block approximation at matched error, while the full 340M model trains $4.9\times$ faster. Models trained at 340M and 1.3B parameters match or exceed Gated DeltaNet and Mamba-2 and remain competitive with same-size Transformers on language-modeling perplexity and zero-shot accuracy, with better recall than the linear recurrences.

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

↑