CoachnestCoachnest
Sign InGet Started
Back to course

Prompt Engineering Mastery: From Fundamentals to Production

…
—
Contents
1

What Is Prompt Engineering?

ReadingFree
2

How Large Language Models Actually Work

ReadingFree
3

Tokens, Context Windows, Temperature & Sampling

Reading11m
4

The Anatomy of a Great Prompt

Reading13m
5

Module 1 Knowledge Check

Quiz8m

Zero-Shot, One-Shot & Few-Shot Prompting

Reading12m
7

Role & Persona Prompting

Reading9m
8

Instruction Clarity, Delimiters & Decomposition

Reading11m
9

Controlling the Output Format

Reading10m
10

Module 2 Knowledge Check

Quiz8m
11

Chain-of-Thought Prompting

Reading12m
12

Self-Consistency & Tree-of-Thought

Reading11m
13

ReAct — Reasoning + Acting with Tools

Reading12m
14

Structured Output with JSON Schemas

Reading11m
15

Module 3 Knowledge Check

Quiz8m
16

Retrieval-Augmented Generation (RAG)

Reading13m
17

Prompt Templates, Variables & Chaining

Reading11m
18

Tool / Function Calling Patterns

Reading12m
19

Project — Build a Customer Support Assistant

Reading14m
20

Module 4 Knowledge Check

Quiz8m
21

Evaluating Prompt Quality

Reading12m
22

Prompt Injection & Security

Reading12m
23

Reducing Hallucinations

Reading10m
24

Cost, Latency & Optimization

Reading10m
25

Final Assessment — Prompt Engineering Mastery

Quiz15m
←→navigate lessons
Chapter 2 of 5·Module 2 · Core Prompting Techniques
Lesson 6 of 25Reading12 min

Zero-Shot, One-Shot & Few-Shot Prompting

#Zero-Shot, One-Shot & Few-Shot Prompting¶

The single highest-leverage technique in your toolkit: showing the model what "good" looks like.

Zero-Shot¶

No examples — just an instruction. Relies entirely on the model's pre-trained ability.

text
4 lines
1Classify the sentiment as positive, negative, or neutral.
2
3Review: "Battery life is disappointing."
4Sentiment:

Great for simple, common tasks. Fragile for anything with a specific format or edge cases.

One-Shot¶

Provide one example to anchor format and behaviour.

text
5 lines
1Review: "Love it, works perfectly!"
2Sentiment: positive
3
4Review: "Battery life is disappointing."
5Sentiment:

Few-Shot¶

Provide several examples — especially ones covering edge cases.

text
11 lines
1Review: "Love it, works perfectly!"
2Sentiment: positive
3
4Review: "It's okay, nothing special."
5Sentiment: neutral
6
7Review: "Stopped working after a week. Avoid."
8Sentiment: negative
9
10Review: "Battery life is disappointing but the screen is gorgeous."
11Sentiment:

That last mixed-signal example teaches the model how you want ambiguity handled — something instructions alone struggle to convey.

Why Few-Shot Works¶

The model continues patterns (Module 1). A consistent set of examples is a pattern. The model infers the implicit rule and applies it to the new input.

Best Practices¶

DoDon't
Use a consistent format across all examplesVary delimiters or labels between examples
Include edge cases and the hard classOnly show the easy/common case
Keep label distribution balancedShow 5 positives then 1 negative (bias!)
Order examples randomlyGroup all of one class together

Diminishing returns: 2–8 examples usually captures most of the gain. 50 examples rarely beats 8 — and burns tokens.

When Few-Shot Isn't Enough¶

If even good examples fail, the task likely needs reasoning, not just pattern-matching. That's Module 3 (chain-of-thought).

Previous

Module 1 Knowledge Check

Next

Role & Persona Prompting

Use ← → arrow keys to navigate between lessons