What Is Fine-Tuning, and How Does It Work?
Fine-tuning adapts a trained model to your task with your own examples. Here is how it works, when it beats prompting, and what good training data looks like.
On this page
Short answer
Fine-tuning is the process of training an already-trained model further on your own examples so it performs better on a specific task. It changes the model itself, rather than just the instructions you give it, so the behaviour persists without a long prompt every time.
What is fine-tuning?
Fine-tuning is the process of taking a model that has already been trained and training it further on your own examples, so it behaves better on a specific task. It starts from a general model and adapts it, rather than building a new model from scratch.
A base model has learned broad patterns from a large training set, but it has not seen your product, your tone or your edge cases. Fine-tuning teaches it those details by showing it pairs of inputs and the outputs you want, then adjusting its internal settings to match them.
Fine-tuning is different from prompting. A prompt tells the model what to do in the moment, while fine-tuning changes the model itself, so the behaviour persists across sessions without a long prompt. It is also different from retrieval, which gives the model documents to read at run time; fine-tuning changes what the model knows how to do.
Teams usually fine-tune when a task has a stable format, such as classifying support tickets, drafting replies in a house style, or extracting fields from a document type. If the task changes every week, prompting or retrieval is usually the better first step.
How does fine-tuning work?
Fine-tuning works by showing a model many examples of the task and adjusting its settings so its outputs move closer to the examples you gave it. The process is the same training loop the model was built with, run on a smaller, focused dataset.
- Pick the base model. Choose a model that already handles the general task, such as text generation or classification, and that you are allowed to fine-tune.
- Collect examples. Gather input-output pairs from your real work, such as a customer message and the reply you sent. Clean them and remove anything wrong or outdated.
- Split the data. Keep part of the data aside as an evaluation set, so you can measure the tuned model on examples it never trained on.
- Train on the examples. Run training for a set number of passes over the data, with a small learning rate so the model adapts without forgetting its general ability.
- Evaluate and compare. Score the tuned model against the original on the held-out set. Keep the tuned version only if it beats the baseline by a clear margin.
- Ship with checks. Put the tuned model behind the same guardrails as any model: input validation, output checks and a fallback to a human or to the base model.
Most teams run this loop more than once. The first pass shows where the data is thin or wrong, and the second pass, with better examples, usually brings the bigger gain. For the evaluation habit that makes this work, how to test AI models covers building a fixed evaluation set.
What are the main types of fine-tuning?
The main types of fine-tuning are full fine-tuning, parameter-efficient tuning, instruction tuning and continued pre-training. They differ in how much of the model changes and how much data and compute they need.
| Type | What changes | Data needed | Best for |
|---|---|---|---|
| Full fine-tuning | All model settings | Thousands of examples | Large, stable tasks |
| LoRA / PEFT | Small adapter layers | Hundreds of examples | Small budgets, quick tests |
| Instruction tuning | Behaviour on instructions | Instruction pairs | Following house style |
| Continued pre-training | General knowledge | Large text corpus | Specialist vocabulary |
Parameter-efficient methods such as LoRA train only a small set of extra weights while the rest of the model stays frozen. They need less compute and less data, which is why most small teams start there. Full fine-tuning can squeeze out more performance on a large, stable task, but it costs more and risks the model forgetting general skills.
Instruction tuning teaches the model to follow instructions in your format, such as always returning a short summary followed by three bullet points. Continued pre-training feeds the model a large body of domain text, such as medical or legal documents, so it learns the vocabulary before you tune it for a task.
What data do you need to fine-tune a model?
You need a set of clean input-output examples that show the model exactly what good output looks like for your task. The examples matter more than the method: a small, accurate dataset beats a large, messy one.
Start with examples from your real work, not examples you invented. A support team should use real tickets and the replies that resolved them. A document team should use real documents and the fields a human extracted. Real examples carry the phrasing, edge cases and mistakes your users actually produce.
Clean the data before training. Remove duplicates, fix wrong outputs, and drop examples that contradict each other. If two examples teach opposite behaviour for the same input, the model will learn neither well. A few hundred good examples are enough to test whether fine-tuning helps; scale up only after the test shows a gain.
Keep a held-out evaluation set of 100 to 200 examples that the model never sees during training. Score the tuned model on that set and compare it with the base model on the same set. Without a fixed set, you cannot tell whether the tuned model is better or just different.
When should you fine-tune instead of prompting?
You should fine-tune when the task is stable, the output format is fixed, and prompting cannot reach the quality you need. If the task changes often, or the model needs fresh facts, prompting or retrieval is usually better.
Prompting is faster and cheaper to change: you edit text and test again. Fine-tuning takes data preparation, training time and evaluation, so it only pays off when the same task runs many times. Retrieval is the better choice when the answer depends on documents that change, since the model reads the current document instead of relying on what it memorised.
Use this guide to decide. Many teams combine all three: retrieval for facts, a tuned model for format and tone, and a prompt for the specific request.
| Approach | Change speed | Needs | Use when |
|---|---|---|---|
| Prompting | Minutes | Good instructions | Task changes often |
| Retrieval | Hours | Clean documents | Facts change often |
| Fine-tuning | Days | Labelled examples | Format is fixed |
For the comparison in more depth, prompt engineering vs fine-tuning walks through when each approach wins on a real task.
Example (hypothetical): a support-team fine-tune
Example (hypothetical): a support team answers 400 tickets a day, and agents spend about 6 minutes on each reply. That is 400 times 6 minutes, or 40 hours of agent time a day. The team wants the model to draft replies in the company tone, with the right links and refund steps.
They collect 1,500 past tickets with the replies that resolved them, clean out the wrong and outdated ones, and keep 200 aside as an evaluation set. The base model scores 120 out of 200 usable drafts on that set, or 60%. After fine-tuning on the remaining 1,300 examples, the tuned model scores 164 out of 200, or 82%.
With the tuned model, agents review a draft in about 1.5 minutes instead of writing from scratch in 6 minutes. That is 400 times 1.5 minutes, or 10 hours a day, saving about 30 hours a day across the team. The team still reviews every draft before it goes out, so quality stays in human hands.
The gain came from the data, not the method. The first training run, on uncleaned data, scored only 132 out of 200. Cleaning the examples and removing contradictory replies brought the score to 164. That is the usual pattern: the dataset, not the training settings, decides the result.
What are the common mistakes?
The most common fine-tuning mistakes are training on dirty data, skipping the evaluation set, and tuning a task that prompting would have handled.
- Training on uncleaned data. Wrong or contradictory examples teach wrong behaviour. Clean the data first; it matters more than training settings.
- No held-out evaluation set. If you test on the data you trained on, the score looks good and means nothing. Keep 100 to 200 examples aside.
- Tuning a moving target. If the task or the facts change weekly, fine-tuning will always be out of date. Use prompting or retrieval instead.
- Too much training. Running too many passes over a small dataset makes the model memorise the examples and fail on new inputs. Watch the held-out score and stop when it stops improving.
- Forgetting the baseline. If you never score the base model, you cannot tell whether tuning helped. Measure both on the same set.
- Shipping without checks. A tuned model still makes mistakes, so keep human review or output checks in place.
Fine-tuning is a tool for stable, repeated tasks with good examples. When the data is clean and the evaluation is honest, it can turn a general model into one that fits your work. For help scoping a tuning project, LLM fine-tuning services cover the data and evaluation work that decides the result.
Key takeaways
- Fine-tuning adapts a trained model to your task; prompting only instructs it in the moment
- Clean, real examples matter more than the training method you pick
- LoRA and other parameter-efficient methods need less data and compute than full fine-tuning
- Always keep a held-out evaluation set and compare the tuned model with the base model
- Fine-tune stable tasks with a fixed format; use prompting or retrieval when facts change often
Frequently asked questions
What is the difference between fine-tuning and training a model from scratch?
Training from scratch builds a model from random settings on a huge dataset, which takes enormous compute and data. Fine-tuning starts from a model that is already trained and adapts it with a small, focused dataset, which is far cheaper and faster for most teams.
How many examples do I need to fine-tune?
A few hundred clean examples are enough to test whether fine-tuning helps on a narrow task. Larger, stable tasks may need a few thousand. Start small, measure on a held-out set, and add data only where the evaluation shows the model still fails.
Does fine-tuning make a model remember my data?
Fine-tuning adjusts the model to match patterns in your examples, and it can memorise specific text from a small dataset. Do not train on secrets, passwords or personal data, and keep evaluation data separate from training data.
Is fine-tuning better than retrieval-augmented generation?
Neither is better in general. Retrieval is better when answers depend on documents that change, because the model reads the current document. Fine-tuning is better when the output format and tone are fixed. Many teams use both together.
How long does fine-tuning take?
A small fine-tuning run on a few hundred examples can take hours, while larger runs take days including data preparation and evaluation. Data cleaning usually takes longer than the training itself, so plan for that in your schedule.
Can fine-tuning make a model worse?
Yes. Training on wrong or contradictory examples, or training for too many passes on a small dataset, can make the model worse on new inputs. That is why you always compare the tuned model with the base model on a held-out evaluation set before shipping.