Primary Model Regression Evaluation: A Rational Guide to Switching Models
This article explains why choosing a primary LLM should be a repeatable engineering decision rather than a reaction to release cycles. It covers how to define task distribution, failure modes, and constraints; how to build a layered, anonymized bad-case set with a freeze window; how to score candidates across correctness, constraint compliance, completeness, stability, economics, and security; and how to run a baseline-versus-candidate regression protocol with explicit thresholds. It also addresses risk-based traffic splitting, rollback conditions, quota management, common evaluation mistakes, and a practical rollout checklist.
When a development team fixes a particular model as its “primary workstation,” it is usually not because that model leads on every task forever. It is because the model fails less often, causes less rework, and has more predictable cost inside the team’s real workflow. Models iterate quickly, and quality across aesthetics, code style, long-context stability, and tool-call reliability all fluctuates. A generation you just found “burns through quota and produces mediocre output” may improve markedly on the same set of historical failures in its next release. The right move is not to chase the release cadence but to build a regression evaluation, turning “should we switch back to the primary?” into a repeatable engineering decision.
1. Abstract the problem before discussing a switch
The raw experience usually looks like this: you have a backlog of cases the old model handled poorly, you rerun them all once the new version ships, it feels “not bad,” and you switch the primary back. That intuition has value but is not enough as a team standard. Break the phenomenon into three manageable objects.
The first is task distribution. What the primary model actually consumes is code completion and refactoring, defect localization, API documentation, test generation, log interpretation, and solution comparison — not the general chit-chat on public leaderboards. Once the distribution drifts away from daily tickets, the evaluation conclusion becomes distorted.
The second is failure modes. Write “hard to use” as reproducible items: missing call-site updates, hallucinating nonexistent APIs, ignoring boundary conditions, breaking existing code style, forgetting constraints in the latter half of a long document, unstable tool-argument formats, and excessive drift across repeated runs of the same prompt.
The third is constraints. Latency budget, per-call and daily cumulative token consumption, context length, whether code may be sent externally, and whether output must be machine-parseable — these constraints often decide whether a model can take the primary workstation more than “looking smarter” does.
The goal of switching is not to prove that some generation has “fully revived.” It is to prove that, under this team’s bad-case set and cost constraints, the new candidate’s expected rework is lower than the current primary’s, and that it introduces no unacceptable new failures.
2. Build a living bad-case set
The bad-case set is the core asset of regression. Build it continuously by repository and business domain rather than grabbing a few items from chat logs on the fly.
Each sample should contain at least: anonymized input (requirements, code snippets, error logs), the constraints that must be respected, a reference answer or acceptance checkpoints, a failure label, and a severity level. For code samples, prefer keeping a minimal reproducible project rather than pasting an entire repository. Any material involving keys, customer data, or undisclosed APIs must be redacted or rewritten into an equivalent structure.
Layer the samples so you do not collect only the “hardest show-off problems”:
- High-frequency daily: renaming, adding tests, explaining stack traces, writing commit messages.
- Medium complexity: cross-file changes, generating a client from an API contract, proposing troubleshooting steps from logs.
- High risk: permission checks, data migration scripts, concurrency and transaction boundaries. These default to human review and are never auto-approved based on a model score.
For scale, the core set used for the primary decision should stay stable at dozens to a few hundred items, with a “freeze window”: no ad-hoc additions or removals during evaluation, so the conclusion does not become self-persuasion. Outside the window you can keep collecting new bad cases for the next round.
For storage, keep samples, scoring scripts, and run logs managed separately across object storage and version control: prompts and expected checkpoints go into version control, while large run artifacts go into object storage. If your team already uses object storage, a container platform, and a log service on Baidu AI Cloud, you can schedule evaluation jobs as ordinary batch tasks and do not need to invent a separate set of platform terms for model selection. Only generic capabilities are used here: store objects, run containers, keep logs — no undisclosed APIs or quota rules are assumed.
3. Scoring dimensions must guide rework
A single “good or not” cannot compare generations. Fix a small number of dimensions, each with checkable rules rather than long impression scores.
Correctness: whether it passes unit tests, static checks, or human-listed assertions. Do not rely on a reading impression when something can be judged automatically.
Constraint compliance: whether it modified forbidden files, invented dependencies that do not exist in the repository, or produced output that violates the agreed format (for example, returning only a patch or only JSON).
Completeness: the coverage ratio of the acceptance points in the requirement. Omissions affect whether a model can serve as primary more than style issues do.
Stability: run the same prompt several times and measure how consistent the key conclusions and patch structure are. If the primary model jitters heavily, code review cost rises.
Economics: record input and output tokens, wall-clock time, and the number of failed retries. When there is no unified price table, do only relative comparisons: under the same samples and the same retry policy, who is cheaper and who is slower. Do not fabricate absolute cross-vendor performance percentages.
Security and compliance: whether it tries to output key-like strings, suggests disabling authentication, or writes internal paths into a document that could be committed. High-risk items use a single veto rather than being averaged into the total score.
An illustrative check can be very plain; the point is repeatability:
for sample in frozen_set:output = run_model(sample.prompt, temperature=fixed)scores = {"tests": run_checks(sample, output),"format": schema_ok(output),"forbidden": not touches_denied_paths(output),}record(sample.id, scores, tokens, latency)
Temperature, system prompt, max length, and whether tools are enabled must be aligned across both sides of the comparison. Otherwise you are evaluating prompt-engineering differences, not model differences.
4. Regression protocol: new versus old, not isolated play
Fix the protocol as four steps.
Baseline freeze. Run the current primary over the same bad-case set once, keeping the scores, the failure list, and the cost. A “feels better” without a baseline cannot be a basis for switching.
Candidate rerun under identical conditions. The new version uses the same prompt templates and decoding parameters. If the default parameters of the product form are not controllable, note the uncontrollable items in the report and avoid over-explaining.
Difference review. Automated scores only rank; they do not decide directly. For items whose scores rose, check whether the original failure mode was truly fixed; for items whose scores dropped, judge whether it is individual jitter or a systematic regression (for example, becoming more verbose to the point that patches are unusable, or more “confidently” fabricating APIs).
Threshold judgment. This can be written in advance, for example: zero new high-risk items; core-set pass rate not below baseline; fewer severe failures; latency and consumption within the team budget; stability not significantly worse. Describe thresholds relative to the baseline and avoid inventing an industry-wide pass line.
A two-hour play session can surface new failures the evaluation set did not cover, but it cannot replace the frozen set. Hands-on feel is good for expanding samples; it is not good for unilaterally declaring that the primary has been “retaken.”
5. When to switch, and when to only split traffic
Even if a candidate is better on the bad-case set, there is no need to replace everything at once. A safer approach is to split by risk.
Low-risk, automatically verifiable tasks (explanatory text, test drafts, format conversion) can switch to the candidate first, observing the human adoption rate over a week. Define adoption rate as “merged into the repository or adopted as-is,” not as likes.
High-risk changes stay on the current primary or use a two-model comparison: give both outputs to the reviewer, but do not auto-apply the patch by default. Comparison is costly, so reserve it for migration scripts and permission- or money-related logic.
Set rollback conditions: a severe incident, a compliance event, or several consecutive days with a severe-failure rate above baseline triggers a switch back to the previous primary. Write the rollback into the on-call notes in advance to avoid live arguments.
Quota management is part of switching. A primary that “burns through quota” often comes from repeatedly pasting long context, retrying without limit after failures, and stuffing an entire repository into the prompt. Whichever version you finally choose, do prompt slimming, diff-patch input, caching of the invariant prefix, and retry limits. These engineering measures often deliver greater cost improvement than a generation change.
6. Common misjudgments
Using public demo problems instead of internal tickets. Demo problems are optimized in a direction that does not match business code.
Counting only winning samples. If the eliminated old model was better on stability or format compliance, the average experience may not actually be worse.
Treating one late-night concentrated run as the long-term distribution. Service load, rate limiting, and default routing near a release can all change, so rerun the key subset across multiple time windows.
Letting brand impression replace acceptance. Generation names, release messaging, and third-party reviews cannot enter the scorecard. The scorecard recognizes only this set’s checkpoints.
Embedding unverifiable speed or accuracy numbers in the evaluation write-up. Percentages without a measurement protocol mislead later procurement and scheduling.
7. Rollout checklist
Define the task distribution the primary covers, and write it up as a one-page note. Freeze the bad-case set and checking scripts, and complete redaction. Align decoding parameters and tool toggles, and run the current baseline. Rerun the candidate under identical conditions and produce a difference report rather than letting a single total score dominate. Decide on a full switch, traffic splitting, or the status quo according to the thresholds set in advance. After launch, track adoption rate, severe failures, and per-task consumption, and roll back when a trigger fires. Add new failures to the next window’s bad-case set.
This way, a model that is “about to be replaced and then fights its way back” is no longer a narrative but an auditable regression: what should stay stays, what should retreat retreats, and the team’s primary workstation is always decided by failure modes and constraints — not by the excitement of a release moment.
