Transfer learning

Transfer learning is reusing what a model learned on one task to help it perform a different but related task, usually by starting from a pre-trained model instead of from scratch.

Training a capable model from scratch needs a lot of data and computing. Transfer learning avoids much of that by starting from a model that has already learned something useful elsewhere. A network trained to recognise cars has learned about edges, wheels and shapes that also help it recognise trucks. Take that network, adjust it with a modest number of truck pictures, and it will usually do far better than a new model trained on those pictures alone.

A 2014 study by Jason Yosinski and colleagues showed why this works for images. The first layer of image networks learned general features such as edge-like filters and colour blobs that applied across tasks, while higher layers became specific to the original task. Transfer helped less as the two tasks grew more different, but even features from a distant task beat starting from random values.

The idea is old. Bozinovski and Fulgosi published work on transfer in neural network training in 1976, and Lorien Pratt formulated an early transfer algorithm in 1992. It became central to language AI in 2018. In January that year Jeremy Howard and Sebastian Ruder's ULMFiT method showed that a language model pre-trained on general text and then fine-tuned could, with only 100 labelled examples, match a model trained from scratch on 100 times as much data. Later that year BERT showed that a pre-trained model could be adapted to many tasks by adding a single output layer.

Much practical AI work today is transfer learning. Foundation models are pre-trained once on broad data and then adapted, through fine-tuning or simply prompting, to thousands of specific jobs. The practical point for businesses is that useful custom models rarely require training from scratch. The limit is that transferred knowledge carries the strengths and the blind spots of the original training data, and it helps less when the new task is very different from the old one.

Common questions

What is the difference between transfer learning and fine-tuning?

Transfer learning is the general idea of reusing knowledge from one task for another. Fine-tuning is the most common way of doing it: continuing to train a pre-trained model on data for the new task. Transfer learning can also be done without fine-tuning, for example by using a pre-trained model's internal features as inputs to a separate, simpler model.

Why does transfer learning work?

Many tasks share underlying patterns. Image tasks share edges, textures and shapes; language tasks share grammar and word meanings. A model that has learned these general patterns from a large dataset only needs to learn what is specific to the new task, which takes far less data.

Is ChatGPT an example of transfer learning?

Yes, in the broad sense. Its underlying model was pre-trained on a large body of text to predict the next token, and that general knowledge was then transferred to the job of being a helpful assistant through fine-tuning and reinforcement learning.

When does transfer learning not help?

It helps less when the new task is very different from the original one, such as transferring from everyday photos to a highly specialised type of medical or scientific image. In some cases starting from a pre-trained model can even hurt, so results should always be checked against a model trained without it.

Finding more

Search for "transfer learning", "pre-trained model fine-tuning" or "domain adaptation" to find tutorials and research. Good sources include the original papers on arXiv, machine learning glossaries such as Google's, and the documentation of model libraries that provide pre-trained models. When a vendor says a model was adapted to your industry, ask what it was pre-trained on and how much of your own data the adaptation used.

Working out what this means for your business?

Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.