Security

When to Fix the Prompt Instead of Fine-Tuning

Antonio Evans10 min read

A split workbench: on the left, a printed prompt sheet with highlighted lines and a red pen, a stopwatch and a stack of index cards labeled 'format', 'knowledge', 'policy'; on the right.
Key points

Key points

  1. 1Sort every labeled model failure into one of three categories (formatting, knowledge gap, policy or tone) before you spend money on either prompts or training data.
  2. 2Fix the prompt first when formatting and missing context dominate; most format problems are cheaper to close with a clearer instruction or a constrained output schema than with a training run.
  3. 3Add retrieval before training when knowledge gaps are a large share of failures, because retrieval changes what the model can see and training changes how it behaves.
  4. 4Fine-tune when the same policy or tone correction repeats across many clean examples and no prompt can hold the rule reliably.

Why "prompt versus fine-tune" is the wrong first question

Most teams reach for fine-tuning because the model "doesn't get it." That framing hides the actual work. A wrong answer on a task can come from a formatting problem, a calculation error, a missing fact or a misread question, and those causes need different fixes. The ErrorMap work from IBM Research and Stanford makes this explicit: benchmarks tell you when a model fails, not why, and separating the causes is what lets you guide improvement (ErrorMap and ErrorAtlas).

That single idea is the fork in the road. Prompting, retrieval and fine-tuning all change behavior, but they change different things. On its own, prompting and few-shot examples use the model's existing knowledge. Retrieval augments the prompt with external content. Fine-tuning adjusts model weights so behavior persists across requests (Codecademy's comparison). If you skip the classification step, you can spend weeks and a real budget retraining a model to solve a problem that a JSON schema would have fixed in an afternoon.

The practical move is to stop asking "prompt or fine-tune" and start asking "what kind of failure is this, and which lever actually moves it?" The rest of this article gives you a repeatable rule for that.

Build the failure set and label each correction

You cannot apply a ratio-based rule without a labeled set. Start with the failures you already have: production logs, a red-team sheet, support escalations, or a sample of outputs a human corrected. Aim for at least 100 failures, ideally 200 to 300, because ratios computed on a handful of examples are noise.

For each failure, record three fields:

  • The input (or a link to it).
  • What the model produced.
  • The correction a competent human made.

Then tag the correction's root cause. Keep the taxonomy small. Three buckets are enough for a first pass:

  1. Formatting. The content was right or close, but the shape was wrong. Wrong field name, missing units, extra prose around a JSON object, a table where a list was expected, a date in the wrong format.
  2. Knowledge. The model did not have the fact. A policy that changed last quarter, a customer-specific contract term, an internal product SKU, a number that lives in a database.
  3. Policy and tone. The model knew the fact and formatted it correctly, but behaved wrongly. It refused something it should have handled, escalated too rarely or too often, used a tone the brand forbids, or failed to follow an approval rule.

A fourth bucket, "the model misunderstood the request," is worth tracking separately. It usually points to a prompt clarity problem, and it inflates your knowledge and policy counts if you lump it in. ErrorMap's taxonomy calls this question misinterpretation and treats it as its own failure type (ErrorMap and ErrorAtlas).

One labeling tip: tag the correction, not the output. Two failures can look similar but need different fixes. "Answered the billing question in the wrong tone" is a policy tag. "Answered the billing question without the refund window" is a knowledge tag. If you only tag outputs, you will train on the wrong thing.

The decision rule, with thresholds

Once the set is labeled, compute the share of each category. Then apply this rule in order:

Step 1: if formatting is the largest bucket, fix the prompt and schema first. Formatting failures are the cheapest to close and the most common early on. A clearer instruction, one worked example in the prompt, and a constrained output format (a JSON schema, a strict enum, a required field list) usually closes most of them. This is hours of work, not weeks. Codecademy's comparison puts prompt iteration at days to deploy against weeks to months for a training run (prompt engineering vs fine-tuning).

Step 2: if knowledge gaps exceed roughly 30 percent of failures, add retrieval before you train. Training bakes in a snapshot of facts, and facts drift. Retrieval lets you update the answer source without retraining. Google's guidance draws the line the same way: fine-tuning changes parameters, while RAG augments the prompt with external knowledge and needs far less training data, though it depends entirely on what it can access (Google Cloud on fine-tuning and RAG). If your knowledge gap is "the model doesn't know our current pricing," a retrieval layer over the pricing table is the durable fix, not a weight update.

Step 3: if policy and tone corrections dominate and you have a few hundred clean examples, fine-tune. This is the case the other levers cannot hold. Tone, refusal boundaries and escalation rules are behaviors, and behavior is what weight updates change persistently. Heavybit's guide is blunt about this: prompting and RAG can improve outputs, but fine-tuning is what delivers "persistent behavior change" (LLM fine-tuning guide). Google lists matching a brand voice or style and handling edge cases as fine-tuning territory (Google Cloud on fine-tuning).

The 30 percent figure is a rule of thumb, not a law. Tune it to your retrieval quality. If retrieval is precise and cheap, lower it. If you have nothing to retrieve from, the number is irrelevant: the failure is a prompt problem until you build the source.

