liveBook · Manning

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.

How 3 Manning books explain it

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.

Read how LLMs in Production explains one-shot prompting →

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 task-specific example that clarifies the desired pattern, style, setting, or characteristics.
How deep it goes
Defines the technique and demonstrates text-to-image and image-based applications, but does not explain model internals.
Examples
Uses a Van Gogh-style cat image, an uploaded cat image, and a request for a matching dog image.
What you can do after
Apply one-shot prompting to guide image generation toward a specified subject, setting, style, or design pattern.

Read how AI for Everyday IT explains one-shot prompting →

Related concepts

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.