AI engineering glossary · Prompt context engineering
What is dynamic few-shot selection?
Dynamic few-shot selection (also called Example selection, Dynamic few-shot prompting): Choosing the examples for a prompt at request time from a larger bank, usually by finding the ones most similar to the current input using embeddings. It gives the model relevant demonstrations instead of a fixed set, which often improves accuracy on varied inputs at the cost of extra retrieval.
Dynamic few-shot selection: an example
A bank of 500 labelled complaints is searched for the 4 closest to the new complaint, and those four are placed in the prompt.
Related terms
More Prompt context engineering terms
- Few-shot chain-of-thought
- Few-shot prompting
- Frequency penalty
- Function calling
- GBNF grammar
- Generated knowledge prompting
- Grammar-constrained decoding
- Grounding
Where you learn it
Dynamic few-shot selection is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.