# Fine-tuning

> Extra training that adapts an existing AI model to a specific task or style.

- Level: Intermediate
- Topics: AI
- URL: https://tidbit.legios.com.ar/fine-tuning/
- In Spanish: [Fine-tuning](https://tidbit.legios.com.ar/es/fine-tuning/)

**Fine-tuning** means taking a model that has already been trained on a huge amount of general data and training it a little more on a small, specific set of examples. Training a large model from scratch costs enormous amounts of data and computing; fine-tuning reuses all that general knowledge and only nudges the model's internal numbers (its parameters) toward what you need.

Typical uses: making a model always answer in a particular format, write in a company's tone, classify support tickets into your own categories, or handle the jargon of a field like law or radiology. You prepare hundreds or thousands of example pairs ('given this input, the ideal output is this'), run the training, and get a new version of the model. Techniques such as **LoRA** make it cheaper by training only a small add-on instead of the whole model.

Fine-tuning is also how chat assistants are made in the first place: a base model that only continues text is fine-tuned on conversations so it learns to follow instructions and reply helpfully. For everyday business problems, though, it is often not the first tool to reach for. If the goal is to give the model up-to-date facts or your own documents, retrieval (RAG) is usually easier and easier to update; if the goal is behavior, a good prompt sometimes gets you most of the way. Fine-tuning shines when you have many good examples of a task you repeat a lot.

## An analogy

Like a doctor who finished general medical school and then does a short residency in dermatology. They do not relearn biology; they sharpen what they already know for one specialty.

## Keep in mind

- Starts from a pretrained model instead of training from zero.
- Needs a good set of examples of the exact task you want.
- Best for style, format and repeated specialized tasks.
- For fresh facts or private documents, RAG is often better.

## Go deeper

- [Fine-tuning (deep learning) on Wikipedia](https://en.wikipedia.org/wiki/Fine-tuning_(deep_learning))
- [What is fine-tuning? (IBM)](https://www.ibm.com/think/topics/fine-tuning)
- [Fine-tuning guide (OpenAI)](https://platform.openai.com/docs/guides/fine-tuning)

## Related terms

- [Training and inference](https://tidbit.legios.com.ar/training-and-inference/): Training builds the model once; inference is using it, millions of times a day.
- [RAG](https://tidbit.legios.com.ar/rag/): Let the model look things up in your documents before it answers.
- [Prompt](https://tidbit.legios.com.ar/prompt/): Everything you send to an AI model: the question, the instructions, the context.
