If your product uses an LLM, how do you stop it from grading its own work?

by•

I hit a bug recently that I think a lot of people building with LLMs

could run into, and I'm curious how others handle it.

My product checks whether academic citations point to real papers. When

a reference is too messy to parse, I ask an LLM to fill in the missing

fields, then search again.

The bug: after the second search, my code replaced the user's input

with the LLM's version. So every candidate paper was being scored

against what the model guessed, not what the user actually typed. If

the model guessed a plausible title, it would find a real paper with

that title, and then "verify" it against its own guess. A wrong

reference could come back as verified.

The fix was to treat LLM output as search hints only. It can help find

candidates, but scoring always uses the original input, and the second

pass only wins if its score is strictly higher.

It made me wonder where other people draw this line:

- Do you let model output become the "source of truth" anywhere in your

pipeline, or only use it for retrieval/suggestions?

- How do you catch this kind of bug? It passed all my tests because the

results looked better.

- Has anyone found a clean way to make this boundary explicit in code,

so it doesn't get crossed by accident later?

Would love to hear how you've approached it.

18 views

Add a comment

Replies

Be the first to reply

Have a question or a thought to share? Add a comment above to start the conversation.