Applied AI: Fine-Tuning

Cost Control

Information in this post reflects publicly available sources as of October 17, 2026.

One team spends three weeks fine-tuning a model on two thousand internal policy documents, so that it will "know" the company's rules. The result writes in exactly the company's tone. It also cites policies that do not exist, mixes up last year's rules with this year's, and needs retraining every time HR updates a page. A retrieval prototype built in two days answers the same questions more accurately.

Down the hall, another team fine-tunes a small model to classify support tickets, using labels produced by a large model. It matches the large model's accuracy on their eval set, responds in a fraction of the time, and costs about 90% less to run.

Same technique, opposite outcomes. Fine-tuning is powerful for some jobs and the wrong tool for others, and the difference comes down to one question: are you trying to change what the model knows, or how it behaves?


Three places to put what a model needs

When a model falls short, you have three places to put the missing piece. You can put it in the prompt: instructions, rules, and a few examples, sent with every request. You can put it in retrieval: facts looked up at request time, as the RAG post described. Or you can put it in the weights: training the model further on your own examples so the behavior becomes part of the model itself.

Prompt Instructions, rules, and a few examples Change it in seconds. Paid for on every call. Retrieval Facts looked up for each request Update the index in minutes. Answers can cite sources. Weights Format, style, and narrow skills, trained in Retrain in hours or days. Shorter prompts per call. Flexible, easy to change Consistent, cheaper per call Facts belong in retrieval. Behavior that must hold on every call is what weights are for.

The mistake in the first story is putting facts into the weights. Research supports the intuition here. A 2024 study from Google researchers, "Does Fine-Tuning LLMs on New Knowledge Encourage Hallucinations?", found that models learn genuinely new facts from fine-tuning much more slowly than they learn to use what they already know. Worse, as the model finally fits those new facts, its tendency to hallucinate grows.

In practice, fine-tuning mostly teaches a model how to use its existing knowledge, not new knowledge.

Fine-tuning shines at the other column: form. A consistent output format, a house style, a narrow classification task, reliable tool use in a small model, or a skill the model can already almost do. These are behaviors you want on every call without spelling them out every time.


How it works

Kinds of fine-tuning

Supervised fine-tuning, often called SFT, is the common case. You provide examples of inputs paired with ideal outputs, and training nudges the model's weights so it produces outputs like yours. Each example is usually a short conversation in the same message format you would send to the API:

{"messages": [
  {"role": "system", "content": "Classify the support ticket. Reply with JSON."},
  {"role": "user", "content": "I was charged twice for my October invoice."},
  {"role": "assistant", "content": "{\"category\": \"billing\", \"priority\": \"high\"}"}
]}

Preference tuning, most often through a method called DPO, uses pairs instead: for each input, a better response and a worse one. It is useful for qualities that are easier to compare than to write down, such as tone or helpfulness.

Reinforcement fine-tuning goes a step further. Instead of examples of correct answers, you provide a grader, much like the graders in the evals post, and training rewards the model for outputs that score well. It suits tasks where answers can be checked but are hard to demonstrate, such as domain-specific reasoning with verifiable results.

Adapters, not new models

Retraining every weight in a large model is expensive. Most fine-tuning today uses LoRA (low-rank adaptation) or a similar technique: the original weights stay frozen, and training adds a small set of extra parameters, an adapter, on top. The adapter is typically a tiny fraction of the model's size.

That has practical consequences for a builder. Training is cheaper and faster. One base model can serve many adapters, one per task or customer. And a tuned model is always tied to a specific base model version, which matters later in this post.

What a training run looks like

From the outside, a hosted fine-tuning job is simple: upload a training file and a validation file, pick a base model, and start the job. A few settings matter. The number of epochs is how many times training passes over the data, and the learning rate controls how far each example moves the weights. Providers choose sensible defaults, and most first attempts should leave them alone.

