Evaluator–Optimizer

One model call produces a draft, another evaluates it against clear criteria, and the draft is revised until it passes or a limit is reached.

Description

Some tasks get noticeably better with feedback: translations, summaries, code, marketing copy. The evaluator–optimizer loop mimics a writer and an editor. A generator produces a draft; an evaluator checks it against explicit criteria and returns specific feedback; the generator revises.

The evaluator works best with concrete, checkable criteria ("under 120 words", "mentions the deadline", "tests pass") and, where possible, with real checks like running tests or validating a schema rather than opinions. Cap the number of rounds so the loop always ends.

System design

brief + criteria1draft2run checks3feedback: missing deadline4passes (or 3 rounds)5Taskrelease notes from 40 PRsGeneratorwrites / revisesEvaluatorcriteria + checksAutomatic checkslength, links, schemaApproved draft

Evaluator–Optimizer system design diagram

  1. Task (client): release notes from 40 PRs.
  2. Generator (language model): writes / revises.
  3. Evaluator (language model): criteria + checks.
  4. Automatic checks (function): length, links, schema.
  5. Approved draft (service).
  6. Step 1: Task → Generator: brief + criteria.
  7. Step 2: Generator → Evaluator: draft.
  8. Step 3: Evaluator → Automatic checks: run checks.
  9. Step 4: Evaluator → Generator: feedback: missing deadline (failure path).
  10. Step 5: Evaluator → Approved draft: passes (or 3 rounds).
  1. The generator gets the task and the explicit criteria the result must meet.
  2. It writes a first draft and hands it to the evaluator.
  3. The evaluator runs automatic checks where it can (word count, valid links, JSON schema) and judges the rest against the criteria.
  4. If something fails, it sends specific feedback and the generator revises.
  5. When the draft passes, or after a fixed number of rounds, the best version is returned.

When to use it

Use it when

  • Quality clearly improves with revision, and you can state what "good" means.
  • Some failures can be detected automatically: tests, linters, schemas, word counts.
  • Extra latency and cost per request are acceptable for better output.

Avoid it when

  • A single attempt is already good enough most of the time.
  • There are no clear criteria. The evaluator's feedback becomes vague and the loop wanders.
  • Latency matters more than polish, as in autocomplete or live chat.

Pitfalls

  • Evaluators that approve everything because they share the generator's blind spots. Use explicit criteria, real checks, or a different model.
  • Endless loops or oscillation between two versions. Cap rounds and keep the best-scoring draft.
  • Optimising for the evaluator rather than the user. Spot-check results with real users and keep an offline evaluation set.

Alternatives

Prompt Chaining

Choose it when quality comes from splitting the task into steps rather than revising one output.

Guardrails

Choose it when you need to block unsafe or invalid output, not improve acceptable output.

Human review

Choose it when judgement is subtle or stakes are high; let a person be the evaluator.