Skip to Content

Zero-Shot and Few-Shot Prompting

Zero-Shot and Few-Shot Prompting

Zero-Shot Prompting

Asking the model to perform a task without any examples. The model relies entirely on its pre-training knowledge.

Classify the sentiment of this review as positive, negative, or neutral:
"The product arrived quickly but the quality was disappointing."

→ Negative

Few-Shot Prompting

Providing examples in the prompt to guide the model's output format and reasoning pattern.

Classify the sentiment:
Review: "Absolutely love this!" → Positive
Review: "Worst purchase ever." → Negative
Review: "It's okay, nothing special." → Neutral
Review: "The product arrived quickly but the quality was disappointing." → 

When to Use Each

  • Zero-shot: Simple, well-defined tasks; when tokens/cost matter; with capable models like Claude
  • Few-shot: When output format matters; for nuanced classification; with smaller models; when consistency is critical

Best Practices for Few-Shot

  1. Use diverse, representative examples
  2. Keep examples consistent in format
  3. 3-5 examples is usually sufficient
  4. Order can matter — put the most relevant examples last
  5. Include edge cases if they're important

🌼 Daisy+ in Action: Prompting Strategies

DaisyBot uses zero-shot prompting for general customer inquiries on the livechat widget, and few-shot prompting for domain-specific tasks like categorizing support tickets or extracting invoice data from emails. For example, the email processing pipeline includes few-shot examples of how to parse sender intent — "is this a new request, a follow-up, or a complaint?" — so the LLM can route accurately without any fine-tuning.

Rating
0 0

There are no comments for now.

to be the first to leave a comment.