A sleep-like consolidation mechanism for LLMs
TL;DR Highlight
Consolidating context into fast weights before clearing the KV cache improved deeper reasoning
Who Should Read
Backend developers building long-context LLM agents who struggle with attention cost and memory retention
Core Mechanics
- A periodic 'sleep' step
- The model writes recent context into fast weights (temporary weights updated quickly) and then clears its KV cache.
- It targets the problem that attention scales poorly with context length on long tasks.
- N offline passes while asleep
- The model re-reads the accumulated context through N offline recurrent passes.
- It updates the fast weights in its SSM (state-space model) blocks using a learned local rule.
- Extra compute moves to sleep
- Wake-time prediction latency stays the same.
- The added computation is shifted into the sleep phase.
- Tested where baselines fail
- Tasks were cellular automata, multi-hop graph retrieval, and a realistic math reasoning task.
- A regular transformer and SSM-attention hybrids fail on these tasks.
- Longer sleep gives better results
- Increasing sleep duration N improved performance.
- The largest gains came on examples requiring deeper reasoning.
- Only the abstract is available
- The source gives no concrete numbers or released code.
- The method needs a changed architecture and training.
Community Reactions
- Opinion that prior work overlaps
- One commenter said E2E-TTT did the same idea as a more flexible, elegant continual learning approach.
- It treats recent context like training data and updates some weights.
- Comparison with sleep-time compute
- A commenter linked Letta's sleep-time compute paper as related work.
- That paper reports about 5x less test-time compute for the same accuracy by precomputing offline before queries arrive.
- Idea to build it with LoRA
- One commenter proposed fine-tuning a LoRA offline on compacted knowledge to form a three-layer memory.
- The layers are base weights, compactions plus replay buffer, and the KV cache.
- Pushback on the 'sleep' name
- Several commenters called it anthropomorphic marketing for what is an offline recurrent consolidation phase.
- Others said it may be a solution in search of a problem, or prone to overfitting.
How to Apply
- Split compaction out of the response path
- Find where your agent summarizes long chats to free context.
- Move that summarization into a separate offline job.
- Compare latency and answer quality before and after.
- Add a sleep summary step to multi-turn work
- Run summarization and key-fact extraction as a background job after a set number of turns.
- Store the result in memory and load it instead of the raw history next turn.
- Evaluate sleep-time compute alongside
- Pick a service where many questions hit the same context.
- Pre-analyze the context before questions arrive.
- Compare cost per question and accuracy against your current approach.
Try It
# Paste into Claude or ChatGPT (simplified version of the paper's method: weights can't be changed, so 'sleep consolidation' is mimicked with a prompt)
You are an agent performing a 'sleep consolidation' mid-task.
Read the conversation log below N=3 times, improving the previous summary each pass.
[Conversation log]
{{conversation log}}
Rules:
1. Pass 1: extract confirmed facts, decisions, and open issues as items.
2. Pass 2: find and fix links and contradictions between items.
3. Pass 3: keep only what the next task needs, compressed to 20 lines or fewer.
Output only the consolidated summary, written so the original log can be discarded.
Now answer using only the summary: {{next question}}Terminology
Related Papers
A Beginner's Guide to Local AI with Inkling, Qwen, and Unsloth
Install Unsloth Desktop, load a quantized Qwen model, and share a private ChatGPT-like AI on your home LAN.
Muru – AI-assisted Rust server for Python apps by mod_WSGI's creator
mod_wsgi's creator is building Muru, an AI-assisted Rust ASGI/WSGI server, documenting it in public
87% of the Anthropic power will come from gas and 11% from coal in 2028
Analysis of Anthropic's contracted data centers: 87% gas, 11% coal power in 2028
Anthropic’s Nasdaq debut
Anthropic listed on Nasdaq and closed its first day below its opening price.
OpenAI still has a WebRTC Problem
WebRTC drops late audio, hurting voice AI; MoQ retransmits and buffers instead
Gemini 4 Neon
Gemini 4 Neon cuts cost per task 32% versus Carbon, at $3 input and $15 output per million tokens
AI is killing All About Berlin
After Google AI Overviews, a Berlin guide site lost 70-75% of its traffic.
Not Everything Needs an LLM
PostHog used small decision models to skip 98.7% of expensive LLM calls