论文精选

ParaTTT算法将测试时训练层的非线性记忆并行化

ParaTTT: Parallelizing Test-Time Training Layers with Deep Memories

精选理由

TTT层一直快不起来,这篇给出并行化算法,比TTT-MLP快32倍,训练340M模型提速4.9倍,还追平Mamba-2。

测试时训练(TTT)层用在线梯度下降训练的小神经网络替代线性快速权重记忆,比Gated DeltaNet和Mamba-2的线性记忆更具表达力,但难以并行。ParaTTT(PTTT)通过迭代精化内层梯度轨迹估计来并行化任意深度的非线性记忆,每轮包含前向、gated-delta-rule和反向三次chunkwise并行计算,并证明两层变体在收缩条件下几何收敛。在4K上下文下,两次精化迭代使内层轨迹求值比TTT-MLP的块近似快32倍(误差相同),340M完整模型训练快4.9倍。340M和1.3B规模的模型在语言建模困惑度和零样本准确率上匹配或超过Gated DeltaNet与Mamba-2,且召回能力优于线性递归模型。

原文 · arXiv cs.LG

ParaTTT: Parallelizing Test-Time Training Layers with Deep Memories

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. Moreover, 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. Starting from a guess of the hidden-layer gradients, 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, while decoding requires no refinement iterations. We prove geometric convergence for a two-layer variant under sufficient contraction conditions. In practice, two iterations suffice. 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.