A chatbot builder may ask a language model for short customer utterances and get full sentences instead. Few-shot prompting adds a few examples to the prompt so the model can see the desired kind of response, not just read instructions about it. The examples can also show the format to follow. section 7.2.2 section 4.1.4
The number of examples gives the technique its name: zero-shot uses none, one-shot uses one, and few-shot uses a few. When an instruction to generate login-related fragments failed, adding “Forgot password” as an example helped produce fragments. A good example can be more effective than another rewrite of the instruction. section 7.2.2
Listing 7.10 Using a creative prompt to generate examples with a Granite model
<|instruction|> #1 Here are actual utterances submitted by customers to an #2 automated help desk. Your task is to create new #2 examples from people having problems with their #2 password and login ability. #2 <|example|> #3 I can't log in <|example|> My login information isn't working <|example|> Forgot password <|example|> Help me get into my account <|example|> #4 Hi there, I can't seem to login to my account #5
The prompt supplies several customer utterances about login trouble, then invites another example. It shows how demonstrations can carry the task without detailed formatting instructions. section 7.2.2
Examples can guide other conversational tasks, including summaries for a human-agent handoff. They do not guarantee accuracy: a summary can still speculate about why a user requested an agent. Check the result against the conversation, and make prompt sections clear when transcripts and examples might be confused. section 12.3.1
For intent-data work, compare an instructions-only prompt with one that includes examples. Review or refine generated utterances before using them, then measure whether they improve a chatbot’s accuracy. Trying the same prompt more than once with sampling can yield additional variations. section 7.2.4 section 7.4

















