Skip to content
AI.info

Training and optimization

Transfer Learning and Fine-Tuning Schedules

Design freezing, gradual unfreezing, discriminative rates, head warmup, layerwise decay, and checkpoint comparisons for pretrained models.

By the end you can

Comparison

Three adaptation regimes answer different constraints

Start with the smallest change that can satisfy the target task. The rungs of that ladder have been measured against each other, on GLUE with BERT-base. A frozen encoder, training 0.0% of the parameters, averaged 62.1. Tuning only the query biases, 0.01% of the parameters, reached 76.6. Tuning every bias term, 0.09%, reached 82.4. Full fine-tuning, 100% of the parameters, reached 82.3.

The fraction is the point. In 2022 Ben-Zaken and colleagues put it plainly: “The bias terms are additive, and correspond to a very small fraction of the network, in BERTBASE and BERTLARGE bias parameters make up 0.09% and 0.08% of the total number of parameters in each model, respectively.”

Roughly one thousandth of the parameters matched what moving all of them achieved on that benchmark. That is why the three regimes below are worth choosing between, rather than defaulting through.

FigureComparison · 3 columns

Frozen backbone

Train only a new head or lightweight adapter.

  • Benefit: low compute
  • Benefit: preserves source features
  • Risk: target mismatch remains
  • Use: small target datasets

Partial fine-tuning

Unfreeze selected blocks or parameter subsets.

  • Benefit: targeted adaptation
  • Benefit: moderate cost
  • Risk: boundary tuning
  • Use: related domains

Full fine-tuning

Update most or all pretrained parameters.

  • Benefit: maximum flexibility
  • Cost: memory and compute
  • Risk: forgetting and overfit
  • Use: sufficient target evidence

Key idea

A small target dataset can make full flexibility dangerous

Large pretrained models can fit narrow target evidence rapidly. Strong validation, conservative rates, data quality, and frozen baselines become especially important.

More unfreezing is not automatically more transfer, and the bill is not only overfitting on the target. Full fine-tuning has been compared with a linear probe across 10 distribution-shift datasets: Breeds-Living17, Breeds-Entity30, DomainNet, CIFAR→STL, CIFAR10.1, FMoW, ImageNetV2, ImageNet-R, ImageNet-A and ImageNet-Sketch. Kumar and colleagues state the result in one line: “fine-tuning obtains on average 2% higher accuracy ID but 7% lower accuracy OOD than linear probing”.

The same trade turned up for CLIP, in a separate 2022 paper: “Although existing fine-tuning methods substantially improve accuracy on a given target distribution, they often reduce robustness to distribution shifts”. Wortsman and colleagues kept both sets of weights instead of choosing between them, ensembling the zero-shot and the fine-tuned parameters. Their figure for it: “WiSE-FT improves accuracy under distribution shift by 4 to 6 percentage points (pp) over prior work while increasing ImageNet accuracy by 1.6 pp”.

For a small target set the best answer may therefore be a frozen encoder, an adapter, a retrieval layer, or an ensemble of pretrained and adapted weights. Full parameter updates are one option, not the default.

Full flexibility bought 2% in distribution and gave back 7% outside it.

Case

Matching full fine-tuning while training a fraction of the parameters

How much to unfreeze has a price, and the parameter-efficient literature has measured it from both sides. Adapter modules were tested on 26 text classification tasks in 2019. They added “only 3.6% parameters per task”, against fine-tuning, which “trains 100% of the parameters per task”, and they tracked full fine-tuning closely. LoRA followed in 2021. Against GPT-3 175B tuned with Adam it cut trainable parameters “by 10,000 times”. GPU memory fell by a factor of three, and LoRA has, “unlike adapters, no additional inference latency”.

