Black October, explainedAppsGuidesAI DictionarySmall FixesOn RecordAboutFollow the lab

Transfer learning

Also called pretrained model

Transfer learning reuses what a model learned on one big task as a head start on a new task, so it needs far less data and time.

In plain words

Training a model from nothing takes huge amounts of data and computing power. But much of what a model learns is general. A model trained on millions of photos has learned to spot edges, textures and shapes, and those skills help with almost any picture.

Transfer learning keeps that general knowledge and adds a small new part for the new job. Want to sort mangoes into ripe and not ripe? Start from a model that already knows how to look at photos, and teach only the final step with a few hundred mango pictures.

This is how most AI gets built today. The big general models, called foundation models or pre-trained models, are trained once and then adapted, through fine-tuning, to thousands of specific uses.

Everyday example

A home cook learning a new cuisine

Someone who cooks Bengali food every day decides to learn Gujarati dishes. They do not start from scratch: knife skills, tempering spices and judging heat all carry over. They only need to learn the new recipes and balance. A complete beginner would take far longer. The years of cooking are the pre-trained model; the new recipes are the small new training.

Where the example breaks: The cook understands why skills transfer. A model just reuses its learned numbers, and if the new task is too different from the original, the old knowledge can even hurt, which researchers call negative transfer.

Go deeper

How it actually works

Google's glossary describes transfer learning as moving knowledge from one machine learning task to another, often from a task with lots of data to one with little.

  1. Start from a pre-trained model

    Pick a model trained on a large, broad dataset, such as an image model trained on ImageNet or a language model trained on web-scale text.

  2. General layers, specific top

    In image models, early layers learn general features like edges and colour blobs, and later layers grow more specific to the original task. A 2014 study measured this shift from general to specific across layers.

  3. Swap the top

    The original output layer, for example 1,000 ImageNet classes, is replaced with a new one for the new task, such as ripe or not ripe.

  4. Train lightly

    Either freeze the reused layers and train only the new top, or gently fine-tune everything with a small learning rate. Methods like LoRA update only a small add-on to save memory.

  5. When it backfires

    If the source and target tasks are too different, the borrowed features help less, and in some cases results are worse than training from scratch.

Early work
Stevo Bozinovski and Ante Fulgosi, 1976, according to Bozinovski's own 2020 account in the journal Informatica
Main benefit
Far less labelled data, training time and compute for the new task
Common forms
Feature extraction (freeze and add a new top), fine-tuning, parameter-efficient tuning such as LoRA
Risk
Negative transfer when tasks are too different

Questions people ask

What is transfer learning in simple terms?

Taking a model that already learned one task and reusing its knowledge for a related task. Instead of starting from zero, you start from a model that already knows a lot, and teach it just the new part.

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

Transfer learning is the overall idea of reusing knowledge from one task for another. Fine-tuning is one way to do it: continuing to train the reused model on the new task's data. Freezing the old layers and training only a new top is another way.

Why is transfer learning useful?

Because labelled data and computing power are expensive. Reusing a model trained on a huge dataset means a new task may need only hundreds or thousands of examples instead of millions, and hours of training instead of weeks.

Is ChatGPT an example of transfer learning?

Yes, in a broad sense. A large language model is pre-trained on general text, then adapted with further training into a helpful chatbot. Companies adapt the same kind of base model again for customer support, coding or legal work.

Further reading