Fine-tuning vs RAG vs prompting: which one your task needs

When a language model gets your task wrong, there are three levers: change the prompt, give it better information with retrieval (RAG), or change the model by fine-tuning it. Each fixes a different kind of failure. This guide shows how to tell which one you have.

The short answer

  • Prompt first. It is the cheapest change and the fastest to test.
  • Add retrieval (RAG) when the model lacks facts: your policies, your catalogue, last week’s prices.
  • Fine-tune when the model lacks a skill or a habit: your exact output format, your label set, your decision rules, applied the same way every time.

Retrieval changes what the model knows at the moment it answers. Fine-tuning changes how it behaves. Most confusion comes from using one to fix a problem that belongs to the other.

What each approach changes

Prompting

You change the instructions and examples the model reads with each request. Nothing about the model itself changes. Prompting is the right start for almost every task, and for many low-volume tasks it is also the right finish. Its limits show at volume: long prompts with many examples cost money on every call, and behaviour can shift when the provider updates the model.

Retrieval-augmented generation (RAG)

You search your own documents for passages relevant to the request and add them to the prompt. The model answers from that context. RAG is the right tool when answers depend on information that is private, large or changing, because you update the document store instead of the model. Its quality depends on the search step: if the right passage is not retrieved, the model cannot use it.

Fine-tuning

You train the model further on examples of the task done correctly, so the behaviour is built into its weights. Fine-tuning is the right tool when the task is narrow and repeated, the output has a fixed format, and you need the same input to get the same treatment every time. It also lets a small model match a much larger one on that one task, which changes cost, speed and where the model can run. Our guide to fine-tuning a small language model covers how.

Side by side

Prompting, retrieval-augmented generation and fine-tuning compared
QuestionPromptingRAGFine-tuning
What it changesThe instructions the model readsThe information the model readsThe model’s weights
FixesUnclear instructions, missing examples of the formatMissing, private or changing factsInconsistent format, labels or decisions on a narrow task
Does not fixFacts the model has never seenA model that ignores the format or your rulesFacts that change after training
What you needA clear task descriptionA searchable, maintained document storeExamples with correct outputs, and a held-out test set
Cost shapePer request; long prompts cost more each callPer request, plus search and index upkeepOne-off training, then serving cost
Model size it suitsUsually a large hosted modelAny sizeOften a small model you run yourself

Choose by the failure you see

Run your current system on real inputs and sort the wrong answers by cause. The cause points to the fix.

“It states facts that are wrong or out of date”

The model does not have the information. Retrieve it. Fine-tuning on last quarter’s policy will only teach the model last quarter’s policy.

“It ignores our format or invents fields”

First, tighten the prompt and validate the output against a schema. If errors remain at a rate you cannot accept, fine-tune. A model trained on many correct outputs in your schema learns the format more firmly than one that only reads a description of it.

“Two similar inputs get different answers”

This is a consistency problem, and fine-tuning is usually the fix. Training on reviewed decisions teaches the model where your lines are. Check your labels too: inconsistent answers often come from inconsistent examples.

“It is right, but too slow or too expensive at our volume”

Quality is not the problem. Size is. Fine-tune a small model to do the same task, and compare it with your current system on the same test set. Our small language model vs LLM guide walks through that decision, and the illustrative break-even estimate does the cost arithmetic with your numbers.

“Our data cannot leave our environment”

Any of the three can run privately if the model runs privately. A fine-tuned small model is often the most practical way to get there, because it fits on hardware you control. See private LLM deployment.

Using them together

These are layers, not rivals. A common production design uses all three:

  1. A fine-tuned small model that knows the task, the format and your rules.
  2. Retrieval that passes in the facts the task needs today, such as the current policy or the customer’s contract.
  3. A short prompt that frames each request.

Add a confidence threshold, and send the uncertain cases to a person or a larger model. Routine traffic gets speed and low cost; hard cases still get judgment.

An illustrative example

Illustrative scenario, not client data

A support team asks a hosted model to route each ticket to one of its queues and set a priority, returning JSON. Reviewing a week of output, they sort the errors into three groups:

  • Tickets about a product launched last month go to the wrong queue, because the model has never heard of the product. Fix: retrieval, passing in the current product list.
  • Some outputs are not valid JSON, or use a queue name that does not exist. Fix: schema validation first, then fine-tuning if the rate stays too high.
  • Two reviewers would disagree on whether a refund request is “high” or “normal” priority, and so does the model. Fix: a written priority rule, relabelled examples, then fine-tuning.

Each fix is cheap to test once the team has a held-out set of tickets with agreed answers.

Test all three on the same set

Debates about technique end quickly when everyone looks at the same scores.

  1. Build a held-out evaluation set from real inputs with agreed correct outputs. Keep it out of every prompt, index and training run.
  2. Score your current prompt on it. That is the baseline.
  3. Add retrieval and score again.
  4. Fine-tune a small candidate on separate examples and score it.
  5. Compare quality, failure types, latency and cost per 1,000 requests side by side.

Our evaluation-first method is built around this test. You keep the evaluation set, whichever approach wins.

Send us the failures you see.

Tell us what the task is, how often it runs and what handles it today. We reply with questions or a fixed-scope Sprint proposal.

hello@simpleoperations.ai
Draft a brief first