Skip to main content

LLM outputs change from run to run. How do you build an eval gate in CI that blocks real regressions but does not fail at random?

Deployment and LLMOps · Pro 1

Short answer

First measure the noise: run the unchanged baseline several times and see how much the score moves. Set the threshold outside that range. Use deterministic checks where possible, enough examples, and a comparison with the baseline on the same cases. Keep a small set of critical cases as hard failures. Pin the judge model and its prompt.

Deeper answer

A gate that fails at random gets disabled, and then it protects nothing. Flakiness has three main sources: a test set too small for one changed example to mean anything, a judge model that itself varies, and a threshold chosen without data. So measure before setting rules. Run the current version five times. If the score moves between 86% and 90%, a rule of fail under 88% will pass or fail by chance.

Then reduce the variance. Use code checks for anything that can be checked exactly: valid JSON, required fields, a forbidden phrase, the correct tool call. Use a model judge only for what needs judgment, with a fixed judge version, a clear rubric and low temperature. Compare the candidate with the baseline case by case, which is more sensitive than comparing two averages. Split the suite: a few must-pass safety cases, each run several times, and an aggregate score with a margin. A fast subset can run on every pull request. Interviewers listen for measured noise.

What a strong answer covers

Answer it out loud in the mock interview about 2 min

Follow-ups to expect

Common mistakes

Learn it

Regression tests for prompts

Practice Deployment and LLMOps questions

More on this topic

Today's AI turns are used

Lessons, roadmaps, videos, practice cards and the code playground stay free with your account, with no limit.