# Fine-tuning

Training an existing model further on your own examples to change its behaviour or style.

AI developers · Part 07: Hugging Face · Card 10 of 12 · Last updated 2026-10-13

## 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.

## Related concepts

- [RAG](https://studyvisually.com/learn/tech/ai-developers/embeddings-rag/rag)
- [The Hugging Face Hub](https://studyvisually.com/learn/tech/ai-developers/hugging-face/hugging-face-hub)
- [Transformers.js](https://studyvisually.com/learn/tech/ai-developers/hugging-face/transformers-js)
- [pipeline()](https://studyvisually.com/learn/tech/ai-developers/hugging-face/pipeline)

Web page: https://studyvisually.com/learn/tech/ai-developers/hugging-face/fine-tuning
Study this card in the app: https://studyvisually.com/app/learn?category=ai-developers&card=fine-tuning