Dominant failure typeFirst fixSecond fixFine-tune?
Formatting (wrong shape, field, units)Clearer instruction plus one exampleConstrained output schemaRarely; only if schema cannot express the requirement
Knowledge gap (missing or stale fact)Retrieval over the authoritative sourceUpdate context, add tool callNo; facts drift faster than weights
Misunderstood requestClarify the prompt, split the taskFew-shot examples of the ambiguitySometimes, if ambiguity recurs across many prompts
Policy and tone (refusal, escalation, brand voice)Explicit rules in the system promptWorked examples of correct behaviorYes, when corrections repeat and you have a few hundred clean examples
Mixed, no dominant bucketFix formatting and retrieval firstRe-label and re-measureDefer until one bucket dominates

Recompute the table every time you ship a change. The ratios move, and the rule follows the ratios.

A worked example with numbers

Suppose you run an assistant for a subscription business. You sample 200 corrected failures from last quarter.

The labels come back as:

  • Formatting: 70 failures (35 percent).
  • Knowledge: 62 failures (31 percent).
  • Misunderstanding the request: 38 failures (19 percent).
  • Policy and tone: 30 failures (15 percent).

The naive read is "35 percent formatting, so that's the biggest bucket, fix the prompt." The better read applies the rule in order.

First, the 70 formatting failures. A schema plus one example in the system prompt typically closes the majority of these. Suppose it closes 56 of 70, or 80 percent. You have spent a day and lost no training budget. That is now 14 remaining format failures.

Second, the 62 knowledge gaps. At 31 percent, you are over the 30 percent line, so retrieval comes next. You index the pricing page, the plan comparison table and the refund policy. Say retrieval fixes 50 of 62, because 12 gaps turn out to be ambiguous questions rather than missing facts. Now you have 12 knowledge failures left, and those questions move to the "misunderstood" bucket.

Third, the misunderstanding bucket. The 38 original plus the 12 reclassified make 50. Prompt clarifications and two examples of the ambiguous cases close most of them. Say 40 of 50.

Fourth, policy and tone. This bucket started at 30 and did not move, because nothing you did touched behavior. Thirty out of 200 is 15 percent: under the 30 percent threshold, and spread thin. The rule says do not fine-tune yet. Instead, sample new failures next quarter and see whether the policy bucket grows after the other fixes ship.

Total spend: roughly two days of prompt and schema work plus a retrieval build, against what a fine-tuning project would have cost. The point is not that fine-tuning is always wrong. The point is that the same 200 failures looked like a training-data problem until they were labeled.

Note what the 30 percent retrieval threshold did here. At 31 percent, retrieval was triggered. A team that skipped this step and trained a model on all 200 corrections would have taught the model a snapshot of pricing that goes stale the moment a plan changes, and it would still have failed the formatting cases because the schema was never fixed.

When fine-tuning is the cheaper fix

Cost is not only dollars. Compare the two paths on the dimension that actually bites.

Prompt iteration costs engineering hours and evals. It stays editable, so a policy change is a text edit and a redeploy. It carries no data-labeling bill and no GPU time. Its weakness is that a long prompt has a ceiling: every rule you add competes with the others for the model's attention, and a rule that holds at 80 percent accuracy may never hold at 98 percent. Fine-tuning does not have the same ceiling, because the behavior is in the weights. Heavybit notes that only fine-tuning delivers persistent behavior change and channels the model toward your purpose (LLM fine-tuning guide).

Fine-tuning costs clean data, a training run, an eval suite and a maintenance path. It pays off when three conditions hold together:

  1. The correction is a behavior (tone, refusal, escalation), not a fact or a format.
  2. The same correction appears in many examples, so the model can learn a general rule rather than memorize cases.
  3. You have at least a few hundred clean, consistent examples. Data volume and quality are the binding constraints in most failed training projects; Oracle lists insufficient, imbalanced and poor-quality datasets among the most common training challenges (Oracle on training challenges).

There is a real risk to name: fine-tuning can overfit to your examples and degrade on inputs outside them, and it can forget capabilities it had before. Google lists catastrophic forgetting and overfitting among fine-tuning's challenges (Google Cloud on fine-tuning). If your failure set is narrow, say 40 tone corrections, do not train. A larger set of consistent examples is safer.

One more cost that teams forget: the human labor of preparing the data. Labeling is work, and depending on the content, it can be difficult or harmful work. A class action against a data-labeling vendor alleged that workers developed psychological injuries from repeated exposure to traumatic content while training models (Epstein Becker Green analysis of Schuster v. Scale AI). Budget for review processes, labeling instructions and support, not just compute.

If you need a preference signal rather than demonstration data (the model produces acceptable and unacceptable outputs and you want it to learn the difference), reinforcement learning from human feedback or AI feedback is the relevant method, not plain supervised fine-tuning. AWS describes the distinction: demonstrations teach the task, but feedback trains a reward model that aligns behavior with preferences (AWS on RLHF and RLAIF). That is another reason tone and policy problems resist prompt fixes and suit training.

