# Let's (not) just put things in Context: Test-Time Training for Long-Context LLMs

- **ID:** 533
- **Kind:** paper
- **URL:** https://arxiv.org/abs/2512.13898
- **Authors:** Rachit Bansal, Aston Zhang, Rishabh Tiwari, Lovish Madaan, Sai Surya Duvvuri, Devvrit Khatri, David Brandfonbrener, David Alvarez-Melis, Prajjwal Bhargava, Mihir Sanjay Kale, Samy Jelassi
- **Venue:** arXiv / Meta / Harvard
- **Published:** 2025
- **Tags:** qttt, test-time-training, long-context, score-dilution, longbench, zeroscrolls, meta, harvard
- **Topics:** long-context LLMs, test-time training, attention
- **Added:** 2026-10-01
- **Research status:** done
- **Page:** https://papers.projxon.ai/entries/533

## Summary

Diagnoses score dilution in static self-attention: the target–distractor logit margin must scale as Ω(log T) or needle mass vanishes. Thinking tokens cannot recover buried evidence under that bound. qTTT does one prefill to cache K/V then a few gradient steps on W_Q only, raising the margin without invalidating the cache. FLOP-matched to 8k thinking tokens, Qwen3-4B gains +12.6 / +14.1 pp average on LongBench-v2 and ZeroScrolls subsets; thinking-token gains saturate as T grows.

## Attributes

- **Purpose:** Spend inference compute on query-only TTT instead of thinking tokens for long-context retrieval
- **Scale:** Qwen3 1.7B/4B/8B (32B in appendix); LongBench-v2 6 subsets; ZeroScrolls 8 datasets; synthetic bug-localization and transaction-log tasks with T up to ~10k tokens; N_TTT=32, k=128
- **Time period:** 2025-12-15 (arXiv 2512.13898 v1). HF paper publishedAt 2025-12-15.

## From the source (fetched 2026-10-03)

- **Published:** Dec 15, 2025 (arXiv)
- **arXiv categories:** cs.LG, cs.CL (arXiv)
- **Citations:** 20 (3 influential) (Semantic Scholar)
- **References:** 41 (Semantic Scholar)

## Abstract

Progress on training and architecture strategies has enabled LLMs with millions of tokens in context length. However, empirical evidence suggests that such long-context LLMs can consume far more text than they can reliably use. On the other hand, it has been shown that inference-time compute can be used to scale performance of LLMs, often by generating thinking tokens, on challenging tasks involving multi-step reasoning. Through controlled experiments on sandbox long-context tasks, we find that such inference-time strategies show rapidly diminishing returns and fail at long context. We attribute these failures to score dilution, a phenomenon inherent to static self-attention. Further, we show that current inference-time strategies cannot retrieve relevant long-context signals under certain conditions. We propose a simple method that, through targeted gradient updates on the given context, provably overcomes limitations of static self-attention. We find that this shift in how inference-time compute is spent leads to consistently large performance improvements across models and long-context benchmarks. Our method leads to large 12.6 and 14.1 percentage point improvements for Qwen3-4B on average across subsets of LongBench-v2 and ZeroScrolls benchmarks. The takeaway is practical: for long context, a small amount of context-specific training is a better use of inference compute than current inference-time scaling strategies like producing more thinking tokens.

## Research notes

- Primary: arxiv abs (cs.LG; also cs.CL). CC BY 4.0 on HTML. Work done while at Meta; affiliations Harvard/Kempner, Meta, OpenAI, UC Berkeley, UT Austin. Correspondence rachitbansal@g.harvard.edu, az@astonzhang.com. No official code on abs. HF paper page 2 upvotes; no linked models/datasets. Discord posted abs (Substack UTM). Uses public LongBench-v2/ZeroScrolls; no new corpus, so no datasets_local row. License field left blank per catalog convention.

## Related entries

- Discussed in: [Long context: three bets and a weak spot in evaluation (overview)](https://papers.projxon.ai/entries/1208) (note, #1208)

## Similar entries

- [MoBA: Mixture of Block Attention for Long-Context LLMs](https://papers.projxon.ai/entries/707) (paper, #707)
- [Triadic Linear Attention: Three-Dimensional Recurrent States for Long-Context Sequence Modeling](https://papers.projxon.ai/entries/1244) (paper, #1244)
- [Titans: Learning to Memorize at Test Time](https://papers.projxon.ai/entries/550) (paper, #550)
- [LongHarness Bench: Stress-Testing Language Model Harnesses for Long-Context Reasoning](https://papers.projxon.ai/entries/821) (paper, #821)
- [Leave No Context Behind: Efficient Infinite Context Transformers with Infini-attention](https://papers.projxon.ai/entries/564) (paper, #564)
- [SmolLM3: smol, multilingual, long-context reasoner](https://papers.projxon.ai/entries/612) (model, #612)
