What Makes a Good Order of Examples in In-Context Learning

Qi Guo, Leiyu Wang, Yidong Wang, Wei Ye, Shikun Zhang


Abstract
Although large language models (LLMs) have demonstrated impressive few-shot learning capabilities via in-context learning (ICL), ICL performance is known to be highly sensitive to the order of examples provided. To identify appropriate orders, recent studies propose heuristic methods to evaluate order performance using a set of unlabeled data. However, the requirement of in-domain data limits their utility in real-world scenarios where additional annotated data is challenging to acquire. Additionally, these dataset-based approaches are prone to being sub-optimal for a lack of consideration for individual differences. To address the problems, we first analyze the properties of performant example orders at both corpus level and instance level. Based on the analysis we propose **DEmO** to adaptively identify performant example order for each instance without extra data. DEmO works by filtering out a subset of orders featuring label fairness, then selecting the most influential order for each test instance. The employment of a content-free metric makes DEmO independent of in-domain data. Extensive experiments indicate the superiority of DEmO over a wide range of strong baselines. Further analysis validates the generalizability across various settings.
Anthology ID:
2024.findings-acl.884
Volume:
Findings of the Association for Computational Linguistics: ACL 2024
Month:
August
Year:
2024
Address:
Bangkok, Thailand
Editors:
Lun-Wei Ku, Andre Martins, Vivek Srikumar
Venue:
Findings
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
14892–14904
Language:
URL:
https://aclanthology.org/2024.findings-acl.884
DOI:
10.18653/v1/2024.findings-acl.884
Bibkey:
Cite (ACL):
Qi Guo, Leiyu Wang, Yidong Wang, Wei Ye, and Shikun Zhang. 2024. What Makes a Good Order of Examples in In-Context Learning. In Findings of the Association for Computational Linguistics: ACL 2024, pages 14892–14904, Bangkok, Thailand. Association for Computational Linguistics.
Cite (Informal):
What Makes a Good Order of Examples in In-Context Learning (Guo et al., Findings 2024)
Copy Citation:
PDF:
https://aclanthology.org/2024.findings-acl.884.pdf