arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2401.06469cs.LGcs.CL
收藏

Batch-ICL:有效、高效且顺序无关的上下文学习

Batch-ICL: Effective, Efficient, and Order-Agnostic In-Context Learning

Gaoling School of Artificial Intelligence, Renmin University of China(中国人民大学高瓴人工智能学院);Ant Group(蚂蚁集团)

Kaiyi Zhang, Ang Lv, Yuhan Chen, Hansen Ha, Tao Xu, Rui Yan

AI总结:

本文将上下文学习视为元优化过程,解释了LLM对示例顺序敏感的原因,并提出Batch-ICL算法,通过聚合N个独立1-shot前向计算的元梯度至零样本查询,实现顺序无关且高效推理,其变体还能进一步提升性能。

摘要:

在本文中,通过将上下文学习(ICL)视为一个元优化过程,我们解释了为什么LLM对ICL示例的顺序敏感。这一理解促使我们开发了Batch-ICL,一种用于ICL的有效、高效且顺序无关的推理算法。与标准的N-shot学习方法不同,Batch-ICL采用$N$个独立的1-shot前向计算,并聚合产生的元梯度。然后,这些聚合的元梯度被应用于零样本查询的前向计算,以生成最终预测。这种批处理方法使LLM对ICL示例的顺序不敏感。通过广泛的实验和分析,我们证明Batch-ICL持续优于大多数ICL示例排列。在某些情况下,它甚至超过了标准ICL最佳顺序的性能,同时减少了所需的计算资源。此外,我们开发了Batch-ICL的一个新变体,具有多个元优化“epochs”。该变体隐式探索ICL示例的排列,进一步增强ICL性能。

英文摘要:

In this paper, by treating in-context learning (ICL) as a meta-optimization process, we explain why LLMs are sensitive to the order of ICL examples. This understanding leads us to the development of Batch-ICL, an effective, efficient, and order-agnostic inference algorithm for ICL. Differing from the standard N-shot learning approach, Batch-ICL employs $N$ separate 1-shot forward computations and aggregates the resulting meta-gradients. These aggregated meta-gradients are then applied to the forward computation of a zero-shot query to generate the final prediction. This batch processing approach renders the LLM agnostic to the order of ICL examples. Through extensive experiments and analysis, we demonstrate that Batch-ICL consistently outperforms most permutations of ICL examples. In some cases, it even exceeds the performance of the best order for standard ICL, all while reducing the computational resources required. Furthermore, we develop a novel variant of Batch-ICL featuring multiple "epochs" of meta-optimization. This variant implicitly explores permutations of ICL examples, further enhancing ICL performance.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