AIsaAIsaStudio English 打开 AIsa Studio

Google Research 提出睡眠框架:让 LLM 在持续学习中巩固长期记忆

原标题:The sleep framework: A new way for LLMs to retain knowledge in continual learning

Google Research 提出受睡眠启发的持续学习框架,让 LLM 在活跃阶段与离线睡眠阶段间交替,将脆弱的短期上下文固化为稳定的长期参数,避免灾难性遗忘。方法包含记忆巩固与做梦自提升两阶段,通过 MoE 参数扩展、GKD 蒸馏加 RL 模仿学习、随机专家激活与梯度筛选实现。在满语和 Kalamang 等未见语言翻译中性能损失接近零;BABILong 长上下文扩展至 10M tokens,优于 GPT-4 和 Titans;SQuAD 单任务 48.9%、CPT 46.2%,超过 SFT 与 SEAL;AIME 24/25 与 HMMT 25 准确率分别为 79.2%、69.0%、46.1%。

为什么值得看

原文给出框架的完整技术机制和跨翻译、长上下文、知识与推理任务的多组对比结果,便于读者评估其实际效果。

阅读原文 ↗10月28日 AI 日报

本页的摘要、推荐理由与解读出自 AIsa Studio 的 AI 风向智能体,原文版权归原作者所有。

深度解读

发生了什么

Google Research 提出了一个面向持续学习的「睡眠框架」,让部署后的大语言模型能够持续学习新知识而不发生灾难性遗忘。该框架借鉴人脑在休息期间巩固记忆的机制,为 LLM 引入「清醒」与「睡眠」两种交替状态:清醒阶段处理输入并将临时信息存入短期记忆;睡眠阶段则暂停处理新输入,将内部计算转向记忆巩固与自我提升。

作者强调,尽管「睡眠」「做梦」等词借自神经科学,整个框架完全运行在固定模型架构和人工定义的训练规则之内:睡眠期间模型解锁预分配的 Mixture-of-Experts(MoE)记忆块,并用自生成的练习样本更新数值权重,核心代码库与设计保持不变。

关键细节

睡眠过程分为两个阶段:

1. 记忆巩固:为避免灾难性遗忘,模型在睡眠期间通过 MoE 和 Hope 架构动态扩展容量,将新解锁的低秩专家整合进稳定的低频记忆块。随后通过「知识播种」(向上蒸馏)把高频层中的脆弱短期记忆转移到新的长期参数中,技术手段包括基于 GKD 与强化学习模仿学习的 on-policy 蒸馏,以及基于语义与 Levenshtein 距离相似度的前缀补全模仿学习。巩固完成后执行「突触修剪」,重置高频临时参数,释放容量。

2. 做梦式自我提升:合成数据生成时 MoE 路由器随机激活非标准专家,迫使模型混合不同领域知识;随后用基于梯度的数据筛选「梦境」样本,对高分样本做监督微调,并在下游任务上评估效果。

理论上,知识播种被建模为结构化低秩压缩问题:on-policy 蒸馏对齐推理时的实际行为,语义奖励决定「什么值得保留」,参数扩展提供写入容量;做梦则通过注入不同 MoE 拓宽梯度方向、通过梯度筛选强化有效信号,改善优化地形。

实验结果包括:在满语(Manchu)、Kalamang 等未见语言的持续翻译中保持接近零的性能下降;BABILong 长上下文基准上扩展到 10M token,超过 GPT-4 和 Titans;SQuAD 单任务 48.9%、CPT 46.2%,超过 SFT 和 SEAL;AIME 24/25 和 HMMT 25 上分别达到 79.2%、69.0%、46.1%,超过 GRPO、OPSD 等基线。

为什么重要

当前 LLM 一旦部署便基本处于静态,受限于固定的知识截止日期;依赖 ICL 又只在上下文窗口内有效,「一旦上下文会话结束,获得的短期信息即被遗忘」。睡眠框架试图打通两者:清醒时获取信息,离线时将其巩固为稳定的长期参数,同时通过容量扩展和低秩写入避免覆盖旧知识。