The number to watch is validation loss: how well the model predicts examples it is not training on. It usually falls, then levels off, then starts rising as the model memorizes the training set. That turning point is where to stop. It is also where the hallucination study above found the risk began, so stopping early protects quality twice.

A job finishes with a new model identifier that you call like any other model. It does not finish with proof that the model is better. That comes only from running your eval suite on the held-out set and comparing against the alternatives.

Distillation: the most common win

The second story from the opening is distillation, and it is where fine-tuning most often pays off. A large, expensive model, the teacher, produces outputs for real inputs. Those outputs, filtered for quality, become training data for a small, cheap model, the student. For a narrow task, the student can match the teacher at a fraction of the cost and latency.

BUILD THE DATASET Real inputs from production Teacher large model labels Checks drop bad labels Dataset train + held-out split TRAIN, PROVE, SHIP Student small model, fine-tuned Compare on held-out student vs. teacher Deploy the student teacher stays as fallback for hard cases match The expensive model writes the training data once. The cheap model serves every request after that.

In code, building the dataset is mostly plumbing. The interesting part is the filter: only labels that pass your checks become training data, because the student will faithfully learn the teacher's mistakes along with its successes.

import json, random

examples = []
for ticket in sample_production_tickets(3000):
    label = classify_with_large_model(ticket)     # the teacher
    if passes_checks(ticket, label):              # schema + business rules
        examples.append({"messages": [
            {"role": "system", "content": SHORT_SYSTEM_PROMPT},
            {"role": "user", "content": ticket},
            {"role": "assistant", "content": json.dumps(label)},
        ]})

random.shuffle(examples)
cut = int(len(examples) * 0.85)
write_jsonl("train.jsonl", examples[:cut])
write_jsonl("heldout.jsonl", examples[cut:])     # never trained on; used to compare

The helper functions stand in for your own code. Notice SHORT_SYSTEM_PROMPT: the teacher may need long instructions and examples, but the student learns the behavior from the data, so its prompt can be a single line. That shorter prompt is a large part of the savings.

Sample inputs from real traffic, including the awkward cases, not just the clean ones. A student trained only on easy tickets will be confidently wrong on hard ones. Keep the held-out set untouched, and compare student and teacher on it with the same eval suite you use for every other change.


When to fine-tune, and when not to

The honest default is not to fine-tune. Models have become very good at following instructions, context windows are large, and prompting plus retrieval solves most problems with far less effort. Work down this list before reaching for training.

Is the model missing facts? Does a better prompt with examples fix it? Narrow and high-volume, or a format or style needed on every call? Hundreds of good examples and an eval suite? Use retrieval or tools Keep prompting Probably not worth it Collect data first Fine-tune yes yes no no no no yes yes Most teams stop at one of the first two answers, and that is usually the right outcome.

Fine-tuning is worth it in a few well-defined situations:

  • A narrow task runs at high volume, so a small tuned model saves real money, as in distillation.
  • A format or style must hold on every call, and long prompts full of examples are getting expensive or unreliable.
  • A small or open-weight model needs to call tools more reliably than prompting achieves.
  • A specialized task has verifiable answers that reinforcement fine-tuning can optimize.

Before training, try the cheaper versions of the same idea. A prompt with twenty good examples often closes most of the gap, and prompt caching makes a long, stable block of examples cheap to resend. If the large prompted model is good enough and the volume is modest, that may be the whole answer.

It is the wrong tool for facts that change, for knowledge you need to cite, for problems a clearer prompt would fix, and for anything without enough good examples to train on and an eval to prove the result. If you cannot measure whether the tuned model is better, you cannot know whether the weeks of work helped.


What goes wrong

Teaching facts creates confident errors. As the research above found, training on facts the model did not already know increases hallucination. The model learns the style of your documents faster than their content, so it sounds authoritative while being wrong. Put facts in retrieval.

The model gets narrower. Training hard on one task can degrade abilities outside it, an effect often called catastrophic forgetting. A support classifier that has been tuned aggressively may get worse at handling the occasional ticket written in another language. Test general behavior on your held-out set, not just the target task.

