Sleep-Time Compute: Preparing AI Context Before a Question

Matthew Berman reviews a 2025 paper on moving some reasoning ahead of a user query, and explains where its experiments found benefits and limits.

MBMatthew BermanVortrag · Forward Future
Kanal
Matthew Berman
Veröffentlicht
25. Apr. 2025
Video
19:06
Lesezeit
5 Min.
Folien
4
Original
Englisch
Auf YouTube öffnen
Beim Scrollen schrumpft das Video in die rechte untere Ecke und läuft weiter. Untertitel folgen Ihrer Lesesprache.
LesespracheIn 2 Sprachen verfügbar
Diesen Artikel gibt es noch nicht auf Deutsch, daher wird das Original (Englisch) angezeigt.
ZUSAMMENFASSUNG

In 30 Sekunden

Matthew Berman explains sleep-time compute, a method from researchers associated with Letta that processes shared context before a query arrives. He walks through mathematical reasoning experiments, the tradeoff between preprocessing and query-time compute, parallel sampling and the role of predictable questions. The paper reports gains under particular benchmark budgets and models, not a universal reduction in total compute. Its cost analysis assumes query-time tokens cost ten times as much as sleep-time tokens and amortizes preprocessing over shared queries.

  1. 1Stateful contextDocuments, conversations and codebases can be reused across queries, creating an opportunity for preprocessing.
  2. 2A juggler exampleFrom 800 balls and their proportions, preprocessing derives 200 tennis balls and 10 marked indigo tennis balls.
  3. 3Token and accuracy tradeoffsOn the adapted math tests, some low-budget settings match baseline accuracy with about five times fewer test-time tokens; preprocessing still costs compute.
  4. 4Scaling preprocessingThe paper reports gains up to 13% and 18% on the two math benchmarks at comparable test-time budgets, with limits on scaling.
  5. 5Cost assumptionsThe modeled multi-query savings rely on a tenfold relative price for test-time tokens and ten queries per context.
  6. 6Question predictabilityThe authors find greater benefits in their tested settings when the question is more predictable from the context.

Das Wichtigste

  1. Sleep-time compute generates a reusable representation of context before the user asks a question.
  2. On the paper’s adapted math benchmarks, some settings reached comparable accuracy with about five times fewer query-time tokens, excluding preprocessing from that measure.
  3. The modeled cost saving of up to 2.5 times assumes ten questions per context and query-time tokens priced ten times higher than sleep-time tokens.
  4. Additional preprocessing can help, but more is not invariably better and query-time-only methods can win at higher budgets.
  5. Predictable questions sharing the preprocessed context are more likely to benefit.
  6. The math benchmarks and a file-selection proxy for software engineering do not establish end-to-end performance across real applications.
VOLLTEXT

Den bearbeiteten Text nach Kapiteln lesen

Nur das Transkript
01

Why preprocess context?

Berman introduces sleep-time compute and the latency and expense of query-time reasoning. He describes shared context as an opportunity to prepare in advance.

What if an AI system could prepare useful inferences before you ask a question? A 2025 paper from researchers associated with Letta explores that idea as sleep-time compute. I previously covered MemGPT, a project from the same team concerned with giving agents more sophisticated memory.

Reasoning models use computation at inference time to work through problems, which can improve results on some tasks. The cost is that users may wait while the model generates reasoning tokens, and serving those tokens consumes computing resources. The amount of improvement, latency and expense depends on the model and task.

The paper asks why all of this work must happen after the query arrives. In a conventional setup, a model receives both the question and the relevant context at test time. If users repeatedly ask about the same documents, codebase or conversation, some analysis of that context might be reusable.

Code repositories, document question answering and conversational assistants are examples of potentially persistent context. Instead of processing only in response to each request, the proposed method prompts a model to make inferences about the context ahead of time and puts that representation into a later prompt.

02

The juggler example and the method

The paper’s diagram illustrates deriving useful facts before questions arrive. The resulting representation can be reused at query time.

The paper illustrates this with a juggler and 800 balls. One quarter are tennis balls, half of those are indigo, and one tenth of the indigo tennis balls are marked. Preprocessing can derive 200 tennis balls, 100 indigo tennis balls and 10 marked indigo tennis balls before either question is asked.

Sleep-time and test-time comparison
FOLIE 1 / 4Sleep-time and test-time comparisonThe paper’s juggler example shows a preprocessed context reused for two questions.

That work is not free: it shifts processing earlier, when it may be scheduled without the same response deadline, and can be reused for several questions. Berman describes latency-sensitive inference as potentially more expensive. The paper models a tenfold price difference for its cost analysis; actual prices and savings depend on deployment and usage.

The authors call this offline inference between interactions sleep-time compute. It does not require a model to continuously think around the clock. The technique prepares a natural-language representation that may help with later queries; its usefulness depends on what those queries turn out to be.

03

Benchmarks and results

Berman discusses adapted GSM-Symbolic and AIME questions, model comparisons, and when test-time-only reasoning does better.

How the method prepares context
FOLIE 2 / 4How the method prepares contextThe highlighted text describes generating inferences before a query and reusing them later.

For example, a coding assistant might inspect a repository in advance, identify architecture and consider possible debugging approaches. The generated context can then be supplied when a user asks a question. This is a proposed application, and its usefulness needs evaluation in the actual workflow.

The paper reports that, in some settings on its adapted math benchmarks, sleep-time compute achieves comparable accuracy with roughly five times fewer test-time tokens. That comparison concerns tokens used when answering, not a fivefold reduction in all computation including the preprocessing. Query-time-only reasoning can outperform it at higher budgets.

