Fine-tuning
Training an existing model further on your own examples to change its behaviour or style.
Last updated
Analogy
Teaching a new hire your team's code style, versus handing them the wiki (that's RAG).
In an agent
For company knowledge, RAG almost always beats fine-tuning: it's easier to update and cheaper.
Practice
Flashcards
- What is fine-tuning?Training an existing model further on your own examples.
- Interview: RAG or fine-tuning for company knowledge?RAG. It adds knowledge and updates by re-indexing. Fine-tuning changes behaviour and needs retraining.
Interview questions
- RAG vs fine-tuning?
- RAG adds knowledge and is easy to update: re-index a document.
- Fine-tuning changes behaviour or style and needs training data and retraining.
- For company knowledge, choose RAG almost every time.
Questions people ask
What is fine-tuning an LLM?
Fine-tuning means training an existing model further on your own examples, so it changes its behaviour, tone or output format. It is like teaching a new hire your team's style through practice. It is not the best way to give a model facts, because updating those facts means training again.
Should I use RAG or fine-tuning for company knowledge?
RAG, almost always. RAG adds knowledge at question time, and updating it only means re-indexing documents. Fine-tuning changes behaviour, needs training data, costs more and must be redone whenever facts change. Use fine-tuning for style or format, and RAG for what the model needs to know.