Sample-Efficient In-Context Adaptation via Sleep

Sangyun Lee, Zhang Enyan, Michael Xu, Hao Tang, Zinan Lin +5 more
11/24/2026
cs.LGcs.AIcs.CL

No confident code implementation found for this paper.

Abstract

The ability to learn and generalize from limited experience, or sample efficiency, is a cornerstone of intelligence. How can we build language models that turn a few user interactions, a few snippets of unfamiliar code, or a handful of experimental results provided in context into knowledge that generalizes?

Show full abstract

Prior work has found that sleep, a process where the model performs $N$ recurrent forward passes to refine its representations of a chunk of context, can improve long-context reasoning (specifically, within SSM-attention hybrid models). We study whether this method also improves in-context adaptation on general, non-synthetic tasks for transformer language models. To this end, we pre-train language models up to 1.2B-parameters on up to 100B tokens with sleep mechanisms. Notably, longer sleep (i.e., using a larger number of recurrent forward passes $N$) enables the model to learn faster in-context on multiple few-shot algorithmic, question-answering tasks, while also achieving lower next-token prediction loss on out-of-distribution evaluations. On held-out code, models with $N=2$ and $N=4$ match the no-sleep baseline's loss using $2.10\times$ and $2.39\times$ fewer tokens in-context, respectively. More broadly, we view our work as a step toward building models that have better tradeoffs between in-context adaptation and decoding latency.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{lee2026sampleefficient,
  title  = {Sample-Efficient In-Context Adaptation via Sleep},
  author = {Sangyun Lee and Zhang Enyan and Michael Xu and Hao Tang and Zinan Lin and Weijia Xu and Chris Quirk and Jianfeng Gao and Giulia Fanti and Xiaodong Liu},
  year   = {2026},
  eprint = {2611.32802},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2611.32802v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2611.32802.svg)](https://codeofpaper.com/paper/2611.32802)

Discussion