Many-Shot CoT-ICL: Making In-Context Learning Truly Learn

1The Hong Kong University of Science and Technology
2Fudan University   3WeChat AI, Tencent
ICML
Reframing CoT-ICL as in-context test-time learning

Reframing many-shot CoT-ICL as in-context test-time learning rather than scaled pattern matching.

Abstract

While many-shot ICL achieves remarkable performance, prior studies of its scaling behavior have mainly focused on non-reasoning tasks. We study many-shot ICL on reasoning tasks, with a particular focus on many-shot chain-of-thought in-context learning (CoT-ICL). Analyzing across non-reasoning and reasoning tasks and across non-reasoning and reasoning-oriented LLMs, we identify several distinctive properties of many-shot CoT-ICL. We further interpret these findings by viewing many-shot CoT-ICL as in-context test-time learning rather than scaled pattern matching, and suggest two principles: (i) demonstrations should be easy for the target model to understand, and (ii) they should be ordered to support a smooth conceptual progression. Guided by the principle, we propose Curvilinear Demonstration Selection (CDS), a simple ordering method that yields up to a 5.42 percentage-point gain on a math task with 64 demonstrations. Overall, our results reframe the long context window from a retrieval buffer into a structured curriculum for in-context test-time learning.

Three Properties of Many-Shot CoT-ICL

Property i

Setting-Dependent Scaling

Increasing CoT demonstrations is unstable for non-reasoning LLMs and benefits mainly reasoning-oriented LLMs.

Property ii

Similarity Fails on Reasoning

Retrieval remains useful, but standard semantic-similarity retrieval is unreliable for reasoning tasks because surface similarity poorly predicts procedural (CoT) compatibility.

Property iii

Order-Scaling Effect

Performance variance grows with more CoT demonstrations, making the order of demonstrations a first-class concern.

Two Principles for Many-Shot CoT

Viewing many-shot CoT-ICL as in-context test-time learning suggests that demonstrations should form a learnable curriculum, not merely a large retrieved set. We derive two practical principles:

Principle 1

Target-Model Understandability

Select demonstrations whose reasoning traces are easy for the target model to understand and follow. A demonstration is not useful merely because its question is semantically similar to the query.

Principle 2

Smooth Conceptual Progression

Order demonstrations so their reasoning forms a smooth conceptual trajectory, avoiding abrupt shifts that increase path dependence and order sensitivity.

Curvilinear Demonstration Selection (CDS)

Motivated by the correlation between embedding-space curvature and performance, CDS constructs an ordering of many-shot CoT demonstrations that produces a smooth trajectory in embedding space, avoiding abrupt transitions between successive demonstrations. It approximates the combinatorial optimum with a lightweight TSP heuristic (nearest-neighbor + 2-opt), taking under a minute on a standard CPU for up to 128 demonstrations.

Curvilinear Demonstration Selection

CDS seeks a low-curvature ordering of demonstrations, yielding a smoother conceptual progression.

CDS Results

CDS is robust across tasks, embedding models, and target LLMs (gpt-5.2 and Qwen3-14B), and across demonstration counts (16–128). CDSbge swaps the ordering embedder for bge-m3.

TaskModelMethod 163264128
number_theorygpt-5.2origin89.6391.1188.5691.48
CDS89.2692.5992.0491.85
Qwen3-14Borigin86.6787.9686.3090.93
CDS85.5687.8587.7890.74
geometrygpt-5.2origin75.9974.7475.3775.78
CDS81.2178.0880.7975.99
Qwen3-14Borigin66.1865.7665.1473.07
CDS65.5568.2768.8973.90
DetectiveQAgpt-5.2origin80.5282.4783.7785.71
CDS80.5283.1285.0688.31
Qwen3-14Borigin75.9774.0370.7872.73
CDS76.6275.3273.3875.32

Accuracy (%) at 16/32/64/128 demonstrations. Bold marks CDS improvements over origin.

Takeaway

Many-shot CoT-ICL is better understood as in-context test-time learning than as scaled pattern matching. Two practical principles follow: choose demonstrations that are easy for the target model to understand, and order them for a smooth conceptual progression. CDS operationalizes the second principle and turns the long context window into a structured curriculum.

BibTeX

@article{chung2026manyshot,
  title     = {Many-Shot CoT-ICL: Making In-Context Learning Truly Learn},
  author    = {Chung, Tsz Ting and Liu, Lemao and Yu, Mo and Yeung, Dit-Yan},
  journal   = {arXiv preprint arXiv:2605.13511},
  year      = {2026}
}