Library

Prompt Engineering

Ten sessions on getting reliable output from a language model. Each one teaches a single mechanism, lets you feel it in a lab, and ends with questions you should answer without notes.

Almost every technique pulls one of five levers. Knowing which lever a fix pulls is most of what scenario questions test.

Five levers
01

Instructions

What the model is asked to do

Role, constraints, output format, TAG, CO-STAR

02

Examples

What good output looks like

Zero-shot vs few-shot, worked reasoning examples

03

Context

What the model knows right now

RAG, tool results, conversation history

04

Process

How the work is broken up

Chain-of-thought, prompt chaining, ReAct

05

Sampling

How the next token is picked

Temperature, top-p, max tokens

The plan

Ten sessions and a cheat sheet, in five stages, 45 to 60 minutes each. Skip ahead when a topic is already familiar; Day 10 is practice and review.

00

Foundations

How a model picks the next token, and what a strong prompt is made of. Sampling settings change how the pick is made; they never add knowledge. The parts of a prompt are the checklist every later technique hangs off.

  1. D01How LLMs generate text3 min
  2. D02Prompt anatomy and frameworks2 min
01

Show and shape

Teach by example, then by reasoning. Few-shot examples are the strongest lever and the one that anchors hardest. Chain-of-thought, self-consistency and prompt chaining decide how the work is broken up.

  1. D03Zero-shot and few-shot prompting2 min
  2. D04Chain-of-thought and related reasoning techniques2 min
  3. D05Decomposition and prompt chaining2 min
02

Act and ground

When the model needs facts it does not have, it has to fetch them. ReAct turns reasoning into a loop of tool calls, and retrieval puts sources in the prompt so answers come from documents instead of memory.

  1. D06ReAct, tool use and agents2 min
  2. D07RAG, grounding and hallucination control2 min
03

Control and verify

Structure the output with schemas and validation, then prove the prompt works with a fixed eval set before trusting it. Prompt injection is covered here because every tool and document is an input you must defend.

  1. D08Output control2 min
  2. D09Evaluation, iteration and safety2 min
04

Practice and review

Scenario questions, graded by symptom and mechanism, and a cheat sheet to check your answers against.

  1. REFCheat sheet2 min
  2. D10Practice scenarios and review1 min