Fundamentals of Generative AI
RAG, Fine-Tuning, and Pretraining Trade-offs
RAG, fine-tuning, and continued pretraining solve different customization problems. RAG is usually best for grounding in changing private knowledge, while fine-tuning is better for behavior, format, or task examples.
Concepts
- Prompt engineering is low-cost and fast but does not add durable knowledge.
- RAG grounds responses in retrieved content and is well suited for changing private knowledge.
- Fine-tuning adjusts model weights to improve behavior, style, or task performance from examples.
- Continued pre-training updates a model on a large domain corpus and is higher effort than fine-tuning.
- Model choice balances quality, latency, context window, modality, availability, and cost.
Exam tips
- Use RAG when source knowledge changes often or must remain external.
- Fine-tuning changes model weights for selected models and use cases.
- Continued pretraining is higher effort and uses a broader domain corpus.