The researchers also vary the preprocessing budget. They report improvements of up to 13% on Stateful GSM-Symbolic and 18% on Stateful AIME at similar test-time budgets. More preprocessing is not guaranteed to improve every configuration: in one experiment, five parallel generations generally beat ten.

The cost of preprocessing can be spread across several questions about the same context. In the paper’s linear cost model, test-time tokens are weighted ten times more expensive than sleep-time tokens. Under that assumption and ten queries per context, the reported average cost per query can fall by up to 2.5 times compared with the single-query baseline.

To create the stateful datasets, the researchers split existing math problems into context and question. Stateful GSM-Symbolic uses P1 and P2 variants; Stateful AIME combines questions from the 2024 and 2025 exams. The multi-query dataset adds synthetic questions about shared contexts, so results should be interpreted in that experimental setting.

The experiments use GPT-4o and GPT-4o-mini on GSM-Symbolic, and o1, o3-mini, Claude 3.7 Sonnet Extended Thinking and DeepSeek-R1 on AIME. For the non-reasoning models, the researchers vary test-time output by prompting for different levels of detail and checking. For reasoning models they vary the available reasoning budget.

The graphs compare accuracy against average test-time tokens per question. At lower budgets, preprocessing often improves the tradeoff, while at higher budgets the standard test-time baseline can regain an advantage. The paper reports limited gains for o1 on the AIME comparison, so the effect is not identical across models.

Reasoning-model accuracy and token budgets
FOLIE 3 / 4Reasoning-model accuracy and token budgetsThe charts compare query-time token use and accuracy on Stateful AIME for four models.
04

Parallel sampling, scaling and cost

The paper compares with pass@k, varies sleep-time compute and models cost across multiple related queries.

Another comparison uses parallel sampling: ask for several answers and choose among them. The paper compares against pass@k, which assumes access to an ideal verifier that can identify a correct answer among samples. On its evaluated tasks and test-time token budgets, the authors report that sleep-time compute outperformed that baseline.

To scale the sleep-time phase, the researchers generate several alternative context representations for non-reasoning models, or vary the reasoning effort used in preprocessing for o1 and o3-mini. This changes the accuracy and test-time tradeoff, but also increases the upfront work that must be accounted for.

Reusing a prepared context across multiple questions is the central amortization argument. The tenfold price weighting in the paper is a simplified assumption about latency-optimized inference, not a finding that every query-time GPU token always costs ten times more. Fewer related questions or different prices can change the result.

05

Predictability and limitations

Berman describes the connection between predictable questions and usefulness. The work leaves allocation and more complex interactions for future research.

Question predictability matters. If the context describes the juggler’s balls, a question about the balls is more likely to benefit from prepared arithmetic than an unrelated question about the ocean. On GSM-Symbolic, the authors group questions by a model-based predictability score and find a wider accuracy gap for more predictable questions, though the harder P2 pattern is less smooth.

Question predictability and accuracy gap
FOLIE 4 / 4Question predictability and accuracy gapThe figure groups GSM-Symbolic questions by predictability and compares sleep-time and standard inference.

The paper concludes that sleep-time compute may be less useful when queries are difficult to predict or unrelated to the context. A future system might decide how much compute to spend before and after a query. Real workflows also involve changing context and multiple interactions, beyond the study’s simplified two-phase setup.

Mehr aus diesem Kanal

12 Folien34:21EN
Matthew Berman· 27. Okt. 2026Matthew Berman Examines Anthropic’s IPO Filing, AI Growth and GovernanceMatthew Berman, Sam Altman · Forward FutureThe presenter reviews the S-1’s financial metrics, compute strategy and voting structure while questioning the tension between rapid AI development and safety.AnthropicAI SafetyEnterprise-KI+2
6 Folien25:50EN
Matthew Berman· 24. Okt. 2026Kimi K3.1 Pro Tested: Strong 3D Demos, Uneven Results and Competitive PricingMatthew Berman · Forward FutureMatthew Berman tests the open-weight model on coding, 3D rendering and visual explanations, then compares benchmark results and prices.Open-weight modelsBenchmarksAI cost & performance+1
2 Folien32:20EN
Matthew Berman· 23. Okt. 2026Who Is Local AI For? The Costs, Trade-offs and a Hybrid FutureMatthew Berman · Forward FutureMatthew Berman weighs data control and independence against hardware cost, setup complexity and inference speed.Local inferenceOpen-weight modelsAI cost & performance+1
6 Folien1:03:37EN
Matthew Berman· 23. Okt. 2026Matthew Berman’s Team Tests Kimi K3.1 on Animation, Games, and ChartsMatthew Berman, Alex, Brian · Forward FutureA live team AMA turns into an informal test of Kimi K3.1, from personal-agent workflows to motion graphics, a browser game, and a benchmark chart.Coding-AgentenGenerative mediaEvals+2
0:53EN
Matthew Berman· 22. Okt. 2026Sam Altman on AI and the Discovery of New KnowledgeSam Altman · OpenAIAltman expects progress in mathematical discovery to extend to biology, materials and energy.AI for scienceMathematicsComputational Biology+1
Folien0:22EN
Matthew Berman· 21. Okt. 2026A Robot Bodyguard Video Shows Dramatic Rescue ScenariosMatthew Berman · Forward FutureMatthew Berman reacts to a short robot demonstration depicting fighting and vehicle-rescue scenarios.RoboticsEvals