Skip to content

Targeted Retrieval, Compact Representations: How CoT Reasoning Improves Long-Context Counting

Sep 2026 · 0 citations
Computer Science Mathematics

TL;DR

Together, the results connect long-context retrieval with representation geometry of counting, supporting a state-tracking account of CoT reasoning.

Abstract

Large language models (LLMs) have been rapidly improving in long-context tasks, powered by Chain-of-Thought (CoT) reasoning. However, the internal mechanisms underlying this improvement remain unclear. We investigate these mechanisms through a needle-in-a-haystack (NIAH) counting task, where an LLM is asked to count the number of records dispersed in a long text. Across twelve model comparison groups, Thinking (or reasoning) improves counting accuracy over Non-thinking, with pronounced gains at larger counts. This motivates our mechanistic analysis, which identifies two contrasting mechanisms: (i) broad retrieval, where Non-thinking models broadly attend to multiple needles; (ii) targeted retrieval, where Thinking models use enumeration in CoT traces to successively retrieve needles. Targeted retrieval concentrates attention on individual needles and is accompanied by more compact internal representations. Moreover, causal intervention analysis suggests that Thinking models use the CoT trace to maintain and update an internal counter as needles are successively retrieved, even without explicit numbering. In small controlled experiments, both retrieval mechanisms and counter states emerge under standard autoregressive training. Together, our results connect long-context retrieval with representation geometry of counting, supporting a state-tracking account of CoT reasoning.

View source

Similar papers

#machine learning Preprint Sep 2026

Counting on Thinking: Tracing Evidence Integration in Language Models

This work asks why evidence integration in large language models requires thinking, and reasoning trajectories showed models revisiting input, recounting letters, and checking intermediate counts that informed the answer, suggesting that thinking constructs the accumulated count that direct responses lack rather than r...

Jing-Ming Xue, Robert C. Wilson, Hua-Dong Xiong · 0 citations
#natural language process... Preprint Oct 2026

Thinking Inertia: LLMs Keep Thinking When Told Not To

Large Language Models (LLMs) increasingly ship with explicit"thinking modes", yet their counterpart,"no-thinking", has received far less attention. We study LLMs'no-thinking behavior along two axes. a. How to measure no-thinking? Prior work typically defines no-thinking through proxies such as a disabled thinking mode...

Dian-Qiao Lei, K. Lin, Pan Lu et al. · 0 citations
#artificial intelligence Preprint Sep 2026

Making LLMs Say What They Think: Measuring and Improving CoT-Interpretability Alignment

Chain-of-thought (CoT) traces often serve as a proxy for how Large Language Models (LLMs) arrive at their answers. However, growing evidence shows that models'CoT often fails to reflect their internal computations and can be changed without affecting their final answers. In this work, we measure and improve the alignme...

Yi-Huai Hong, Shauli Ravfogel, Chen Zhao et al. · 0 citations
#artificial intelligence Preprint Sep 2026

Evidence Integration in Large Language Models

A distributional theory in which evidence shifts the receiver's distribution of initial answers, driven by a receiver prior weight and a candidate evidence tilt, leading to three predictions: candidates more probable to the receiver are more persuasive, receivers more readily integrate characteristic errors of their ow...

Sebastien Kawada, M. Kellis · 2 citations
#small language model Preprint Oct 2026

COMPASS: Finding Where Reasoning Lives in Language Models

Comparing three model families and multiple math benchmarks, COMPASS outperforms the activation-steering baselines the authors compare against, improves GSM8K accuracy by 16 percentage points on average, and approaches CoT accuracy with 20-70\% fewer generated tokens.

Pratyay Dutta, Kowshik Thopalli, V. Narayanaswamy · 0 citations

Related blog posts

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.