Few-Shot Example
A few-shot example is the section of a prompt where you stop writing instructions and start showing receipts. You drop in three to five concrete input-output pairs pulled from work your team has already shipped or killed. The input is the raw homepage variant, the brand brief, or the component spec. The output is the exact critique or generation the team judged. The model studies these real specimens the way a junior designer studies the Figma file at midnight and absorbs the invisible pattern no bullet list could capture. In the five-part prompt anatomy this section sits third because system and scope only set the stage. Examples deliver the actual spec. The prompts that survive model updates from Claude 3.5 to Claude 4 in 2026 all carry real few-shot examples. The ones that rot do not.
A few-shot example is not a list of rules formatted as pretend dialogues. It is not hypothetical scenarios you made up on a Tuesday. It is not a single golden output with no failures attached. It is not synthetic data generated by another model to save time. Those fakes look useful in a Notion page but collapse the moment the underlying model shifts or a new designer joins the team. The prompt library fills with eight slightly different versions of the same brand-audit prompt and nobody can trace why quality dropped in Q3. Teams that treat examples as decoration learn this lesson the expensive way.
Look at what Linear did in February 2025. Their systems team rebuilt the hero-copy critique prompt after the last model update silently softened every output. They pulled three approved homepages from the previous quarter: the Linear 2024 launch page that converted 18 percent better than baseline, the Vercel 2025 dashboard hero that felt sharp without screaming, and the Perplexity search page that nailed technical tone without sounding like documentation. They paired each with the exact critique notes the design lead had written in Linear itself. Then they added two rejected versions: one that started with Imagine a world where and another that buried the lead under corporate fluff. Each example sat in clean JSON blocks so the output format stayed machine-readable downstream. The prompt without examples scored 67 on their rubric. After the five real shots it hit 94. New hires opened Cursor, triggered the prompt component, and matched senior taste on day one. The same few-shot set powered three child prompts for CTA review, navigation scan, and microcopy tone. One set of examples lifted the entire parent prompt and every variant.
Stripe ran a similar experiment six months later on illustration direction prompts. Their brand team had spent months writing rules about line weight, negative space, and financial optimism. Outputs still felt generic. They switched to few-shot by pulling four real illustrations from their 2025 annual report, two that shipped and two that got rejected in critique for feeling too playful. They included the original brief, the generated direction, the final illustration, and the one-line Slack note from the brand director that explained the decision. The new prompt needed half as many tokens because the examples did the heavy lifting. The illustration variants now ship as size, state, and role variants inside their Claude Skills pack. The lenient first-pass variant uses the softer examples. The final-ship variant loads the harshest rejections. The team no longer debates tone in Monday meetings. The examples already settled it.
Use few-shot examples when the task requires taste instead of truth. Brand voice audits, UX critique, visual QA, illustration direction, tone matching, or any job where good lives in the teams collective gut instead of a rulebook. Drop them into every prompt component that reaches the library. They compound fast. A strong set in the parent prompt raises every child prompt that inherits context. Teams that shipped real examples inside Cursor .cursorrules files in 2026 cut cleanup time by more than half. The variant matrix gets sharper too. One spine prompt, multiple example subsets, nine usable tools instead of nine separate prompts. The eval suite runs against the same fifty test cases every time a new example joins the set so quality never drifts.
Skip few-shot examples on pure logic or data tasks. Calculating contrast ratios, counting tokens, extracting named entities from a brief, or transforming Figma JSON into Tailwind. The model already owns those rules. Adding examples there wastes tokens and risks overfitting to irrelevant patterns from your sample set. Also skip them when you face a brand new problem space with zero past work to reference. In that case run zero-shot first, generate twenty outputs, judge them brutally as a team, then build the few-shot set from that fresh truth. Never exceed seven examples. Past that point the signal drowns and the model starts averaging instead of excelling. The prompt becomes bloated, slow, and less decisive.
Few-shot examples turn vague instructions into ironclad specs the entire team can trust.
Read the full guide
Related terms
Keep exploring
Prompt Component
A prompt component is a reusable scoped instruction unit for AI models built with the same discipline as a UI component including anatomy variants versioning evals and distribution.
Prompt Anatomy
Prompt anatomy is the fixed five-part structure every production prompt must follow: system, scope, examples, constraints, and output format. It turns disposable strings into versioned, reusable components that survive model updates and team scaling.
Prompt Variant
A prompt variant is a configured version of a core prompt spine that adapts size, state, or role while sharing the same system prompt, examples, constraints, and output schema. Designers multiply one tested asset into many tools the same way Figma variants turn one button into nine usable states.