Lune

ACL Findings2024

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

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

摘要

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. 1

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 9 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Hierarchical Demonstration Order Optimization for Many-shot In-Context Learning 引用了 Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivity
  • Eliminating Position Bias of Language Models: A Mechanistic Approach 引用了 Calibrate Before Use: Improving Few-shot Performance of Language Models
  • Disentangling Latent Shifts of In-Context Learning with Weak Supervision 引用了 Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivity
  • Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivity 引用了 True Few-Shot Learning with Language Models
  • Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivity 引用了 Calibrate Before Use: Improving Few-shot Performance of Language Models
  • An Explanation of In-context Learning as Implicit Bayesian Inference 引用了 Calibrate Before Use: Improving Few-shot Performance of Language Models
  • Mixture of In-Context Experts Enhance LLMs' Long Context Awareness 引用了 Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivity
  • True Few-Shot Learning with Language Models 引用了 Calibrate Before Use: Improving Few-shot Performance of Language Models
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper9

  1. Mixture of In-Context Experts Enhance LLMs' Long Context AwarenessHongzhan Lin, Ang Lv, Yuhan Chen, Chen Zhu 等NeurIPS 2024 · 25 次引用
  2. More is not always better? Enhancing Many-Shot In-Context Learning with Differentiated and Reweighting ObjectivesXiaoqing Zhang, Ang Lv, Yuhan Liu, Flood Sung 等ACL 2025 · 9 次引用
  3. Disentangling Latent Shifts of In-Context Learning with Weak SupervisionJosip Jukic, Jan SnajderNeurIPS 2025 · 3 次引用
  4. Hierarchical Demonstration Order Optimization for Many-shot In-Context LearningYinhan He, Wendy Zheng, Song Wang, Zaiyi Zheng 等NeurIPS 2025 · 2 次引用
  5. Eliminating Position Bias of Language Models: A Mechanistic ApproachZiqi Wang, Hanlin Zhang, Xiner Li, Kuan-Hao Huang 等ICLR 2025

它引用的 Paper12

  1. Calibrate Before Use: Improving Few-shot Performance of Language ModelsZihao Zhao, Eric Wallace, Shi Feng, Dan Klein 等ICML 2021 · 1,843 次引用
  2. Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order SensitivityYao Lu, Max Bartolo, Alastair Moore, Sebastian Riedel 等ACL 2022 · 1,494 次引用
  3. An Explanation of In-context Learning as Implicit Bayesian InferenceSang Michael Xie, Aditi Raghunathan, Percy Liang, Tengyu MaICLR 2022 · 1,030 次引用
  4. Transformers Learn In-Context by Gradient DescentJohannes von Oswald, Eyvind Niklasson, Ettore Randazzo, João Sacramento 等ICML 2023 · 729 次引用
  5. True Few-Shot Learning with Language ModelsEthan Perez, Douwe Kiela, Kyunghyun ChoNeurIPS 2021 · 547 次引用

相关 Paper

  1. What Makes a Good Order of Examples in In-Context LearningQi Guo, Leiyu Wang, Yidong Wang, Wei Ye 等ACL Findings 2024 · 8 次引用
  2. Batch Calibration: Rethinking Calibration for In-Context Learning and Prompt EngineeringHan Zhou, Xingchen Wan, Lev Proleev, Diana Mincu 等ICLR 2024 · 90 次引用
  3. OptiSeq: Ordering Examples On-The-Fly for In-Context LearningRahul Atul Bhope, Praveen Venkateswaran, K. R. Jayaram, Vatche Isahagian 等EMNLP Findings 2025 · 2 次引用
  4. Feature-Adaptive and Data-Scalable In-Context LearningJiahao Li, Quan Wang, Licheng Zhang, Guoqing Jin 等ACL 2024
  5. Rethinking Invariance in In-context LearningLizhe Fang, Yifei Wang, Khashayar Gatmiry, Lei Fang 等ICLR 2025
黄昏的海面,两侧是细线勾勒的悬崖