DawnLoop

Blog

Sleep-time compute: what it is and how it works

Reasoning done ahead of time, while nobody is waiting: the idea, the evidence, and where it stops working.

Sleep-time compute is reasoning a model does before anyone asks it a question. A model normally thinks only when a query arrives, which is test-time compute. With sleep-time compute, a stateful agent uses idle time to study the context it already has, draw inferences, and rewrite that context so later questions are cheaper to answer. The term comes from a 2025 paper by researchers at Letta and UC Berkeley. This post covers what the paper claims, how the idea differs from test-time compute, where it shows up in real tools, and how a nightly memory consolidation pass relates to it.

Where does the term “sleep-time compute” come from?

The source is “Sleep-time Compute: Beyond Inference Scaling at Test-time” (arXiv:2504.13171), submitted on April 17, 2025, by Kevin Lin, Charlie Snell, Yu Wang, Charles Packer, Sarah Wooders, Ion Stoica and Joseph E. Gonzalez. The authors are affiliated with Letta and UC Berkeley, and five of the seven also co-wrote the MemGPT paper. Letta published its own announcement a few days later.

The paper splits a problem into two parts: a context (a document, a codebase, a conversation history) and a query (the user’s question). In the usual setup, the model receives both together and reasons within a budget. With sleep-time compute, the model receives only the context in advance and produces a re-represented context: the same material, rewritten with the inferences it was able to draw. When the query arrives, the model answers against that prepared context with a much smaller budget.

What the authors report:

  • On two benchmarks adapted for this setting, Stateful GSM-Symbolic and Stateful AIME, sleep-time compute reduced the test-time compute needed for the same accuracy by about 5x.
  • Spending more at sleep time raised accuracy by up to 13% on Stateful GSM-Symbolic and 18% on Stateful AIME.
  • When several related questions share one context (Multi-Query GSM-Symbolic), the sleep-time work is reused across them, cutting the average cost per query by 2.5x.
  • How well it works tracks how predictable the query is from the context.
  • In an agentic software engineering case study (predicting which files a feature pull request touches), sleep-time compute did better at low test-time budgets, with up to about 1.5x fewer test-time tokens. At high budgets, plain test-time compute did better.

How is sleep-time compute different from test-time compute?

Test-time compute means spending more inference when the query arrives: longer chains of thought, sampling several answers, or searching with a verifier. It works. Snell et al. (2024) found that allocating test-time compute well could let a smaller model beat one 14 times larger on problems where the smaller model already had some success. The costs are that the user waits, and the work is repeated for every query, even when ten queries are about the same context.

  Test-time compute Sleep-time compute
When it runs After the query arrives Before the query, during idle time
Input Context and query Context only
Who waits The user Nobody
Reuse Repeated for each query Shared by every query on the same context
Works best when Queries are hard to predict Queries are predictable from the context
Needs Only the model A stateful agent that keeps the result

The last row matters most. Letta’s post makes the point that a stateless model would lose anything it worked out during downtime. Sleep-time compute only makes sense if there is somewhere durable to put the result, which makes it a natural fit for agents with long-term memory.

The two approaches complement each other. Sleep-time compute lowers the per-query cost of the questions you could see coming, and test-time compute still handles the ones you couldn’t. Routing is a third way to manage the same cost, by sending easy requests to a small model; see our post on model routing.

What does sleep-time compute look like in practice?

Several memory tools now do expensive memory work off the request path. Not all of them use the term. As of October 2026:

  • Letta. In 2025, Letta’s sleep-time agents came in pairs: a primary agent that talks to the user but has no tools to edit its core memory, and a sleep-time agent that manages memory for both. In Letta Code, the README says sleep-time compute is “now called ‘dreaming’”. Background subagents review recent conversations and update memory, triggered after a set number of agent steps or when the context window is compacted (docs).
  • Mem0. On Mem0’s managed Platform, a feature called Dream marks outdated facts as superseded and merges duplicates as memories are added. On plans that include it, a scheduled job per user also writes “pattern memories” that summarize several supporting observations. Nothing is deleted. Mem0 doesn’t call this sleep-time compute, but the scheduled synthesis runs off the request path in the same way.
  • LangMem. LangMem’s conceptual guide separates “hot path” memory writes during a conversation from background formation, which “occurs between interactions, allowing deeper pattern analysis without impacting response time”.
  • Codebase pre-analysis. The paper’s software engineering case study is this pattern: read the repository ahead of time, so a later change request starts from a prepared summary instead of a cold read.

