One-shot prompting
One-shot prompting is a prompting technique that provides a language model with a single task-related example to guide its response.
Effective Conversational AI
One-shot prompting is the practice of providing a language model with one example demonstration in a prompt to guide its response.
- How it is used
- Guides language-model output when instructions alone fail to produce the desired utterance form or conversational summary.
- How deep it goes
- Defines shot counts and works through utterance-generation and summarization prompts, including mistakes and formatting sensitivity, without detailing model internals.
- Examples
- Uses a “Forgot password” fragment, store-location patterns transferred to password resets, and a claim-status conversation awaiting human handoff.
- What you can do after
- Practice/perform it by adding one representative demonstration, checking generated output against the task, and refining errors or speculation.
Read how Effective Conversational AI explains one-shot prompting →
LLMs in Production
One-shot prompting is a prompting technique that supplies exactly one example or instruction to guide a language model's performance on a task.
- How it is used
- Uses one carefully crafted demonstration or instruction to guide an LLM when multiple examples are costly or unavailable.
- How deep it goes
- Explains definition, diminishing returns, example bias, and pretrained-model rationale, but stops short of implementation code.
- Examples
- Uses sentiment classification and a father-and-son hospital riddle as demonstrations of bias and guided reasoning.
- What you can do after
- Apply one-shot prompting by selecting a precise demonstration and checking whether it unintentionally biases the requested output.
AI for Everyday IT
Single-shot prompting is a prompting technique that provides an AI model with one task-specific example before requesting an output.
- How it is used
- Guides AI responses by supplying one example within the spectrum of zero-shot, few-shot, and many-shot prompting.
- How deep it goes
- Defines the approach and demonstrates visual use with image-generation prompts rather than detailing model internals.
- Examples
- Uses a reference photo of a cat to request a dog image in the same artistic style.
- What you can do after
- Apply it with ChatGPT, Gemini, or Copilot by providing one reference image and requesting a related image in its style.
Understanding AI
One-shot prompting is a prompting technique in which a model receives one example before the task.
- How it is used
- Uses one example to clarify a task’s expected structure or style when instructions alone are difficult.
- How deep it goes
- Defines the technique and demonstrates its escalation from zero-shot to few-shot, without detailing model internals.
- Examples
- Demonstrates an electric-vehicle description guiding a hybrid-vehicle description in the same format.
- What you can do after
- Apply one-shot prompting by adding a representative example when a task’s format or style is hard to describe.
Also covered in
- Investing for Programmers
- AI Agents in Action
- AI Agents and Applications
- Transformers in Action
- The Complete Obsolete Guide to Generative AI
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.
- few-shot learningFew-shot learning is an approach in which a model is guided to perform or adapt to a task from only a small number of examples.
- prompt engineeringPrompt engineering is the deliberate design and refinement of inputs, instructions, and context to guide an AI model’s behavior or outputs.
Related concepts
- language modeluses · A language model is a computational model that represents patterns in linguistic sequences to assign probabilities, predict, generate, or evaluate language.
- prompt engineeringkind of · Prompt engineering is the deliberate design and refinement of inputs, instructions, and context to guide an AI model’s behavior or outputs.
- promptuses · 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.
- few-shot learningalternative to · Few-shot learning is an approach in which a model is guided to perform or adapt to a task from only a small number of examples.
- one-shot examplehas part · A one-shot example is a single input-output demonstration supplied to a model to guide its behavior on a task.
Questions about one-shot prompting
What is one-shot prompting?
One-shot prompting is a prompting technique that provides a language model with a single task-related example to guide its response.
Which Manning books explain one-shot prompting?
Effective Conversational AI, LLMs in Production, AI for Everyday IT and Understanding AI.
What should I know before learning one-shot prompting?
Manning books that teach one-shot prompting usually introduce language model, prompt, few-shot learning and prompt engineering first.
What is the difference between one-shot prompting and few-shot prompting?
One-shot prompting is a prompting technique that provides a language model with a single task-related example to guide its response. Few-shot prompting is a technique that provides a model with multiple examples to guide the form or content of its output.
What is one-shot prompting a kind of?
One-shot prompting is a kind of prompt engineering. Prompt engineering is the deliberate design and refinement of inputs, instructions, and context to guide an AI model’s behavior or outputs.
What are the parts of one-shot prompting?
One-shot prompting includes one-shot example.
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.



