ai newsDi., 1. Dez.

Your last prompt tweak broke something. You just didn't find out until a user did.

That's the failure mode nobody tests for. Unit tests check code. Nothing checks what the model actually says after a prompt change, a system message edit, or a model upgrade — until the support tickets arrive. I built a small free skill that closes the gap: the LLM Prompt Regression Suite. How it w

dev.toSonntag 02:47 · 29.11.1 Min. Lesezeit
Bild: dev.to

That's the failure mode nobody tests for. Unit tests check code. Nothing checks what the model actually says after a prompt change, a system message edit, or a model upgrade — until the support tickets arrive.

I built a small free skill that closes the gap: the LLM Prompt Regression Suite.

Everything runs offline and deterministic: no live LLM calls, no API keys, stdlib-only Python.

I ran it on the bundled fictional 6-prompt sample (classification, FAQ, tone, extraction, JSON format, yes/no). Real dry-run result: overall FAIL — 4/6 passed, 2 failed.

Validator confirmed: 6 cases, 4 passed, 2 failed, 0 errors.

The two failures are exactly the kind that slip through: a product summary that lost its key fact and friendly tone, and a JSON-only greeting that came back as plain text.

A golden set is just JSON: cases with an id, name, prompt, baseline output, and new output, plus a meta.threshold (default 0.85). Swap the bundled fictional sample for your own set in the same shape and the same two commands run it. The sample covers classification, FAQ, tone, extraction, JSON format, and yes/no — six cases that exercise the exact failure modes teams actually hit.

It compares recorded outputs — it doesn't call a live model, grade factual truth, or judge creative quality. Similarity is text overlap (difflib), not a semantic judge: a paraphrase can score low and a wrong answer can score high. Triage every failure.

The workflow to steal: golden set, compare, validate, triage, gate the release.

Quelle: dev.to (dev.to). Original öffnen