Community post
One Example Beats a Long Lecture: Using Before-and-After Samples
By Liam · Published · 2 min read
Editorial standards and correctionsSee when examples help an AI prompt, how to choose good samples, and how to test whether the model follows the pattern.
When I want a repeated pattern, a concrete example can clarify it faster than a long explanation. This is often called few-shot prompting: show the model one or more input-output examples before asking it to handle a new input. The trick is not to show just any example. Show one that reflects the actual rule.
Suppose I want short, actionable playtest notes. I could say “make the notes concise and useful,” but those words are subjective. An example makes the expected format visible:
Raw note: “The player kept tapping the locked door and seemed confused.”
Output: “Locked door offers no feedback. Add a clear locked-state cue. Test whether players notice it without instruction.” Then I ask: Rewrite the next raw note in the same three-part pattern: observed problem, proposed change, next test. Do not add facts absent from the note. Raw note: “Two players tried to move the same crate and blocked each other.” I now know what to inspect: three parts, no invented facts, and a next test tied to the observation. After giving examples, How to Test a Prompt on More Than One Example shows how to test the pattern on unseen cases.
Output: “Locked door offers no feedback. Add a clear locked-state cue. Test whether players notice it without instruction.” Then I ask: Rewrite the next raw note in the same three-part pattern: observed problem, proposed change, next test. Do not add facts absent from the note. Raw note: “Two players tried to move the same crate and blocked each other.” I now know what to inspect: three parts, no invented facts, and a next test tied to the observation. After giving examples, How to Test a Prompt on More Than One Example shows how to test the pattern on unseen cases.
Choose examples that cover variation
One example may accidentally teach the wrong rule. If every sample mentions a door, the model may overuse door-related language. Add a second example about a timer or menu to show that the pattern applies across topics. If important edge cases exist, include one of them.
Google’s prompt design guidance recommends specific and varied examples. Examples are especially useful for formatting, classification, and style; they are not proof that the resulting factual content is correct.
Keep examples original and safe
Use examples you created or have permission to use. Do not paste private playtest recordings or a client’s internal tickets into a public prompt library. Replace real names and sensitive details with fictional ones without changing the task’s logic.
Try it: Take a repeated rewrite task. Create two original input-output samples and one unseen test input. Run the prompt. If the third output violates the pattern, revise the examples before adding more prose.
Keep learning: How to Test a Prompt on More Than One Example, A Better Code Review Prompt Uses a Diff and a Risk Checklist, and What to Put in a Reusable Prompt Template.
About the author
Liam
Coder and gamer. I test prompts, share what works, and show how to improve AI results for code and creative projects.
View Liam's public profileComments (0)
Loading comments…
Keep exploring
Related from Prompt Engineering Lab
How to Prompt Across Models Without Pretending They Work the Same
Keep the task and success criteria stable while checking each AI provider’s current model-specific guidance.
Compare Two Prompt Versions Without Fooling Yourself
Hold the task and test set constant, change one instruction, and record tradeoffs when comparing AI prompts.
What to Put in a Reusable Prompt Template
Learn how to create a prompt template with meaningful variables, a fixed task, examples, and a test log.