General Quality Evaluation Metric Towards Demonstrations for In-Context Learning

Huazheng Wang, Jinming Wu, Haifeng Sun, Z. Cedric Xia, Daixuan Cheng, Jingyu Wang, Qi Qi, Jianxin LiaoIEEE Transactions on Audio Speech and Language Processing 2025

Abstract

Recently, Large Language Models (LLMs) have demonstrated strong capabilities to perform multiple tasks through in-context learning (ICL), which is a new paradigm allowing LLMs to learn by observing a few demonstrations. Previous studies have revealed that ICL is highly variable to a range of factors, such as the quality, the quantity and the order of the demonstrations. Though they conduct qualitative analyses, they still lack comprehensive quantitative analyses to evaluate the quality of demonstrations. Previous studies assume that demonstrations exhibiting high similarity to the test query indicate high quality. We argue that high-quality demonstrations should also align with the preferences of the inference model. However, there lacks a comprehensive method to define how good a demonstration is to the inference model. Aiming at this, we propose a <sc xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">G</small>eneral quality <sc xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">E</small>valuation <sc xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">M</small>etric of demonstrations to the inference model for <sc xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">I</small>n-<sc xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">C</small>ontext learning, named <sc xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">Gemic</small>, without any human-annotation or extra training cost. To verify the effectiveness of <sc xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">Gemic</small>, we take demonstration retrieval task as an illustrative case. Experiments are conducted on a variety of datasets under different LLMs with multiple scales. The results with a relative improvement of up to 56.7% highlight the effectiveness of <sc xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">Gemic</small>.
BibTeX
@article{wang2025general,
  author = {Huazheng Wang and Jinming Wu and Haifeng Sun and Z. Cedric Xia and Daixuan Cheng and Jingyu Wang and Qi Qi and Jianxin Liao},
  title = {{General Quality Evaluation Metric Towards Demonstrations for In-Context Learning}},
  journal = {IEEE Transactions on Audio Speech and Language Processing},
  year = {2025},
  doi = {10.1109/taslpro.2025.3606230},
}

Loading related content...

Figure