What it is
Fine-tuning is extra training that turns a general AI model into a specialist. You take a model that has already learned a great deal from a huge amount of text, and you train it a little more on a small, focused set of examples of the job you want done. After that, the model does that job in the way the examples showed, without needing to be told each time.
It helps to know where fine-tuning sits in the life of a model. First comes pretraining, where a model reads a vast library of text and learns to predict the next word. That stage is where almost all of its knowledge comes from, and it costs a fortune. What comes out is a raw text-continuer, not yet a helpful assistant. Fine-tuning is everything that shapes it afterwards. The chatbots you use have all been fine-tuned by the companies that make them, using written examples of good answers and then human ratings through a method called RLHF. That's how a text-continuer becomes something that answers questions politely.
But fine-tuning isn't only something AI companies do. Many AI providers let customers fine-tune a model on their own examples, and open models such as Llama can be fine-tuned by anyone with a suitable computer. That's the version this page is mostly about: fine-tuning as a tool you might use.
The training data for fine-tuning is simple in shape. It's a list of pairs: an input, and the exact output you wish the model had given. A support team might collect 500 real customer questions, each paired with the reply their best agent wrote. A publisher might pair plain summaries with the house-style blurbs they turned into. The model is shown each input, makes its guess, is compared with your answer, and has its internal numbers, called parameters, nudged a little towards your answer. Repeat that across all the examples a few times, and the model's habits shift.
The key word is habits. Fine-tuning is very good at teaching a model how to behave: a tone of voice, a fixed format, a way of sorting things into categories, a specialist way of phrasing. It's surprisingly poor at teaching a model new facts. That single point explains most of the good and bad decisions people make with it.
Here's the everyday comparison. A good new employee arrives already knowing how to read, write, and reason. That's pretraining. You could hand them a sticky note each morning with instructions ("keep emails short, always sign off with our slogan"). That's prompting. You could give them a binder of company documents to look things up in when a question comes in. That's RAG, short for retrieval-augmented generation, where the AI looks up relevant documents before it answers. Or you could put them through a few weeks of practice on real cases until the house style is second nature. That's fine-tuning. All three are useful. They solve different problems.
Why it matters
It's how general models become useful ones. Every mainstream chatbot is a fine-tuned model. Without that stage, the most capable model in the world would answer "What's a good name for a bakery?" with a list of other questions it had seen on a forum. Knowing that fine-tuning exists explains why two chatbots built on similar technology can feel so different: they were fine-tuned on different examples with different goals.
It can do what a prompt can't hold. A prompt can only include as many examples as fit in the model's context window, the amount of text it can take in at once, and you pay for those words on every single request. Fine-tuning bakes the lesson into the model itself, so thousands of examples can shape its behaviour, and the prompt can be short. When OpenAI opened fine-tuning for GPT-3.5 Turbo on 22 August 2023, it said early testers had cut their prompts by up to 90 percent by moving instructions into the model, which made each request faster and cheaper. It also said a fine-tuned GPT-3.5 Turbo could match or beat its bigger GPT-4 on certain narrow tasks. Those are the company's own claims, but they show the appeal: a smaller, cheaper model, trained well for one job, can compete with a larger general one.
It's usually not the first thing to try, and that matters for your budget. OpenAI's own guide to improving results tells readers that good prompting may be all they need, and treats fine-tuning as a later step. That advice is worth taking seriously. Fine-tuning costs money, takes a well-made set of examples, and produces a model you then have to test, host or pay for, and maintain. For a creator or small business, the honest order is: write a better prompt, then give the AI your documents to look things up in, and only then consider fine-tuning.
When it is worth it, the signs are fairly clear. Fine-tuning tends to pay off when:
- You do the same narrow task many times a day, so a shorter prompt and a smaller model add up to real savings.
- You need a very consistent format or voice that prompting keeps getting almost right.
- You already have hundreds of good examples of the finished work, such as past replies, product listings, or labelled tickets.
- The task is about how to say things, or how to sort things, rather than about what's true.
It's usually not worth it when you need the AI to know your changing facts (prices, stock, policies), when you have only a handful of examples, when the task changes every week, or when you simply haven't tried a careful prompt with a few worked examples yet. For facts, RAG is the better tool, because you can update a document in seconds and the AI can point to where an answer came from.
It makes open models practical for everyone. A technique called LoRA, explained below, cut the cost of fine-tuning so sharply that a single researcher can now adapt a large model on one graphics card. That's why there are thousands of specialised open models online, fine-tuned for medicine, coding, particular languages, or role-play. It has spread the power to shape AI far beyond the big labs, for better and worse.
Real-world examples
Stanford Alpaca: a chatbot for under $600
On 13 March 2023, researchers at Stanford's Center for Research on Foundation Models announced Alpaca. They had taken LLaMA 7B, a small model Meta had released to researchers only a few weeks earlier, and fine-tuned it on 52,000 examples of instructions and answers. They didn't write those examples by hand. They started with 175 human-written seed examples and had one of OpenAI's models generate the rest, a form of synthetic data.
The results surprised people. In the team's own tests, Alpaca behaved in many ways like OpenAI's much larger text-davinci-003 model. The cost was the headline. The Stanford post put data generation at under $500 through OpenAI's paid service and the fine-tuning itself at under $100, with training taking three hours on eight high-end chips. Until then, many people assumed a useful assistant needed the budget of a large company.
Alpaca also showed the limits. The team was open that the model made things up, could produce toxic text, and repeated stereotypes, and they said it was for academic research only, not commercial use. That was partly because of LLaMA's research-only licence and OpenAI's terms, which restrict using its output to build competing models. They later took the public demo down, citing hosting costs and the weakness of their content filters. The lesson for anyone thinking of fine-tuning is twofold: it's far cheaper than most people think, and it copies the habits of whatever produced the examples, flaws included.
LoRA: fine-tuning without rewriting the whole model
Traditional fine-tuning adjusts every one of a model's parameters, which for a large model means billions of numbers. That takes enormous memory, and it leaves you with a complete new copy of the model for each job. In June 2021, a team at Microsoft led by Edward Hu published a paper called "LoRA: Low-Rank Adaptation of Large Language Models" with a cleverer approach.
In plain words, LoRA freezes the original model so it can't change, and adds a small set of extra adjustment numbers alongside it. Only those extras are trained. Think of it as putting a thin, removable overlay on top of a finished painting instead of repainting the canvas. The paper reported that, compared with fully fine-tuning GPT-3's 175 billion parameters, LoRA cut the number of parameters that needed training by 10,000 times and the memory needed by three times, while performing as well or better on the tasks tested and adding no delay when the model runs.
The overlay idea has a practical bonus. Because each job's adjustments are small and separate, you can keep one base model and swap in different overlays: one for support replies, one for product descriptions. In May 2023, Tim Dettmers and colleagues at the University of Washington published QLoRA, which combined LoRA with a way of storing the frozen model in compressed form. They reported fine-tuning a 65-billion-parameter model on a single 48 GB graphics card. Most do-it-yourself fine-tuning today uses LoRA or one of its descendants. If you see a "LoRA" for download on an image-generation site, it's the same idea: a small add-on that teaches a large model one particular style or subject.
Ten examples to undo the safety training
In October 2023, researchers from Princeton University, Virginia Tech, IBM Research, and Stanford published a paper with a pointed title: "Fine-tuning Aligned Language Models Compromises Safety, Even When Users Do Not Intend To!" It was later presented at ICLR 2024, a major AI conference.
The team used OpenAI's public fine-tuning service on GPT-3.5 Turbo, the same one opened to customers that August. By fine-tuning on just 10 carefully designed harmful examples, at a cost of under $0.20, they removed much of the model's refusal behaviour, so that it would go along with nearly any harmful request. They found the same on Meta's open Llama-2 chat model. The finding that worried people most came next. Fine-tuning on ordinary, harmless datasets, of the kind people use to make a model more helpful, also weakened the safety behaviour, though less severely. Nobody had to intend any harm.
The reason connects to how alignment works. The care a chatbot takes, refusing dangerous requests and adding caveats, was itself put there by fine-tuning. Fine-tune again for a different goal, and you can wear down that earlier layer without meaning to. The authors shared the results with OpenAI before publishing. For anyone fine-tuning a model for a business, the practical message is to test its safety behaviour again afterwards, not assume it carried over.
An everyday case: the listing writer
Imagine Tom, who sells vintage furniture online and writes around 40 listings a week in a very particular voice: dry, specific about wood and joinery, never using the word "stunning". He's used a chatbot with a long prompt for months. The results are fine but drift: every tenth listing sounds like an advert.
A consultant offers to fine-tune a model for him. Before paying, he runs a cheaper test. He adds five of his best past listings to his prompt as worked examples, a technique called few-shot prompting, and scores 20 new drafts against his own checklist. Eighteen pass, up from thirteen. At his volume that's good enough, and it costs nothing extra. He writes down what would change his mind: if he grew to 400 listings a week, the savings from a shorter prompt and a smaller fine-tuned model might be worth it, and he'd have more than 2,000 past listings to train on. For now, the prompt wins.
Try it yourself
You don't need to fine-tune anything to learn the most useful thing about it: whether your task needs it. This exercise takes about an hour and a chatbot you already use.
- Pick one repeated task. Something you do at least weekly with AI in a consistent style: product descriptions, replies to a common type of email, social captions, sorting messages into categories.
- Collect 15 real examples of finished work. Past pieces you were happy with, each with the input that produced it. Put them in a spreadsheet: input in column A, finished output in column B. This is exactly the shape of a fine-tuning dataset, so you're not wasting effort either way.
- Hold back five as a test. Move five rows to a separate tab. You'll use them to judge results, never as examples.
- Try plain prompting. Write your best instructions and run the five test inputs through them. Grade each result pass or fail against two or three clear checks you write down first, such as "matches our tone", "correct format", "under 100 words".
- Try prompting with examples. Add three to five of your remaining examples to the prompt and run the five test inputs again. Grade them the same way. This is the cheap cousin of fine-tuning: showing, not just telling.
- Try looking things up, if facts are involved. If failures were about wrong facts (prices, policies, product details), paste the relevant document into the chat or use your tool's file upload, and run the test again. If that fixes it, you needed RAG, not fine-tuning.
- Read the results honestly. If examples in the prompt fixed most failures, you don't need fine-tuning. If the style is still inconsistent across many attempts, you do the task at high volume, and you have hundreds of examples, fine-tuning may be worth pricing. Check your provider's current fine-tuning options and costs yourself, since these change often.
A prompt that asks a chatbot to help you decide:
I use AI for this repeated task: [describe it].
I do it about [number] times a week.
I have about [number] past examples of finished work.
The main problems with current results are: [list them].
Tell me whether better prompting, giving the AI documents to look up (RAG),
or fine-tuning is most likely to fix each problem, and why.
Be honest if fine-tuning is not worth it at my scale.
Common mistakes and misunderstandings
Fine-tuning to teach facts. This is the most common mistake. People fine-tune a model on their product catalogue or their policy manual and expect it to answer questions accurately. It often doesn't. A 2024 study by researchers at Google Research and the Technion, led by Zorik Gekhman, found that models learn genuinely new facts through fine-tuning slowly, and that as they do learn them, their tendency to hallucinate, meaning to state false things confidently, rises. Knowledge mostly comes from pretraining; fine-tuning mostly shapes how existing knowledge is used. For facts, give the model documents to look up, and ground its answers in them.
Thinking a custom chatbot is a fine-tuned one. Many tools let you build a "custom" assistant by writing instructions and uploading files. In most cases that doesn't change the model at all. It's a saved system prompt plus document lookup. That's usually a good thing, because it's cheaper and easier to update, but it's worth knowing which one you're paying for.
Forgetting about forgetting. Train a model hard on one narrow job and it can get worse at things it used to do well. This is called catastrophic forgetting, and researchers have known about it since at least 1989, when Michael McCloskey and Neal Cohen showed a small network forgetting earlier arithmetic after being trained on new sums. A model fine-tuned only on formal legal summaries might start writing everything like a contract. Methods like LoRA reduce the risk, and mixing some general examples into the training set helps, but the only way to know is to test the model on ordinary tasks after fine-tuning.
Assuming safety carries over. As the 2023 Princeton-led research showed, fine-tuning can weaken a model's refusals and caveats even when the training data is harmless. If a fine-tuned model will talk to customers, re-test how it handles awkward, risky, or off-topic requests, and keep guardrails outside the model as well.
Training on bad examples. A fine-tuned model copies its examples closely, including their mistakes, their typos, and their tone on a bad day. Five hundred average replies teach average replies. A smaller set of your genuinely best work usually beats a large set of whatever was in the inbox. The quality of the datasets is the whole game.
Skipping the test set. If you judge a fine-tuned model on the same examples it was trained on, it'll look brilliant, because it has seen the answers. Always keep some examples aside that it never trains on, and compare it against your old prompt on those. That habit has a name: evals.
Believing fine-tuning is a one-time job. Your business changes, and so do the base models. When a provider retires the model you fine-tuned, or releases a much better one, you may need to train again. Keep your training examples organised so you can.
Confusing fine-tuning with transfer learning. They're closely related. Transfer learning is the general idea of reusing what a model learned on one task for another. Fine-tuning is the most common way of doing it with today's language models.
Related elements
- Pretraining: the huge first stage that gives a model its knowledge, which fine-tuning then shapes.
- Transfer Learning: the broader idea of reusing a trained model for a new job, which fine-tuning puts into practice.
- RLHF: a later fine-tuning step where people rank answers instead of writing them.
- RAG: letting the model look up documents, usually the better choice when the problem is facts.
- Few-shot: putting examples in the prompt, the cheap test to run before paying for fine-tuning.
- Prompt: the first thing to improve before considering any extra training.
- Datasets: the collections of examples that fine-tuning depends on.
- Synthetic Data: examples generated by another AI, as Alpaca used for its training set.
- Alignment: the safety and helpfulness training that fine-tuning can accidentally wear down.
- Continual Learning: the research goal of models that learn new things without forgetting old ones.
- Evals: the test sets that tell you whether a fine-tuned model actually beats your prompt.