RAG vs Fine-Tuning
People often think fine-tuning is how you teach a model your own documents. Fine-tuning changes how a model writes, and it is poor at adding facts that change. RAG leaves the model alone and hands it the right text at question time, so the facts stay current and can be traced. Use RAG for knowledge. Use fine-tuning for style and format.
Retrieval-Augmented Generation (RAG)
First find the right pages, then let the model answer from them.
Retrieval-augmented generation is a way to make a language model answer from your own documents. When a question comes in, a search finds the most relevant passages. Those passages are put into the prompt next to the question. The model then answers from that text and can point to its sources. It lets a model use private or fresh facts without any new training. The name comes from a 2020 research paper.
Fine-Tuning
More training on a model that is done, so it gets good at one job.
Fine-tuning is more training on a model that is already trained, using a small set of examples for one job. The model keeps what it knew and gets better at that job or style. A few hundred to a few thousand good examples are often enough. It is much cheaper than training from scratch. It changes the model's weights, so the new skill is built in.
In one line
- Retrieval-Augmented Generation (RAG)
- First find the right pages, then let the model answer from them.
- Fine-Tuning
- More training on a model that is done, so it gets good at one job.