# 2.3 Evaluator-optimizer

A generator and a rubric-grounded evaluator iterate until an acceptance threshold.

1. Generator produces draft v1.
2. Evaluator scores it against an explicit rubric.
3. Targeted critique conditions the next generation.
4. Terminates at the threshold or max_rounds.

- **Use when:** Explicit rubrics exist and critique measurably improves output.
- **Avoid:** Ungrounded LLM judges (sycophancy) and uncapped rounds.

```
draft = writer(task)

for round in range(MAX_ROUNDS):
    score, advice = reviewer(draft, rubric)
    if score >= PASS_MARK:
        break
    draft = writer(task, draft, advice)

return draft
```

## References

- [Building effective agents](https://www.anthropic.com/engineering/building-effective-agents) (Anthropic)
- [Self-Refine](https://arxiv.org/abs/2303.17651) (Madaan et al.)
- [Demystifying evals for AI agents](https://www.anthropic.com/engineering/demystifying-evals-for-ai-agents) (Anthropic)
- [Harness design for long-running apps](https://www.anthropic.com/engineering/harness-design-long-running-apps) (Anthropic)
