AI Glossary / Generative AI and language / Intermediate
Fine-tuning
Definition
Fine-tuning is additional training that adapts a pretrained model to a particular task, domain, or desired behavior. It begins with learned capabilities rather than training an entirely new model from random initialization. Depending on the method, it updates all model parameters, selected parameters, or added trainable components. For language models, fine-tuning can encourage particular response patterns, formats, or specialist behavior, but it does not guarantee that every answer becomes correct.
What it means
A pretrained model has learned broad patterns from its earlier training. Fine-tuning changes how it uses those patterns by exposing it to a more focused training objective and dataset. For example, carefully prepared input-output pairs can demonstrate how to classify support requests or draft structured summaries. This is different from putting examples in a prompt, which normally leaves the model's parameters unchanged. It is also different from retrieving fresh documents into the context for each request.
How it works
Begin by defining the desired behavior and a baseline evaluation. Prepare suitable data, remove problematic duplicates, and separate training, validation, and final testing so related examples do not leak across the boundary. Choose an adaptation method and training objective, then update the trainable parameters using batches of examples. Monitor both the target task and capabilities that should be retained. Select a checkpoint using validation evidence, and assess the final choice on reserved data. Keep the base-model version, training configuration, dataset version, and deployment dependencies together.
Three practical examples
- Ticket routing: adapt a model to map customer messages to a stable set of business categories, including ambiguous cases and escalation rules.
- Structured drafting: teach consistent organization and terminology for a specific document format using reviewed examples.
- Domain language: adapt a model to specialized text patterns, then separately evaluate factual correctness and whether it handles unfamiliar requests appropriately.
Think of it this way
Think of an experienced employee learning an organization's procedures. Previous knowledge provides a starting point, while focused practice shapes task-specific habits. The analogy stops short of suggesting human understanding or guaranteed learning: a model optimizes a statistical objective and may absorb unwanted patterns, memorize examples, or perform poorly when the new situation differs from its training data.
Worked example
Suppose a fictional team has 1,000 reviewed examples of messages paired with routing labels. It sets aside 200 for final evaluation, uses 700 for training, and 100 for validation. These counts are illustrative, not a recommended universal split. All messages from the same underlying case stay in one partition to reduce leakage. Before adaptation, the baseline correctly routes 156 of the 200 final-test messages, or 78%. After the team chooses its training settings using validation data, the selected model correctly routes 172, or 86%.
The observed increase is 8 percentage points, and errors fall from 44 to 28, a reduction of 16 / 44, approximately 36.4%. Those figures describe this constructed test, not guaranteed future performance. The team still inspects which categories gained or lost accuracy and whether mistaken urgent messages became more common. If it repeatedly changes the model after inspecting those 200 test results, the set becomes part of the development process and no longer provides a clean final assessment. A separate evaluation of response behavior is also needed if the adapted model will generate text rather than only route messages.
Illustrative case study
A fictional service company wants shorter, consistently organized draft replies. Its first dataset contains many historical messages with outdated instructions, so simply training on the archive would preserve undesirable behavior. Editors build a reviewed collection and compare fine-tuning with a stronger prompt baseline. They test unusual requests and current-policy questions as well as routine examples. The company uses retrieval for changing policy details and considers fine-tuning only for stable response behavior that the evaluation shows it can improve.
Common misconceptions and mistakes
Uploading documents does not necessarily mean a system has been fine-tuned; the documents may instead be indexed for retrieval. Fine-tuning is not reliable database storage, and recalling a training statement does not establish that it is current or true. More epochs can increase memorization rather than usefulness. A lower training loss does not prove better performance on new requests. Updating only a small number of parameters can reduce adaptation costs, but it does not remove the need for the base model or eliminate evaluation work.
Business use
Use fine-tuning when there is a well-defined behavior, sufficient suitable examples, and measurable value beyond simpler approaches. Include data preparation, training, hosting, evaluation, and maintenance in the cost comparison. Decide who owns the training examples and how corrections will enter later versions. Plan regression checks when the base model, business categories, or operating environment changes. Track model versions in production so feedback can be associated with the system that actually produced a response.
People also ask
Does fine-tuning always update the whole model?
No. Full fine-tuning does, while parameter-efficient methods can train a smaller set of components.
Can fine-tuning replace retrieval?
Sometimes the goals overlap, but retrieval is often useful for supplying changing or attributable information at request time. The methods can be combined.
How much data is required?
There is no universal count. Task difficulty, base capabilities, example quality, diversity, and the acceptance criteria all influence what is sufficient.
Check your understanding
A team adds five examples to every prompt without performing training. Has it fine-tuned the model?
Answer: No. That is an in-context prompting approach unless a separate training process updates trainable model components. Both approaches should be compared using the same task criteria.
Related terms
- Transfer learning
- Supervised fine-tuning
- Instruction tuning
- Parameter-efficient fine-tuning
- Validation set
- Overfitting
- Retrieval-augmented generation
- Pretraining
- LoRA
- training data
- catastrophic forgetting
Learn next
Define one target behavior and collect examples of both successful and unsuccessful outputs. Build a prompt baseline and a held-out evaluation before considering training. Study full fine-tuning and parameter-efficient methods next, paying attention to data leakage, checkpoint selection, and regression testing. Keep changing factual knowledge separate from stable behavioral patterns when designing the overall system.
More in Generative AI and language
- Factored Language Model - A Factored Language Model represents a word or token through several associated factors, such as its surface form, stem, grammatical category, or learned...
- Factuality - Factuality is the extent to which factual claims in an AI response are accurate about the world, within the relevant time, scope, and context.
- Fast decay - Fast decay describes a quantity decreasing quickly over a specified sequence of steps or period of time.
- Flash Attention - FlashAttention is an efficient way to compute attention in neural networks by reducing data movement between different levels of GPU memory.
- Fraction of successes - The fraction of successes is the number of trials meeting a defined success condition divided by the total number of eligible trials.
- Function Calling with LLMs - Function Calling with LLMs is a way for a language model to request the use of defined software functions through structured outputs.
Sources
Hugging Face Transformers, Fine-tuning: https://huggingface.co/docs/transformers/training Hu and colleagues, LoRA: Low-Rank Adaptation of Large Language Models: https://arxiv.org/abs/2106.09685
Previous: Fine-motion planning Next: Finger search