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?