The Digital Futurist logoSkills and Prompt Registry
type frameworkowner Thomas Cherickalcurator Thomas Cherickalupdated 2026-11-15

Few-Shot

What It Is

Show the model 2 to 5 worked input/output examples before the real input. Documented at scale in Brown et al., 2020, "Language Models are Few-Shot Learners" (arXiv:2005.14165).

When to Use It

Use when format or judgement is easier to show than describe. Vary the examples so the model does not copy surface features.

Blank Template

{{instruction}}
<examples>
<example><input>{{in_1}}</input><output>{{out_1}}</output></example>
<example><input>{{in_2}}</input><output>{{out_2}}</output></example>
<example><input>{{in_3}}</input><output>{{out_3}}</output></example>
</examples>
<input>{{real_input}}</input>

Five Sample Prompts for Gen AI Professionals

FEWSHOT-01 - Ticket triage

id role version status owner
FEWSHOT-01 AI engineer 0.1.0 seed Thomas Cherickal
Classify support tickets into billing, bug, feature_request or account with a priority 1 to 3.
<examples>{{3 varied labelled tickets}}</examples>
<input>{{ticket}}</input>
Return JSON only.

FEWSHOT-02 - Test case generation

id role version status owner
FEWSHOT-02 Python engineer 0.1.0 seed Thomas Cherickal
Write pytest cases for the function in the same style as the examples.
<examples>{{2 function/test pairs}}</examples>
<input>{{function}}</input>

FEWSHOT-03 - Release-note voice

id role version status owner
FEWSHOT-03 Software engineer 0.1.0 seed Thomas Cherickal
Turn the merged PR list into release notes in our house style.
<examples>{{2 past PR lists with the release notes we published}}</examples>
<input>{{pr_list}}</input>

FEWSHOT-04 - Eval judge calibration

id role version status owner
FEWSHOT-04 LLM engineer 0.1.0 seed Thomas Cherickal
Grade answers 1 to 5 for factual accuracy.
<examples>{{one example each of a 1, 3 and 5 with reasons}}</examples>
<input><question>{{q}}</question><answer>{{a}}</answer></input>
Return score and one-line reason.

FEWSHOT-05 - Component from spec

id role version status owner
FEWSHOT-05 Front-end engineer 0.1.0 seed Thomas Cherickal
Write a component from a short spec, matching the examples' structure, naming and accessibility attributes.
<examples>{{2 spec/component pairs}}</examples>
<input>{{spec}}</input>