liveBook · Manning

One-shot prompting

As explained in 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.

Suppose you ask a language model for short customer utterances about login problems, but it keeps writing full sentences. Adding more instructions may not help. A single example—“Forgot password”—shows the shape of the answer you want. section 7.2.2

One-shot prompting puts one demonstration in the prompt to guide the model’s next response. The “shot” is the example: zero-shot provides none, one-shot provides one, and few-shot provides several. An example can convey a format or grammatical pattern more clearly than instructions alone. section 7.2.2

Generate a different kind of utterance

To generate login-related sentence fragments, request fragments and give “Forgot password” as the first item. The model can then continue with phrases such as “Unable to login” and “Account locked out.” The example demonstrates what counts as a fragment; it does not guarantee that every generated item will fit the intent. section 7.2.2

Guide a handoff summary

A chatbot handoff needs a brief account of why the user requested a representative. Instructions alone produced a speculative claim-denial summary even though the conversation said the claim was paid. A one-shot prompt pairs a sample transcript with a suitable summary, then supplies the transcript to summarize. Check the result against the conversation: the example improved its structure but did not eliminate speculation. section 12.3.1

Choose an example that matches the output you need, then inspect the result for accuracy and usefulness. Prompt formatting can matter: the summarization example needed distinct markers to separate instructions, transcripts, and summaries. For generated intent data, refine unsuitable outputs rather than assuming the first response is ready to use. section 12.3.1 section 7.4

How Effective Conversational AI covers it

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 it assumes
Defines shot counts from zero while assuming basic familiarity with prompts, language models, and customer utterances.
What you can do after
Practice/perform it by adding one representative demonstration, checking generated output against the task, and refining errors or speculation.
How it connects
Connects prompt engineering with zero-shot prompting, few-shot prompting, intent training data, and conversational summarization.

Also explained in

Compare how 3 books explain one-shot prompting →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Effective Conversational AI. The section links point to the parts of the book it draws on.