Few-Shot Prompting

Domain: Prompt Engineering

🎯 Motivation

Including several input-output examples in the prompt teaches the pattern. More examples = more accurate, but uses more tokens.

πŸ“‹ Concrete Example

Prompt: β€˜English: Hello, French: Bonjour\nEnglish: Thank you, French: Merci\nEnglish: Goodbye, French: ___’ The model fills in β€˜Au revoir’ having learned the translation pattern from examples.

πŸ”— Analogy

Flashcards before a test - you review several example problems (few-shot examples). When the test comes (new input), you apply the pattern you learned. More flashcards (shots) = better performance.