Training a large neural network from scratch needs a great deal of data and computing power, and most projects have neither. Transfer learning sidesteps that by starting from a model that someone else already trained on a large dataset, and adapting it to your smaller problem.
The core idea
A model trained on a big, general dataset learns broadly useful patterns. An image model trained on millions of photos learns to detect edges, textures and shapes, and a language model trained on large amounts of text learns how words and sentences fit together. Those patterns are useful for many other tasks. Transfer learning reuses them instead of relearning them, so your own model starts far ahead of random weights.
Two common approaches
The first is feature extraction. You keep the pretrained model fixed, run your data through it, take the internal representation it produces, and train a small new model on top of that. It is fast, cheap and hard to overfit. The second is fine-tuning. You also update some or all of the pretrained model’s weights on your data, usually with a small learning rate so you adjust the model gently instead of wiping out what it learned. Fine-tuning can reach better accuracy but needs more care and more compute.
Freezing layers
In a deep network, the early layers learn general patterns and the later layers learn task-specific ones. A common recipe is to freeze, meaning not update, the early layers, and train only the last few layers on your data. With more data you can unfreeze more of the network. The structure of layers behind this is explained in neural networks explained.
Why it helps with small datasets
With few examples, a large model trained from scratch will memorize them. A pretrained model already carries general knowledge, so only a small number of parameters need to be learned from your data. That reduces the risk described in how to detect overfitting and moves you toward the good side of the bias-variance trade-off.
Embeddings are a form of transfer
When you use a pretrained model to turn text into vectors, as in text embeddings, and then train a simple classifier on those vectors, you are doing feature extraction. It is often the quickest way to get a working text model from a small labeled dataset.
How to fine-tune carefully
- Use a lower learning rate than you would when training from scratch, because the weights are already good. The mechanics are covered in gradient descent explained.
- Match the preprocessing the pretrained model expects, such as the same image size and normalization, or the same tokenizer for text.
- Watch validation performance and stop when it stops improving.
- Record each run’s settings and scores, as described in MLflow experiment tracking.
When it does not help
Transfer learning works best when your task resembles what the pretrained model learned. A model trained on everyday photographs may transfer poorly to specialized images such as medical scans, and a general language model may struggle with unusual jargon. There are also licenses to check, because pretrained models come with terms about how they may be used. And for ordinary tabular data, there is rarely a useful pretrained model to start from.
Start with a baseline
Before reaching for a pretrained network, see what a simple model achieves, as argued in baseline model in machine learning. Transfer learning is worth the added complexity only if the baseline falls short.
A quick checklist
- Does your task resemble the data the pretrained model was trained on?
- Will feature extraction be enough, or do you need to fine-tune?
- Are you using the preprocessing the pretrained model expects?
- Is the learning rate low enough for fine-tuning?
- Did you check the model’s license and compare against a simple baseline?
If you want help adapting and deploying a pretrained model, see my machine learning and MLOps service.
FAQ
What is transfer learning in simple terms?
It is reusing a model trained on a large dataset as the starting point for a new, related task, instead of training a new model from scratch.
What is the difference between feature extraction and fine-tuning?
Feature extraction keeps the pretrained model fixed and trains a new model on its outputs. Fine-tuning also updates some of the pretrained weights on your data.
How much data do I need for transfer learning?
Much less than training from scratch, but the amount depends on how close your task is to the pretrained one. Measure performance on held-out data to see whether you have enough.