When does sleep-time compute pay off?

The paper’s results point to three conditions:

  1. The context is stable and reused. One codebase, one long-running user relationship, one document set. The sleep-time work is shared across many queries.
  2. The queries are predictable from the context. If you can’t guess what will be asked, inferences drawn in advance may never be used.
  3. There’s somewhere to keep the result. Without persistent state, the work is lost.

The authors are explicit about the limits. Sleep-time compute helps less when queries are hard to predict or unrelated to the context. Their setup assumes two clean phases, while real use has many rounds, edits to the context and idle periods of different lengths. How best to split compute between sleep time and test time is left as future work. Idle compute also isn’t free. It still costs tokens, just at a time when nobody is waiting.

We’d add one risk the paper doesn’t measure. An inference drawn with no question in sight can be wrong, and once it’s written into the context, every later query trusts it. Offline work needs a way to be checked and undone.

How does a nightly consolidation pass relate to sleep-time compute?

They belong to the same family: compute spent offline, on stored context, so the next request is cheaper and better informed. The difference is what gets rewritten. In the paper, the sleep-time step rewrites a context to anticipate questions. A memory consolidation pass rewrites the memory itself. It turns many raw episodes into fewer durable beliefs, retires beliefs that have gone stale or been contradicted, and re-weights what matters for retrieval.

The other difference is what the offline pass knows. During the day, an agent rarely knows whether its work was right. By night, outcomes exist: tests passed or failed, pull requests merged or were reverted. A pass that runs after outcomes are known can use them as supervision, instead of relying on the model’s opinion of its own work. That also answers part of the risk above, because an offline inference can be checked against what actually happened.

That’s the design of DawnLoop’s nightly pass, which is planned, not built. It is designed to run in four stages, Replay, Consolidate, Prune and Strengthen, entirely on the memory graph, without touching model weights. Distilling consolidated knowledge into model weights is a separate research bet. It will only ship if it beats the memory-only version on an evaluation, and it may never ship. Our how it works page explains the split.

What does a consolidation pass look like in our prototype?

We have a prototype that runs the graph-only pass end to end on a synthetic scenario. This is trimmed output from one run. It’s prototype output, not a product:

Nightly pass — Track A (Replay → Consolidate → Prune → Strengthen)
  Replay — 8 episodes joined to their outcomes (7 ok, 1 failed)
  Consolidate — extract candidate beliefs from repeated success patterns
  created belief 'Team auth work is repeatable and succeeds every time: ...' (conf 0.92, 6 episodes)
  Prune — decay unconfirmed beliefs, retire contradicted ones
  decayed 'Team uses service objects, not fat models' to conf 0.69
  contradicted 'Deploying directly to production via SSH is fine for small fixes' by 'Deploy the auth changes straight to production' (conf 0.28)
  retired 'Deploying directly to production via SSH is fine for small fixes' below conf floor after contradiction
  replaced with 'Team discourages ssh direct deploy: ...' (conf 0.5)
  Strengthen — update salience weights from access and outcome magnitude
  graph: 8 episodes, 3 beliefs

Rollback — the nightly pass is fully reversible (one operation)
  revert -> exact restore (2 beliefs, was 2)

Here’s what happened in that run. A deploy straight to production failed and was rolled back, and that outcome contradicted a belief seeded on day 0 that SSH deploys were fine for small fixes. The belief’s confidence fell below the floor, so the pass retired it and wrote a replacement that cites the failed episode as evidence. A belief nobody had confirmed lost some confidence. Six successful episodes on one topic became one new belief. Every step is journaled, and the whole pass reverts in one operation.

The output also shows the prototype’s limits. The new belief’s wording is crude, because the prototype’s consolidation is a simple rule that groups successful episodes by topic. It isn’t a model writing a careful summary. The scenario is synthetic, and the only checks are the prototype’s own “did the graph behave as designed” tests. In sleep-time terms, though, the shape is right: the work happens with no query in sight, after the outcomes are in, and the next day’s retrieval reads the result.

Where DawnLoop fits

We think sleep-time compute and nightly consolidation are the same bet: memory work that’s too slow for a request gets done when nobody is waiting. DawnLoop is designed around that bet, with outcome labels as the supervision. For the wider picture of how agents remember, start with our guide to long-term memory for AI agents.