NeurIPS 2026QuestionsPapersAreasAboutMarkdown

Learning What to Remember: Test-Time Training via Context Distillation

Zixuan Wang, Xingyu Dang, Rui-Jie Zhu, Zixin Wen, Hengyu Fu, Wenhao Chai, Jason Lee

NeurIPS page · OpenReview · Open on the map

Category: Interpretability & Model Adaptation › Transformer Length and Memory Scaling · Type: new method · Keywords: test-time training, context distillation, long-context modeling, memory allocation, continual pre-training, transformer adaptation

Areas: Memory › Memory mechanisms › Memory Augmentation; Long Context › Long-context mechanisms › Long-context memory; Model Architectures & Sequence Modeling › Language Model Architectures › Long-Context Memory; Continual Learning & Adaptation › Catastrophic Forgetting and Unlearning › Catastrophic Forgetting

Summary

Test-Time Context Distillation (TTCD) is a test-time training framework that allocates limited memory capacity by distilling knowledge from a long-window teacher to a short-window student, enabling long-context modeling with minimal architectural changes.

Explained to a 5-year-old

We have a computer brain that reads long stories. It can only remember a little at a time, so it forgets things that might be needed later. The new idea teaches the brain to remember only the parts that will be useful later, like a helpful friend. It does this by watching a teacher that knows everything and copying its hints. This helps the brain get smarter without adding many new parts.

Explained to a 5-year-old, longer

Computers can read many words, but they cannot keep everything in mind. When they read a long story, they only remember a small part at a time. Sometimes they forget something that will be needed later. The new idea helps the computer decide what to keep in memory. It looks at a teacher that knows a lot and learns from its hints. The teacher shows which parts are important for later tasks. The computer then stores those important parts instead of everything. This makes the computer smarter without using a lot of extra memory. It also works on existing computers without changing their hardware. The computer can keep learning as it reads more, just like a student studying. This helps the computer understand long texts better. It also saves energy because it does not need to store huge amounts of data.

For a technical reader

The paper introduces a test-time training method that allocates limited memory for future use by distilling knowledge from a long-window teacher to a short-window student. The hidden-state differences between teacher and student provide a dense self-supervised signal that guides the model to retain only the context needed later. An in-place variant reuses existing MLP parameters as fast weights, allowing continual pre-training during inference with minimal architectural changes. Experiments on long-context language modeling show consistent gains over baseline approaches such as DeltaNet and sliding-window attention. This enables pre-trained transformers to acquire long-range capabilities on the fly without extensive fine-tuning.

Problem

Existing test-time training methods for long-context modeling focus on reconstruction or adaptation but ignore the future utility of retained information, leading to inefficient use of limited memory capacity.

Method

The approach uses a long-window teacher to supervise fast weights of a short-window student, leveraging hidden-state discrepancy as a self-supervised signal to guide memorization of crucial contextual information. An in-place variant reuses existing MLP parameters as the fast weights, enabling continual pre-training during inference with only lightweight architectural augmentation.

Results

The approach shows consistent improvements over baseline methods such as DeltaNet, Gated DeltaNet, sliding-window attention, and TTT when pre-trained from scratch, and enables continual pre-training for long-context adaptation with minimal architectural changes.

Contributions

The work introduces a test-time training framework that explicitly optimizes memory allocation for future utility, using teacher-student distillation to guide memorization of relevant context, and proposes an in-place variant that reuses existing MLP parameters for lightweight continual pre-training.

Practical relevance

It enables existing transformer models to acquire long-context abilities during inference with minimal overhead, facilitating deployment in memory-constrained environments.

Research questions this paper is counted under

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. Suggest a correction