Dashboard
0%
1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
51 small wins to finish your pathNext question →

Q12EasyConcept

What are zero-shot, few-shot, and chain-of-thought prompting?

30-second answerSay your answer out loud first, then reveal.

Zero-shot: "Classify this review as positive or negative: ..." Works well for common tasks with strong instruct models.

Few-shot

text
Review: "Battery died in a day" → negative
Review: "Superb camera, fast delivery" → positive
Review: "Okay screen but laggy" → ?
  • Useful for custom formats, labels and edge cases.
  • Tips: diverse examples, balanced labels, consistent format. Examples strongly influence output, so models may copy surface features.

Chain-of-thought

  • "Let's think step by step" (zero-shot CoT, Kojima et al. 2022), or few-shot examples that include reasoning (Wei et al. 2022).
  • Why it helps: the model gets more computation (tokens) to work through intermediate steps, and each step conditions the next.
  • Self-consistency: sample several CoT answers and take a majority vote. More accurate, more expensive.

With reasoning models (models trained to think before answering), explicit "think step by step" prompting matters less. Focus instead on a clear task definition and the context.

Common mistakes

  • Using CoT for simple lookups (adds latency and cost for no gain).
  • Showing raw CoT to end users when it may contain errors or irrelevant text. Often the final answer alone is better.

You understood something today that you didn't yesterday.