研究:"睡眠"机制让语言模型少看样本也能上下文适应
Sample-Efficient In-Context Adaptation via Sleep
一篇挺有意思的论文:让模型像睡觉一样对上下文反复做前向传播,结果 1.2B 模型看代码时少用 2 倍多 token 就追平基线损失。做小模型高效微调或上下文学习的人可以看看机制细节。
arXiv 论文(编号 2611.32802)研究了"睡眠"(sleep)机制能否提升 transformer 语言模型的少样本上下文适应能力。睡眠指模型对一段上下文做 N 次循环前向传播以精炼内部表示,此前已被证明能改善 SSM-attention 混合架构的长上下文推理。
团队预训练了最大 1.2B 参数、最多 100B token 的语言模型并加入睡眠机制。结果显示:更大的 N 使模型在多个少样本算法任务和问答任务上学习更快,同时在分布外评测中取得更低的下一 token 预测损失。在留出的代码数据上,N=2 和 N=4 的模型分别用少 2.10 倍和 2.39 倍的上下文 token 达到了无睡眠基线的损失水平。
作者认为这项工作是在上下文适应能力与解码延迟之间寻找更优权衡的一步:更多次前向传播换取更少所需样本,对需要小上下文高效学习的应用场景有参考价值。
Sample-Efficient In-Context Adaptation via Sleep
The ability to learn and generalize from limited experience, or sample efficiency, is a cornerstone of intelligence. How can we build language models that turn a few user interactions, a few snippets of unfamiliar code, or a handful of experimental results provided in context into knowledge that generalizes? Prior work has found that sleep, a process where the model performs $N$ recurrent forward passes to refine its representations of a chunk of context, can improve long-context reasoning (specifically, within SSM-attention hybrid models). We study whether this method also improves in-context adaptation on general, non-synthetic tasks for transformer language models. To this end, we pre-train language models up to 1.2B-parameters on up to 100B tokens with sleep mechanisms. Notably, longer sleep (i.e., using a larger number of recurrent forward passes $N$) enables the model to learn faster in-context on multiple few-shot algorithmic, question-answering tasks, while also achieving lower next-token prediction loss on out-of-distribution evaluations. On held-out code, models with $N=2$ and $N=4$ match the no-sleep baseline's loss using $2.10\times$ and $2.39\times$ fewer tokens in-context, respectively. More broadly, we view our work as a step toward building models that have better tradeoffs between in-context adaptation and decoding latency.
This report is categorized under AITOP's "Papers" desk, focusing on US frontier AI labs and Silicon Valley technology leaders. Within our cross-regional analytical framework, it directly maps to AI developer toolchains, coding agents, and engineering workflows. Key entities and technical topics under continuous tracking include in-context learning, sampling efficiency, language models.
Source attribution: curated from arXiv cs.LG (@Sangyun Lee, Zhang Enyan, Michael Xu, Hao Tang, Zinan Lin, Weijia Xu, Chris Quirk, Jianfeng Gao, Giulia Fanti, Xiaodong Liu).