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
下载
关闭预览

相关内容

《语言模型的推理时间学习算法》162页博士论文
专知会员服务
14+阅读 · 2025年11月23日
130页pdf《长上下文语言建模综合研究》综述
专知会员服务
40+阅读 · 2025年3月25日
大语言模型长文本训练技术解析
专知会员服务
37+阅读 · 2024年10月17日
最新综述:速览Transformer长文本建模研究进展
专知会员服务
46+阅读 · 2023年3月15日
绝对干货!NLP预训练模型:从transformer到albert
新智元
13+阅读 · 2019年11月10日
长文本表示学习概述
云栖社区
15+阅读 · 2019年5月9日
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
40+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
23+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
VIP会员
最新内容
2025年大语言模型进展报告
专知会员服务
1+阅读 · 今天13:30
多智能体协作机制
专知会员服务
1+阅读 · 今天13:26
非对称优势:美海军开发低成本反无人机技术
专知会员服务
4+阅读 · 今天4:39
《美战争部小企业创新研究(SBIR)计划》
专知会员服务
6+阅读 · 今天2:48
《军事模拟:将军事条令与目标融入AI智能体》
专知会员服务
9+阅读 · 今天2:43
【NTU博士论文】3D人体动作生成
专知会员服务
7+阅读 · 4月24日
以色列军事技术对美国军力发展的持续性赋能
专知会员服务
8+阅读 · 4月24日
《深度强化学习在兵棋推演中的应用》40页报告
专知会员服务
14+阅读 · 4月24日
《多域作战面临复杂现实》
专知会员服务
10+阅读 · 4月24日
《印度的多域作战:条令与能力发展》报告
专知会员服务
5+阅读 · 4月24日
相关基金
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
40+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
23+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员