理论上,该工作论证了记忆巩固与做梦两个阶段「不是简单地用新知识换取旧能力」,而是分别通过结构化压缩和改善学习几何来支持持续学习,为自主持续学习 AI 系统提供了一条路径。

对谁有影响

  • 需要模型持续吸收新事实、新领域知识的工程团队,可关注其记忆巩固与蒸馏机制;
  • 从事持续学习、MoE 架构和后训练方法的研究者,该框架提供了参数扩展、on-policy 蒸馏与合成数据筛选相结合的具体方案;
  • 关注长上下文与推理能力的从业者,其在 10M token 扩展和数学推理基准上的表现值得跟进。
全文翻译

现代大型语言模型(LLMs)通过预训练和上下文学习(ICL)取得了令人印象深刻的性能。然而,一旦部署,它们在很大程度上仍然是静态的,以固定的知识截止日期运行,这使得它们无法获得长期能力或适应新信息。

虽然用新数据更新模型似乎是显而易见的解决方案,但持续的参数更新往往会触发灾难性遗忘,这是一个根本性问题,即学习新任务会严重降低对先前学习任务的性能。或者,严格依赖 ICL 会将知识保留限制在即时上下文窗口内:一旦上下文会话结束,获得的短期信息就会被遗忘。

受人类大脑在休息期间处理和稳定记忆的启发,我们在持续学习中引入了一个睡眠框架:这是一种学习范式,为大型语言模型配备了一个连续的_周期性_生命周期,使它们能够持续学习,将脆弱的短期上下文整合到稳定的长期参数中。通过这个框架,我们证明了在主动交互和离线记忆巩固之间交替,可以使 LLMs 持续获取新事实,保留长达 1000 万 token 的长上下文知识,并提高复杂推理能力。

重新思考机器学习:活跃(清醒)阶段与睡眠阶段

传统机器学习依赖于训练和推理之间的严格分离。在持续学习框架中,这种区分变得人为化;智能代理必须不断学习、适应和处理信息。

在睡眠范式下,LLM 在两个主要状态之间运行:

  1. 活跃(清醒)阶段:模型主动接收、处理并与输入进行交互,将临时信息存储在快速、短期的记忆组件中。
  2. 睡眠阶段:模型暂停处理新输入,并将其内部计算重定向到记忆巩固和自我改进。

虽然“睡眠”、“做梦”和“自我改进”等术语借用于神经科学,但我们的框架完全在固定的模型架构和人类定义的训练规则内运行。在离线睡眠阶段,模型解锁预分配的混合专家(MoE)内存块,并使用自生成的练习示例更新其数值权重。这种自动化的后训练周期有助于已部署的模型吸收新事实并提高推理准确性,同时保持其核心代码库和设计不变。

睡眠过程的关键组成部分

睡眠范式通过两个阶段解决灾难性遗忘和持续适应问题:记忆巩固和做梦。

1. 记忆巩固

在人类大脑中,非快速眼动(NREM)慢波睡眠通过抽象和提炼将脆弱的记忆巩固为长期结构。我们提出的睡眠框架通过两个关键技术机制镜像了这一自然现象:

  • 参数扩展与连续体记忆层次结构:为了防止灾难性遗忘,模型在睡眠期间动态扩展其容量。使用混合专家(MoE)和Hope架构,新解锁的低秩专家被整合到稳定的低频记忆块中,以存储传入的知识,而不破坏较旧的参数。
  • 知识播种(向上蒸馏):存储在高频率层(例如,上下文记忆)中的脆弱短期记忆被转移到新扩展的长期参数中。这是通过广义知识蒸馏(GKD)结合基于强化学习(RL)的模仿学习实现的:
    • 策略内蒸馏:扩展的学生模型从教师分布中学习特定于 token 的反馈,这些教师分布是在自采样序列上生成的。
    • 学习模仿(LTI):当学生模型完成教师生成文本的前缀时,根据其语义和绝对相似度(莱文斯坦距离)给予奖励。
  • 突触修剪:一旦向低频模块的记忆巩固完成,高频临时参数将被重置,为未来的活跃会话释放容量。

