Cognition · Software component

Exemplar Selector

Software componentCognitionCognition & MemoryVariation point (abstract)arc:ExemplarSelector

An abstract component that chooses which demonstration examples from a demonstration pool are placed into a prompt, and in what order, for in-context learning.

Responsibility. Composes the demonstration block used for few-shot prompting.

Also known as: Demonstration selector, Few-shot example selector

is invoked byreadsis specialized byis specialized byis specialized byPrompt Context Builder: is invoked byPrompt Context BuilderPrompt Exemplar Set: readsPrompt Exemplar SetCluster-Diverse Exemplar Selector: is specialized byCluster-Diverse Exemplar…Similarity Exemplar Selector: is specialized bySimilarity Exemplar Sele…Coreset Exemplar Pre-selector: is specialized byCoreset Exemplar Pre-sel…
Direct neighbourhood (hover for relationship types)

Variants

VariantWhen to choose
Cluster-Diverse Exemplar SelectorChoose when demonstrations must cover diverse problem types and reasoning chains are to be generated automatically rather than written manually.
Coreset Exemplar Pre-selectorChoose when the demonstration pool is large or noisy and a compact core subset satisfying sufficiency and necessity is needed.
Similarity Exemplar SelectorChoose when accuracy gains justify per-query retrieval cost; computational cost becomes high on large demonstration pools.

Relationships

is invoked by dependency

reads dependency

Design guidance

Quantitative guidance

As stated by the sources; verify before use.

Classification

Patterns
Few-shot in-context learningRecency-aware orderingSimple-to-complex ordering
Quality attributes
Functional suitability: correctness and validity (ISO/IEC 25010 | NIST AI RMF: valid)Cost efficiencyPerformance efficiency (ISO/IEC 25010)
Risks mitigated
High variance from random demonstration selectionToken waste from excessive examplesRecency bias

Sources

  1. Ch3.5: T. Nguyen, "Prompt Optimization, Few-Shot Learning, Fine-Tuning," in Mastering Agentic AI Systems: Guide for the NVIDIA NCP-AAI Exam, 1st ed. 2026, ch. 3.5. ISBN: 9798244538229.