LIVE · Thursday 3 December

Prompt Engineering vs Fine-Tuning for Decision Tasks: Diagnose the Errors First, Then Pick the Fix

For classification and routing, the cause of each error decides between a better prompt, better context, a rule or a fine-tune. Here is an evaluation design that tests all of them on the same untouched cases.

By Surya10 min read

For decision tasks such as classification and routing, start with model optimization through evaluation and prompt engineering, and fine-tune only when errors on stable categories persist after the prompt and context are fixed. OpenAI's model optimization guide describes the same loop: build evals, improve the prompt, and use fine-tuning "for some use cases." The deciding evidence is the cause of each error. Unclear labels, missing facts and ignored instructions are fixed outside the weights, and only a stable, subtle boundary that a good prompt still misses is a case for tuning.

Prompting and fine-tuning change different parts of the system

Prompt engineering changes what the model receives at inference: the instructions, the label definitions, the examples and the facts about the current case. Fine-tuning changes the model weights by training on labeled examples. The two are not alternatives in the strict sense. OpenAI's guide says that "you can use fine-tuning with prompt engineering to realize a few more benefits over prompting alone." A tuned model still needs the ticket, the customer record and any current policy in its input.

OpenAI's guide to optimizing LLM accuracy splits the problem into two parts. Context optimization deals with what the model needs to know, such as missing, outdated or proprietary information. LLM optimization deals with how the model acts, such as inconsistent results or incorrect formatting. Fine-tuning belongs to the second part. It cannot supply a fact that changed last week.

The same guide gives two reasons to fine-tune. The first is "to improve model accuracy on a specific task." The second is efficiency: "Achieve the same accuracy for less tokens or by using a smaller model." Both reasons are conditional, and both need a held-out test to prove them.

Each kind of error points to a different fix

A routing system can fail for several reasons, and each reason has its own remedy. The first step is to read the failures and sort them. The OpenAI cookbook's evaluation flywheel suggests reviewing around 50 failing traces, labeling each error freely, and then grouping the labels into categories. The groups below cover most decision tasks.

  1. When two reviewers would disagree on the correct label, the criteria are unclear, and the fix is a clearer rubric with label definitions and worked edge cases. Training on inconsistent labels teaches the inconsistency.
  2. When the model lacks a current fact, such as which team now owns refunds or which plan a customer is on, the fix is to supply or retrieve that fact in the input. A tuned model would need the same input.
  3. When the model ignores an instruction that the prompt states clearly, the fix is to test better examples, reordered instructions and structured output first.
  4. When the model keeps confusing two stable categories after the first three fixes, a fine-tuning trial is justified, using training examples that cover that boundary.
  5. When accuracy is acceptable but cost or latency is too high, a fine-tuned smaller model is worth testing, because OpenAI's guide names efficiency as a reason to tune.

Errors that follow a fixed rule are better handled without a model. A hard rule such as "every ticket from a flagged fraud account goes to the risk team" is better as deterministic code in front of the model. Code is cheaper, testable and easy to audit.

A fair comparison needs a routing example with stable and changing categories

A support router with eight destination teams, two of them recently redefined, tests both approaches in one experiment. Six teams, such as shipping and account access, have had the same definitions for a year. Two have changed: billing was split into billing and refunds, and a new team took over business accounts. Tickets arrive with the message text, the customer's plan and the order history.

This example tests both sides of the argument. A fine-tune should do well on the six stable teams if it has enough consistent examples. The two changed teams test whether each approach can absorb a new policy. Anthropic's ticket routing guide says that an LLM "can easily adapt to changes in class definitions or new classes without extensive relabeling of training data," while a traditional trained classifier needs new labeled data.

The comparison should include four arms, and each should get a fair amount of development effort.

  • A set of deterministic rules serves as the floor and covers cases that a rule can decide, such as account flags.
  • A frozen baseline model with an optimized prompt gets the rubric, label definitions, retrieved examples and the customer facts.
  • A named fine-tuning configuration records the base model, the method, such as full fine-tuning or LoRA, the number of examples and epochs, and the same input facts.
  • An existing decision model with a confidence threshold, if one fits the task, is tested on the same cases.

Giving the prompt arm a week of work and the fine-tune arm a month would bias the result. The fairer design fixes a budget of engineer hours for each arm before work starts.

The data splits must keep development and testing apart

Every arm is scored on the same untouched cases. OpenAI's supervised fine-tuning guide calls the holdout set "a control group" and says that training and holdout data should have "roughly the same diversity of user input types and model responses." Its accuracy guide adds that a hold-out set detects overfitting.

A decision task needs four separate sets, and the order of the steps matters.

  1. Remove exact and near-duplicate tickets first, so that a copy of a test ticket cannot sit in the training set.
  2. Split by time or by customer rather than at random, so that the test set looks like future traffic.
  3. Keep a prompt-development set for writing and revising the prompt, and a training set for the fine-tune.
  4. Keep a calibration set for setting confidence thresholds, and a final test set that is scored once.

The cookbook uses a similar rule for LLM judges. It splits about 20% train, 40% validation and 40% test, and it calls the test set "your report card," run once after tuning.

Rare categories and ambiguous labels need deliberate sampling. If business-account tickets are 2% of traffic, a random 400-ticket test set holds about eight of them. That is too few to measure recall. Oversample rare classes in the test set and report them separately. Keep a labeled pool of ambiguous tickets where reviewers disagreed, and score them separately rather than dropping them.

