Back to all articles
8 MIN READ

Prompt Engineering Techniques: Zero-Shot, One-Shot

By Dorian Laurenceau

📅 Last reviewed: April 24, 2026. Updated with April 2026 findings and community feedback.

Prompt Engineering Techniques: Zero-Shot, One-Shot & Few-Shot

The difference between a mediocre AI output and an excellent one is not the model, it is the technique. Zero-shot, one-shot, and few-shot prompting are the three foundational techniques every AI practitioner must master. By the end of this article, you will know exactly when and how to use each one.

Why Prompting Techniques Matter

The same model can produce wildly different results depending on HOW you ask. Zero-shot is fast but imprecise. Few-shot is slower to set up but dramatically more reliable. Choosing the right technique for the right task is the core skill of prompt engineering.

The honest read on zero-shot vs. few-shot vs. chain-of-thought in 2026, tracked across r/LocalLLaMA, r/PromptEngineering, and r/MachineLearning: the research that underpins these techniques is solid, but the community's lived experience has updated the textbook rankings. The original few-shot paper (Brown et al., 2020) established that examples dramatically improve in-context learning, the chain-of-thought paper (Wei et al., 2022) showed that intermediate reasoning helps, and the Anthropic prompting guide remains the cleanest practical reference. What's changed: with GPT-5-class and Claude-Opus-class models, the gap between zero-shot and few-shot has narrowed on many tasks, and the gap between zero-shot and chain-of-thought has narrowed on reasoning tasks because reasoning is increasingly baked into the model by default.

Where the community correctly pushes back on the "always use few-shot" doctrine: examples cost tokens and risk anchoring the output too tightly to the pattern you showed. If your task is novel or creative, zero-shot often outperforms because the model isn't constrained by your examples. If your task needs consistency (tone, format, structure) across many runs, few-shot wins. The test is simple: write one good example, run it both ways, compare.

Pragmatic rule from practitioners who've moved past the hype: pick the technique based on what failure looks like. "Wrong format" → few-shot with a format example. "Wrong reasoning" → chain-of-thought. "Wrong style" → few-shot with style examples. "Too generic" → zero-shot with stronger role and constraint specification. The technique is the tool; the failure mode tells you which tool.

The Three Techniques Explained

Zero-Shot Prompting

You give the model an instruction with NO examples. The model relies entirely on its training knowledge.

Few-Shot Prompting

You provide 3-5 examples of input-output pairs BEFORE your actual request. The model learns the pattern from your examples.

The 5 Components of an Effective Prompt

Beyond shot techniques, every prompt benefits from five structural components.

Technique Effectiveness Across Tasks

Advanced: Prompt Chaining with Techniques

Test Your Understanding

Continue Learning

You now know when to use zero-shot, one-shot, and few-shot, plus the 5 components of an effective prompt. Next, you will build your own prompt book, a reusable library of templates using these techniques.


Continue to the workshop: Build Your Prompt Book to create templates you will use every day.

GO DEEPER — FREE GUIDE

Module 1 — LLM Anatomy & Prompt Structure

Understand how LLMs work and construct clear, reusable prompts.

D

Dorian Laurenceau

Full-Stack Developer & Learning Designer

Full-stack web developer and learning designer. I spent 4 years as a freelance full-stack developer and 4 years teaching React, JavaScript, HTML/CSS and WordPress to adult learners. Today I design learning paths in web development and AI, grounded in learning science. I founded learn-prompting.fr to make AI practical and accessible, and built the Bluff app to gamify political transparency.

Prompt EngineeringLLMsFull-Stack DevelopmentLearning DesignReact
Published: March 9, 2026Updated: April 24, 2026
Newsletter

Weekly AI Insights

Tools, techniques & news — curated for AI practitioners. Free, no spam.

Free, no spam. Unsubscribe anytime.

FAQ

What will I learn in this Prompt Engineering guide?+

Master the 5 components of an effective prompt and learn when to use zero-shot, one-shot, and few-shot prompting techniques. Includes comparison tables and practical examples.