Techniques

What is Fine-Tuning vs RAG?

Two different approaches to customizing AI โ€” permanent training vs. runtime knowledge injection.

Definition

Fine-tuning permanently changes model weights by training on custom data, making the model inherently better at specific tasks. RAG (Retrieval-Augmented Generation) dynamically retrieves relevant documents at runtime and includes them in the prompt context. Fine-tuning is better for style/format changes; RAG is better for adding up-to-date knowledge without retraining.

๐Ÿ’ก Example

A law firm wanting Claude to write in their specific legal style would fine-tune a model. The same firm wanting Claude to reference their case database would use RAG โ€” retrieving relevant cases at query time and providing them as context.

Related concepts

LLM (Large Language Model)

A type of AI trained on massive text datasets to understand and generate human language.

โ†’
RAG (Retrieval-Augmented Generation)

A technique that lets AI access external knowledge bases to provide more accurate answers.

โ†’
Fine-Tuning

Training a pre-trained AI model on specialized data to improve performance on specific tasks.

โ†’
Embedding

A numerical representation of text that captures its meaning as a vector.

โ†’

Explore AI tools

Find tools that use fine-tuning vs rag in practice.

Browse all tools โ†’ Back to glossary
What is Fine-Tuning vs RAG?

Fine-tuning permanently changes model weights by training on custom data, making the model inherently better at specific tasks. RAG (Retrieval-Augmented Generation) dynamically retrieves relevant documents at runtime and includes them in the prompt context. Fine-tuning is better for style/format changes; RAG is better for adding up-to-date knowledge without retraining.

How does Fine-Tuning vs RAG work in practice?

A law firm wanting Claude to write in their specific legal style would fine-tune a model. The same firm wanting Claude to reference their case database would use RAG โ€” retrieving relevant cases at query time and providing them as context.