2. 为自我改进而做梦

在快速眼动睡眠期间,人类大脑积极模拟场景,巩固情感/语义联系,并探索新的神经通路。与此类似,在“做梦阶段”,睡眠框架实施了一个自主的自我改进循环:

  • 随机专家选择:在合成数据生成期间,MoE 路由器随机激活非标准专家。这迫使模型混合不同领域的知识,并发现潜在的模式。
  • 精心策划的复习:模型生成合成训练样本(“梦”),并使用基于梯度的数据选择对其进行过滤,以优先考虑具有最高潜力提升整体模型能力的样本。
  • RL 精炼:模型对排名最高的梦境样本执行监督微调,并评估生成是否提高了下游任务的性能。

理论基础

除了实证结果外,我们的睡眠范式还建立在一个理论上,该理论阐明了为什么它的两个阶段(记忆巩固和做梦)可以支持持续学习,而不会简单地用新知识交换旧能力。

对于记忆巩固,分析表明,知识播种可以被理解为一个结构化的低秩压缩问题。模型并不被要求将其短期痕迹的每个细节复制到其参数中。相反,它识别出一组紧凑的方向,最好地保留了模型自身的策略内行为和学习目标所奖励的语义质量。

这一观点解释了两个信号的互补作用:策略内蒸馏将巩固与模型在推理时间实际产生的轨迹对齐,减少了仅使用教师生成分布进行训练时可能出现的失配;与此同时,语义奖励改变了值得保留的内容,优先考虑保留意义和任务相关行为的方向,而不仅仅是匹配 token 概率。参数扩展随后提供了写入这些选定记忆所需的能力,而不会覆盖之前巩固的知识。

对于做梦,理论将随机专家激活和基于奖励的样本选择描述为改善学习几何结构的机制。注入不同的 MoE 扩大了合成生成过程中探索的梯度方向集合,使模型接触到比仅由其普通清醒时间数据引起的更丰富的更新集合。基于梯度的过滤然后强调携带最有用的学习信号的合成经验,加强信息丰富的方向,同时保留底层梯度空间的结构。

总之,这些步骤产生了一个更平衡的优化景观:学习不再由少数几个方向主导,梯度条件更好,模型在完善其能力时可以取得更稳定的进展。从这个角度来看,做梦不仅仅是自生成的数据增强;它是一个刻意过程,用于多样化、选择和巩固模型自我改进的更新。

对于持续翻译,在未见过语言(如满语和 Kalamang 语)方面,睡眠框架在多阶段评估中保持了近乎零的性能下降,而标准基线如 ICL、Cartridges 和监督微调(SFT)在顺序学习期间遭受了严重的灾难性遗忘。

在 BABILong 基准上的长上下文理解方面,我们的睡眠方法展示了高达 1000 万 token 的近完美扩展,通过使用睡眠时间的巩固将长上下文信息直接压缩到参数记忆中,优于强大的基线如 GPT-4 和 Titans。

在 SQuAD 和继续预训练(CPT)上评估的事实知识整合方面,我们的睡眠方法在单任务评估中达到了 48.9%,在 CPT 评估中达到了 46.2%,优于包括基础模型、SFT 和自适应语言模型(SEAL)在内的基线方法,成功集成了新的事实信息而没有降低现有模型表示。

最后,在包括 AIME 24/25 和 HMMT 25 在内的数学推理基准上,睡眠增强的基础模型分别取得了 79.2%、69.0% 和 46.1% 的准确率分数。这优于 SFT、组相对策略优化(GRPO)和策略内自蒸馏(OPSD)等基线,表明将记忆巩固与模仿学习相结合可驱动卓越的推理性能。

结论

我们的睡眠范式为实现自主、持续学习的 AI 系统提供了一条路径。通过超越静态预训练和脆弱的上下文窗口,在主动学习和离线休息之间交替,赋予 LLMs 保留短期记忆、将新技能抽象为长期参数结构,并持续自我改进而不发生灾难性遗忘的能力。

致谢

