# Exemplar Selection

> Exemplar selection is the choice of which demonstrations to include in a few-shot prompt, commonly by retrieving the examples most semantically similar to the current input.

- Identifier: PTL-0019
- Category: Exemplars & In-Context Learning
- Canonical URL: https://protologue.com/t/exemplar-selection/
- Also known as: demonstration selection, dynamic few-shot, kNN prompting

## Description

Liu et al. showed that retrieving nearest-neighbor examples by embedding similarity outperformed random selection. Selection can also target diversity, difficulty, or the model's uncertainty, as in active prompting.

## Broader terms

- [Few-shot Prompting](https://protologue.com/t/few-shot-prompting/)

## Narrower terms

- [Active Prompting](https://protologue.com/t/active-prompting/)

## Related terms

- [Exemplar Ordering](https://protologue.com/t/exemplar-ordering/)
- [Retrieval-Augmented Generation](https://protologue.com/t/retrieval-augmented-generation/)

## Sources

- Liu et al. (2021). What Makes Good In-Context Examples for GPT-3?. https://arxiv.org/abs/2101.06804

## Cite this entry

Protologue. (2026). Exemplar Selection. In Protologue: A Taxonomy of Prompting and LLM Techniques (v1.0.0, PTL-0019). https://protologue.com/t/exemplar-selection/

License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)
