cd /news/ai-safety/finding-and-fixing-regressions-insid… · home › topics › ai-safety › article
[ARTICLE · art-182134] src=mubit.ai ↗ pub= topic=ai-safety verified=true sentiment=· neutral

Finding and fixing regressions inside a model's weights

A released incident-routing model that passed its schema check on all 40 held-out alerts still saw routing accuracy fall from 21 to 11 of 40 after a weight edit, and 6 look-alike and unrelated prompts the base model had handled correctly became wrong, according to an account of the evaluation harness built to catch such regressions. The harness scores every edit on four slices — target, look-alike, unrelated and safety — with a fixed grader that does not know which model wrote a response, and classifies failures as Miss, Wrong, Leak or Damage, counting Damage only on prompts the base model got right. The authors argue that because an edit changes weights every task shares, fine-tunes need a regression suite covering behaviour they never meant to touch, not just a test for the behaviour they add.

recommendation

Add look-alike, unrelated and safety slices to every fine-tune's eval suite and score them against the base model, since a schema check alone shipped a model whose routing accuracy fell from 21 to 11 of 40.

more in playbook: Evals and testing for LLM apps
by read8 min views1 publishedDec 4, 2026
Finding and fixing regressions inside a model's weights
Image: source

If you've used an AI model at work, you've probably shaped it with a prompt: a paragraph of instructions telling it what job to do. Prompts are cheap but fragile, so teams that depend on a model for one job increasingly change the model itself. They fine-tune it, train an adapter on it, or edit its weights directly, until the behaviour they want is built in rather than asked for. The catch is that there's no such thing as a private change to a model. The weights that learn your task are the same weights that answer every other question the model sees. Push them towards one behaviour and you move everything else that runs through them. Most of that movement is invisible to the test you wrote for the new behaviour, and it doesn't matter how the change was made. The problem is the change, not the method.

Most fine-tunes come with a test for the behaviour they add. Few come with a test for what they break. This post follows that gap from a model that passed its release check to a fix we can trace back to a single component of the edit: how we measure what an edit changes, why testing an edit at partial strength misleads, and how far white-box attribution gets us towards repairing a regression.

The test that passed #

When a team updates a model's weights, through full fine-tuning or a LoRA, they know what they want the model to learn and they write evaluations for it. We call any such update an edit: $\Delta W = W_{\text{edited}} - W_{\text{base}}$. What the team rarely has is a list of everything the base model already did well. Nobody writes down that the old model handled some edge case correctly. They find out when it stops.

We hit this on an incident-routing model we had released. For each alert, the model picks a severity, assigns a team, decides whether to escalate, and returns JSON for downstream tools. The released model returned valid JSON on all 40 held-out alerts, so a schema check passed. Compared with the base model, though, routing accuracy fell from 21 to 11 of 40, and 6 look-alike and unrelated prompts that the base model handled correctly were now wrong. A release gate that checked format would have shipped it.

An edit changes weights that every task shares, so its effects reach beyond the training data. If you treat an edit like a code change, you need a regression suite, and that suite has to cover behaviour you never meant to touch.

Scoring an edit #

Every edit goes through our evaluation harness. From a plain description of the intended behaviour, the harness builds a held-out set with no overlap with training, split into four slices. Each prompt has a written grading criterion:

  • Target: checks that the edit learned the requested behaviour.
  • Look-alike: prompts close to the target that should keep the base model's answer. These catch over-generalisation.
  • Unrelated: checks that general capability survived.
  • Safety: checks whether the model is now easier to push into harmful output.

A fixed grader marks every response against its criterion without knowing which model wrote it. We run the same prompts on the base model ($W_{\text{base}}$) and on the base model with a system prompt. The prompted baseline checks whether a better prompt would have done the job without any training.

Each failure goes into one of four categories. Miss and Wrong measure what the edit learned; Leak and Damage measure what it cost:

  • Miss: on a target prompt, the requested behaviour is absent.
  • Wrong: on a target prompt, the behaviour is present but the content fails the criterion.
  • Leak: the target behaviour fires on a look-alike or unrelated prompt.
  • Damage: a look-alike or unrelated prompt that the base model got right is now wrong, or a safety prompt gets the harmful answer it asks for.

Damage only counts prompts the base model got right, so an edit is never blamed for the base model's own mistakes. We graded the 379-prompt dosage set below twice, and the two passes agreed on about 97% of marks.

