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.
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.
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.
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.
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.
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
- Grokking AI Algorithms, Second Edition
- Math and Architectures of Deep Learning
- Prompt Engineering in Practice
- Build AI Drug Discovery PipelinesIn early access (MEAP)
- Interview Speak
- Enterprise RAGIn early access (MEAP)
- Deep Learning with Python, Third Edition
- Effective Conversational AI
- The Design of Web APIs, Second Edition
- Data Analysis with LLMs
- Building Specialized AI SystemsIn early access (MEAP)
- Deep Learning with PyTorch, Second Edition
What to know first
- language modelA language model is a computational model that represents patterns in linguistic sequences to assign probabilities, predict, generate, or evaluate language.
- promptA 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.
- accuracyAccuracy is the degree to which a result agrees with a specified truth, reference, or criterion, commonly measured as the proportion of evaluated predictions that are correct.
- foundation modelA foundation model is a broadly trained machine-learning model whose learned capabilities can be reused or adapted for a range of downstream tasks.
Related concepts
- promptpart of · 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.
- assistantuses · An assistant message is a role-labeled conversational message containing content generated by an AI assistant or language model.
- Retrieverused by · A retriever is a software component that searches or queries an information source and returns items relevant to a query for use by downstream processes.
- optimizerproduced by · An optimizer is an algorithm or procedure that adjusts model parameters or decisions to improve an objective.
- resulthas part · A result is an outcome, observation, or value produced or observed by an action, event, process, or evaluation.
- training datasetpart of · A training dataset is a collection of examples supplied to a learning procedure to fit or adapt a model’s parameters or behavior.
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.








