We formulate long-context language modeling as a problem in continual learning rather than architecture design. Under this formulation, we only use a standard architecture -- a Transformer with sliding-window attention. However, our model continues learning at test time via next-token prediction on the given context, compressing the context it reads into its weights. In addition, we improve the model's initialization for learning at test time via meta-learning at training time. Overall, our method, a form of Test-Time Training (TTT), is End-to-End (E2E) both at test time (via next-token prediction) and training time (via meta-learning), in contrast to previous forms. We conduct extensive experiments with a focus on scaling properties. In particular, for 3B models trained with 164B tokens, our method (TTT-E2E) scales with context length in the same way as Transformer with full attention, while others, such as Mamba 2 and Gated DeltaNet, do not. However, similar to RNNs, TTT-E2E has constant inference latency regardless of context length, making it 2.7 times faster than full attention for 128K context. Our code is publicly available.


翻译:我们将长上下文语言建模重新表述为一个持续学习问题,而非架构设计问题。在此框架下,我们仅采用标准架构——即配备滑动窗口注意力的Transformer。然而,我们的模型在测试时通过基于给定上下文的下一个词元预测持续学习,将其读取的上下文信息压缩至权重中。此外,我们通过在训练阶段进行元学习,优化模型在测试时学习的初始化状态。总体而言,我们的方法作为一种测试时训练形式,在测试时(通过下一个词元预测)和训练时(通过元学习)均实现端到端处理,与此前的方法形成对比。我们进行了大量实验,重点关注缩放特性。具体而言,对于使用1640亿词元训练的30亿参数模型,我们的方法在上下文长度缩放方面表现出与完全注意力Transformer相同的特性,而其他方法(如Mamba 2和Gated DeltaNet)则未能实现。然而,与循环神经网络类似,我们的方法具有不随上下文长度变化的恒定推理延迟,在处理128K上下文时比完全注意力机制快2.7倍。相关代码已公开提供。

0
下载
关闭预览

相关内容

[ICML2024]消除偏差:微调基础模型以进行半监督学习
专知会员服务
17+阅读 · 2024年5月23日
【CVPR2022】提示分布学习
专知会员服务
31+阅读 · 2022年5月17日
UTC: 用于视觉对话的任务间对比学习的统一Transformer
专知会员服务
14+阅读 · 2022年5月4日
【NeurIPS2021】用于视频分割的密集无监督学习
专知会员服务
15+阅读 · 2021年11月14日
【ACL2020-Facebook AI】大规模无监督跨语言表示学习
专知会员服务
34+阅读 · 2020年4月5日
【MIT】硬负样本的对比学习
专知
13+阅读 · 2020年10月15日
语义分割中的深度学习方法全解:从FCN、SegNet到DeepLab
炼数成金订阅号
26+阅读 · 2017年7月10日
MNIST入门:贝叶斯方法
Python程序员
23+阅读 · 2017年7月3日
国家自然科学基金
9+阅读 · 2015年12月31日
国家自然科学基金
17+阅读 · 2015年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
国家自然科学基金
5+阅读 · 2014年12月31日
VIP会员
相关VIP内容
[ICML2024]消除偏差:微调基础模型以进行半监督学习
专知会员服务
17+阅读 · 2024年5月23日
【CVPR2022】提示分布学习
专知会员服务
31+阅读 · 2022年5月17日
UTC: 用于视觉对话的任务间对比学习的统一Transformer
专知会员服务
14+阅读 · 2022年5月4日
【NeurIPS2021】用于视频分割的密集无监督学习
专知会员服务
15+阅读 · 2021年11月14日
【ACL2020-Facebook AI】大规模无监督跨语言表示学习
专知会员服务
34+阅读 · 2020年4月5日
相关资讯
【MIT】硬负样本的对比学习
专知
13+阅读 · 2020年10月15日
语义分割中的深度学习方法全解:从FCN、SegNet到DeepLab
炼数成金订阅号
26+阅读 · 2017年7月10日
MNIST入门:贝叶斯方法
Python程序员
23+阅读 · 2017年7月3日
相关基金
国家自然科学基金
9+阅读 · 2015年12月31日
国家自然科学基金
17+阅读 · 2015年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
国家自然科学基金
5+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员