Reflection

Autocrítica · Reflexion

Escrito por Darjus Kazakevic · revisado el

Ask the model to find its own mistake — where the mistake is visible.

Reflection is a cheap way to raise quality. Give the model its own output, ask what is wrong with it, and let it revise. It costs one or two extra calls. It finds real problems when they are visible in the output: a missed requirement, a contradiction, code that does not compile.

It has a hard limit. The critic is the same model as the writer. If the error is a gap in knowledge, the critic does not know either, and it approves the wrong answer. Reflection that uses an outside check — tests, a compiler, a source document — is a real feedback loop. Without one, it is mostly opinion.

En esencia — Reflection works when the error can be seen in the output itself. It fails when the critic shares the writer's blind spot.

Cuándo recurrir a él

Recurre a él cuando

  • An outside check exists: tests, a compiler, a validator, a source
  • The fault would be visible in the output: a gap, a contradiction
  • Quality matters more than the extra latency and cost

Reconsidéralo cuando

  • The likely error is missing knowledge; the critic lacks it too
  • Plain code could answer the question directly
  • You have no evals, so you cannot tell whether it helps

The parts of a reflection pass

The generator
The call that produces the draft, plan or patch. It does not change; reflection is added after it. That makes reflection easy to adopt, and easy to adopt without any benefit.
The critic (The reviewer pass)
A call that checks the output against explicit criteria and reports faults. It works best in a fresh context with the requirements and the output, but not the reasoning behind it.
The outside signal (Grounding)
A verdict from outside the model: the tests pass or fail, the code compiles, the JSON validates, the cited page contains the claim or not. This is what makes reflection improve results instead of agreeing with them.
The revision
The model rewrites, given the original task, the output and the critique. One or two rounds capture most of the benefit. After that it starts rewriting parts that were already fine.

Reglas de diseño

Ground the critique in an outside check
Use tests, a compiler, a schema validator or the cited source. A verdict the model cannot argue with beats any prompt asking the critic to be strict. If plain code can answer the question, run the code.
Give the critic a checklist
“Review this” produces praise. List what to check — every requirement covered, no invented APIs, error paths handled — and ask for specific faults with their locations. Vague criteria give vague, agreeable critiques.
Hide the writer's reasoning from the critic
Give the critic the requirements and the output, not the reasoning that produced it. A critic that sees the justification tends to accept it, which is the exact failure you added the critic to catch.
Limit the rounds and measure the gain
One or two rounds capture most of the benefit. Run your evals with and without reflection. On tasks with no outside check, a real share of the “improvements” make the output worse.

Errores habituales

  • Self-critique with no outside check, reported to others as “verification”.
  • Vague criteria like “review and improve”, so the critic always approves.
  • Unlimited rounds that keep rewriting text and spending money without improving it.
  • Asking a model to check something a validator or a test would settle.