Adapting LLMs: Context Injection vs. Fine-Tuning › Adapting LLMs: Summary of Methods
Michael BrenndoerferJuly 22, 20252 min read
Adapting LLMs: Context Injection vs. Fine-Tuning › Adapting LLMs: Summary of MethodsOne section · Sections in this article5 / 8 ↓
Sections in this article8
## Off-the-Shelf Models
- **Best for**: General-purpose use with zero setup
- **Advantages**: Quick and easy, immediate results
- **Limitations**: May falter on specific or recent queries, risk of hallucination without extra context
## Prompt Engineering
- **Best for**: Minor tweaks or injecting ephemeral knowledge
- **Advantages**: Maintains model breadth while providing guidance, suitable when information changes often
- **Limitations**: Limited by context size, requires iterative prompt crafting
## RAG (Retrieval-Augmented Generation)
- **Best for**: Knowledge-intensive tasks with lots of reference material
- **Advantages**: Acts like an "open-book exam" - combines model capabilities with your data, keeps data private and updateable
- **Limitations**: Engineering complexity and potential latency
- **Ideal for**: Company documents, scientific literature, live news requiring accuracy
## Fine-Tuning
- **Best for**: Static or slow-changing domains where maximum performance is needed
- **Advantages**: Allows offline deployment, deeply internalizes datasets for controlled outputs
- **Limitations**: Heavy upfront training process, less ideal for frequently updating knowledge
- **Ideal for**: Well-defined domain data (product catalogs, specific formats like legal contracts)
In practice, these approaches can be combined. For example, you might fine-tune a base model on general instruction-following or your brand's tone, and still use RAG to provide live data for factual quer
Fine-tuning can also be done after building a RAG pipeline: you could fine-tune the model on examples of using retrieved documents, to help it better integrate external info (though it then starts to blur into the model's weights).
Deciding which path to take depends on your specific needs in terms of accuracy, data freshness, compute budget, privacy, and development effort.