liveBook · Manning

Demonstration

Also called Few-shot examples, prompt-completion pair, question-answer pair

A demonstration is an example, often pairing an input with an output, that illustrates a task or desired behavior for training or guiding a model.

How 9 Manning books explain it

Building LLM Applications with DSPy

An input paired with an appropriate output to illustrate a task to a language model.

How it is used
Uses demonstrations to clarify language-model tasks and optimize prompts for intent classification.
How deep it goes
Explains selection, bootstrapping, multistep traces, and evaluation of candidate demonstration sets.
Examples
Illustrates customer intent classification and a two-step flight-query clarification and classification program.
What you can do after
Apply demonstrations via DSPy optimizers and compare candidate sets using an evaluation metric.

Read how Building LLM Applications with DSPy explains demonstration →

LLM Customization and Fine-Tuning

A data example consisting of an input prompt and its desired completion.

How it is used
Uses demonstrations to condition few-shot prompts and prompt–completion pairs to prepare fine-tuning data.
How deep it goes
Explains prompt structure, example-bank iteration, validation, and the cost of adding shots.
Examples
Uses labeled support tickets and an IT question–answer dataset to illustrate prompt and training examples.
What you can do after
Evaluate a demonstration bank against a zero-shot baseline using held-out accuracy, variability, and brittleness checks.

Read how LLM Customization and Fine-Tuning explains demonstration →

The Art of AI Product Development

A demonstration is an input-output example supplied in a prompt to illustrate the task and desired response format.

How it is used
Uses demonstrations in few-shot prompts to guide responses to new inputs or reproduce a desired style and structure.
How deep it goes
Defines input-output demonstrations and explains prompt placement, omitted inputs, and trade-offs in manual effort, token use, and context length.
Examples
Illustrates demonstrations with sentiment analysis and prior webinar announcements used to guide new content.
What you can do after
Apply demonstrations in few-shot prompts while weighing example quality, manual effort, and context limits.

Read how The Art of AI Product Development explains demonstration →

Grokking AI Applications

A sample output or input-output pair supplied in a prompt to demonstrate the desired response pattern.

How it is used
Clarifies the desired response pattern as one structural element of a prompt.
How deep it goes
Defines examples as a prompt element and indicates that supplying more can ease the task, without detailing their selection or formatting.
Examples
Points to an illustration linking more examples with an easier task.
What you can do after
Apply demonstrations by adding examples to a structured prompt to clarify the expected response.

Read how Grokking AI Applications explains demonstration →

Context Engineering

A demonstration supplied in a model's context to guide its response to a task.

How it is used
Guides model responses by placing desired input-output patterns in system or user prompts.
How deep it goes
Explains few-shot inference and dynamic example retrieval, including token-budget and caching trade-offs.
Examples
Uses capital-city question-answer pairs and labeled bug reports normalized into JSON support tickets.
What you can do after
Apply few-shot prompting to guide transformations and select relevant demonstrations within a context budget.

Read how Context Engineering explains demonstration →

Data Without Labels

A single historical data record containing input variables and its corresponding target value.

How it is used
Frames each labeled historical record as an input-target unit for supervised prediction.
How deep it goes
Defines record structure and predictive purpose but stops short of data preparation or model-training procedures.
Examples
Uses telecom customer records and a height-weight dataset to illustrate labeled inputs and outcomes.
What you can do after
Evaluate whether a historical record contains the inputs and target required for supervised prediction.

Read how Data Without Labels explains demonstration →

Coding with AI

An illustrative input or output included in a prompt to show an artificial-intelligence model the desired result or format.

How it is used
Uses examples as one ingredient in prompt engineering, alongside context and clear instructions.
How deep it goes
Identifies examples as a prompt ingredient alongside context and instructions.
What you can do after
Apply it by including examples alongside relevant context and clear instructions in prompts.

Read how Coding with AI explains demonstration →

Building Reliable AI Systems

An example included in a prompt to demonstrate desired model behavior.

How it is used
Uses prompt examples to communicate expected behavior, response style, and format when instructions alone may be insufficient.
How deep it goes
Explains single-example generalization and multiple-example adaptation, but does not detail example selection or evaluation procedures.
Examples
Uses invented fribble/blicket vocabulary and cozzy/gliders product queries to show pattern transfer and chatbot responses.
What you can do after
Apply few-shot prompting with examples to improve performance on new concepts and specific task formats.

Read how Building Reliable AI Systems explains demonstration →

LLM Evaluation and Alignment, The Foundational Ideas

A demonstration is a training example showing a model how to respond in a particular situation or case.

How it is used
Uses training examples to teach aligned responses during alignment fine-tuning.
How deep it goes
Defines demonstrations and diagnoses their limits, but stops short of specifying how to author or curate them.
Examples
Uses critique-revised demonstrations and evaluates generalization on prompts not directly covered by demonstration data.
What you can do after
Evaluate whether demonstrations teach underlying principles rather than merely reproducing familiar response patterns.

Read how LLM Evaluation and Alignment, The Foundational Ideas explains demonstration →

Also covered in

What to know first

Related concepts

Questions about demonstration

What is demonstration?

A demonstration is an example, often pairing an input with an output, that illustrates a task or desired behavior for training or guiding a model.

Which Manning books explain demonstration?

Building LLM Applications with DSPy, LLM Customization and Fine-Tuning, The Art of AI Product Development, Grokking AI Applications, Context Engineering, Data Without Labels, Coding with AI, Building Reliable AI Systems and 1 more.

What should I know before learning demonstration?

Manning books that teach demonstration usually introduce language model, prompt, accuracy and foundation model first.

What is demonstration part of?

Demonstration is part of prompt. A prompt is text or other input supplied to an AI model to provide instructions, context, or other information that guides its response or generated output.

What are the parts of demonstration?

Demonstration includes result.

What is demonstration also called?

Demonstration is also called Few-shot examples, prompt-completion pair or question-answer pair.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.