← All comparisons AI Techniques

RAG vs Fine-tuning

Retrieval-augmented generation vs fine-tuning an LLM.

RAG gives models access to new facts. Fine-tuning changes model behavior/style/format. They solve different problems.

At a glance

RAGFine-tuning
ChangesWhat facts the model can accessHow the model behaves
CostLow (infrastructure)High (training)
Update frequencyAnytime (reindex)Rare (retrain)
Use caseFacts, docs, groundingStyle, format, specialized tasks

When to pick RAG

You need the model to answer from specific (changing) facts.

When to pick Fine-tuning

You need stable output format/style the model can't get via prompting.

My verdict

Start with RAG. Fine-tune only when RAG isn't enough and the behavior you need is stable.

Further reading