LISTEN TO THIS ARTICLE
Attention Heads Are the New Inference Budget
Models that can technically process 128K tokens routinely fail on tasks requiring reasoning across 32K. That gap isn't a context window problem. It's an attention allocation problem, and a new decoding algorithm called DySCO is making the case that the fix belongs at inference time, not training time.
The core finding from Xi Ye and colleagues at Princeton Language and Intelligence is blunt: even when a model has the right information in its context window, it often fails to keep attention aligned with that information as decoding progresses. Attention drifts. Relevant tokens get buried under the weight of recency bias and positional noise. The model's retrieval heads, a specific subset of attention heads that the authors identify as specialized for locating relevant context, can be dynamically boosted during decoding to counteract this drift without touching the model weights.
That's the bet DySCO is making: dynamic test-time scaling applied not to reasoning steps or chain-of-thought branches, but directly to attention head weights during generation.
What Retrieval Heads Actually Do
The concept of retrieval heads isn't new. Prior work established that large transformer models develop functional specialization across attention heads, with certain heads consistently responsible for copying, attending to specific token types, or retrieving information from distant context. What DySCO does is operationalize this specialization as a first-class inference-time control knob.
Think of it like a radio with a broken tuner. The signal is there. The antenna picks it up. But the receiver keeps drifting off-frequency mid-broadcast. DySCO is the auto-tune circuit that keeps snapping it back. It's a rough analogy, but it captures what's actually happening: the relevant information is in the context, the model just keeps losing its grip on it.
The authors identify retrieval heads by analyzing attention patterns on held-out long-context tasks, then use those heads to guide token selection during decoding. At each step, DySCO runs a three-stage process: first, an aggregation stage where a partial forward pass through the retrieval heads produces relevance scores for context tokens. Then a selection stage, where nucleus sampling over those scores identifies the most important tokens. Finally, a rescaling stage that up-weights the selected tokens by adding a scaling factor to their attention logits across all heads before the full forward pass generates the next token.
The Selective Intervention Is Doing Real Work
Here's what the headlines miss. DySCO isn't just "boost some attention heads." The selective, retrieval-head-guided intervention is what separates it from cruder approaches like uniform attention scaling or prompt compression.
The key distinction is that DySCO doesn't boost all attention equally. It first uses retrieval heads, which represent a small subset of all attention heads, to identify which context tokens are task-relevant. Only those tokens get up-weighted, and only during the rescaling stage. This targeted approach avoids a known failure mode of uniform attention boosting: amplifying noise as readily as signal. If you crank up all attention equally, you're not improving retrieval, you're just turning up the volume on a noisy channel. DySCO's retrieval-head-guided selection targets the amplification at tokens the model's own specialized heads have flagged as relevant.
The empirical results back this up. On long-context benchmarks including MRCR and LongBenchV2, DySCO shows consistent gains over strong baselines like YaRN, uniform attention scaling, RAG, and prompt compression methods, with particularly large improvements on reasoning tasks at long context lengths. The authors report relative accuracy improvements of up to 25% on MRCR and LongBenchV2 at 128K context length across multiple instruction-tuned and reasoning models. That's not a rounding error.

