# Fine-Tuning

Fine-tuning adapts a pre-trained model by updating some or all of its parameters using task-specific examples or feedback.

- Type: method
- Domain: Engineering & architecture
- Level: Advanced
- Last reviewed: 2026-09-26
- Original: [Soroush’s Product Wiki](<https://wiki.soroush.uk/topic/fine-tuning/>)

## What it means

Fine-tuning continues training a pre-trained model on selected examples or preference signals so its behavior better fits a task, domain, style, or output pattern. It changes learned parameters, unlike prompting or retrieval, which supply request-time context. Methods include supervised fine-tuning and parameter-efficient adaptation; each requires evaluation against a stable baseline.

## Why it matters

Fine-tuning can improve consistent behavior, reduce long prompts, and adapt smaller models for repeated tasks. It also introduces dataset, training, versioning, safety, and maintenance work that product teams may underestimate.

## When to use it

Consider fine-tuning after prompt and workflow baselines show a repeatable behavioral gap and enough high-quality examples exist. Use retrieval for frequently changing factual knowledge, tools for external actions, and deterministic code for guaranteed rules. Avoid training when success cannot be measured.

## How it works

1. Define the target behavior, baseline, evaluation set, acceptable regressions, and deployment constraints.
2. Collect, authorize, clean, deduplicate, and split representative examples without evaluation leakage.
3. Choose a base model and adaptation method, then train with tracked data and configuration versions.
4. Evaluate task quality, general capability, safety, memorization, and subgroup performance against the baseline.
5. Release gradually and monitor drift, new failure cases, data deletion obligations, and retraining triggers.

## A practical example

A support platform has thousands of approved examples for classifying issue type and urgency. After prompting plateaus, it fine-tunes a smaller model, holds out recent tickets for evaluation, checks rare critical cases separately, and keeps the previous model available for rollback.

## Where it breaks

Fine-tuning can overfit, memorize sensitive data, amplify annotation bias, or degrade unrelated capabilities. It does not reliably add current facts or eliminate hallucinations and security risks. Training data curation and repeated retraining may cost more than prompt, retrieval, or workflow changes.

## Common mistakes

- Fine-tuning before establishing a prompt, model, and non-model baseline.
- Training on noisy production logs without consent, quality review, or leakage checks.
- Using fine-tuning to store changing facts that retrieval should supply.
- Evaluating on examples duplicated from or too similar to the training set.

## Visualization

[View the visualization on the website](<https://wiki.soroush.uk/topic/fine-tuning/#visualization-fine-tuning>)

## Sources

1. [Model Optimization](<https://developers.openai.com/api/docs/guides/model-optimization>) — OpenAI · Official documentation
2. [Machine Learning Glossary](<https://developers.google.com/machine-learning/glossary>) — Google for Developers · Official technical glossary

## Related topics

- [Foundation Model](<https://wiki.soroush.uk/topic/foundation-model/>)
- [Retrieval-Augmented Generation \(RAG\)](<https://wiki.soroush.uk/topic/retrieval-augmented-generation/>)
- [Model Evaluation](<https://wiki.soroush.uk/topic/model-evaluation/>)
