arXiv:2506.05233cs.LGcs.AI2025-06被引 37

通过最优测试时训练,让RNN模型在长文本理解上超越传统Transformer。

MesaNet: Sequence Modeling by Locally Optimal Test-Time Training

  • 基于上下文损失优化,用共轭梯度法实现每步精确求解
  • 在百亿参数规模下,语言建模困惑度更低,下游任务表现更优
  • 适合需要长序列建模的场景,如文档理解、复杂推理

序列建模目前主要依赖因果Transformer架构,其自注意力使用softmax机制,推理时内存和计算成本随序列长度线性增长。近期研究将softmax线性化,催生出如DeltaNet、Mamba和xLSTM等具有恒定内存与计算开销的RNN模型。这些模型可统一为一种在线学习规则近似优化的上下文回归目标。本文引入一种数值稳定、分块并行的Mesa层新版本,解决了原版仅能串行运行、难以扩展的问题。该层源自一个上下文损失函数,但通过快速共轭梯度求解器在每个时间步达到最优最小化。大规模实验表明,在高达百亿参数的规模下,最优测试时训练显著降低语言建模困惑度,并提升下游基准性能,尤其在长上下文理解任务中优势明显。此性能提升以增加推理阶段浮点运算量为代价,呼应了当前通过增加测试时计算来提升模型表现的趋势——即在神经网络内部解决顺序优化问题。

原文摘要 · Abstract (English)

Sequence modeling is currently dominated by causal transformer architectures that use softmax self-attention. Although widely adopted, transformers require scaling memory and compute linearly during inference. A recent stream of work linearized the softmax operation, resulting in powerful recurrent neural network (RNN) models with constant memory and compute costs such as DeltaNet, Mamba or xLSTM. These models can be unified by noting that their recurrent layer dynamics can all be derived from an in-context regression objective, approximately optimized through an online learning rule. Here, we join this line of work and introduce a numerically stable, chunkwise parallelizable version of the recently proposed Mesa layer (von Oswald et al., 2024), which could only run sequentially in time and was therefore not scalable. This layer again stems from an in-context loss, but which is now minimized to optimality at every time point using a fast conjugate gradient solver. Through an extensive suite of experiments study up to the billion-parameter scale, we show that optimal test-time training enables reaching lower language modeling perplexity and higher downstream benchmark performance than previous RNNs, especially on tasks requiring long context understanding. This performance gain comes at the cost of additional flops spent during inference time. Our results are therefore intriguingly related to recent trends of increasing test-time compute to improve performance -- here by spending compute to solve sequential optimization problems within the neural network itself.

RNN序列建模测试时计算长上下文

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。