Parameter count is not the whole comparison. Chen and colleagues re-ran adapters, prefix tuning, LoRA and BitFit against full fine-tuning on 12 GLUE and SuperGLUE tasks in 2022, under one fixed protocol. The parameter-efficient methods came out ahead only in low-resource settings, and they were far more spread across seeds. On RTE, BitFit averaged 66.76 ± 12.98 accuracy against full fine-tuning's 79.28 ± 1.9. Their verdict: “When being compared under a truly fair evaluation protocol, PETuning cannot yield consistently competitive performance while finetuning remains to be the best-performing method in medium- and high-resource settings.”

The three orders of magnitude in the figure are real. So is the standard deviation the same comparison leaves out.

Figure

Three orders of magnitude separate these rows, and all three report accuracy close to the method above them — so the question is what the deployed model has to carry per task.

Retraining an experienced specialist for a new clinic

When a specialist moves to a clinic with different equipment and patient patterns, the expertise arrives intact. Existing skill is valuable, but some routines require careful adaptation.

Where the analogy parts company with fine-tuning is that a colleague can name which routines to relearn. Parameter groups cannot. Layerwise decay assumes the earlier layers hold the transferable competence. That is a claim about one architecture and one domain shift, not a property of pretrained models. The sections below show what happened when people tested it, by cutting real networks at every layer and reading off what the cut cost.

Adaptation should preserve useful knowledge while changing only what target evidence supports.

Visual

A staged fine-tuning program

Phases separate head initialization from backbone adaptation, and each regime has a measured price. Table 7 of the ULMFiT paper reports validation error for four regimes on the same three datasets — IMDb, TREC-6 and AG. Training from scratch: 9.93 / 13.36 / 6.81. Fine-tuning only the last layer ('Last'): 6.49 / 16.09 / 8.38. Full fine-tuning: 6.87 / 6.86 / 5.81. Gradual unfreezing with discriminative rates and slanted triangular rates ('Freez + discr + stlr'): 5.00 / 5.69 / 5.38.

Head-only adaptation was the worst of the four on two of the three tasks. It lost even to training from scratch on TREC-6, 16.09 against 13.36, and on AG, 8.38 against 6.81. Howard and Ruder say why: “'Last', the standard fine-tuning method in CV, severely underfits and is never able to lower the training error to 0.”

The order of the phases below is itself a borrowed claim. They unfreeze “starting from the last layer as this contains the least general knowledge (Yosinski et al., 2014)”.

FigureTimeline · 4 stops
  1. Head verification

    Train or test the new output head while the backbone remains frozen.

  2. Selective unfreezing

    Open upper blocks or adapters with conservative parameter-group rates.

  3. Broader adaptation

    Unfreeze more layers only when target evidence justifies it.

  4. Refinement

    Decay rates, monitor forgetting, and select checkpoints under target metrics.

Steps

Design a staged adaptation experiment

Compare regimes under matched target evidence and selection rules. Steps 5 and 6 deserve the same standing as the in-domain score.

Step 5 has a documented payoff. Probing first and then fine-tuning — LP-FT — was 1% better in-distribution and 10% better out-of-distribution than full fine-tuning, in the same study by Kumar and colleagues. That is the staged ordering the timeline above already describes.

Step 6 needs more than one run per arm. Chen and colleagues fixed their protocol at 20 runs for each low- and medium-resource task and 10 for each high-resource one, across 12 GLUE and SuperGLUE tasks. It took that many runs to see that the parameter-efficient methods led only in the low-resource regime.

FigureProcess · 6 steps
  1. 1. Establish frozen baselines

    Measure zero-shot, linear-probe, or head-only performance.

  2. 2. Define parameter groups

    Separate new, upper, lower, normalization, and embedding parameters.

  3. 3. Choose conservative rates

    Use smaller rates for pretrained groups and verify update ratios.

  4. 4. Unfreeze by evidence

    Broaden adaptation only when the current regime plateaus for understood reasons.

  5. 5. Test retention

    Evaluate source-like or general capabilities that the product still needs.

  6. 6. Compare cost and stability

    Include memory, time, seeds, and sensitivity in the final choice.

Example

Ways adaptation can look successful while losing value

