2.4 Few-shot Prompting

Teach Copilot with multiple examples

Provide a short set of samples so Copilot learns the exact format, tone, and level of detail you expect.

Best-fit scenarios

  • You need several outputs that match existing study notes or flashcards.
  • The topic requires consistent structure across multiple examples.
  • You want Copilot to internalise subtle differences (e.g., varying troubleshooting paths).

Pattern to follow

  1. Introduce the task clearly (e.g., “Create troubleshooting flashcards”).
  2. Provide two or three examples separated with markers like “Example 1 … Example 2 …”.
  3. Specify how many new outputs you need and what must stay consistent.

Sample few-shot prompt

Prompt: Create three additional troubleshooting flashcards using the structure below.
Example 1:
Issue: Laptop battery drains quickly
Diagnosis steps: Check power plan → Inspect battery health → Run firmware update
Fix: Replace battery if wear level > 80%
Example 2:
Issue: Desktop powers on with no display
Diagnosis steps: Reseat RAM → Test monitor cable → Boot with onboard graphics
Fix: Replace GPU if onboard graphics work

Workshop: build a mini set

  1. Choose a format you use often—flashcards, study tables, or troubleshooting logs.
  2. Write two examples that highlight the structure and tone you want.
  3. Ask Copilot for additional items, specifying how many and any constraints (e.g., focus on network issues).
  4. Review the outputs. Tweak the examples if Copilot missed an important detail, then rerun.

Next steps

Need deeper reasoning from Copilot? Continue to 2.5 for chain-of-thought prompting.

Continue to 2.5