TTT让模型在推理时动态调整,显著提升对非线性函数的适应能力。
Test time training enhances in-context learning of nonlinear functions
- 在推理时动态更新参数,使模型适应测试数据中的特征和函数形式。
- 随着上下文长度和网络宽度增加,预测误差可逼近噪声水平。
- 特别适合需要灵活适应不同任务链接函数的场景。
测试时训练(TTT)通过在每次预测前显式更新指定参数来适应测试数据,从而提升模型性能。尽管TTT在实践中表现优异,但其理论基础,尤其是对非线性模型的解释仍不充分。本文研究了TTT与上下文学习(ICL)的结合,其中模型在推理时接收目标分布的少量示例。我们在单索引模型 $y=σ_*(\langle β, \mathbf{x} \rangle)$ 框架下分析该方法,其中特征向量 $β$ 来自隐藏的低维子空间。对于使用梯度算法训练的单层Transformer并采用TTT的情况,我们建立了预测风险的上界。理论表明,TTT使模型能够同时适应特征向量 $β$ 和链接函数 $σ_*$,而这些在不同任务间可能变化。这与仅靠ICL存在本质差异——后者难以适应链接函数的变化。此外,我们给出了关于数据长度的收敛速率,证明当上下文大小和网络宽度增长时,预测误差可任意接近噪声水平。
原文摘要 · Abstract (English)
Test-time training (TTT) enhances model performance by explicitly updating designated parameters prior to each prediction to adapt to the test data. While TTT has demonstrated considerable empirical success, its theoretical underpinnings remain limited, particularly for nonlinear models. In this paper, we investigate the combination of TTT with in-context learning (ICL), where the model is given a few examples from the target distribution at inference time. We analyze this framework in the setting of single-index models $y=σ_*(\langle β, \mathbf{x} \rangle)$, where the feature vector $β$ is drawn from a hidden low-dimensional subspace. For single-layer transformers trained with gradient-based algorithms and adopting TTT, we establish an upper bound on the prediction risk. Our theory reveals that TTT enables the single-layer transformers to adapt to both the feature vector $β$ and the link function $σ_*$, which vary across tasks. This creates a sharp contrast with ICL alone, which is theoretically difficult to adapt to shifts in the link function. Moreover, we provide the convergence rate with respect to the data length, showing the predictive error can be driven arbitrarily close to the noise level as the context size and the network width grow.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。