RAG vs fine-tuning vs long context: which one does your product need?
Three ways to make a language model know your stuff, in plain terms. When each one fits, what each costs, and the order I try them in on real projects.
If you want a language model to know about your products, your policies or your customers, there are three ways to get there. You can let it look things up (RAG), you can paste everything into the prompt (long context), or you can train it on your data (fine-tuning).
For most products the answer is RAG, sometimes long context, and fine-tuning only for a specific kind of problem. Here's how to tell which one you have.
What is each one, in plain terms?
RAG (retrieval-augmented generation) means the model looks things up before it answers. Your content is split into passages and indexed. When a question comes in, the system finds the most relevant passages and gives only those to the model, which writes the answer and cites them.
- 01Question"Can I return a sale item?"
- 02SearchFinds the 5 most relevant passages
- 03Check accessDrops what this user can't see
- 04AnswerWritten only from those passages
- 05SourcesLinks back to the policy page
Long context means skipping the search. Modern models can read hundreds of pages in one go, so you put all your content in the prompt and ask the question at the end.
Fine-tuning means training. You give the model hundreds or thousands of examples of input and the output you want, and it adjusts itself to produce that kind of output.
How do they compare?
| Question | RAG | Long context | Fine-tuning |
|---|---|---|---|
| Best for | Answering from lots of changing content | Small, stable sets of documents | Style, format, one narrow task |
| Content updates | Re-index, minutes | Change the prompt, instant | Retrain, days |
| Shows sources | Yes, naturally | Possible, less reliable | No |
| Per-user permissions | Yes, filter at search time | Hard | No |
| Cost per question | Low | High with lots of text | Low once trained |
| Upfront cost | Medium | Very low | High |
When is long context enough?
More often than people think. If your content is a few dozen pages, changes rarely, and everyone is allowed to see all of it, try putting it straight in the prompt first. It takes an afternoon and gives you a baseline to beat.
It stops working when the content grows, because every question pays to re-read everything. It also gets harder to tell which part of the text an answer came from, and you can't easily hide one document from one user.
When do you need RAG?
As soon as one of these is true:
- The content is bigger than you'd want to pay to send on every question.
- It changes weekly or daily, like prices, stock, tickets or policies.
- Different people are allowed to see different things.
- You need to show where an answer came from, for trust or for legal.
Most support bots, internal knowledge assistants and "chat with your documents" features land here. The model is the easy part. The work is in cleaning the documents, splitting them sensibly, and making search find the right passage for the questions people actually ask.
When is fine-tuning the right call?
Fine-tuning shines when the problem is how the model answers, not what it knows:
- Writing in a very specific house style or format, every time.
- Classifying or extracting from documents in a narrow domain, at high volume.
- Making a small, cheap model do one job as well as a big expensive one.
It's a poor way to teach facts. The model may blend them, misremember them, or keep repeating last quarter's prices after you've changed them. And every time the facts change, you retrain and re-test.
Which should you try first?
- Is the problem the style or format of answers, not the facts?Yes →Look at fine-tuning, or try good examples in the prompt first.No ↓
- Is the content small, stable and visible to everyone?Yes →Put it in the prompt. Long context is enough.No ↓
- Does it change often, need permissions, or need sources?Yes →RAG.
- Still no →Start with long context to get a baseline, then move to RAG if cost or accuracy say so.
You can also combine them. A common setup is RAG for the facts, with a fine-tuned small model for one high-volume step like classification. But only once the simple version has shown where it falls short.
If you're not sure which of these fits your product, tell me what you're building and I'll give you a straight answer.