Few-shot prompting means showing the AI two to five examples of what you want before asking for the real thing, which is the most reliable way to keep ebook chapters consistent in structure and voice. Descriptions like "friendly but authoritative" are open to interpretation. An example is not.
This guide explains where the technique came from, how many examples to use, how to format them, a full chapter-prompt template, and the failure modes to watch for.
What is few-shot prompting and where did it come from?
It's putting worked examples in the prompt so the model infers the pattern. The idea was demonstrated at scale in "Language Models are Few-Shot Learners" (Brown et al., 2020), which showed that a 175-billion-parameter model could perform many tasks given just instructions and a few demonstrations in the text, with no gradient updates or fine-tuning. Modern assistants are far more capable, but the vendors still lean on the technique:
| Source | What it says about examples |
|---|---|
| Anthropic (Claude docs) | Recommends 3-5 examples that are relevant, varied and clearly marked (often with XML tags) |
| Google (Gemini docs) | "Always include few-shot examples"; use specific, varied ones; too many can cause overfitting; keep formatting consistent; with clear examples you can remove instructions |
| OpenAI (developer guide) | Lists Examples as a standard section of a developer message, after Identity and Instructions |
For authors the benefit is practical. Chapter 7 should read like Chapter 2. If you describe the style in words, the model reinterprets it each time. If you show it, the interpretation is pinned. That's why it appears in our guide on how long a prompt should be as one of the few "extras" worth the length.
How many examples should I use?
Two or three to start, five at most, and each one should be different from the others. Here's how the options compare in practice (the right-hand column is my own guidance, not a measured result):
| Setup | Typical effect | When to use |
|---|---|---|
| Zero-shot (instructions only) | Model chooses its own style | Quick brainstorms |
| One example | Strong copying of that example's shape and phrases | Fixed templates, such as a "Key takeaways" box |
| Two to three examples | Pattern emerges; less word-for-word copying | Most chapter work |
| Four to five examples | Stable on tricky styles | Voice-heavy writing; mixed formats |
| Many (6+) | Risk of overfitting; long prompt | Rarely worth it for prose |
"Varied" matters. Three examples that all open with a question teach the model that chapters open with a question. Choose examples that differ in topic and length but share the features you want to keep (structure, voice, level of detail).
How should I format the examples?
Make them identical in structure, and label them. Google's guide stresses consistent structure, XML tags, white space, newlines and splitters across examples, because the examples teach the output format. This is more than tidiness. In "Quantifying Language Models' Sensitivity to Spurious Features in Prompt Design" (Sclar et al., 2023), changing nothing but the format of a few-shot prompt moved accuracy by up to 76 points on one setup. Your chapters are not a benchmark, but the lesson carries over: sloppy formatting in the examples produces sloppy variance in the output.
<example>
<input>Chapter topic: Why the first week matters
Reader: first-time freelancers
<output>
Title: Why the First Week Matters
Opening: [2-sentence scene]
Body: [3 short sections, each starting with a bold takeaway]
Try this: [one 5-minute action]
</output>
</example>
Keep the tags, the field names and the line breaks exactly the same in every example. Then add the real request in the same shape, with the output left blank.
What does a full few-shot chapter prompt look like?
It has five parts: instruction, examples, anti-copy rule, material, and the request.
You write chapters for a practical guide. Match the structure and voice of the examples. Do not reuse their wording, topics or anecdotes.
<example>
[Chapter A, 250 words of your real writing]
</example>
<example>
[Chapter B, a different topic and length]
</example>
Notes for this chapter (use only these facts):
[your notes]
Write: Chapter 5, "Pricing without panic". About 600 words.
The anti-copy line is important. With a single example, models often echo its phrases and rhythm too faithfully; telling them to match the pattern but not the wording, and giving two different examples, reduces that. If the echo persists, shorten the examples to excerpts. Our guide to making AI writing sound less like AI uses the same few-shot layout for voice, and giving AI your brand voice for every chapter shows how to build a durable voice sample.
Your own chapters are the best examples, but you may not have any yet. In that case, write the first chapter by hand (or edit an AI draft heavily), then promote it to the template. In a staged workflow, Interactive eBook Builder does something related: Agent A Spec Builder sets down the Chapter Plan first, and Section Blueprints in the Packs Database describe how a section should be built, so the "shape" of a chapter is stated before drafting rather than rediscovered each time.
How do I turn one of my chapters into a reusable example?
Strip it to its pattern, label the parts, and save it as a fixed block you paste in unchanged. Here is a worked sketch (the chapter is invented for illustration):
- Take a chapter you're happy with, say 700 words on "Setting your first price".
- Cut it to the two or three paragraphs that show the voice best, roughly 200-250 words.
- Add a one-line header describing what it demonstrates: "Direct opener, one concrete number, one 5-minute action."
- Write a second, different example on another topic, so the model can't link the style to one subject.
- Save both in a notes file named "chapter examples v1". Change them only on purpose, and version them when you do.
That last point is a consistency tool in itself: if the examples change between chapters, so will the output. The same logic is behind the Seed Prompt and editable agent instructions in Interactive eBook Builder: the instructions you set once are reused across every chapter instead of being retyped from memory.
What goes wrong with few-shot prompts?
Copying, drifting and overstuffing are the three common failures.
| Problem | Sign | Fix |
|---|---|---|
| Copying | New chapter reuses phrases or the same anecdote | Add an anti-copy rule; use 2-3 varied examples; trim to excerpts |
| Drift | Chapter 9 looks different from Chapter 1 | Reuse the same examples every time; pin the model version if you can |
| Overfitting | Every chapter has the same length and number of sections | Show examples with different lengths and say which parts are fixed |
| Format mismatch | Output has different headings than the examples | Make example formatting identical; end the prompt in the same shape |
| Examples contradict instructions | It follows the example, not the rule | Edit one or the other so they agree |
Because examples and instructions compete when they conflict, they are a common cause of AI "ignoring" a rule. If that's your problem, prompt structure for turning an outline into a draft shows how to lay out the whole prompt in order, and the results are easier to debug once it has a clear skeleton.
Before you hit send
- Do you have 2-5 examples that differ in topic but share the style you want?
- Is the formatting of every example identical?
- Did you tell the model to match the pattern, not the content?
- Are the examples your own writing, or text you have the rights to use?
- Did you save the examples so you can reuse them for every chapter?
The takeaway: show, don't just tell. Two or three well-chosen, identically formatted examples will keep your chapters consistent better than any adjective.