Start with the prompt. If the model gives wrong answers because it lacks your information, give it that information: paste the documents in if they are small, and use retrieval (RAG) if they are large. Fine-tune only when the model has the right information and still does not behave the way you need, and only after you have a test set that proves it.
Here is a request every AI builder hears: "We need a fine-tuned model trained on our data." Ask what is going wrong, and the answer is often something like this: the chatbot does not know the company's return policy. That is not a training problem. The model has never been shown the policy.
This mix-up is common, and it is expensive, because the three ways of improving an AI system fix different things. Pick the wrong one and you spend weeks on work that could not have helped.

Three tools, three different jobs

A better prompt changes what you ask. Clearer instructions, a few worked examples, the output format spelled out. Nothing is built and nothing is trained.
RAG (retrieval-augmented generation) changes what the model can see. Before the model answers, the system searches your documents and adds the relevant passages to the prompt. The idea comes from a 2020 research paper, which paired a text-generating model with a searchable index because models are limited in how they store and update facts on their own.
Fine-tuning changes the model. You train it further on your own examples so that it responds in a particular way without being told each time.
OpenAI's guide to optimizing accuracy gives the cleanest way to think about it. Every wrong answer is one of two kinds. Either the model lacked information, or it had the information and behaved inconsistently. RAG fixes the first kind. Fine-tuning fixes the second. And the guide says prompt engineering is usually the best place to start, before either.
Start with the prompt, and a test set
Before changing anything, write down twenty or more real questions with the answers you would accept. OpenAI's guide recommends exactly this. Without a test set you are judging by feel, and you will not know whether the next change helped.
Then fix the prompt. Most first prompts are a paragraph of hopes. A working prompt states the role, the rules, the format and what to do when the answer is unknown, and includes two or three examples of a good reply. Run the test set again. A good number of "the model is not good enough" complaints end right here.
If it lacks your information, give it the information
Look at the answers that are still wrong. If the model is guessing about your prices, policies or products, it needs your material in front of it.
That does not always mean building retrieval. Anthropic's engineering team notes that a knowledge base under 200,000 tokens, roughly 500 pages, can simply be placed in the prompt in full, and that prompt caching can cut the cost of doing so by up to 90%. For a hotel's policies or a clinic's service list, that is the whole job done in an afternoon.
RAG earns its place when the material is too large for that, changes daily, or has to respect who is allowed to see what. Be ready for the work, though. Retrieval is a search problem, and search has to be tuned: how documents are split, how they are indexed, what happens when nothing relevant is found. The same Anthropic post reports that adding context to each chunk and re-ranking results cut its retrieval failures by 67%, which tells you how much quality depends on these details.
Fine-tune last, and only with evidence
Suppose the model now has the right information and still gets it wrong: the format drifts, the tone is off, it ignores an instruction one time in twenty. That is a behaviour problem, and fine-tuning is the tool for it. OpenAI's guide suggests starting with 50 or more good examples that look like real traffic (source).
Three cautions before you commit.
It is tied to one model. A fine-tuned model lives only as long as the base model under it. OpenAI's fine-tuning documentation currently says the company is winding down its fine-tuning platform, that it is closed to new users, and that tuned models stop working when their base model is shut down. Google still offers tuning for several Gemini models on Vertex AI, where you pay for training and then for normal usage. Whichever you choose, plan to redo the work when the model is retired.
It does not teach facts well. Training on last year's price list gives you a model that is confidently out of date. Facts belong in the prompt or in retrieval, where you can change them the same day.
More is not always better. In OpenAI's own worked example, adding RAG on top of a fine-tuned model made the score slightly worse. Each layer is one more thing to maintain, so add one only when the test set says it helps.
Open-source models you host yourself change this picture a little, because nobody can retire them for you. That is one reason teams with strict data rules fine-tune their own models. It is also a much larger commitment in hardware and people.
The order we would try them in
- Write the test set. Real questions, agreed answers.
- Fix the prompt. Instructions, examples, format.
- Add your information. All of it in the prompt if it fits; retrieval if it does not.
- Fine-tune only if the behaviour is still wrong and the test set shows it.
Each step costs more than the one before and takes longer to undo. That is the whole reason for the order. If you are also weighing the budget, our guide to what decides the cost of an AI agent covers the running costs behind each choice.
So when someone says they need a model trained on their data, ask one question first: what did it get wrong, and did it have the answer in front of it?
Questions people ask
What is the difference between RAG and fine-tuning?
RAG gives the model your information at the moment it answers, by searching your documents and adding the relevant parts to the prompt. Fine-tuning changes the model itself by training it on examples, which shapes how it behaves. RAG fixes missing knowledge; fine-tuning fixes inconsistent behaviour.
Should I try prompt engineering before RAG or fine-tuning?
Yes. OpenAI's own accuracy guide says prompt engineering is usually the best place to start, and it is the cheapest thing to change. Many problems that look like they need RAG or fine-tuning turn out to be unclear instructions.
Do I always need RAG to use my company documents?
No. If the documents are small enough to fit in the prompt, you can include all of them. Anthropic suggests this for knowledge bases of up to about 500 pages, with prompt caching to keep the cost down. Retrieval becomes useful when the material is larger than that or changes often.
Is fine-tuning still worth it?
Sometimes: for strict output formats, a specific tone, classification at high volume, or to make a smaller model do a narrow job. It needs good examples, a test set and re-work when the base model is retired, so treat it as the last step, not the first.
Sources
- Optimizing LLM accuracy (OpenAI developer documentation)
- Contextual retrieval in AI systems (Anthropic Engineering, September 2024)
- Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks (Lewis et al., 2020)
- Supervised fine-tuning (OpenAI developer documentation)
- About supervised fine-tuning for Gemini models (Google Cloud documentation)



