Skip to content
Quantoros

Compare zero-shot, few-shot, and chain-of-thought prompting.

LLM & AILevel: FoundationCore Techniques

Compare zero-shot, few-shot, and chain-of-thought prompting.

Hints
  • Identify the stage: pretraining, adaptation, generation or evaluation.
  • Name the inputs, constraints and a case where the approach fails.

Answer

TechniqueWhat It DoesWhen to Use
Zero-shotTask description onlySimple, well-defined tasks; strong base models
Few-shotInclude 2–8 worked examplesWhen zero-shot underperforms; need consistent format
CoT (chain-of-thought)"Think step by step"Multi-step reasoning, math, logic problems
Self-consistencySample N CoT paths, majority voteCritical accuracy; single sample unreliable
Zero-shot CoTAdd "Let's think step by step"Easy CoT without examples

When to use few-shot: if the output format is non-standard, or the model needs to understand a domain-specific evaluation rubric. If the task is simple, zero-shot is cheaper and often equally good.

Source and licence: JustInCache & contributors — Awesome AI Interviews · Apache-2.0

Related questions