LLM Quality Regression: A Reproducible Method for Detecting Model Changes

    Has your language model become less capable, or has its behavior simply changed? This article presents a reproducible detection workflow using historical baselines, random-number fingerprints, capability probes, and statistical comparisons. It includes Python code and practical monitoring guidance to help distinguish normal variation from meaningful changes in model behavior and quality.

    1. Model Quality Regression Is a Measurable Problem

    Many users notice that a familiar large language model seems less capable over time. Generated code becomes less precise, complex instructions are only partially followed, or generated images crowd subjects and backgrounds together.

    This perceived decline can have several explanations:

    1. An undisclosed model replacement. A provider may route requests to a lower-capability model for cost, capacity, or staged-rollout reasons while retaining the same public model label.
    2. Changes to inference settings. The model weights may remain unchanged, but adjustments to temperature, inference compute, context length, or system prompts can reduce output quality.
    3. Regression during model updates. Fine-tuning or a new model version may introduce capability losses.

    A subjective impression is not enough to establish a regression. The goal is to turn that impression into evidence that is reproducible, measurable, and comparable.

    The approach described here uses statistical behavioral fingerprints: output patterns that remain relatively stable under controlled conditions. A substantial shift in those patterns can indicate a change in the underlying model or its serving configuration.

    2. Why Random Numbers Can Serve as a Fingerprint

    A counterintuitive observation is that asking an LLM for a random number does not generally produce a uniform distribution.

    For example, when prompted to “generate a random number between 1 and 355,” a model may strongly favor particular numbers. Those preferences reflect its training data, sampling mechanism, and learned output tendencies.

    • A uniformly distributed random integer from 1 to 100 has an entropy of approximately 6.64 bits.
    • An LLM’s generated “random numbers” can have much lower entropy—sometimes around 1 bit, depending on the model and conditions.
    • Repeated sampling from the same model under the same conditions can converge toward a distinctive distribution.

    Entropy measures how difficult an outcome is to predict. At approximately 6.64 bits for the 1–100 range, no number is favored. At around 1 bit, a few high-frequency numbers account for most of the probability mass.

    This combination of model-specific preferences and relative stability makes the distribution useful as a behavioral fingerprint. If it suddenly deviates substantially from a historical baseline under identical conditions, the model’s behavior has changed. That signal alone, however, does not establish that its capabilities have declined.

    3. A Reproducible Detection Workflow

    The workflow has four stages:

    Establish a baseline → Sample multiple probes → Compare statistically → Evaluate the combined evidence

    3.1 Establish a Historical Baseline

    Collect and preserve behavioral data while the model is performing as expected.

    Useful probes include:

    • Random-number distributions: Ask for a “random number” between 1 and N, collecting several hundred to several thousand responses per batch.
    • Mathematical probes: Use problems with unique correct answers across several difficulty levels. Record accuracy and observable solution-pattern characteristics.
    • Complex instruction probes: For example, request structured JSON that must satisfy seven constraints, then measure the constraint satisfaction rate.
    • Generative probes: For text or image generation models, use fixed prompts describing complex scenes with multiple subjects and spatial relationships. Assess subject completeness and composition.

    Collect baseline data in multiple batches, such as on different dates, to distinguish ordinary variation from persistent drift.

    3.2 Repeat Sampling Across Multiple Probes

    During a check, repeat the probes using the same prompts, parameters, and calling method as the baseline.

    Key requirements include:

    • Keep temperature, maximum output length, and system prompts unchanged.
    • Avoid distortions caused by caching or rate limiting.
    • Collect at least several hundred samples per probe to support statistical comparisons.
    • Sample within a consistent time window to reduce confounding from upstream routing or policy changes.

    3.3 Compare the Results Statistically

    For random-number distributions, useful comparisons include:

    • Entropy: Compare the empirical entropy of the current distribution with the baseline.
    • Chi-square tests: Test whether the current distribution differs from the baseline distribution.
    • KL divergence or JS divergence: Quantify the difference between the two distributions.
    • Top-k overlap: Check whether the most frequently generated numbers have changed.

    For mathematical and instruction-following probes, compare accuracy and constraint satisfaction rates, including their confidence intervals. Confidence-interval overlap provides context, but should not be treated as a definitive significance test on its own.

    3.4 Evaluate the Combined Evidence

    A single metric can be misleading. Look for agreement across multiple probes.

    If the random-number fingerprint shifts while mathematical accuracy and instruction-following performance also decline, the combined evidence supports a substantive change in model behavior and quality.

    If the fingerprint changes but capability metrics remain stable, a sampling or serving-configuration adjustment may be responsible. Further investigation is needed before calling it a quality regression.

    4. Python Example: Measuring Entropy and Distribution Differences

    The following Python example extracts a fingerprint from numeric model outputs and compares it with a baseline. It requires SciPy.

    1. import math
    2. from collections import Counter
    3. from scipy.stats import chisquare
    4. def entropy_bits(samples, upper):
    5. """Calculate the entropy of the empirical distribution in bits."""
    6. n = len(samples)
    7. counts = Counter(samples)
    8. ent = 0.0
    9. for c in counts.values():
    10. p = c / n
    11. ent -= p * math.log2(p)
    12. return ent
    13. def top_tokens(samples, k=10):
    14. """Return the most frequent numbers as a behavioral fingerprint."""
    15. return [x for x, _ in Counter(samples).most_common(k)]
    16. def compare(baseline, current, upper):
    17. """Compare the current distribution with the baseline using chi-square."""
    18. base_counts = Counter(baseline)
    19. cur_counts = Counter(current)
    20. tokens = list(range(1, upper + 1))
    21. observed = [cur_counts.get(t, 0) for t in tokens]
    22. expected = [base_counts.get(t, 1e-9) for t in tokens]
    23. # Scale the expected counts to match the total observed count.
    24. total_obs = sum(observed)
    25. total_exp = sum(expected)
    26. expected = [e * total_obs / total_exp for e in expected]
    27. stat, p = chisquare(observed, f_exp=expected)
    28. return stat, p
    29. # baseline and current are lists of numeric model outputs
    30. # collected during two sampling runs.
    31. # print("Entropy: %.2f bits" % entropy_bits(current, 355))
    32. # print("Top-10 fingerprint:", top_tokens(current))
    33. # print("Chi-square p-value:", compare(baseline, current, 355)[1])

    Interpret the results carefully:

    • A p-value below 0.01, with sufficient samples and valid test assumptions, provides evidence that the distributions differ.
    • Lower entropy indicates a more concentrated output distribution. It may reflect a more conservative model or inference configuration, but does not by itself demonstrate lower capability.
    • A substantially different top-k fingerprint is a strong behavioral-change signal, though it does not uniquely identify a model replacement.

    The chi-square calculation is illustrative. Sparse expected counts, particularly the near-zero values used for numbers absent from the baseline, can make its p-value unreliable. Treat the result as one part of the evidence rather than a standalone verdict.

    5. Common Pitfalls

    Insufficient Samples

    With fewer than several hundred observations, empirical entropy and distribution-test results can fluctuate substantially. A small sample can produce an apparent change that disappears in subsequent batches.

    Inconsistent Prompts

    Even a whitespace or line-break change can affect the output distribution. Reuse the baseline prompt exactly.

    Upstream Caching

    Repeated prompts may return cached responses, creating an artificially concentrated distribution. Disable caching where possible. If prompt variations are necessary to avoid it, apply the same variation procedure when collecting both baseline and current samples.

    Staged Rollouts and Mixed Routing

    Requests made during the same period may reach different model versions. Sample across several time windows and look for evidence of mixed fingerprints. Such mixtures may appear as multiple concentrations in the distribution, although a visibly bimodal pattern is not guaranteed.

    Mistaking Statistical Noise for a Conclusion

    An isolated deviation in one probe is not enough to establish a regression. Cross-check the result with mathematical, instruction-following, and other relevant capability probes.

    6. Engineering Recommendations

    Turn the workflow into a repeatable monitoring process:

    • Schedule regular sampling. Run probes daily and record entropy, top-k fingerprints, and capability metrics.
    • Define alert thresholds. Examples include an entropy drop above a chosen threshold, such as 15%; persistently low chi-square p-values below 0.01; or an accuracy decline beyond the baseline uncertainty range.
    • Version baseline data. Track prompts alongside the results. Rebuild the baseline whenever a probe prompt changes.
    • Store and visualize results. In enterprise environments, general-purpose logging, monitoring, and alerting services can support long-term trend analysis.

    Thresholds should trigger investigation, not automatically label a model as degraded. Persistent changes across several metrics are more informative than a single alert.

    7. Conclusion

    Determining whether an LLM has become less capable should not depend on anecdotal impressions alone.

    Random-number fingerprints provide a low-cost signal of behavioral change. Combined with mathematical probes, instruction-following tests, and statistical comparisons, they can support a reproducible model-quality monitoring workflow.

    The central principle is straightforward: capture a baseline while the model is performing well, reproduce the sampling conditions when concerns arise, and evaluate statistical evidence alongside capability measurements.

    This approach helps detect and quantify meaningful changes without confusing every distribution shift with a loss of intelligence—or assuming that observed behavior reveals exactly what changed upstream.