# In-Context Example Ordering Guided by Label Distributions

Source: [In-Context Example Ordering Guided by Label Distributions](<https://www.sota2.com/research/paper/68fa723a1e209131cea55180>)

Collection index: [llms.txt](<https://www.sota2.com/research/llms.txt>)

Data updated: 2025-10-26T02:21:13.235Z

Authors: Zhichao Xu, Daniel Cohen, Bei Wang, Vivek Srikumar

Published: 2024-02-18T04:08:10.000Z

## Abstract

By allowing models to predict without task-specific training, in-context learning (ICL) with pretrained LLMs has enormous potential in NLP. However, a number of problems persist in ICL. In particular, its performance is sensitive to the choice and order of in-context examples. Given the same set of in-context examples with different orderings, model performance may vary between near random to near state-of-the-art. In this work, we formulate in-context example ordering as an optimization problem. We examine three problem settings that differ in the assumptions they make about what is known about the task. Inspired by the idea of learning from label proportions, we propose two principles for in-context example ordering guided by model's probability predictions. We apply our proposed principles to thirteen text classification datasets and nine different autoregressive LLMs with 700M to 13B parameters. We demonstrate that our approach outperforms the baselines by improving the classification accuracy, reducing model miscalibration, and also by selecting better in-context examples.

## Recorded benchmark results

A research result applies to its stated dataset, split, metric and evaluation configuration. Compare like-for-like settings, preserve the metric's unit and direction, and distinguish paper-reported results from independent reproduction. The best result recorded here is not a claim of exhaustive, current global coverage.

- [Text Classification on MR (test)](<https://www.sota2.com/research/sota/text-classification-on-mr-test.md>): Text Classification; MR (test); Accuracy: 91.87.

## Original sources and implementation

[Original paper](<https://arxiv.org/abs/2402.11447>)

[PDF](<https://arxiv.org/pdf/2402.11447.pdf>)
