[论文解读] In-Context Learning with Many Demonstration Examples
本文提出EvaLM,一种基于高效Transformer架构的长序列语言模型,通过循环位置嵌入和增量编码技术,支持高达256k上下文长度。该模型在大量演示样本的上下文学习中表现出高性能,相比同类模型平均准确率提升4.1%,且因高效的推理与外推技术,计算开销极低。
Large pre-training language models (PLMs) have shown promising in-context learning abilities. However, due to the backbone transformer architecture, existing PLMs are bottlenecked by the memory and computational cost when scaling up to a large context size, leaving instruction tuning and in-context learning of many demonstration examples, as well as long-range language modeling under-explored. In this study, we propose a long-range language model EVALM based on an efficient transformer mechanism. EVALM is trained with 8k tokens per batch line and can test up to 256k-lengthed contexts with extrapolation, 128 times to the limit of existing PLMs (e.g. GPT3). Based on EVALM, we scale up the size of examples efficiently in both instruction tuning and in-context learning to explore the boundary of the benefits from more annotated data. Experimental results on a diverse set of tasks show that EVALM achieves 4.1% higher accuracy on average, and the average length of achieving the best accuracy score over tasks is around 12k. We find that in-context learning can achieve higher performance with more demonstrations under many-shot instruction tuning (8k), and further extending the length of instructions (16k) can further improve the upper bound of scaling in-context learning.
研究动机与目标
- 解决标准Transformer架构在长上下文上下文学习(ICL)中导致的计算与内存瓶颈问题。
- 探索在增加演示样本数量时,上下文学习性能的极限。
- 通过轻量化、可扩展的语言模型,实现高效且可外推的长上下文建模,适用于指令微调与ICL。
- 探究增加样本数与指令长度是否能提升长上下文场景下的ICL性能。
提出的方法
- 使用改进的高效Transformer机制(EVA)对EvaLM进行预训练,以支持位置嵌入的外推能力。
- 引入循环位置嵌入,使模型能泛化至训练序列长度之外的更长上下文。
- 采用增量编码技术,缓存并重用演示样本的编码表示,减少推理过程中的冗余计算。
- 使用最多8k-shot的多示例指令微调(MSIT)对模型进行微调,以增强上下文学习性能。
- 在10个不同NLP任务上开展实验,采用多种提示策略,评估模型的可扩展性与有效性。
- 通过训练FLOPs与推理时间衡量效率,并与OPT及其他基线模型进行比较。

实验结果
研究问题
- RQ1在少样本设置之外显著增加演示样本数量,是否能显著提升上下文学习性能?
- RQ2在长上下文场景中,增加指令长度如何影响多示例指令微调带来的性能增益?
- RQ3高效注意力机制与外推技术在多大程度上能够实现预训练语言模型的长上下文建模?
- RQ4在使用多示例演示扩展上下文学习时,其计算成本如何?是否能够实现高效处理?
主要发现
- 在采用多示例指令微调时,EvaLM在10个不同NLP任务上的平均准确率比同类模型(如OPT)高出4.1%。
- 达到各任务峰值准确率所需的平均输入长度约为12k token,表明性能增益在规模扩大时才显现。
- 多示例指令微调显著提升了上下文学习性能,尤其在结合更长指令(最长达16k token)时效果更为明显。
- 通过增量编码与缓存机制,从少样本到多示例ICL的计算开销极低,使其在长上下文推理中具有实际可行性。
- EvaLM利用循环位置嵌入成功外推至256k长度的上下文,实现比现有模型(如GPT-3,2048 token)长128倍的上下文长度。
- 实验表明,增加样本数带来的性能增益并非无限,存在边际收益递减的饱和点。

更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。