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 security incident flashcards using the structure below.
Example 1:
Incident: Suspicious outbound network traffic
Investigation steps: Review firewall logs → Check process connections → Analyze DNS queries
Response: Isolate host, run malware scan, collect forensic evidence
Example 2:
Incident: Multiple failed authentication attempts
Investigation steps: Check auth logs → Identify source IPs → Review user account status
Response: Block source IPs, reset compromised credentials, enable MFA

Workshop: build a mini set

  1. Choose a format you use often-flashcards, study tables, or incident response 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 threat hunting scenarios).
  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