Fine-tuning vs prompt engineering
Fine-tuning vs prompt engineering: when a trained model beats a prompt, when prompts are enough, and how to test both on your own data before you choose.
Updated
Fine-tuning changes the model’s weights so it learns one task from many examples. Prompt engineering leaves the model alone and changes only the instructions and examples sent with each request. For a narrow, high-volume task with a clear right answer, training usually pulls ahead. For work that changes often, a good prompt is the better place to start.
What each method changes
Prompt engineering edits the text you send: instructions, a few examples and a description of the output format. The model stays the same, and every request carries those instructions again. A rule added to the prompt is paid for on every call and read fresh every time.
Fine-tuning trains the model on many input and output pairs from your task. The pattern moves into the weights, so the prompt can shrink to the parts that still change. The trade is that the tuned model does one job well and may handle unrelated jobs worse than the general model it started from.
Neither method fixes bad labels. If two reviewers mark the same clause differently, a prompt will describe the disagreement and a trained model will learn to copy it. Check that reviewers agree before you spend time on either approach.
A worked example: one clause, two approaches
Take a team that pulls the governing-law clause out of vendor agreements and writes it to a database field. The first prompt describes what the clause looks like, includes two sample clauses and asks for JSON. It works on clean agreements and fails in two places: when the clause sits inside a schedule, and when a definitions section mentions a state’s law in passing. The team adds a rule for each failure. After a few rounds the prompt has rules that contradict each other, and the same miss keeps coming back.
That pattern is the signal to test training. The team has two reviewers mark the clause in a batch of agreements, splits the batch by agreement so no vendor appears on both sides, and scores the prompt on the held-out set. If the tuned model beats the prompt on schedules and definitions, where the prompt failed, the training run has earned its cost. If it does not, the labels and the test set are the first things to check.
Set the bar before either run. For a field like governing law, score an exact match on the clause text, and decide in advance how many of the schedule and definitions cases the tuned model must get right where the prompt missed. A small overall gain that leaves those cases unsolved is not worth a training run.
Common mistakes
- Scoring the tuned model on examples you also used to write the prompt. Both methods look better than they are.
- Splitting by chunk, so near-copies of one contract or ticket land on both sides of the test.
- Comparing against a prompt nobody tuned. A weak baseline makes any training look good.
- Judging only the average score. Check the rare clause types and the messiest inputs, because that is where a prompt tends to fail.
- Training on labels nobody agreed on, then blaming the model for the inconsistency.
- Stacking prompt rules that contradict each other instead of rewriting the prompt once, cleanly, and testing it.
Checklist before you choose
- Write down the task and what a correct output looks like. If two reviewers would disagree, fix the definition first.
- Collect real inputs with accepted answers and hold some back as a test set, split by document or ticket. The how much data to fine-tune guide covers sizing the training batch.
- Write the best prompt you can and score it on the test set.
- Note where it fails. A repeated miss on one edge case points toward training. Misses on requirements that change every week point toward keeping the prompt.
- If you train, score the tuned model on the same held-out set and ship only if it wins there.
- Compare cost per document, not cost per token. A long prompt adds tokens to every call, while a trained model can run on a shorter input. The cost per document guide shows the arithmetic.
Prompts are cheap to change, quick to test and need no training run, but they grow with every rule and pay for those rules on every call. Training removes the long prompt and keeps the output format steady, but each change to the task means new labels and a new run. The LLM evaluation guide walks through the scoring step, and the fine-tuning vs RAG guide covers answers that depend on documents that change.
If you send one task to a frontier API today, Own Weights can tell you whether a trained model would beat it on your own data. Start with a free AI cost audit, or book a call and we will go through your task together.
Questions
Is fine-tuning better than prompt engineering?
Not always. Prompt engineering is cheaper to start and easier to change, so it is usually the right first step. Fine-tuning tends to win when one high-volume task needs the same accurate answer format on every call.
How many examples do I need before fine-tuning beats a good prompt?
There is no fixed number. It depends on how varied your inputs are and how clear the right answer is. Build a test set first, then train on a batch of examples and check whether the result beats the prompt on that test.
Can I use prompt engineering and fine-tuning together?
Yes. A trained model still responds to instructions, so a short prompt can carry rules that change often. Keep stable behavior in training and the changing parts in the prompt.