On the target slice alone, this protected-LoRA edit on Qwen3-8B looks ready to ship: 140 of 148 dosage requests answered correctly, with 5 Misses and 3 Wrongs. The other slices look worse. There are 35 Damage marks (out of 164 base-correct look-alike and unrelated prompts plus 50 safety prompts), and 32 of them are ordinary medication questions the base model answered well. The prompted baseline scored 97 of 148 on target with 18 Damage marks. The prompt alone learned less of the behaviour and broke less.

Some regressions fall outside any generated prompt set, such as a skill a customer relies on, or whether the model still respects caller permissions. We check those separately. We compare outputs on tasks the base model already solved, flag repetition loops and truncated answers, and log the exact tool calls on authorised and unauthorised requests.

That is the measurement, and running it on every edit is not cheap. The tempting shortcut is to test a weaker version of the edit and extrapolate. It turned out to be the most misleading thing we tried.

The edit at a quarter strength #

Because we have the weights, we can scale an edit. For any $\alpha \in [0, 1]$:

$$W(\alpha) = W_{\text{base}} + \alpha \Delta W$$ This is the weight interpolation used in task-vector methods. It shows how behaviour changes as the edit is turned up, which you cannot do through a closed API.

To avoid sampling noise, we fix the prompt and two continuations: a routine referral to a doctor, and an instruction to call emergency services. We add up the log-probabilities over each continuation's tokens and track the change in log-odds between the two, in nats. A shift of 1 nat multiplies the odds by about 2.7; 5 nats multiplies them by about 148.

A common shortcut is to treat the response as roughly linear. You take the slope at $W_{\text{base}}$ ($\alpha = 0$), or test a small fraction of the edit, and extrapolate to $\alpha = 1$. Set the slider below to a quarter strength ($\alpha = 0.25$) on the Llama 3.2 1B off-target experiment. On 20 emergency prompts the edit was never meant to affect, the average shift is about $+0.5$ nats, almost nothing.

Now move the slider to full strength ($\alpha = 1$). The shift reaches nearly $+46$ nats towards the routine referral. The slope at the original weights predicted about $-16$ nats, the wrong sign.

Switch the dropdown to the intended task (a separate edit on the same model, scored on 25 dosage prompts) and the curve bends the other way. Most of the change happens early, with $+61.8$ nats by $\alpha = 0.25$ out of $+139.2$ at full strength. Put the two curves together and a partial-strength test can show the edit already doing its job with almost no side effects, while the off-target damage only appears near full strength. The slope at the midpoint ($\alpha = 0.5$) does much better. On the Llama off-target set it predicted the direction of change on all 20 prompts; the slope at the original weights got 3 of 20. Neither a small dose nor the slope at $W_{\text{base}}$ can stand in for the full edit, so we always score $\alpha = 1$ on the full held-out set.

Knowing an edit is broken is only half of what a team needs. The other half is knowing which part of it is doing the breaking, and whether that part can come out without losing what the edit was for.

From a trace to a repair #

Finding Damage helps only if you can fix it and keep the edit. Our white-box auditor runs $W_{\text{base}}$ and $W_{\text{edited}}$ on the same text, ranks the prompts where predictions moved most, and attributes those shifts to parts of $\Delta W$. We can then scale back the part it nominates and regenerate. If the regression goes away, we rerun the target slice to check the requested behaviour is still there.

In a controlled test, this works. On a 4-bit Qwen3-8B we planted a low-rank edit with a known defect that released fictional requests when they had no approval. Removing the single rank-1 factor at layer 33 that the auditor nominated fixed all 11 false releases and kept all 12 legitimate approvals. Removing another factor from the same update fixed none.

A planted defect is easier than a real customer edit, where nobody knows the failure modes in advance. Our edits already generalise to unseen target prompts and run at base-model speed. Damage is the open problem. In the next round, the auditor flags where an edit spills over, those cases go back into training, and the harness scores the new weights on fresh prompts.

What this means if you ship edited models #

Our incident-routing model passed every check we had given it, because every check was about the job it was trained for. Nothing in that gate was built to notice that it had got worse at the job itself, or at questions it used to answer correctly.

The fix is not a cleverer training method. It is treating every change to a model's weights the way you would treat a change to production code: with a regression suite that covers what nobody meant to change, run on the edit you are actually going to ship, at full strength, against a prompted baseline that tells you whether the edit was worth making at all. When something does break, white-box attribution can already point at the part of the edit responsible and, in clean cases, take it out.

If you're changing a model's weights, you should know what else you changed before your users find out.

── more in #ai-safety 4 stories · sorted by recency
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/finding-and-fixing-r…] indexed:0 read:8min 2026-12-04 · —