Menu

Glossary

RAG vs fine-tuning: which do you need?

Use RAG when a model needs current or private facts at answer time, and fine-tuning when it needs a new behavior, style or format.

Copy as MarkdownOpen in ChatGPT (opens in a new tab)Open in Claude (opens in a new tab)

Use RAG when your model needs current or private facts at answer time. Use fine-tuning when it needs new behavior, style or format. RAG retrieves documents into the prompt, so knowledge updates as soon as the documents do and answers can cite sources. Fine-tuning retrains model weights, which changes how the model responds, not what it knows today.

The one-line rule: knowledge vs behavior

RAG adds knowledge: documents fetched at request time and placed in the prompt. Fine-tuning adds behavior: additional training that adjusts the model's weights so it responds in a particular style, format or domain register. Most "should we fine-tune?" questions get easier once framed this way. If the failure is "the model does not know X", retrieval fixes it. If the failure is "the model knows X but answers in the wrong shape", tuning might.

Where each one wins

RAG wins when:

Fine-tuning wins when:

Can you combine them?

Yes, and mature systems often do: fine-tune for behavior (format, tone, tool-use patterns) and retrieve for facts. What fine-tuning is not is a substitute for retrieval. Facts added by tuning are expensive to refresh, cannot be cited, and may be blended with what the model already learned instead of being recalled exactly.

Practical consequence

Choosing RAG moves the hard work to retrieval quality. Your answers become only as good as the documents you fetch, so grounding on clean, verifiable evidence can matter more than the choice of model. For pipelines that use the web as their knowledge source, that means a search API made for programs. The RAG use case and the Search for RAG guide show how MillionShort search fits that step: it returns ranked results with snippets and URLs, and your model writes the answer.

This page as Markdown ยท llms.txt