LearnQuestion bank

How do you stop prompt or model changes from silently breaking things? Describe eval-in-CI that copes with non-deterministic outputs.

Applied LLMTechnicalMedium

Theme reported publicly: Cohere

Answer it yourself first, out loud or on paper, then compare.

Answer

Model answer, written in a candidate's voice

In short

  • Treat prompt, model, and parameters as versioned configs, not code-adjacent strings
  • Golden suite mixes deterministic code assertions with judge checks for open-ended outputs
  • Run multiple samples and compare pass rates/distributions to a baseline, not exact match
  • Handle flakiness with retries, quarantine, and explicit known-flaky tracking without hiding regressions
  • Tier checks: fast smoke on every PR, full suite nightly, with caching to control cost
  • Turn every production incident into a regression test and block deploys on critical-slice regressions

In full

I would make the prompt, model, and decoding parameters a versioned config artefact, so every run is reproducible and every change is reviewable. The golden suite would combine code assertions for the parts that can be checked mechanically, such as schema validity, required or forbidden substrings, and numeric ranges, with judge checks for open-ended items using a fixed rubric and human spot checks rather than a single brittle score. Because outputs are non-deterministic, I would sample multiple times and compare pass rates or distributions against a stored baseline with explicit thresholds, instead of requiring exact match, and I would treat borderline or intermittent failures as flaky only after retries and a known-flaky registry, never by silently deleting them. I would keep a quick smoke tier on every PR and a full suite nightly, cache stable outputs and judge results keyed by config hash, and invalidate that cache whenever the prompt, model, or parameters change. Finally, every production incident becomes a regression test, and deploys are blocked when the critical slice regresses, while non-critical noise can be reviewed separately.

Corrected by an independent AI reviewer.

What a strong answer covers

  • Versioned prompt+model+parameter configs; golden suite with code assertions (schema, must/must-not contain, numeric checks) and judge checks for open-ended items
  • Multiple samples, thresholds and statistical comparison with the baseline instead of exact match; flaky-test handling
  • Tiers: quick smoke on every PR, full suite nightly; caching to control cost
  • Every production incident becomes a test; deploys blocked on critical-slice regressions

Common mistakes

  • Exact string matching on free text
  • one aggregate threshold hiding a critical slice