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.

Level: advancedTopic: Prompt context engineering

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

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.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.