cs.CLNov 5, 2024

Mixtures of In-Context Learners

Authors: Giwon Hong, Emile van Krieken, Edoardo Ponti, Esmeralda S. Whitammer, Pasquale Minervini

Organizations: University of Edinburgh, United Kingdom · Miniml.AI, United Kingdom

Abstract

In-context learning (ICL) adapts LLMs by providing demonstrations without fine-tuning the model parameters; however, it does not differentiate between demonstrations and quadratically increases the complexity of Transformer LLMs, exhausting the memory. As a solution, we propose Mixtures of In-Context Learners (MoICL), a novel approach to treat subsets of demonstrations as experts and learn a weighting function to merge their output distributions based on a training set. In our experiments, we show performance improvements on 5 out of 7 classification datasets compared to a set of strong baselines (up to +13% compared to ICL and LENS). Moreover, we enhance the Pareto frontier of ICL by reducing the inference time needed to achieve the same performance with fewer demonstrations. Finally, MoICL is more robust to out-of-domain (up to +11%), imbalanced (up to +49%), or noisy demonstrations (up to +38%) or can filter these out from datasets. Overall, MoICL is a more expressive approach to learning from demonstrations without exhausting the context window or memory.

Explore similar work

CardsList
  1. Data Efficient Sample Selection for In-Context Learning

    Sep 6, 2026V Venktesh, Cem Levi, Avishek AnandIn-Context Example SelectionIn-Context Learning

  2. Demonstrations, CoT, and Prompting: A Theoretical Analysis of ICL

    Mar 20, 2026Xuhan Tong, Yuchen Zeng, Jiawei ZhangDemonstration SelectionIn-Context Learning

  3. A Theoretical Interpretation of In-Context Learning via Probabilistic Modeling

    Jun 27, 2026Zhenyu Liu, Huaze Tang, Shao-Lun HuangProbabilistic ModelingIn-Context Learning