Researchers have developed a new technique that lets large language models (LLMs) periodically ‘sleep’—consolidating recent information into fast weights and clearing their short-term memory cache. This process, inspired by biological sleep, helps AI systems handle longer and more complex tasks without losing track of earlier context.
In a preprint paper titled Language Models Need Sleep, the team describes a mechanism where the model performs offline recurrent passes over accumulated context, updating internal state-space model (SSM) blocks through a learned local rule. During normal use (the ‘wake’ phase), the model continues to operate at low latency, while the extra computation happens during the ‘sleep’ phase.
The method was tested on synthetic tasks like cellular automata and multi-hop graph retrieval, as well as a realistic math reasoning problem. Standard transformers and hybrid SSM-attention models struggled with these tasks, but the sleep-enhanced models showed significant improvement. Moreover, increasing the duration of ‘sleep’ (more offline passes) led to better performance, especially on examples requiring deeper reasoning.
The research suggests that mimicking sleep in AI could be a key step toward more capable and context-aware systems, echoing the way human brains consolidate memories during rest.