Lesson 48.1 · 1 of 3 · 5 min read · Reviewed 24 Nov 2026
Self-critique loops
By the end, you can
- Explain self-critique loops.
- Write criteria that make critique useful.
The loop
draft = generate(task)
for round in 1..N:
critique = review(draft, criteria) # list concrete problems
if critique is empty: break
draft = revise(draft, critique)
return draft
This is the evaluator-optimizerEvaluator-optimizer: A pattern where one call produces an output and another evaluates it and asks for improvements, in a loop. workflowWorkflow: A system where LLM calls and tools follow a path defined in code, rather than chosen by the model. (41.5) applied to one output.
Criteria make or break it
| Vague | Checkable |
|---|---|
| “Make it better” | “Every claim cites a source from the provided docs” |
| “Improve the code” | “All functions have type hints; no function over 40 lines” |
| “Is it clear?” | “A new hire could follow step 3 without asking anything” |
Ground truth beats opinion
The strongest critique comes from tools, not the model’s own judgement:
- Code: run the tests, the type checker, the linter.
- Data: validate against the schema (chapter 14).
- Facts: check each claim against the retrieved documents.
Feed those results into the revision step. A failing test is better feedback than any self-assessment.
Diminishing returns
Most of the gain comes in the first one or two rounds. Measure on your evalEval: A repeatable test that measures how well an AI system performs on a set of cases with defined success criteria. set (Part 3) to find where extra rounds stop paying (48.3).
Key points
- A self-critique loop drafts, critiques against criteria, then revises.
- Critique works best against explicit, checkable criteria, not 'make it better'.
- Gains are real for writing, code and analysis, but usually shrink after one or two rounds.
- Tool feedback (tests, linters, validators) beats the model's opinion of its own work.
Critique a draft against checkable criteria
Replace a vague 'make it better' critique with checks that point to exact fixes.
You will have: Three criterion functions and a draft, critique, revise loop that prints each round.
Steps
- Run the starter: every criterion returns True, so the hype-filled draft 'passes' at once.
- Write short_enough() as a word count check.
- Write no_hype() and cites_source() so a reviewer could apply them line by line.
- Run the loop and read which criterion each round fixes.
- Add a fourth criterion of your own and a matching fix.
Done when
- The starter wrongly reports 3/3 on the original draft.
- The solution passes 3/3 within 4 rounds, and each round fixes one named problem.
- The final text has no hype words and ends with [spec sheet].
Open in the Playground No API key needed.
Starter code (Python)
# Self-critique only helps when the critique checks something concrete.
DRAFT = ("Our amazing new lamp is the best lamp ever. It has a dimmer and a timer and lots of other "
"really great features that customers will love using every day at home or in the office.")
HYPE = ["amazing", "best", "ever", "really great"]
# TODO: write three checkable criteria. Each takes the text and returns True when it passes.
def short_enough(text): # 25 words or fewer
return True
def no_hype(text): # none of the HYPE phrases
return True
def cites_source(text): # ends with "[spec sheet]"
return True
CRITERIA = {"short_enough": short_enough, "no_hype": no_hype, "cites_source": cites_source}
# Simulated reviser: it can fix exactly what the critique names.
FIXES = {
"no_hype": lambda t: t.replace("amazing new lamp is the best lamp ever", "new desk lamp is built for long work sessions").replace("really great ", "useful "),
"short_enough": lambda t: t.split(". ")[0] + ". It has a dimmer and a timer.",
"cites_source": lambda t: t + " [spec sheet]",
}
def critique(text):
return [name for name, check in CRITERIA.items() if not check(text)]
text = DRAFT
for round_no in range(1, 5):
failing = critique(text)
print(f"round {round_no}: failing {failing}")
if not failing:
break
text = FIXES[failing[0]](text) # revise the first named problem
print(f"criteria passed: {len(CRITERIA) - len(critique(text))}/{len(CRITERIA)}")
print("final:", text)
Show a solution
# Self-critique only helps when the critique checks something concrete.
DRAFT = ("Our amazing new lamp is the best lamp ever. It has a dimmer and a timer and lots of other "
"really great features that customers will love using every day at home or in the office.")
HYPE = ["amazing", "best", "ever", "really great"]
def short_enough(text): # 25 words or fewer
return len(text.split()) <= 25
def no_hype(text): # none of the HYPE phrases
return not any(h in text.lower() for h in HYPE)
def cites_source(text): # ends with "[spec sheet]"
return text.endswith("[spec sheet]")
CRITERIA = {"short_enough": short_enough, "no_hype": no_hype, "cites_source": cites_source}
# Simulated reviser: it can fix exactly what the critique names.
FIXES = {
"no_hype": lambda t: t.replace("amazing new lamp is the best lamp ever", "new desk lamp is built for long work sessions").replace("really great ", "useful "),
"short_enough": lambda t: t.split(". ")[0] + ". It has a dimmer and a timer.",
"cites_source": lambda t: t + " [spec sheet]",
}
def critique(text):
return [name for name, check in CRITERIA.items() if not check(text)]
text = DRAFT
for round_no in range(1, 5):
failing = critique(text)
print(f"round {round_no}: failing {failing}")
if not failing:
break
text = FIXES[failing[0]](text) # revise the first named problem
print(f"criteria passed: {len(CRITERIA) - len(critique(text))}/{len(CRITERIA)}")
print("final:", text)