Language Models Need Sleep: Learning to Self-Modify and Consolidate Memories

AK's Picks LLM Model Editing ML RL Continual Learning Replay Methods
过去几十年间,机器学习算法的设计取得了显著进展,其发展轨迹从早期面向特定任务的浅层模型,逐步演进为更具普适性的深度大语言模型(Large Language Models, LLMs)。尽管现有模型在需要即时预测或上下文内学习(in-context learning)的任务中展现出令人鼓舞的效果,但它们仍缺乏持续学习的能力,也无法将短期、易失的上下文知识有效迁移并固化为长期、稳定的模型参数。受人类学习机制的启发,我们提出一种“睡眠”(Sleep)范式:该范式使模型能够持续学习,通过“重放”(replay)机制将短暂而脆弱的短期记忆提炼为稳固的长期知识,并借助“做梦”(Dreaming)过程实现自我迭代优化。具体而言,“睡眠”包含两个阶段:(1)记忆巩固(Memory Consolidation):即一种自下而上的知识蒸馏过程,称为“知识播种”(Knowledge Seeding),其目标是将一个规模更小的“子模型”(smaller-self)所习得的记忆,蒸馏注入到一个更大、容量更强的网络中,在扩充模型能力的同时完整保留已有知识;作为概念验证,我们提出一种新型广义蒸馏方法用于“知识播种”,该方法融合了策略内蒸馏(on-policy distillation)与基于强化学习(Reinforcement Learning, RL)的模仿学习;(2)做梦(Dreaming):一种自主提升阶段,在此阶段中,模型利用强化学习自主生成一套合成数据构成的学习课程(curriculum),用以演练新知识、精进既有能力,整个过程无需人工监督。我们在长程任务、持续学习、知识融入以及少样本泛化等多类任务上开展的实验,均有力印证了“睡眠”阶段的关键作用。
The past few decades have witnessed significant advances in the design of machine learning algorithms, from early studies on task-specific shallow models to more general deep Large Language Models (LLMs). Despite showing promising results in tasks that require instant prediction or in-context learning, existing models lack the ability to continually learn and effectively transfer their temporal in-context knowledge to their long-term parameters. Inspired by human learning process, we introduce a ''Sleep'' paradigm that allows the models to continually learn, distill their short-term fragile memories into stable long-term knowledge with replay, and recursively improve themselves with ''Dreaming'' process. In more detail, sleep consists of two stages: (1) Memory Consolidation: an upward distillation process, called Knowledge Seeding, where the memories of a smaller-self are distilled into a larger network to provide more capacity while preserving the knowledge. As a proof of concept, we present a new Generalized Distillation process for {Knowledge Seeding} (i.e., the combination of on-policy distillation with Reinforcement Learning (RL)-based imitation learning); (2) Dreaming: a self-improvement phase, where the model uses RL to generate a curriculum of synthetic data to rehearse new knowledge and refine existing capabilities without human supervision. Our experiments on long-horizon, continual learning, knowledge incorporation, and few-shot generalization tasks support the importance of the sleep stage.
许愿