CLAILGMay 26, 2025

The Role of Diversity in In-Context Learning for Large Language Models

arXiv:2505.19426v25 citationsh-index: 1
Originality Incremental advance
AI Analysis

This addresses the problem of optimizing in-context learning for LLM users, but it is incremental as it builds on existing selection methods by exploring diversity.

The paper tackles the problem of in-context learning performance in large language models by investigating the role of diversity in example selection, finding that diversity-aware methods improve performance, especially on complex tasks like math and code, and enhance robustness to out-of-distribution queries.

In-context learning (ICL) is a crucial capability of current large language models (LLMs), where the selection of examples plays a key role in performance. While most existing approaches focus on selecting the most similar examples to the query, the impact of diversity in example selection remains underexplored. We systematically investigate the role of diversity in in-context example selection through experiments across a range of tasks, from sentiment classification to more challenging math and code problems. Experiments on Llama-3.1, Gemma-2, and Mistral-v0.3 families of models show that diversity-aware selection methods improve performance, particularly on complex tasks like math and code, and enhance robustness to out-of-distribution queries. To support these findings, we introduce a theoretical framework that explains the benefits of incorporating diversity in in-context example selection.

Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes