Many-Shot In-Context Learning

📄 arXiv: 2404.11018v3 📥 PDF

作者: Rishabh Agarwal, Avi Singh, Lei M. Zhang, Bernd Bohnet, Luis Rosias, Stephanie Chan, Biao Zhang, Ankesh Anand, Zaheer Abbas, Azade Nova, John D. Co-Reyes, Eric Chu, Feryal Behbahani, Aleksandra Faust, Hugo Larochelle

分类: cs.LG, cs.AI, cs.CL

发布日期: 2024-04-17 (更新: 2024-10-17)

备注: NeurIPS (Spotlight)


💡 一句话要点

提出多样化的上下文学习方法以提升生成与判别任务性能

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

关键词: 上下文学习 多示例学习 强化学习 无监督学习 复杂推理 语言模型 生成任务 判别任务

📋 核心要点

  1. 现有的少量示例学习方法在处理复杂任务时受到人类生成示例数量的限制,难以充分发挥模型能力。
  2. 论文提出了强化ICL和无监督ICL两种新方法,前者利用模型生成的推理链,后者则仅依赖领域特定问题进行学习。
  3. 实验结果显示,多示例ICL在多种任务中显著提升性能,尤其在复杂推理任务上表现突出,且推理成本可控。

📝 摘要(中文)

大型语言模型(LLMs)在少量示例的上下文学习(ICL)中表现优异。随着上下文窗口的扩展,本文探讨了多示例(many-shot)ICL的潜力,发现其在多种生成和判别任务中显著提升性能。为了解决人类生成示例的限制,提出了强化和无监督ICL两种新设置,前者使用模型生成的推理链替代人类示例,后者则仅用领域特定问题进行提示。研究表明,这两种方法在复杂推理任务中表现良好,并且多示例学习能够有效克服预训练偏见,学习高维函数,且其推理成本呈线性增长。最后,分析显示下一步预测损失并不能有效指示下游ICL性能。

🔬 方法详解

问题定义:本文旨在解决多示例上下文学习(many-shot ICL)中人类生成示例数量不足的问题。现有方法在复杂任务中难以充分利用模型的潜力,限制了性能提升。

核心思路:论文提出了两种新方法:强化ICL和无监督ICL。强化ICL通过模型生成的推理链替代人类示例,无监督ICL则完全去除推理链,仅用领域特定问题进行提示。这种设计旨在减少对人类示例的依赖,同时提高模型在复杂任务中的表现。

技术框架:整体架构包括两个主要模块:一是生成推理链的强化ICL模块,二是仅依赖问题提示的无监督ICL模块。模型通过这两种方式进行训练和推理,适应不同的任务需求。

关键创新:最重要的创新在于提出了强化和无监督ICL两种新设置,显著提升了多示例学习的效果,尤其是在复杂推理任务中表现优于传统的少量示例学习。

关键设计:在实验中,模型的推理链生成采用了特定的参数设置,损失函数设计考虑了多示例学习的特点,确保了模型在高维输入下的有效学习。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果表明,采用多示例ICL方法在复杂推理任务中性能显著提升,尤其是在与传统少量示例学习相比时,表现出更强的学习能力和更低的推理成本,推理成本呈线性增长,且在不同的前沿LLMs中效果各异。

🎯 应用场景

该研究的潜在应用领域包括自然语言处理、智能问答系统和复杂推理任务等。通过提升多示例学习的能力,模型能够在实际应用中更好地处理复杂问题,具有重要的实际价值和未来影响。

📄 摘要(原文)

Large language models (LLMs) excel at few-shot in-context learning (ICL) -- learning from a few examples provided in context at inference, without any weight updates. Newly expanded context windows allow us to investigate ICL with hundreds or thousands of examples -- the many-shot regime. Going from few-shot to many-shot, we observe significant performance gains across a wide variety of generative and discriminative tasks. While promising, many-shot ICL can be bottlenecked by the available amount of human-generated examples. To mitigate this limitation, we explore two new settings: Reinforced and Unsupervised ICL. Reinforced ICL uses model-generated chain-of-thought rationales in place of human examples. Unsupervised ICL removes rationales from the prompt altogether, and prompts the model only with domain-specific questions. We find that both Reinforced and Unsupervised ICL can be quite effective in the many-shot regime, particularly on complex reasoning tasks. Finally, we demonstrate that, unlike few-shot learning, many-shot learning is effective at overriding pretraining biases, can learn high-dimensional functions with numerical inputs, and performs comparably to fine-tuning. We also find that inference cost increases linearly in the many-shot regime, and frontier LLMs benefit from many-shot ICL to varying degrees. Our analysis also reveals the limitations of next-token prediction loss as an indicator of downstream ICL performance.