Accuracy alone hides the errors that cost money

A single accuracy figure can rise while the expensive mistakes get worse. The evaluation should report a set of measures for every arm.

  • Precision and recall per class show whether a rare team is being starved or flooded.
  • False positives and false negatives should be priced separately. OpenAI's accuracy guide uses an example in which a customer who churns after a failed AI interaction costs $1,000 and an unneeded escalation to a human costs $40. Its table puts break-even accuracy at 81.5%.
  • Coverage at a calibrated abstention threshold shows how many tickets the model can decide on its own at a target error rate.
  • Downstream task success, such as tickets resolved without reassignment, measures the real outcome.
  • Latency at p50 and p95 matters when routing blocks a customer reply.
  • Full cost includes training, inference, retraining and the fallback model that handles abstentions.

Uncertainty belongs in every result. On 400 test cases, a measured accuracy of 90% carries a 95% interval of about plus or minus 2.9 points. On 20 rare-class cases, a recall of 80% carries an interval of about plus or minus 17.5 points. A two-point gain from tuning on a test set of that size is not a clear win. Regressions should be reported per class, because tuning can raise the average while lowering recall on one team.

Anthropic's routing guide offers targets that can serve as a starting point. It suggests classification consistency of 95% or higher and at least 80% accuracy on a set of edge cases. It also suggests reaching more than 90% accuracy on a new category within 50 to 100 sample tickets.

A policy-change test separates retraining from editing a prompt

The two redefined teams are the most useful part of the experiment. Build a policy-change set: tickets that would have gone to billing under the old rules and should now go to refunds. Then measure how each arm responds and what it costs to fix.

  • For the prompt arm, edit the label definitions and add examples, then rescore. The cost is hours of editing and one evaluation run.
  • For the rules arm, change the code and rerun the tests.
  • For the fine-tune arm, relabel the affected training examples, retrain and rescore. The cost includes relabeling and a training run.

New evidence follows the same logic. If a customer's plan changes, every arm needs that fact in its input. Only the definition of a category, not a fact about a case, ever requires retraining.

Open-weight training is one documented route for the fine-tune arm

The fine-tune arm does not require a hosted service. OpenAI's own route is closing: its supervised fine-tuning guide says that eligible existing customers can create training jobs only until January 6, 2027, and gpt-6-luna does not support fine-tuning.

One documented open route is open-jev, an MIT-licensed repository with an SDK, openjev-sdk, for training small decision models. It offers three methods. The head method trains small heads on a frozen Gemma 3 4B and needs about 9 GB of GPU memory. The encoder method fully fine-tunes a Hugging Face encoder, ModernBERT-large by default, and serves on CPU. The tod method applies LoRA to TOD, which is built on Gemma 4 12B and needs an NVIDIA GPU with 40 GB or more. The README's own example is a ticket router with billing and shipping teams. It warns that its synthetic test task "is easy for both" and that real validation needs your own labelled rows. The README does not state how many examples the TOD path needs.

TOD itself is a decision model from Parsec, a small language model lab, published under the same GitHub organization. It ranks options from a list that the caller supplies and passes uncertain turns to a larger model. Parsec's TOD page prices it at $0.30 per 1,000 decisions, plus the cost of the parent model. On the public JevBench set of 231 text decisions, the same page reports that TOD scored 84.4%, below the 86.2% of its untrained base model. The adapters are Apache-2.0, and the base model stays under Gemma 4 terms. Parsec publishes no price for custom tuning. Results from the compact encoder and head methods should be reported separately from TOD results.

The acceptance criteria should be written before any result is seen

The final decision should follow from criteria that are agreed before the test set is scored. Three criteria cover the three possible outcomes.

  1. Keep the optimized prompt if it meets the accuracy and per-class recall targets and the categories change more than a few times a year. Editing a prompt is faster than relabeling and retraining.
  2. Adopt an existing decision model if it matches the prompt arm within the confidence interval at a calibrated threshold and lowers full cost, including the fallback.
  3. Commission or build a fine-tune only if it beats the optimized prompt by more than the confidence interval on the final test set. It must also show no per-class regression beyond an agreed limit and keep its lead after the policy-change test.

A worked cost example shows why error cost tends to dominate. Assume 1,000,000 tickets a month, 300 tokens per ticket and 10 output tokens. Claude Haiku 5.5 with a 2,000-token cached prompt costs about $55 a month at Anthropic's list prices of $0.10 input, $0.01 cache hit and $0.50 output per million tokens. A fine-tuned GPT-4.1 mini with a 200-token prompt costs about $432 a month at OpenAI's fine-tuned rates of $0.80 input and $3.20 output. Training it on 2,000 examples of 500 tokens for three epochs adds about $15. Sending an assumed 10% of tickets to Claude Sonnet 5.5 as a fallback adds about $130. Against those bills, if each misrouted ticket costs an assumed $2 of rework, one point of accuracy is worth 10,000 tickets, or $20,000 a month.

No public evaluation has measured these four arms on one routing workload with per-class results, latency and full cost. The model bills above are small next to the cost of a single point of accuracy. The arm that wins on the final test set, per class and after the policy change, should be chosen even if its bill is higher.

Sources

More in Research

All Research →