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

📄 arXiv: 2605.13511v1 📥 PDF

作者: Tsz Ting Chung, Lemao Liu, Mo Yu, Dit-Yan Yeung

分类: cs.CL, cs.AI

发布日期: 2026-05-13

备注: Accepted by ICML 2026


💡 一句话要点

提出Curvilinear Demonstration Selection (CDS)方法,提升CoT-ICL在推理任务上的性能。

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 上下文学习 链式思维 推理任务 长上下文模型 示例选择 示例排序 测试时学习 几何推理

📋 核心要点

  1. 现有研究对长上下文模型中多示例CoT-ICL在推理任务上的缩放行为理解不足,存在性能不稳定等问题。
  2. 将多示例CoT-ICL视为上下文测试时学习,提出示例易理解和排序平滑两个原则,指导示例选择和排序。
  3. 提出Curvilinear Demonstration Selection (CDS)方法,通过特定排序提升CoT-ICL在几何推理任务上的性能。

📝 摘要(中文)

本文研究了多示例链式思维上下文学习(CoT-ICL)在推理任务中的应用,发现标准的多示例规则并不适用。研究表明,CoT示例数量的增加对非推理LLM不稳定,主要有益于推理LLM;基于相似性的检索在非推理任务上有帮助,但在推理任务上失败,因为语义相似性不能很好地预测程序(即CoT)兼容性;性能方差随着CoT示例的增加而增大。作者将多示例CoT-ICL视为上下文测试时学习,而非缩放的模式匹配,并提出了两个原则:示例应该易于目标模型理解,并且应该以支持平滑概念进展的方式排序。基于此,作者提出了一种简单的排序方法Curvilinear Demonstration Selection (CDS),在64个示例的几何任务上获得了高达5.42个百分点的增益。研究结果将长上下文窗口从检索缓冲区重新定义为上下文测试时学习的结构化课程。

🔬 方法详解

问题定义:现有的大语言模型(LLMs)可以通过上下文学习(ICL)适应新任务,但对于推理任务,特别是多示例链式思维上下文学习(CoT-ICL),其缩放行为的理解还不够深入。现有的基于相似性的检索方法在推理任务中表现不佳,且随着示例数量的增加,性能方差增大。现有的方法未能充分利用长上下文窗口的潜力,将其仅仅视为检索缓冲区,而忽略了其作为结构化课程进行上下文测试时学习的可能性。

核心思路:论文的核心思路是将多示例CoT-ICL视为一种上下文测试时学习过程,而非简单的模式匹配。这意味着示例的选择和排序至关重要,需要精心设计,以帮助模型更好地理解和学习推理过程。作者认为,示例应该易于目标模型理解,并且应该以支持平滑概念进展的方式排序。

技术框架:论文提出了一种名为Curvilinear Demonstration Selection (CDS) 的排序方法。该方法基于两个原则:1)选择易于理解的示例;2)对示例进行排序,以实现概念上的平滑过渡。具体来说,CDS方法首先选择一组代表性的示例,然后根据某种度量(例如,示例之间的语义相似性或推理难度)对这些示例进行排序,以创建一个结构化的学习课程。

关键创新:论文的关键创新在于将多示例CoT-ICL重新定义为上下文测试时学习,并提出了示例选择和排序的两个原则。CDS方法是基于这些原则的具体实现,它通过对示例进行精心排序,显著提高了CoT-ICL在推理任务上的性能。与传统的基于相似性的检索方法相比,CDS方法更注重示例之间的逻辑关系和概念连贯性。

关键设计:CDS方法的关键设计在于如何选择和排序示例。具体的排序策略可以根据不同的任务和数据集进行调整。例如,在几何推理任务中,可以使用示例之间的几何关系或推理步骤的复杂程度作为排序的依据。论文中没有详细说明具体的参数设置或损失函数,但强调了示例选择和排序的重要性。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果表明,提出的Curvilinear Demonstration Selection (CDS) 方法在几何推理任务上取得了显著的性能提升,在64个示例的情况下,获得了高达5.42个百分点的增益。这表明,通过精心设计示例的排序方式,可以有效提高CoT-ICL在推理任务上的性能,验证了论文提出的示例选择和排序原则的有效性。

🎯 应用场景

该研究成果可应用于各种需要复杂推理能力的场景,例如数学问题求解、科学推理、代码生成等。通过优化CoT-ICL的示例选择和排序,可以显著提高LLMs在这些任务上的性能,从而提升AI系统的智能化水平和解决实际问题的能力。未来,该方法可以进一步扩展到其他类型的推理任务和语言模型。

📄 摘要(原文)

In-context learning (ICL) adapts large language models (LLMs) to new tasks by conditioning on demonstrations in the prompt without parameter updates. With long-context models, many-shot ICL can use dozens to hundreds of examples and achieve performance comparable to fine-tuning, yet current understanding of its scaling behavior is largely derived from non-reasoning tasks. We study many-shot chain-of-thought in-context learning (CoT-ICL) for reasoning and show that standard many-shot rules do not transfer. Across non-reasoning and reasoning-oriented LLMs and across non-reasoning and reasoning tasks, we find: (i) a setting-dependent scaling effect, where increasing the number of CoT demonstrations is unstable for non-reasoning LLMs and benefits mainly reasoning-oriented LLMs; (ii) similarity-based retrieval helps on non-reasoning tasks but fails on reasoning, since semantic similarity poorly predicts procedural (i.e., CoT) compatibility; and (iii) an order-scaling effect, where performance variance grows with more CoT demonstrations. We interpret these behaviors by viewing many-shot CoT-ICL as in-context test-time learning rather than scaled pattern matching, and suggests 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 geometry 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.