Many-Shot In-Context Learning

大型语言模型(LLMs)在少量样本的上下文学习(ICL)方面表现出色——在推理时从上下文中提供少量示例进行学习,而不进行任何权重更新。新扩展的上下文窗口使我们能够研究具有数百或数千个示例的ICL——即众多示例的情况。从少量示例到众多示例,我们观察到在各种生成和判别任务中都有显着的性能提升。虽然有前途,但众多示例的ICL可能会受到人类生成示例的可用数量的限制。为了缓解这种限制,我们探索了两种新的设置:强化和无监督ICL。强化ICL使用模型生成的思维链理由代替人类示例。无监督ICL完全从提示中删除理由,并仅用特定于领域的问题提示模型。我们发现,无论是强化ICL还是无监督ICL,在众多示例的情况下都可以非常有效,特别是在复杂的推理任务上。最后,我们证明,与少量示例学习不同,众多示例学习在覆盖预训练偏差和学习具有数值输入的高维函数方面非常有效。我们的分析还揭示了下一个标记预测损失作为下游ICL性能指标的局限性。
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 and can learn high-dimensional functions with numerical inputs. Our analysis also reveals the limitations of next-token prediction loss as an indicator of downstream ICL performance.
许愿