Design an LLM output quality validation system
I was asked this
No reports yet. Sign in to say where you were asked it.
An AI system design interview question asked in Amazon's system design round, last asked Dec 2025. It tests llm, evaluation and monitoring.
Design a system that checks the quality of a large language model, for a team that trains and serves models. It should evaluate correctness, safety and regression risk for each new model version before release, and keep watching the quality of answers in production. Engineers or the CI pipeline submit a validation run (model version, test sets, evaluation settings) and get back scores, per-example results and a pass or fail.
Requirements
- Functional: submit an asynchronous run; provision compute and start inference servers for the model version; run batched inference over the chosen prompts; store responses with their metadata; score them with several evaluation methods; publish metrics, per-example scores and comparisons with the previous version; gate releases on thresholds.
- Non-functional: scale to large test suites and many concurrent runs; reproducible results (fixed seeds, frozen datasets, versioned models and judges); partial failures recovered without rerunning everything; an API and dashboards that ML engineers and product teams can use.
Clarifying questions
- What does "quality" mean for the products these models serve?
- How many models and versions, and how large are the test suites?
- Who decides the release thresholds, and can a human override a failed gate?
- Do production answers get scored too, and how many of them?
What a strong answer covers
- Levels of checks: numeric internals (NaN or Inf in logits, loss and perplexity on held-out data, calibration), token-level behaviour (tokenizer round trips, stop tokens, output length), and full responses.
- Evaluation methods, combined: reference-based metrics where there is ground truth, programmatic checks (code runs, format is valid), model-based graders with a rubric and calibration against human labels, human review for samples and disagreements, and safety and policy classifiers.
- The pipeline: a run request on a queue, a scheduler that provisions GPUs and inference servers, batched inference, responses and metadata in an object store, evaluation workers that read them, and aggregated results in a metrics store and dashboards.
- Reproducibility and fairness of comparisons: frozen test sets, fixed decoding settings, versioned judge prompts and judge models, confidence intervals.
- Regression detection against the previous version, per category and per slice, not only one average.
- Production monitoring: sampling live traffic, scoring it with the same graders, alerting on drift.
Follow-ups
- The model-based grader and human reviewers disagree on 20% of examples. What do you do?
- The test sets leak into training data. How do you detect and prevent it?
- How do you keep the cost of each run down as test suites grow?
Where it's asked
- Amazon · System design · Last asked Dec 202555 min · Design discussion
What it tests
llm · evaluation · monitoring
No official answer yet. Draw yours on the right; publish it and it shows under Community.
Nothing published yet. Publish your canvas and it shows here for others to open and remix.