A prompt that holds formatting and policy rules

Structured prompts are the cheapest fix for formatting and simple policy rules. Here is a pattern that closes most formatting failures with a schema and a single example.

System:
You answer questions about subscription plans.
Output must be valid JSON matching this schema exactly:
{"answer": string, "plan": "basic"|"standard"|"premium", "confidence": "high"|"medium"|"low", "escalate": boolean}
Rules:
- Never include prose outside the JSON object.
- Set escalate to true if the customer asks for a refund outside the policy window.
- If the answer is not in the provided context, set confidence to "low" and escalate to true.

Example:
User: Can I cancel within 30 days of buying premium?
Assistant: {"answer": "Yes, premium plans can be cancelled within 30 days of purchase.", "plan": "premium", "confidence": "high", "escalate": false}

Three things make this work. The schema constrains the output so the parser cannot fail. The rules are short and testable. The example shows the exact shape, which is what few-shot prompting is for (prompt engineering basics). The escalate rule is the beginning of a policy fix: if it holds, you have closed those failures without a training run. If the model still escalates wrongly on messy real inputs, the rule has hit the prompt ceiling, and that is your signal to consider training.

Keep the prompt under version control and run it against your labeled failure set after every change. A prompt edit that fixes formatting can break a policy rule, and without evals you will not know.

Measuring whether the fix worked

Define success before you touch anything. Your baseline is the labeled set. After a change, rerun the same inputs and re-label the failures. Report two numbers: total failures closed, and the category mix.

If formatting failures dropped but policy failures rose, you traded one problem for another. If a category refuses to move after two iterations, stop iterating on it. That is the evidence for the next lever in the rule.

Do not confuse model quality with task fit. Shin and colleagues compared prompt-engineered GPT-4 against 17 fine-tuned code models across summarization, generation and translation, and found the prompt approach did not consistently win: fine-tuned models beat prompted GPT-4 by 28.3 points on one code-generation dataset, while prompted GPT-4 won by 8.59 points on another (prompt engineering or fine-tuning). The lesson is not "fine-tuning wins." It is that the right answer depends on the task, and you only learn which task you have by measuring. That is exactly what your labeled failure set gives you.

One discipline that helps: route new inputs to a retrieval path, a prompt path or a trained path based on what you already know. When a new failure arrives, the label tells you which path to fix. Over time the mix decides the architecture.

If you would rather work through your own failure set with someone who has done it, a free half-hour discovery call is the fastest way to get a recommendation before you spend on a training run: Quanta Consulting. No obligation.

FAQ

FAQ

What share of failures should trigger fine-tuning?

There is no fixed number, but a usable rule is to fine-tune when policy and tone corrections are the dominant bucket and repeat across a few hundred clean examples. If knowledge gaps exceed roughly 30 percent of failures, add retrieval first. If formatting dominates, fix the prompt and schema first. The exact thresholds should shift with your retrieval quality and data volume.

Can I fine-tune to teach the model new facts?

You can, but it is usually the wrong tool. Facts change, and a weight update captures a snapshot. Google's guidance contrasts fine-tuning, which changes parameters, with retrieval, which augments the prompt with external knowledge and needs less training data (Google Cloud on fine-tuning and RAG). Use retrieval for facts and training for behavior.

How many examples do I need for a fine-tune?

A few hundred clean, consistent examples is the working floor, and more is safer. The bigger constraint is quality and consistency, since insufficient, imbalanced or poor-quality data is a leading cause of training problems (Oracle on training challenges). Forty examples of a tone rule will memorize, not generalize.

What is the risk of fine-tuning too early?

You can overfit to your examples, degrade on inputs outside them, and forget prior capabilities, which Google lists as catastrophic forgetting and overfitting risks (Google Cloud on fine-tuning). You also freeze a snapshot of facts that will go stale. Label first, then train only the behavior that prompts cannot hold.

How do I know a prompt fix is enough?

Run the same labeled failure set after each change and count failures closed per category. If formatting and misunderstanding failures fall and policy failures hold steady, the prompt fixed what it could. If a category stalls after two iterations, that is the signal to move to retrieval or training. The measurement, not intuition, decides.

Sources

Sources

  1. ErrorMap and ErrorAtlas: Charting the Failure Landscape ...
  2. Prompt Engineering vs Fine Tuning: When to Use Each
  3. Fine-tuning LLMs: overview and guide
  4. LLM Fine-Tuning: A Guide for Engineering Teams in 2025
  5. 6 Common AI Model Training Challenges
  6. Tasked with Troubling Content: AI Model Training and ...
  7. Fine-tune large language models with reinforcement ...
  8. An Empirical Assessment of LLMs for Code
About the author

About the author

Antonio Evans
Antonio Evans

Antonio Evans is the founder of Quanta Intelligence and a fractional CTO who builds HIPAA-ready AI systems for health and life-science companies. Before that he was technical co-founder of FriendsEAT for twenty years, CEO of Socialdraft, and a data engineer at IBM. Antonio lives with his dog Santino in Lisbon, Portugal.

All articles