Test-Time Scaling Gets Structural
The broader conversation about test-time compute has mostly been about how many reasoning steps to run, or which chain-of-thought path to select. Anthropic's work on extended thinking, OpenAI's o-series models, and the growing literature on best-of-N sampling have all focused on the reasoning layer. I've written about this before, small models allocating inference budget dynamically rather than uniformly is a real capability unlock. But DySCO points at a different layer of the stack entirely.
If you accept the framing, test-time scaling now operates across at least three distinct levels: the attention head level (DySCO's intervention), the decoding step level (chain-of-thought, tree search, reflection), and the model selection level (routing to larger models for harder queries, as in the confidence-driven multi-scale selection work from Chen et al.). These aren't competing approaches. They stack.
That stacking is what makes this genuinely interesting. A system that routes hard queries to a larger model, then applies dynamic attention scaling to keep that model's retrieval focused across a long context, then selects among multiple reasoning chains via a verifier, that's a qualitatively different architecture than any single one of those pieces alone. The part that actually worries me is that most current benchmarks don't evaluate the interaction effects between these layers. We're measuring each piece in isolation and assuming composition is safe.
Where the Methodology Gets Wobbly
DySCO has some gaps worth naming. The retrieval head identification process requires task-specific calibration data. The authors use a held-out set from the target distribution to identify which heads are retrieval heads before inference. That's fine for a research setting, but it introduces a distribution assumption: the calibration set needs to match the deployment distribution closely enough that the identified heads generalize. In practice, if you're running a legal document QA system and calibrate on academic long-context benchmarks, you might be boosting the wrong heads.
The paper does address computational overhead: DySCO introduces approximately 4% extra FLOPs when generating 8K tokens from 128K-token inputs, since the additional partial forward pass in the aggregation stage is modest compared to the quadratic-cost prefilling pass over the full context. For long-context tasks where the bottleneck is processing thousands of input tokens, that's genuinely minimal. But for shorter contexts where the method's gains are also smaller, the overhead-to-benefit ratio is worse. The method is self-limiting in a somewhat elegant way: it helps most exactly where you'd want to pay for it.
One gap worth noting is how well the retrieval head identification generalizes across distributions. The paper provides ablations showing that both the dynamic rescaling and the retrieval-head-guided selection contribute to the method's effectiveness, but questions remain about robustness when the calibration data diverges significantly from deployment conditions.
Connection to Agent Memory and Multi-Step Reasoning
This work connects directly to a persistent problem in multi-agent systems: when agents reason over long conversation histories or large retrieved context windows, their performance degrades in ways that aren't well-explained by context length alone. The relevant information is there. The model just stops attending to it. We've covered the memory problem in multi-agent reasoning and the agentic RAG retrieval gap before, and DySCO suggests one mechanism behind those failures is attention drift during generation, not just retrieval quality at context-loading time.
This reframes the problem. If you're building a RAG pipeline and you've tuned your retriever carefully but still see degraded performance on long contexts, the issue might not be what you retrieved. It might be whether the model holds attention on what it retrieved as it generates a long response. That's a decoding problem, not a retrieval problem, and it requires a decoding-layer fix.

Confidence-Driven Model Routing as a Parallel Track
The confidence-driven multi-scale selection work from Chen et al. is worth pulling in here because it represents a complementary axis of inference-time hierarchy. Rather than modulating attention within a single model, it routes queries across models of different sizes based on confidence signals. Low-confidence outputs from a small model trigger escalation to a larger one. The hierarchy operates at the model level rather than the attention-head level.
What's striking is that both papers are reaching for the same general principle: don't spend inference budget uniformly. Spend it where the system is struggling. DySCO identifies which context tokens matter via retrieval head relevance scores, then amplifies them. Chen et al. identify task difficulty via output confidence, then escalate to larger models. Both are runtime signals about where the model needs help, used to dynamically allocate additional compute. The mechanism differs; the logic is identical.
This convergence matters. It suggests that dynamic test-time scaling isn't a single technique but a design pattern, a way of building inference systems that monitor their own uncertainty and respond with targeted resource allocation. That pattern is going to show up at multiple levels of the stack simultaneously.
What This Actually Changes
DySCO doesn't solve long-context reasoning. Models still struggle with tasks requiring precise recall across very long documents, attention drift is one mechanism among several, and the calibration requirement limits out-of-the-box deployability. Don't mistake a strong empirical result for a general solution.
What it does change is the design space for inference systems. The assumption that attention allocation is fixed once you've chosen a model turns out to be wrong, or at least unnecessarily limiting. If retrieval heads are identifiable and their influence is tunable at inference time without retraining, then test-time scaling has a new dimension that was previously ignored. That's not incremental. It means architectures that co-optimize reasoning depth and attention focus simultaneously become feasible at runtime.
For teams building long-context agent systems, the practical takeaway is specific: if you're seeing degraded performance on multi-hop or long-document tasks despite adequate context windows and good retrieval, your decoding strategy is worth auditing. The context might be fine. The generation process might be the bottleneck. DySCO is one tool, but the principle generalizes: targeted test-time interventions at the attention level are now a real option, not a research curiosity.
The field has been fixated on what goes into the context. It's time to pay more attention to what happens during generation.
Sources
Research Papers:
- DySCO: Dynamic Attention-Scaling Decoding for Long-Context LMs, Xi Ye, Wuwei Zhang, Fangcong Yin, Howard Yen, Danqi Chen — Princeton Language and Intelligence (2026)
- Confidence-Driven Multi-Scale Model Selection for Cost-Efficient Inference, Bo-Wei Chen, Chung-Chi Chen, An-Zi Yen (2026)
- Retrieval Head Mechanistically Explains Long-Context Factuality, Wu et al. — ICLR 2025
Industry / Case Studies:
- Test-Time Compute Scaling Overview, Hugging Face Blog
- Long Context and Inference-Time Reasoning, Google DeepMind Blog
- Papers With Code: Long-Context Benchmarks, Papers With Code
Related Swarm Signal Coverage: