QamoosTech
AI & DataIntermediate

Few-shot Prompting

PronunciationFYOO-shot PROM-pt-ing

Definition

Providing a few examples within the prompt to guide the LLM toward a specific output format or behavior.

Where you hear it

When tuning model outputs, writing system prompts, or improving accuracy without retraining.

Examples

  • We used few-shot prompting to teach the model how to format JSON responses.
  • Adding three classification examples via few-shot prompting fixed the incorrect category outputs.
  • Two example emails in the prompt made the model reply in the same polite tone.

Common mistake

Assuming you need dozens of examples, when usually two to five well-chosen examples are enough for the model to understand the pattern.

Don't confuse with

Few-shot prompting is often confused with fine-tuning; while few-shot prompting provides examples within the prompt at inference time, fine-tuning involves permanently updating the model's weights using a large dataset.

Say it at work

  • In a meeting or chatLet's try adding a few-shot prompting section to the system message to see if it stabilizes the output format.
  • In an email or ticketI have updated the prompt with few-shot prompting examples to help the model better understand the required extraction logic.