solidcodersolidcoder
AI TopicsExplore Courses
solidcodersolidcoder

Practical courses for software engineering interviews — no gatekeeping, no fluff.

AI Engineering

  • How AI Actually Thinks
  • Prompt Engineering
  • Connection Layer (MCP)
  • Skills

Explore

  • Courses
  • AI Engineering Topics
  • About
  • Privacy Policy
  • Terms

© 2026 solidcoder · Practical courses for software engineering interviews.

Built for the AI era — learn by doing.

Home/AI Engineering/Prompt Engineering/Teaching By Example
Chapters — Prompt Engineering▾

Teaching By Example

6 min read·Sep 5, 2026
Keywords:Prompt Engineering

How to teach an AI a pattern with two or three examples instead of a paragraph of instructions, and how many examples is too many.

Show, don't just tell

Instructions describe a pattern in words; examples let the model see the pattern directly. For anything with a specific shape (a format, a voice, a structure), two or three good examples usually beat a paragraph of description.

Turning Slack messages into changelog entries
Convert engineering Slack updates into public changelog entries: Example 1: Slack: "finally killed that bug where the export button double-fired on slow connections" Changelog: "Fixed: the export button no longer triggers twice on slow network connections." Example 2: Slack: "added dark mode toggle to settings, took forever but it's in" Changelog: "Added: a dark mode toggle, available in Settings." Now convert: Slack: "invoices load way faster now, we were doing 3 db calls for no reason"
Open in ChatGPT ↗

Changelog: "Improved: invoices now load significantly faster."

What makes an example worth including

  • Relevance: it matches the actual task, not a nearby one
  • Clarity: the input→output relationship is obvious at a glance
  • Consistency: every example follows the same structure
  • Completeness: it shows the full output, not a truncated version
  • Variability: 2–3 examples cover different scenarios, not the same one twice
How many examples do you actually need?
One
Simple, low-ambiguity tasks: the pattern is obvious from a single case.
Two to three
Most tasks: enough to show the pattern without wasting tokens.
Four to five
Complex tasks, or ones where you need to show meaningful variation.
More than five
Rarely worth it: diminishing returns, and it buries the actual request.

Common mistakes

Inconsistent examples
Mixing formats or quality levels teaches the model the wrong pattern. Keep every example aligned.
Weak example quality
Your examples are the template; the model follows them closely, flaws included.
Irrelevant detail
Strip anything that doesn't relate to the pattern you're teaching.
Too little input context
Include enough of the input side that the AI understands what drove each output.

Few-shot examples earn their keep on custom formats, a brand voice that's hard to describe in words, and any task where you need consistent output across many similar requests.

Key concepts in this chapter

  • Few-Shot Prompting
Up next2/3
Part 4 · Leveling Up
←
← Prev Chapter
Getting the Model to Show Its Work
6 min
Next Chapter →
Boundaries and Scope
7 min · continue reading
→
Part of a free guide

Prompt Engineering

A simple guide to writing better prompts, so AI gives you the answer you actually want.

Browse All Guides →
On this page
  • Show, don't just tell
  • What makes an example worth including
  • Common mistakes