Topic 1 of 6 · 4 min read
Exhaust prompting and context first
Goal: Given a failing task, list the prompting and context changes to try, each measured with an eval, before proposing fine-tuning.
Before you train anything, show that a better prompt, better context or a stronger model cannot already do the job. Fine-tuning is the most expensive fix on the list, so it goes last, and only with numbers that say the cheaper fixes ran out.
Check yourself · 1 of 3
A team wants to fine-tune because the model keeps returning the wrong date format. What should they try first?
Why it matters
A prompt change takes minutes and costs nothing to undo. A fine-tune takes data, a training run, an eval and a hosting plan, and it ties you to one base model. Many "the model cannot do this" complaints turn out to be a vague instruction, a missing example or an input the model never saw. Provider guides such as OpenAI's model optimization guide and Anthropic's prompt engineering docs both put prompting and evals ahead of tuning for this reason.
How to do it
- Build the eval first. Collect 50 to 200 real inputs with the output you would accept. Score the current system. Without a baseline, no change can be called an improvement.
- Fix the instruction. State the task, the audience, the format and what to do when unsure. Remove contradictions.
- Add examples. Three to five few-shot examples of correct output often fix format and tone drift.
- Constrain the output. Use structured output or a JSON schema so the shape is enforced by the API, not requested politely.
- Add context. Put the policy, the glossary or the retrieved documents in the prompt.
- Try a stronger or newer model. If a larger model passes the eval, the question becomes cost, not capability.
- Split the task. Two small prompts in a chain often beat one overloaded prompt.
Record the eval score after each step. The log is the evidence you will need later.
Before and after
Weak: "Our support classifier mislabels refund emails. Let's fine-tune on 5,000 tickets."
Better: "Baseline on 120 labelled tickets: 71 percent correct. We rewrote the label definitions and added four examples per label: 86 percent. Structured output removed all invalid labels. The remaining errors are 15 tickets with two intents. We now test a stronger model on those."
The second version spent an afternoon and may have removed the need to train at all.
What goes wrong
- No baseline. A team tunes, sees "better" outputs by eye, and cannot say by how much.
- Tuning to fix a prompt bug. If the labels are ambiguous, training data inherits the ambiguity.
- Testing on the examples in the prompt. Hold out inputs the prompt has never seen.
- Stopping at one try. One weak prompt does not show that prompting failed.
Examples
The refund classifier
A support team scores 71 percent on 120 labelled tickets. Rewriting label definitions and adding four examples per label lifts it to 86 percent. Structured output removes invalid labels. Only 15 multi-intent tickets remain, so the next step is a stronger-model test, not a training job.
The plan before the proposal
A proposal says "fine-tune for tone". The reviewer asks for a log: baseline score, prompt rewrite, five few-shot examples, a style guide in the system prompt, a larger model. Each has a score. If none reached the target, the proposal can go ahead with a clear gap to close.
Key points
- Fine-tuning is the most expensive fix, so it comes after instructions, examples, structured output, context and a stronger model.
- An eval with real inputs and accepted outputs must exist before any change can be called an improvement.
- Record the score after each change; the log is the evidence for or against tuning.
- Many failures come from vague instructions or missing context, which training would copy into the weights.
- Held-out inputs, not the prompt's own examples, are what the eval must use.
Common mistakes
- Proposing fine-tuning with no baseline score on a fixed set of inputs.
- Judging prompt changes by reading a few outputs instead of scoring a held-out set.
- Giving prompting one quick try, then concluding it cannot work.
- Training on data that carries the same ambiguous labels the prompt had.
Check yourself · 2 of 3
What must exist before you can say a prompt change improved a task?
Check yourself · 3 of 3
A prompt scores 62 percent on your eval. Adding three few-shot examples gives 81 percent. What does that tell you?
Practice items, not counted towards your mastery.
Start here
- Model optimization guide (OpenAI) (opens in a new tab)DocsFree
A provider's own loop of evals, prompt changes and fine-tuning, in the order to try them.
- Fine-tuning large language models (Hugging Face LLM Course) (opens in a new tab)CourseFree
Supervised fine-tuning with open-weight models, from data format to training run.
- Is fine-tuning still valuable? (Hamel Husain) (opens in a new tab)ArticleFree
A practitioner's view of when fine-tuning pays off and when evals and data come first.
More for this topic
- Prompt engineering overview (Claude docs) (opens in a new tab)DocsFree
Which prompt changes to try and how to define success criteria before tuning anything.