When to reach for it
- Quality criteria can be explicitly formulated.
- Iterative improvement is measurable.
- Creative outputs need rigorous checking.
Generate. Judge. Improve. Repeat.
A generator produces a result, an evaluator scores it against specific criteria, and the generator optimizes it based on the feedback.
An optimizer generates drafts; an external evaluator scores and feeds back until the threshold is met.
| Round | Generator | Evaluator | Verdict |
|---|---|---|---|
| 1 | 112 words, opens with “the best backpack ever made” | Too long. Superlative in the first sentence. The weight is missing | Revise |
| 2 | 78 words, weight added, still says “unbeatable” | Length and specifications are met. One superlative remains | Revise |
| 3 | 76 words, volume, weight and frame named, neutral wording | All three criteria are met | Accept |
def write_until_accepted(brief, criteria, max_rounds=3):
draft, feedback = None, None
for _ in range(max_rounds):
draft = generator(brief, previous=draft, feedback=feedback)
# a separate call with its own prompt
verdict = evaluator(draft, criteria)
if verdict.accepted:
return draft
# concrete, one entry per failed criterion
feedback = verdict.reasons
return draft # budget used up: hand over for reviewWhen to reach for it
When it backfires
Both models miss the same factual error. The loop converges to a polished but wrong answer.
Countermeasure
Use a different model family for evaluator, or ground scoring in external checks (tests, regex, database queries).
The evaluator optimizes for BLEU score or length, not the user's actual quality criteria. The output looks good but misses the point.
Countermeasure
Align the evaluator's rubric with user requirements. Calibrate with human ratings before deploying.
Search patterns, frameworks, and pages.