arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2605.26099cs.CLcs.AI
收藏

语言模型需要睡眠吗?用于改进在线推理的离线循环

Do Language Models Need Sleep? Offline Recurrence for Improved Online Inference

Carnegie Mellon University(卡内基梅隆大学);University of Maryland(马里兰大学)

Sangyun Lee, Sean McLeish, Tom Goldstein, Giulia Fanti

AI总结:

本文提出一种类似睡眠的巩固机制,通过离线循环将上下文转换为快速权重,以解决Transformer注意力机制随上下文长度扩展性差的问题,并在合成任务和数学推理任务上验证了其有效性。

摘要:

基于Transformer的大型语言模型越来越多地用于长时任务;然而,它们的注意力机制随上下文长度扩展性差。为了解决这个问题,我们研究了一种类似睡眠的巩固机制,其中模型在清除其键值缓存之前,定期将最近的上下文转换为持久的快速权重。在睡眠期间,模型对累积的上下文进行$N$次离线循环传递,并通过学习到的局部规则更新其状态空间模型(SSM)块中的快速权重。在推理过程中,这会将额外的计算转移到睡眠阶段,同时保持清醒时预测的延迟。我们在受控的合成任务(包括元胞自动机和多跳图检索)以及一个现实的数学推理任务上测试了我们的方法,在这些任务上,常规Transformer以及SSM-注意力混合模型都失败了。然后我们表明,增加我们模型的睡眠持续时间$N$可以提高性能,在需要更深层推理的示例上收益最大。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