这项研究 由 Ali Behrouz(Google 和康奈尔大学)、Farnoosh Hashemi(康奈尔大学)、Adel Javanmard(Google 和南加州大学)以及 Vahab Mirrokni 进行。我们要感谢 Yuan Deng 和 Corinna Cortes 审阅这项工作并提出宝贵建议。我们还要感谢 Mark Simborg、Kimberly Schwede 和 Tim Herrmann 在撰写这篇博客文章方面的帮助。

查看原文

Modern LLMs achieve impressive performance via pre-training and in-context learning (ICL). However, once deployed, they remain largely static, operating with a fixed knowledge cutoff date that leaves them unable to acquire long-term capabilities or adapt to new information.

While updating models with new data seems like the obvious solution, continual parameter updates often trigger catastrophic forgetting, a fundamental issue where learning new tasks severely degrades performance on previously learned ones. Alternatively, relying strictly on ICL limits knowledge retention to the immediate context window: once the context session ends, the acquired short-term information is forgotten.

Inspired by how the human brain processes and stabilizes memory during rest, we introduce a sleep framework in continual learning: a learning paradigm that equips large language models (LLMs) with a continuous periodic lifecycle, enabling them to continually learn, consolidate fragile short-term context into stable long-term parameters. With this framework, we demonstrate that alternating between active interaction and offline memory consolidation allows LLMs to continuously acquire new facts, retain long-context knowledge up to 10M tokens, and improve complex reasoning.

Rethinking machine learning: Active (wake) vs. sleep phases

Traditional machine learning relies on a strict separation between training and inference. In a continual learning framework, this distinction becomes artificial; an intelligent agent must constantly learn, adapt, and process information.

Under the sleep paradigm, an LLM operates across two primary states:

  1. Active (wake) phase: The model actively receives, processes, and interacts with inputs, storing temporary information in fast, short-term memory components.
  2. Sleep phase: The model pauses processing new inputs and redirects its internal computations toward memory consolidation and self-improvement.

While terms like "sleep," "dreaming," and "self-improvement" borrow from neuroscience, our framework operates entirely within a fixed model architecture and human-defined training rules. During the offline sleep phase, the model unlocks pre-allocated Mixture-of-Experts (MoE) memory blocks and updates its numerical weights using self-generated practice examples. This automated post-training cycle helps a deployed model absorb new facts and sharpen its reasoning accuracy while keeping its core codebase and design unchanged.

Key components of the sleep process

The sleep paradigm addresses catastrophic forgetting and continuous adaptation through two stages: memory consolidation and dreaming.

1. Memory consolidation

In the human brain, non-rapid eye movement (NREM) slow-wave sleep consolidates fragile memories into long-term structures via abstraction and distillation. Our proposed sleep framework mirrors this natural phenomenon through two key technical mechanisms:

  • Parameter expansion & continuum memory hierarchy: To prevent catastrophic forgetting, the model dynamically scales its capacity during sleep. Using a Mixture of Experts (MoE) and Hope architecture , newly unlocked, low-rank experts are integrated into stable, lower-frequency memory blocks to store incoming knowledge without disrupting older parameters.
  • Knowledge seeding (upward distillation): Fragile short-term memories stored in high-frequency layers (e.g., in-context memory) are transferred into the newly expanded long-term parameters. This is achieved through Generalized Knowledge Distillation (GKD) combined with reinforcement learning (RL)-based imitation learning:
    • On-policy distillation: The expanded student model learns token-specific feedback from teacher distributions generated on self-sampled sequences.
    • Learning to imitate (LTI): The student model is rewarded based on semantic and absolute similarity (Levenshtein distance) when completing prefixes of teacher-generated text.
  • Synaptic pruning: Once the memory consolidation into lower-frequency modules is complete, the high-frequency temporary parameters are reset, freeing up capacity for future active sessions.

2. Dreaming for self-improvement