Safety behavior can erode. Research in 2023 showed that fine-tuning an aligned model, even on harmless-looking data, can weaken its refusals and safety training. Providers run their own checks on training data, but you still own the result. Include adversarial and out-of-scope cases in your evals for any tuned model.

Bad data gets learned perfectly. The model reproduces patterns in its training data, including mislabeled examples, inconsistent formats, and a teacher model's mistakes. A few hundred clean, consistent examples beat thousands of noisy ones.

The comparison uses the wrong baseline. A tuned small model that beats the untuned small model has proved very little. The real question is whether it beats the best alternative you could ship: the large model with a good prompt and retrieval. Always include that baseline in the comparison, along with its cost.

The base model gets retired. A tuned model is an adapter on a specific base model version. When the provider deprecates that version, your tuned model goes with it, and you retrain on the successor. Keep your training data, scripts, and evals in version control, so retraining is a routine job rather than an archaeology project.

Meanwhile, the new general model may simply do the task well enough with a prompt.


Cost, latency, and complexity

Training itself is often the cheapest part. Training a small hosted model on a few thousand examples typically costs a few dollars to a few hundred, depending on the provider, model size, and number of passes over the data. The real costs are building a clean dataset, running evals, and maintaining the pipeline as data and models change.

Inference is where fine-tuning pays off or does not. Take the ticket classifier at one million tickets a month. A large model with a 1,000-token prompt full of instructions and examples, producing 50 output tokens, costs about $0.00375 per ticket at an illustrative $3 per million input tokens and $15 per million output tokens: about $3,750 a month. A tuned small model with a 300-token prompt, even at twice the small model's normal price of $0.30 and $1.50, comes to about $0.00033 per ticket: about $330 a month, roughly 91% less.

The savings scale with volume, and so does the break-even point. At ten thousand tickets a month, the same switch saves about $34, which will not pay for the engineering time. Hosting your own open-weight model adds GPU costs that only make sense at steady, high volume or when data cannot leave your infrastructure. Tuned models are usually faster too, since small models with short prompts return sooner.

Serving many tuned variants is cheaper than it sounds. Because LoRA adapters are small, platforms can load many of them onto one copy of a base model and pick the right adapter per request. A product with a tuned adapter per customer or per task does not need a separate deployment for each.


The current landscape

Hosted fine-tuning is available from the major providers, but usually not for their newest frontier models. OpenAI offers supervised, preference (DPO), and reinforcement fine-tuning on selected models, while its latest models have often not been tunable at launch. Google's Vertex AI supports supervised and preference tuning for Gemini models. Anthropic has offered fine-tuning of Claude 3 Haiku through Amazon Bedrock, and Bedrock also supports reinforcement fine-tuning for some models.

Check each provider's current list, because which models are tunable changes often.

For open-weight models, the ecosystem is mature. Libraries such as Hugging Face's TRL and PEFT, Unsloth, and Axolotl handle LoRA and full fine-tuning, and QLoRA makes it possible to tune models on a single GPU. Hosted platforms such as Together AI and Fireworks AI train and serve tuned open-weight models without managing infrastructure.

The broader trend runs against routine fine-tuning. As general models improve and prompts get cheaper through caching, many tasks that once needed tuning now work with good instructions. What remains is a sharper set of use cases: distillation for cost, reinforcement fine-tuning for verifiable specialized tasks, and small models that need to be reliable on one job.


Summary

Fine-tuning changes how a model behaves, not what it knows. It is excellent for teaching a format, a style, a narrow skill, or for compressing an expensive model's behavior into a cheap one. It is a poor and risky way to add facts, which belong in retrieval where they can be updated and cited.

So treat fine-tuning as an optimization, not a starting point. Get the task working with a prompt and retrieval first, build an eval that defines success, and collect real examples along the way. If volume, consistency, or cost then justify it, those examples and that eval are exactly what a good fine-tune needs.


Part of the Applied AI series: AI from the builder's side.



×