Module 11 · Notebook 04
GenAI 2026 · Pattern Masterclass

14 patterns.
Four shapes.

Stop memorising names. Learn to recognise the shape, and the name comes free.

LINE one pass, no going back CoT · Self-Discover LOOP try, check, try again ReAct · Reflection · Reflexion CRITIC · Self-RAG PLAN FIRST decide everything up front REWOO · Plan-and-Execute Plan-and-Solve · LLM Compiler TREE / SEARCH explore, score, prune ToT · GoT · LATS
14
patterns from real papers
4
shapes to recognise them by
60×
cost spread, cheapest to worst
1
trap interviewers always use
The map

Each family answers a different question

Line
"Just think harder, once."
CoTSelf-Discover
Loop
"Was that good enough? No? Again."
ReActReflectionReflexionCRITICSelf-RAG
Plan first
"Write the whole plan, then run it."
REWOOPlan-and-ExecutePlan-and-SolveLLM Compiler
Tree / search
"Try several futures, keep the best."
ToTGoTLATS
the only question that matters
Does the agent need feedback? If no → Line. If yes, from a tool → Loop. If the whole path is knowable up front → Plan. If you must compare alternatives → Tree.
why interviewers care
Picking Tree where Line would do is how teams burn a 60× token bill for the same answer.
The zoo

Click a pattern. Watch its shape run.

ready
The interview trap

Same loop. Different critic.

Reflection, Reflexion and CRITIC draw the identical cycle. The only difference is what feeds the critic — the orange box.

Reflection
Madaan et al. 2023 · Self-Refine
nothing no tools, no memory generate critique revise
The model is its own only judge. Cheap, and it will happily approve its own mistake.
Reflexion
Shinn et al. 2023
real outcome + notes from past tries attempt reflect retry, remembering
It saw the code actually fail, and it keeps a written memory across attempts. HumanEval 80 → 91%.
CRITIC
Gou et al. ICLR 2024
a TOOL calculator · search · tests generate verify correct
Ground truth the model cannot argue with. 2+2 is 4 because the calculator said so.
Say it in one breath: "Reflection judges itself. Reflexion judges what happened, and remembers. CRITIC lets a tool judge."
The production lens

The same answer, 60× the bill

Typical LLM calls to finish one task. This is the slide that gets you hired.

CoT
1 call
REWOO
2 · plan + solve
LLM Compiler
3 · parallel DAG
Self-Discover
~4
Reflection
~5
Self-RAG
~6
CRITIC
~7
Plan-and-Execute
~8
ReAct
~12 · unbounded
Reflexion
~15 per retry
ToT
~28 · branches
LATS
60+ · MCTS
Green = ship it by default. Red = you'd better be able to justify it.
Decision tree, made clickable

Real task in. Pattern out.

Interview prep

Answer out loud, then tap

Recap

What to actually remember

Shape before name
Line, loop, plan, tree. Every paper you meet next year is one of these four.
Every loop needs a cap
A counter on the state and a recursion limit. Otherwise you ship an infinite bill.
Plan first is the cheap win
REWOO gets ReAct's answer in 2 calls when the steps are knowable up front.
Tree only for real forks
Architecture choices, not "capital of France". Reach for it last.
need feedback?no → LINE feedback each step?yes → LOOP path known up front?yes → PLAN must compare options?yes → TREE
Next → notebook 05: put a pattern to work. A SQL agent that must discover the schema before it dares write a query.