Prompt Engineering Lesson 3: Examples and Templates (Few-Shot)

📎 This article includes 1 downloadable practice file ↓

⏱ 2 min read

📘 Prompt Engineering Course · Lesson 3 of 8

In this article
  1. Classification with examples
  2. Copying your style
  3. Templates
  4. Practice

Describing the style or rules you want is hard. Showing a couple of examples is easy, and models copy patterns very well. This is called few-shot prompting.

Classification with examples

“`text
Classify each expense into Travel, Office, Meals or Other.
“Uber to client office” -> Travel
“Printer cartridge” -> Office
Now classify: “Team lunch”, “Train ticket Delhi-Jaipur”, “Stapler”, “Gift for client”
“`

Two examples define the format and the categories better than a paragraph of rules.

Copying your style

Paste two emails or reports you wrote that you like, then: “Write a reply to the message below in the same style and length.” The result sounds like you, not like a generic AI.

Templates

“`text
Write a payment reminder.
Customer: [CUSTOMER] Invoice: [INVOICE] Amount: [AMOUNT] Days overdue: [DAYS]
Tone: [friendly/firm]. Under 120 words.
“`

Save templates for tasks you repeat; fill the brackets each time (Lesson 8 builds a library).

💡 Use varied examples. If all your examples are short or all are positive, the model will assume every answer should be short or positive.

Practice

Try the three exercises in the worksheet.

📎 Practice files for this article

  • 📄
    Lesson 3 prompt worksheetCopy-paste prompts and exercises to try in ChatGPT, Copilot, Gemini or Claude.
    ⬇ TXT · 449 B

Free to use for learning. Files with macros (.bas) are plain text — import them with Alt+F11 → File → Import File, and always test on a copy.

✨ Ask AI about this article

Stuck on a step? Ask a question and the AI answers using this article.

Free · AI can be wrong