During REM sleep, the human brain actively simulates scenarios, consolidates emotional/semantic connections, and explores novel neural pathways. Mirroring this, during the “dreaming stage”, the sleep framework implements an autonomous self-improvement loop:

  • Random expert selection: During synthetic data generation, the MoE router randomly activates non-standard experts. This forces the model to mix disparate domains of knowledge and uncover latent patterns.
  • Curated rehearsal: The model generates synthetic training samples ("dreams") and filters them using gradient-based data selection to prioritize samples with the highest potential to boost overall model capability.
  • RL refinement: The model performs supervised fine-tuning on top-rated dream samples and evaluates whether the generation improves performance on downstream tasks.

Theoretical foundations

Beyond the empirical results, our sleep paradigm is grounded in a theory that clarifies why its two stages (memory consolidation and dreaming) can support continual learning without simply trading new knowledge for old capabilities.

For memory consolidation, the analysis shows that knowledge seeding can be understood as a structured, low-rank compression problem. The model is not asked to copy every detail of its short-term traces into its parameters. Instead, it identifies a compact set of directions that best preserve both the model’s own on-policy behavior and the semantic qualities rewarded by the learning objective.

This perspective explains the complementary roles of the two signals: on-policy distillation aligns consolidation with the trajectories the model will actually produce at inference time, reducing the mismatch that can arise when training only on teacher-generated distributions; meanwhile, the semantic reward changes what is worth retaining, prioritizing directions that preserve meaning and task-relevant behavior rather than merely matching token probabilities. Parameter expansion then provides the capacity needed to write these selected memories without overwriting previously consolidated knowledge.

For dreaming, the theory characterizes random expert activation and reward-based sample selection as mechanisms for improving the geometry of learning. Injecting different MoEs broadens the set of gradient directions explored during synthetic generation, exposing the model to a richer collection of updates than those induced by its ordinary wake-time data alone. Gradient-based filtering then emphasizes the synthetic experiences that carry the most useful learning signal, strengthening informative directions while preserving the structure of the underlying gradient space.

Together, these steps yield a more balanced optimization landscape: learning is less dominated by a small number of directions, gradients are better conditioned, and the model can make more stable progress when refining its capabilities. In this view, dreaming is not simply self-generated data augmentation; it is a deliberate process for diversifying, selecting, and consolidating the updates through which the model improves itself.

For continual translation, in unseen languages, such as Manchu and Kalamang, the sleep framework maintained a near-zero performance drop in multi-stage evaluations, whereas standard baselines like ICL, Cartridges, and supervised fine-tuning (SFT) suffered severe catastrophic forgetting during sequential learning.

In long-context understanding on the BABILong benchmark, our sleep method demonstrated near-perfect scaling up to 10M tokens, outperforming strong baselines like GPT-4, and Titans by using sleep-time consolidation to compress long-context information directly into parametric memory.

For factual knowledge incorporation evaluated on SQuAD and continued pre-training (CPT), our sleep method achieved 48.9% on single-task and 46.2% on CPT evaluations, outperforming baseline methods including the base model, SFT, and Self-Adapting Language Models (SEAL) by successfully integrating new factual information without degrading existing model representations.

Finally, on mathematical reasoning benchmarks including AIME 24/25 and HMMT 25, sleep-enhanced base-model achieved accuracy scores of 79.2%, 69.0%, and 46.1%, respectively. This outperformed baselines like SFT, group relative policy optimization (GRPO), and on-policy self-distillation (OPSD), showing that pairing memory consolidation with imitation learning drives superior reasoning performance.

Conclusion

Our sleep paradigm provides a path toward autonomous, continually learning AI systems. By moving beyond static pre-training and fragile context windows, alternating between active learning and offline rest empowers LLMs to retain short-term memories, abstract new skills into long-term parameter structures, and continuously self-improve without catastrophic forgetting.

Acknowledgements

This research was conducted by Ali Behrouz (Google and Cornell University), Farnoosh Hashemi (Cornell University), Adel Javanmard (Google and University of Southern California), and Vahab Mirrokni. We thank Yuan Deng and Corinna Cortes for reviewing the work and their valuable suggestions. We also thank Mark Simborg, Kimberly Schwede, and Tim Herrmann for their help in crafting this blog post.

原文版权归 Google Research 及原作者所有,本站转载仅供阅读。如需删除,请联系 support@aisa.one。