Batch-ICL: Effective, Efficient, and Order-Agnostic In-Context Learning
Not on the map. Why?
Abstract (arXiv)
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.
Key facts. Cited by 20 papers in the map (data through 7 Oct 2026). Builds on 21 of its 31 references that are in the map. First posted on arXiv 12 Jan 2024.
Builds on
21 of 31 references.
References · 21
- 2017Attention Is All You Needcited by 59,932
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
- 2018GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understandingcited by 4,854
- 2015Character-level Convolutional Networks for Text Classificationcited by 2,293
- 2019SuperGLUE: A Stickier Benchmark for General-Purpose Language Understanding Systemscited by 1,718
- 2021Calibrate Before Use: Improving Few-Shot Performance of Language Modelscited by 1,371
- 2022Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 smallcited by 1,130
- 2021Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivitycited by 1,122
- 2022In-context Learning and Induction Headscited by 930
- 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 915
- 2022Transformers learn in-context by gradient descentcited by 714
9 more
- 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 671
- 2021True Few-Shot Learning with Language Modelscited by 343
- 2023In-Context Learning Creates Task Vectorscited by 302
- 2023Function Vectors in Large Language Modelscited by 292
- 2023Label Words are Anchors: An Information Flow Perspective for Understanding In-Context Learningcited by 235
- 2023Transformers as Algorithms: Generalization and Stability in In-context Learningcited by 220
- 2022Parallel Context Windows for Large Language Modelscited by 81
- 2022The Dual Form of Neural Networks Revisited: Connecting Test Time Predictions to Training Patterns via Spotlights of Attentioncited by 45
- 2023Towards Understanding How Transformers Learn In-context Through a Representation Learning Lenscited by 15
Built on by
Citing papers per year: 2024: 9; 2025: 7; 2026: 4.
20 papers.
Sort:
By area:
- 2024Eliminating Position Bias of Language Models: A Mechanistic Approachcited by 61
- 2024From Skepticism to Acceptance: Simulating the Attitude Dynamics Toward Fake Newscited by 51
- 2025StepHint: Multi-level Stepwise Hints Enhance Reinforcement Learning to Reasoncited by 37
- 2024Finding Visual Task Vectorscited by 24
- 2024Order Matters: Exploring Order Sensitivity in Multimodal Large Language Modelscited by 19
- 2024Mixture of In-Context Experts Enhance LLMs' Long Context Awarenesscited by 17
- 2025More is not always better? Enhancing Many-Shot In-Context Learning with Differentiated and Reweighting Objectivescited by 12
- 2025Rethinking Invariance in In-context Learningcited by 8
- 2025OptiSeq: Ordering Examples On-The-Fly for In-Context Learningcited by 6
- 2024Language Models "Grok" to Copycited by 5
- 2025ReFeed: Multi-dimensional Summarization Refinement with Reflective Reasoning on Feedbackcited by 4
- 2025Adaptive Task Vectors for Large Language Modelscited by 4
8 more
- 2025Hearing the Order: Investigating Position Bias in Large Audio-Language Modelscited by 4
- 2024Disentangling Latent Shifts of In-Context Learning with Weak Supervisioncited by 3
- 2024MILE: A Mutation Testing Framework of In-Context Learning Systemscited by 2
- 2026PLR: Plackett-Luce for Reordering In-Context Learning Examplescited by 1
- 2026Easier to Judge than to Find: Predicting In-Context Learning Success for Demonstration Selectioncited by 1
- 2024Distributed In-Context Learning under Non-IID Among Clientscited by 0
- 2026Self-Improving In-Context Learningcited by 0
- 2026Efficient Task Adaptation in Large Language Models: A Survey of Weight-Based, Prompt-Based, and Embedding-Based Adaptationscited by 0
- 2026Efficient Task Adaptation in Large Language Models: A Survey of Weight-Based, Prompt-Based, and Embedding-Based Adaptations1 Oct 2026
- 2026Self-Improving In-Context Learning22 May 2026
- 2026Easier to Judge than to Find: Predicting In-Context Learning Success for Demonstration Selection18 May 2026
- 2026PLR: Plackett-Luce for Reordering In-Context Learning Examples22 Mar 2026
- 2025Hearing the Order: Investigating Position Bias in Large Audio-Language Models1 Oct 2025
- 2025StepHint: Multi-level Stepwise Hints Enhance Reinforcement Learning to Reason3 Jul 2025
- 2025Adaptive Task Vectors for Large Language Models3 Jun 2025
- 2025Rethinking Invariance in In-context Learning8 May 2025
- 2025ReFeed: Multi-dimensional Summarization Refinement with Reflective Reasoning on Feedback27 Mar 2025
- 2025OptiSeq: Ordering Examples On-The-Fly for In-Context Learning25 Jan 2025
- 2025More is not always better? Enhancing Many-Shot In-Context Learning with Differentiated and Reweighting Objectives7 Jan 2025
- 2024Order Matters: Exploring Order Sensitivity in Multimodal Large Language Models22 Oct 2024
8 more
- 2024Disentangling Latent Shifts of In-Context Learning with Weak Supervision2 Oct 2024
- 2024Language Models "Grok" to Copy14 Sep 2024
- 2024MILE: A Mutation Testing Framework of In-Context Learning Systems7 Sep 2024
- 2024Distributed In-Context Learning under Non-IID Among Clients31 Jul 2024
- 2024Eliminating Position Bias of Language Models: A Mechanistic Approach1 Jul 2024
- 2024Mixture of In-Context Experts Enhance LLMs' Long Context Awareness28 Jun 2024
- 2024Finding Visual Task Vectors8 Apr 2024
- 2024From Skepticism to Acceptance: Simulating the Attitude Dynamics Toward Fake News14 Mar 2024
- 2024Language Models "Grok" to Copycited by 5
- 2024Language Models "Grok" to Copy14 Sep 2024
- 2024Eliminating Position Bias of Language Models: A Mechanistic Approachcited by 61
- 2024From Skepticism to Acceptance: Simulating the Attitude Dynamics Toward Fake Newscited by 51
- 2024Finding Visual Task Vectorscited by 24
- 2024Mixture of In-Context Experts Enhance LLMs' Long Context Awarenesscited by 17
- 2025More is not always better? Enhancing Many-Shot In-Context Learning with Differentiated and Reweighting Objectivescited by 12
- 2025ReFeed: Multi-dimensional Summarization Refinement with Reflective Reasoning on Feedbackcited by 4
- 2025Adaptive Task Vectors for Large Language Modelscited by 4
- 2025Hearing the Order: Investigating Position Bias in Large Audio-Language Modelscited by 4
- 2024Disentangling Latent Shifts of In-Context Learning with Weak Supervisioncited by 3
- 2024MILE: A Mutation Testing Framework of In-Context Learning Systemscited by 2
- 2026PLR: Plackett-Luce for Reordering In-Context Learning Examplescited by 1
- 2026Easier to Judge than to Find: Predicting In-Context Learning Success for Demonstration Selectioncited by 1
12 most cited of 15 All 15 (JSON)
- 2026Efficient Task Adaptation in Large Language Models: A Survey of Weight-Based, Prompt-Based, and Embedding-Based Adaptations1 Oct 2026
- 2026Self-Improving In-Context Learning22 May 2026
- 2026Easier to Judge than to Find: Predicting In-Context Learning Success for Demonstration Selection18 May 2026
- 2026PLR: Plackett-Luce for Reordering In-Context Learning Examples22 Mar 2026
- 2025Hearing the Order: Investigating Position Bias in Large Audio-Language Models1 Oct 2025
- 2025Adaptive Task Vectors for Large Language Models3 Jun 2025
- 2025ReFeed: Multi-dimensional Summarization Refinement with Reflective Reasoning on Feedback27 Mar 2025
- 2025More is not always better? Enhancing Many-Shot In-Context Learning with Differentiated and Reweighting Objectives7 Jan 2025
- 2024Disentangling Latent Shifts of In-Context Learning with Weak Supervision2 Oct 2024
- 2024MILE: A Mutation Testing Framework of In-Context Learning Systems7 Sep 2024
- 2024Distributed In-Context Learning under Non-IID Among Clients31 Jul 2024
- 2024Eliminating Position Bias of Language Models: A Mechanistic Approach1 Jul 2024
12 newest of 15 All 15 (JSON)