Transfer has to be judged on more than one in-domain score.

  • Head shortcut: A new classifier exploits a target-specific artifact while the backbone stays useful only superficially. That is what 'Last' underfitting looks like in Table 7 — worst of the four regimes on two of the three datasets.
  • Catastrophic forgetting: A commercial model's alignment came off in a handful of steps. Qi and colleagues reported it this way: “For instance, we jailbreak GPT-3.5 Turbo's safety guardrails by fine-tuning it on only 10 such examples at a cost of less than $0.20 via OpenAI's APIs, making the model responsive to nearly any harmful instructions.” Fine-tuning on benign, commonly used datasets degraded alignment too. Zhan and colleagues then repeated the result on a stronger model, GPT-4: “fine-tuning allows attackers to remove RLHF protections with as few as 340 examples and a 95% success rate”, against 7% for the base models, while standard-benchmark performance was retained.
  • Layer mismatch: A single global rate changes early features too quickly and the new head too slowly. Yosinski and colleagues showed that the boundary itself costs accuracy — freezing at layers 3–6, and particularly at 4 and 5, lost top-1 accuracy even when the copied weights came from a network trained on the same task.
  • Small-data overfit: The model memorizes target examples because pretrained capacity is enormous relative to evidence, and the reported average hides it. On RTE, BitFit's ± 12.98 across 20 runs against full fine-tuning's ± 1.9 is mostly seed.
  • Optimizer-state leak: Resuming with moments from a different parameter-freezing regime creates unexpected early updates.

Pretraining changes the starting point, not the target contract

A pretrained model encodes representations shaped by its source data and objective. Fine-tuning asks those parameters to support a new target, distribution, and decision.

Good source performance does not guarantee useful transfer. Measure target baselines, domain distance, and whether frozen features already contain the required evidence.

ULMFiT put numbers on that in 2018. Howard and Ruder's recipe added discriminative fine-tuning and gradual unfreezing to a pretrained language model. On six text classification tasks it cut error by “18-24% on the majority of datasets”. With “only 100 labeled examples” it matched training from scratch on 100x more data. The pretrained starting point was worth roughly two orders of magnitude of labels.

Transfer is an empirical relationship between source representation and target task.

Layerwise rate decay is a hypothesis about representation hierarchy

Lower rates in earlier layers assume those features are more transferable and should change less. The rule has a constant in it, and the constant was tuned, not derived. Howard and Ruder set each layer's rate from the layer above: “We empirically found it to work well to first choose the learning rate ηL of the last layer by fine-tuning only the last layer and using ηl−1 = ηl/2.6 as the learning rate for lower layers.”

That constant has since been swept end to end, and the table published. On IMDb with BERT, at base rate 2.0e-5, ξ=0.95 was best at 5.40% test error. ξ=1.00 — no decay at all — gave 5.42%. ξ=0.85 gave 5.65%. The whole sweep spans 0.25 points. Sun and colleagues' recommendation, in 2019: “We find that assign a lower learning rate to the lower layer is effective to fine-tuning BERT, and an appropriate setting is ξ=0.95 and lr=2.0e-5.”

Where the network is cut matters more than how steeply the rates decay below the cut. Yosinski and colleagues took an eight-layer ImageNet network and cut it at each of layers 1 through 7. Freezing at layers 3–6, and particularly at 4 and 5, lost top-1 accuracy, even when the copied weights came from a network trained on the same task. The boundary splits neurons that depend on each other: “This performance drop is evidence that the original network contained fragile co-adapted features on successive layers, that is, features that interact with each other in a complex or fragile way such that this co-adaptation could not be relearned by the upper layers alone.”

Transferring features and then fine-tuning them still beat training on the target directly, by a mean of 1.6% across layers 1–7 and 2.1% when at least five layers were kept. So inspect layerwise updates and target gains. A decay factor is not a universal rule.

The whole decay sweep spanned 0.25 points; which layers you open decides more than how fast you decay them.

Key takeaways