语言模型需要睡眠:定期巩固记忆提升长程任务表现
Long-running language agents may work better if they periodically stop to consol…
Long-running language agents may work better if they periodically stop to consolidate memory.
长时间运行的语言代理如果定期停下来整合记忆,可能会工作得更好。
The problem is that today’s transformer agents get slower and more expensive as their context grows, because attention has to keep checking more past tokens.
问题在于,当今的Transformer代理随着上下文增长会变得更慢、更昂贵,因为注意力机制必须不断检查更多的过去标记。
The usual fix for long context is to keep more tokens nearby, but that turns every next-token prediction into a larger search through the past.
处理长上下文的通常方法是保留更多附近的标记,但这会将每次下一个标记的预测变成对过去的更大搜索。
The sharper idea here is that memory is not only storage.
这里更尖锐的想法是,记忆不仅仅是存储。
Sometimes the hard part is converting a messy stretch of experience into a state that can actually be used later.
有时困难的部分在于将一段杂乱的经验转换为以后可以实际使用的状态。
So the paper’s idea is to add a sleep phase, where the model pauses, rereads recent context several times, writes the useful information into fixed-size memory layers, and then clears the short-term attention cache.
因此,论文的想法是增加一个睡眠阶段,模型暂停,多次重读最近的上下文,将有用信息写入固定大小的记忆层,然后清除短期注意力缓存。
During sleep, the model runs several offline passes over recent context, writes the result into fast weights inside its state-space blocks, then clears the attention cache.
在睡眠期间,模型对最近的上下文进行几次离线遍历,将结果写入其状态空间块内的快速权重,然后清除注意力缓存。
This means the model pays extra compute while sleeping, not while answering, so normal prediction can still happen with 1 forward pass.
这意味着模型在睡眠时支付额外计算,而不是在回答时,因此正常预测仍然可以通过一次前向传播完成。
The authors test this on cellular automata, graph lookup, and GSM-Infinite math problems, where the model must use old information that is no longer sitting in its attention cache.
作者在细胞自动机、图查找和GSM-Infinite数学问题上测试了这一点,在这些问题中,模型必须使用不再位于其注意力缓存中的旧信息。
The main result is that longer sleep improves performance, especially on harder cases that need deeper reasoning rather than just remembering a fact.
主要结果是,更长的睡眠可以提高性能,尤其是在需要更深层次推理而不仅仅是记住事实的更难案例上。
The big deal is that long-horizon agents may not need to carry bigger and bigger raw context forever, because they can consolidate the important parts and safely forget the raw tokens.
重要的是,长视野代理可能不需要永远携带越来越大的原始上下文,因为它们可以整合重要部分并安全地忘记原始标记。
– arxiv. org/abs/2605.26099
– arxiv.org/abs/2605.26099
Title: "Language Models Need Sleep"
标题:“语言模型需要睡眠”
更进一步:量化金融体系
看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力