AI Space

AI Models & Assistants / Knowledge library

Evaluator-Optimizer Loop

Alternates a generator with an evaluator that supplies criteria-based feedback

Iterative agent workflow

Why learn Evaluator-Optimizer Loop?

It improves outputs when evaluation criteria are clearer than a one-shot generation path.

The problem it solves

It turns quality feedback into repeated targeted revisions rather than a final unacted-on score.

Where it came from

One component produces or revises an artifact while another evaluates it against explicit criteria. The loop stops when quality passes or a budget is reached; weak or correlated evaluators can reward polished but incorrect work.

Build your understanding

Work through these exercises in order. Try the task before opening a reference.

  1. Define Evaluator-Optimizer Loop and identify its place in an agent architecture.
  2. Choose a task where Evaluator-Optimizer Loop improves an agent system.
  3. Diagnose one failure caused by misusing Evaluator-Optimizer Loop.
  4. Interpret a trace or state transition involving Evaluator-Optimizer Loop.
  5. Explain one operational tradeoff of Evaluator-Optimizer Loop.

Documentation and sources

Connect the ideas

Explore next

Reflection LoopAgent Evaluation LoopAgent Termination Condition

Real World Example

Illustrative business scenario · AI-generated from linked documentation · Not a measured customer case study

Legal Contract Clause Refinement

Legal departments drafting high-volume standardized contracts.

The business problem

Initial drafts often contain inconsistent terminology or missing clauses that require multiple manual reviews, causing significant delays in deal finalization.

How this topic solves it

An Evaluator-Optimizer loop automates the iterative refinement of contract clauses by using a generator LLM to draft content and an evaluator LLM to critique the draft against a predefined legal checklist, looping until the criteria are met.

  1. Define the specific legal criteria or checklist that a compliant contract clause must satisfy.
  2. Configure the generator LLM to produce an initial draft based on the contract requirements.
  3. Configure the evaluator LLM to compare the draft against the checklist and output specific feedback.
  4. Implement a loop that passes the evaluator's feedback back to the generator for revision.
  5. Set a termination condition, such as a maximum number of iterations or a successful evaluation pass.
Evaluator-Optimizer Loop Process · Process flow

A cyclical process where a generator creates content and an evaluator provides feedback until the criteria are satisfied.

Input Request

Contract requirements

Generator

Drafts the clause

Evaluator

Checks against criteria

Pass/Fail

Check termination condition

Final Output

Refined clause

  • Input Request → triggers → Generator
  • Generator → sends draft → Evaluator
  • Evaluator → provides feedback → Pass/Fail
  • Pass/Fail → if fail, re-draft → Generator
  • Pass/Fail → if pass, finalize → Final Output

Expected business outcome

Higher quality, consistent contract drafts that require minimal human intervention before final review.

Limitations and checks

The loop can increase latency and cost; check this by monitoring the average number of iterations required to reach a 'pass' state and ensuring it stays within acceptable time bounds.

Sources

Generated 2026-10-18 with gemini-3.1-flash-lite. Your assessment includes two questions about this example.

Catalog source: technology-maxxing. This page reproduces the existing catalog’s learning material and source links.