Full Byte Developer.

Do not let the model that wrote the answer grade it

A prompt edit can quietly break answers your demos never show. Grade with code first.

Published here · 1 source

Do not let the model that wrote the answer grade it. A prompt edit can quietly break answers your demos never show.

The grading order

Checked Nov 8 against Anthropic develop-tests:

  1. Pick the fastest, most reliable, most scalable grader: code-based first. An LLM grader once you have tested it. Humans only if you must (the docs say "avoid if possible").

  2. More auto-graded questions beat fewer hand-graded ones.

Starter function

python
def evaluate_exact_match(model_output, correct_answer):
    return model_output.strip().lower() == correct_answer.lower()

LLM judge rules

  • Detailed rubric with auto-fail conditions
  • Output only correct/incorrect or 1 to 5
  • Thinking on
  • Different model than the writer
  • Mirror your real tasks and include edge cases

Send this to the friend who lets the same model write the answer and grade it.

Keep this guide

By Full Byte Developer

Filed under AI agents

Questions about this guide

Why prefer code-based graders?

They are faster, more reliable, and more scalable than LLM or human graders.

When should I use an LLM judge?

Only after you have tested it. Use a detailed rubric with auto-fail conditions, output only correct/incorrect or 1 to 5, enable thinking, and use a different model than the writer.

Sources

Next in this stack