TRANSMISSION // 2611.32802v1

Can language models learn more from context by “sleeping”?

Source published

A transformer preprint reports that periodic extra processing improved context use in tested tasks, while adding training compute and prompt-processing time.

AI-generated conceptual illustration for Can language models learn more from context by “sleeping”?
AI-generated conceptual illustration; not documentary evidence.

This preprint tests whether transformer models can use examples in a prompt more effectively by periodically processing a completed block of context again. The authors call the extra processing “sleep”; it is a computing strategy, not a claim about how brains learn.

The question: can a model make better use of examples it has just seen?

A language model may need to infer a rule from examples, follow a new instruction, or work with unfamiliar code. In-context adaptation is the ability to use information in a prompt to adjust behavior without changing the model’s trained parameters. The researchers ask whether extra processing of that context can help models adapt with fewer examples.

In Sample-Efficient In-Context Adaptation via Sleep, “sleep” is an analogy for periodic computation outside ordinary token-by-token generation. It does not mean the model sleeps or learns as a brain does.

What the researchers did

The team trained transformer language models to process context in windows. During “wake,” the model predicts tokens in the usual way. When a window is complete, it makes additional recurrent forward passes to refine the window’s key-value (KV) cache—the stored representations used by attention. The model retains the full context; unlike some earlier sleep-style approaches, this method does not evict tokens. It then resumes ordinary decoding until the next window is complete.

The researchers varied the number of passes, N, and compared the results with a no-sleep version. Their experiments included a 600-million-parameter model trained on 16 billion tokens, and 1.2-billion-parameter models trained on 32 billion or about 98 billion tokens. Evaluations included next-token prediction on ProLong and on held-out scientific-paper and code corpora called arXiv2025 and Repo2025. They also tested few-shot tasks in which models had to infer rules or label mappings from examples in context.

What they found

On the paper’s next-token prediction evaluations, sleep models generally had lower loss than the no-sleep baseline after context accumulated. The reported differences appeared around sleep boundaries, and longer sleep often improved results in these evaluations. On the study’s held-out code evaluation, the N = 2 and N = 4 models matched the baseline’s measured loss with 2.10 and 2.39 times fewer prefix tokens, respectively. These figures describe particular models and test data; they do not establish the same advantage for arbitrary prompts or code.

The paper also reports improvements across its tested few-shot tasks and model configurations, including question answering, classification and algorithmic word tasks. Results varied by task and setting: at some demonstration counts, N = 2 tied or outperformed N = 4, including on CoQA and SST-2. The authors also found that formatting choices could substantially affect some algorithmic-task results.

For standard evaluations shorter than the 256-token sleep window, models did not use sleep; results were similar to the baseline and, if anything, slightly lower. That finding is not evidence of a sleep effect at short context lengths.

The trade-off—and what remains uncertain

Extra processing costs computation. The authors say training requires approximately N times the computation per token of the no-sleep baseline. At inference, the added work occurs in periodic bursts at window boundaries. Decoding between boundaries proceeds at the usual speed, but the bursts add latency to cumulative generation time. The paper reports that prompt prefill—the processing before the first generated token—takes longer, approximately in proportion to N.

For one specific latency test, the authors used a 1.2-billion-parameter model with a 256-token sleep window, BF16 weights, batch size 8, CUDA graphs and an RTX 6000 Ada GPU. With a 128,000-token prefix, cumulative decoding time, excluding time to first token, increased by 2.6% for N = 2 and 7.6% for N = 4. These measurements should not be assumed to hold for other hardware or configurations.

The comparisons are not compute-matched: sleep models use more training computation. The findings therefore describe a trade-off, not a free efficiency gain. The authors designed their evaluation corpora to reduce training-data overlap, but note that the scientific-paper and code datasets may not be fully uncontaminated. Few-shot results also varied with task, configuration and example formatting. The paper suggests that benefits grow as context accumulates, but does not establish a universal context threshold at which sleep helps.

This is an arXiv preprint, not evidence of peer-reviewed consensus. The authors identify testing larger models and models after post-training as future work. Whether the method is useful in practice will depend on the task and on whether improved use of context justifies additional training compute and slower prompt processing. In the settings tested, the paper reports improved results on several adaptation evaluations, with important costs and qualifications.

Reviewed cross-references

These connections were reviewed by a model, not independently fact-checked by a human. Similarity does not imply agreement; consult the original papers and the evidence below.

  • How a robot can learn from its own attempts

    Supporting evidence: These preprints report task-specific benefits from using accumulated context: Lee et al. find improved language-model adaptation after recurrent KV-cache refinement, while Shi et al. report improved robotic task success conditioned on interaction and reward history. This supports only a parallel across different tasks and mechanisms, not transfer between them; Lee et al. also note higher training compute and slower prefill.

    Model review: · openai-codex/gpt-6-luna

    Evidence and provenance

    Selected excerpts, not complete papers. PDF extraction can omit figures or damage equations, tables and reading order; sources may be preprints.

    • 2611.32802v1 — Original paper

      Excerpt reference: static/papers/2611.32802v1.md:263-336
      Basis: Paper text
      Source SHA-256: 30d9bd9e624e7b08ef37d96f167629d77c119a474deb7abfad671b0c394450e6

    • 2611.32802v1 — Original paper

      Excerpt reference: static/papers/2611.32802v1.md:1386-1563
      Basis: Paper text
      Source SHA-256: 30d9bd9e624e7b08ef37d96f167629d77c119a474deb7abfad671b0c394450e6

    • 2610.19517v2 — Original paper

      Excerpt reference: static/papers/2610.19517v2.md:62-109
      Basis: Paper text
      Source SHA-256: 43123c92b46b50ec8e840300c38623b7a1a0797c88f64bc91cd86a02962b5d17

    • 2610.19517v2 — Original paper

      Excerpt reference: static/papers/2610.19517v2.md:740-797
      Basis: Paper text
      Source SHA-256: 43123c92b46b50ec8e840300c38623b7a1a0797c88f64bc91cd86a02962b5d17

Automatically matched by shared topic keywords. These links do not imply that the sources agree or establish a consensus.