Skip to content
mentoor

Topic 1 of 6 · 3 min read

Why prompts break on a new model

Goal: List what in a prompt and its parser depends on one model's habits and predict what a switch breaks.

A prompt is tuned to one model's habits, so changing the model changes the program even when you change no code. The failures are usually quiet: the app still runs, the output just looks a little different, and something downstream stops matching.

Check yourself · 1 of 3

A team swaps the model behind a classifier. No code changed, but the app now throws errors on some replies. Which cause is most likely?

Choose one answer

Why it matters

A model is not a library with a fixed contract. Two models given the same prompt differ in length, tone, how strictly they follow formats and how they handle edge cases. Your prompt, your parser and your tests grew up around the old model. Every workaround you added is a bet on its behaviour.

What depends on the model

Go through the feature and list each place that leans on a habit:

  1. Output format. A regex that expects the answer to start with Category:, or code that strips a ```json fence. A new model may add a sentence before the JSON, drop the fence, or wrap it differently.
  2. Length and style. A summary field that fit in the UI at 80 words now arrives at 140, or the other way round.
  3. Workarounds. "IMPORTANT: do NOT use markdown" or "think step by step" were added to fix a specific failure. A newer model may not need them, may over-obey them, or may already reason on its own, so the line now changes the answer in a way you did not intend.
  4. Refusals and safety behaviour. A request that passed before may be declined, or the refusal text may no longer match the string your code looks for.
  5. Tool calls. Argument names, how often the model calls a tool, and how it formats the call all shift between models.
  6. Cost and speed. A model that writes longer answers or reasons first costs more tokens and takes longer per request, which changes timeouts and budgets.

Before and after

Before, the parser relies on a habit:

raw = reply.text
label = raw.split("Label:")[1].strip().split("\n")[0]

This works while the model always opens with Label:. A new model answers "Sure, here is the label. Label: refund" and the split still works, until it answers "The label is refund" and the call raises an error, or worse, returns the wrong line.

After, the format is requested explicitly and checked:

data = json.loads(reply.text)   # structured output requested in the call
label = data["label"]
if label not in ALLOWED_LABELS:
    raise ValueError(label)

The check turns a quiet drift into a loud error you can see in testing.

What goes wrong

  • Testing three prompts by hand. They pass, and the 4% of real inputs with odd formatting break in production.
  • Keeping every old workaround. Lines written against a past failure stay in the prompt for years and now cause new ones.
  • Changing the model and the prompt together. When quality moves, you cannot tell which change did it. Switch the model first, measure, then edit the prompt.

Examples

A parser that depended on a fence

The old model always returned JSON inside a ```json fence and the code removed the first and last lines. The new model returns bare JSON. The code now deletes the opening brace and the closing brace, json.loads fails on 1 in 3 calls and the retry loop hides it. Asking for structured output and parsing it directly fixes both models.

A workaround that became a bug

A prompt said "Always answer in exactly three bullet points" because the old model rambled. The new model obeys it literally, so a question with one real answer gets two padding bullets. Remove the workaround, rerun the test set, and add it back only if the failure returns.

Key points

  • Changing the model changes the behaviour of your app even when no code changes.
  • Parsers that rely on a habit such as an opening phrase or a code fence break quietly on a new model.
  • Old workarounds in a prompt were written for one model's failures and can hurt on the next one.
  • Refusal wording, tool-call style, length and token cost all differ between models.
  • Change the model first and measure, then adjust the prompt, so you know which change moved quality.

Common mistakes

  • Judging a new model on a handful of hand-picked prompts instead of a fixed test set.
  • Leaving workaround lines in the prompt without knowing which failure each one fixed.
  • Changing the prompt and the model in the same release, so no one can say which caused a regression.
  • Parsing free text with string splits instead of requesting a structured format and validating it.

Check yourself · 2 of 3

Which line in an old prompt is most likely to cause trouble after a model switch?

Choose one answer

Check yourself · 3 of 3

You move a feature to a newer model and also rewrite its prompt in the same release. Quality drops 6 points on your tests. What is the problem with this approach?

Choose one answer

Practice items, not counted towards your mastery.

Start here