How does fine-tuning work?
Fine-tuning: how pretrained models are adapted to new tasks by updating parameters or adding small modules. Learn common strategies, practical hyperparameters, and tradeoffs between full fine-tuning, head-only, and parameter-efficient methods.

TL;DR
- Fine-tuning means adapting a pretrained model to a downstream task by updating parameters or adding small modules.
- Common approaches: full-parameter fine-tuning, head-only, adapters, LoRA, and prefix tuning.
- Key knobs: learning rate, number of trainable parameters, dataset size, and regularization. Key tradeoffs: accuracy versus compute, memory, and risk of catastrophic forgetting.
In this question, we will learn what fine-tuning is, why it works, and how to pick a practical strategy for different resource and data regimes. We will walk through a concrete example you can explain in an interview.
We will cover the following:
- The short direct answer
- The intuition
- How it actually works with a worked example
- Practical strategies and comparison of methods
- Tradeoffs and failure modes
- Questions the interviewer might ask
Fine-tuning is the process of adapting a pretrained model to a new task by updating some or all model parameters or by adding small task-specific modules; you choose how many parameters to change, set a learning rate appropriate to the pretrained weights, and validate to avoid overfitting. Fine-tuning usually gives better final performance than training from scratch, but costs more memory and can risk forgetting.
The intuition (an analogy that makes it click)
Think of a pretrained model as a chef who learned many cuisines. Fine-tuning is like teaching that chef one new signature dish. You can either let the chef rewrite their entire cookbook for the dish, adjust only the last steps of the recipe, or attach a short cheat-sheet the chef consults while cooking. Updating the whole cookbook can yield the best dish but takes time and risks changing other recipes. Attaching a small cheat-sheet is cheaper and keeps the chefs other recipes intact.
How it actually works (the real mechanics, with one concrete worked example)
Mechanically, fine-tuning changes parameters to minimize a task loss. If the pretrained parameters are and the task loss is , standard gradient descent updates are
where is the learning rate. In parameter-efficient methods we freeze most parameters and only optimize a subset . The loss then depends on and the update becomes
Concrete example: sentiment classification using a pretrained transformer with 100 million parameters. Options:
| Method | Trainable params | Typical learning rate | When to use |
|---|---|---|---|
| Full fine-tuning | 100M | to | Enough compute, moderate data |
| Head-only (classifier) | 0.1M | to | Small data, constrained memory |
| Adapter modules | 1-5M | Multi-task or many tasks with low memory | |
| LoRA / low-rank updates | 0.5-2M | Large models where full tuning is costly |
Suppose you have 2,000 labeled examples. A practical recipe is: freeze most layers, add a classifier head, use a batch size of 16 to 32, run 3 to 10 epochs, and set a head learning rate near . If performance saturates, gradually unfreeze more layers with a smaller learning rate, like multiplying by 0.1 for lower layers.
Practical strategies and comparison of methods
Full fine-tuning
- Update every parameter. Best when you have a lot of labeled data and GPU memory. Use lower learning rates to avoid destroying pretrained features.
Head-only training
- Only train a final linear or MLP head. Fast and stable for small datasets. It can underperform if the task needs changes in earlier representations.
Adapter and small-module tuning
- Insert small trainable modules into transformer blocks and freeze base weights. This keeps memory low and enables multiple tasks without multiple full models.
Low-rank and prefix methods (LoRA, prefix-tuning)
- Represent updates in a low-dimensional subspace to reduce trainable parameters and memory. Works well for very large models.
Comparison table of common tradeoffs:
| Method | Accuracy | Memory | Ease of reusing pretrained model |
|---|---|---|---|
| Full fine-tuning | High | High | Single task only unless saved copies kept |
| Head-only | Medium | Low | Easy reuse |
| Adapters / LoRA | Near full | Low | Excellent, supports many tasks |
Hyperparameters and practical tips
- Learning rate: pretrained weights are already good. Start low for weights you fine-tune, often to for large models. For newly added parameters use higher rates.
- Weight decay: small values help, but be cautious if you tune bias or layernorm parameters.
- Warmup and schedulers: a short linear warmup helps stabilize updates on large models.
- Batch size and steps: small datasets need fewer steps to avoid overfitting; track validation metrics.
When you unfreeze layers gradually, use discriminative learning rates where deeper layers get smaller .
Tradeoffs and failure modes
Fine-tuning can improve accuracy but introduces risks and costs. You must balance compute, memory, and the amount of labeled data.
Other failure modes:
- Tuning with too large a learning rate can destroy useful pretrained features and yield worse performance than random initialization in extreme cases.
- Label noise in a small dataset can make fine-tuning harm generalization. Consider regularization or training with robust loss functions.
Questions the interviewer might ask
Some follow-up questions you might get:
Why is the learning rate usually smaller for pretrained weights? Because pretrained weights already encode useful representations. Large updates can erase those representations. Small learning rates preserve them while nudging parameters toward the task objective.
When should you prefer adapters or LoRA over full fine-tuning? When memory is limited, you have many tasks, or you want to keep one shared base model and switch small modules per task.
What is catastrophic forgetting and how can you mitigate it? Catastrophic forgetting occurs when adapting to a new task makes the model lose performance on original tasks. Mitigations include regularization to stay near , rehearsal with old data, or parameter-efficient tuning.
How do you choose how many layers to unfreeze? Start by training the head. If performance is insufficient, unfreeze top transformer blocks progressively. Monitor validation gains and stop when returns diminish or overfitting appears.
How does dataset size affect strategy? Small datasets: head-only or adapters. Medium datasets: unfreeze some layers. Large datasets: full fine-tuning is often best.
Some things to note:
- Save both the fine-tuned weights and the training recipe: learning rates, epochs, and seed matter.
- Parameter-efficient methods often match full fine-tuning for many tasks when designed well.
What the interviewer is really testing
They want to know you understand why pretrained representations help, how optimization choices affect those representations, and the practical tradeoffs between accuracy, compute, and memory. They also want to see you can select a sensible experimental plan and defend hyperparameter choices based on data size and constraints.
Further reading in the curriculum
Go deeper on the fundamentals behind this question.
- Fine-Tuning and Adaptation How to adapt pretrained language models to specific tasks using full fine-tuning, LoRA, instruction tuning, and preference alignment, and when each approach is the right tool.
Related questions
How would you rate the quality of this article?
Prepare for your AI engineering interview
This is one of many detailed questions and explainers on StudyAIDesign. Browse the full set, work through the curriculum, and walk into your interview ready.