Transformer 也需要睡眠:周期性记忆巩固机制提升长程推理
Language Models Need Sleep
这项研究给长上下文推理带来了新思路——用类似睡眠的离线巩固机制解决注意力瓶颈,做长链推理或复杂数学问题的开发者值得关注,尤其适合处理超长上下文的场景。
论文提出一种类似睡眠的记忆巩固机制,让 Transformer 模型在长上下文任务中表现更好。模型在推理过程中定期将近期上下文转换为持久化的快速权重,并清除键值缓存,类似生物体的睡眠过程。
在睡眠阶段,模型对积累的上下文进行多次离线循环处理,通过局部学习规则更新状态空间模型(SSM)块中的快速权重。在合成任务(如元胞自动机、多跳图检索)和数学推理任务上,该方法显著优于普通 Transformer 和 SSM-注意力混合模型。
增加睡眠时长 N 能持续提升性能,尤其在需要深层推理的样本上效果最明显。
Language Models Need Sleep
Transformer-based large language models are increasingly used for long-horizon tasks; however, their attention mechanism scales poorly with context length. To handle this, we study a sleep-like consolidation mechanism in which a model periodically converts recent context into persistent fast weights before clearing its key-value cache. During sleep, the model performs $N$ offline recurrent passes over the accumulated context and updates the fast weights in its state-space model (SSM) blocks through a learned local rule. During inference, this shifts extra computation to sleep while preserving the latency of wake-time prediction. We test our method on controlled synthetic tasks, including cellular automata and multi-hop graph retrieval, as well as a realistic math reasoning task, on which a regular transformer as well as SSM-attention hybrid models fail. We then show that increasing sleep duration $N$ for our models improves performance, with the largest gains on examples that require deeper reasoning.
This report is categorized under AITOP's "Papers" desk. Key entities and technical topics under continuous tracking include Transformer, long context, reasoning models, state space models.
Source attribution: curated from arXiv cs.AI (@Sangyun Lee, Sean McLeish, Tom Goldstein, Giulia Fanti). Cross-source corroboration: 2 independent sources have covered this development (including elvis), confirming industry-wide signal strength.
- elvis05-26 20:08Source