AI Terminology Course
AI Terminology
/
Intermediate

Few-Shot Prompting

Definition

A prompt engineering technique where you provide the LLM with a small number of examples (usually 2 to 5) demonstrating exactly how you want it to behave, before asking it to perform the actual task.

Explain Like I'm New

Teaching by example. Instead of just saying 'Translate English to French', you say: 'Apple -> Pomme' 'Dog -> Chien' 'Cat -> ?'. The AI looks at the pattern and perfectly answers 'Chat'.

Real World Example

You want the AI to format data into strict JSON. Instead of writing a massive paragraph explaining the JSON schema, you just provide two examples of perfectly formatted JSON in the prompt. The AI will effortlessly copy that exact format.

Common Use Cases

  • •Formatting enforcement
  • •Complex classification
  • •Tone matching

Interview Questions

basic

  • If you provide ZERO examples in your prompt, what is that technique called?

intermediate

  • Why is Few-Shot prompting often better than just writing a highly detailed set of instructions?

Flash Cards

Question

Zero examples?

Click to reveal answer
Answer

Zero-Shot Prompting.

Question

Why better than instructions?

Click to reveal answer
Answer

LLMs are incredibly good at pattern matching. Showing them a pattern (Few-Shot) is often mathematically easier for the attention mechanism to lock onto than trying to parse complex, multi-layered English instructions.