Concepts / Training a Base Model

Training a Base Model

Finetuning adapts a base model that has some, but not all, of the capabilities needed so that it performs well for a specific task.

  • Programming

A Model That Knows Part of the Job

Imagine a model that already knows something useful but not everything you need. It can handle part of the work, yet it falls short on the particular job you care about. Finetuning is the process that closes that gap. It begins with a base model that has some of the capabilities the job requires, and it adapts that model so it performs well enough on one specific task.

What do you think happens?

A base model has some of the capabilities a specific task requires. Does it already have all of them?

  • Yes, a base model is always ready for any specific task

  • No, it has some of the required capabilities but not all of them

Reveal answer
Answer:

No, it has some of the required capabilities but not all of them

This gap is exactly why finetuning exists. The base model is a useful starting point, but it still falls short on the particular job, so it must be adapted before it performs well for that task.

Tracing a Model Through Its Two Stages

Transfer learning, the strategy behind finetuning, runs in two stages. In the first stage, a base model is trained on tasks where plenty of data is available. In the second stage, what that model has learned is transferred to the target task, which is the task you actually care about but for which data is scarce. Follow the model's state through the diagram below: it starts as a general-purpose base model, passes through a finetuning step that uses data from the target task, and ends as a finetuned model.

Data-rich tasksplenty of training dataBase modelsome required capabilitiesFinetuningadapts the base modelFinetuned modelperforms well on the targettaskTarget task datalimited or expensive tocollecttrainstarting pointguides adaptationproduces
What state the model is in at each stage, from training on data-rich tasks through finetuning on a specific target task

The diagram shows the key idea of the whole article. The base model is not thrown away. It is the starting point for the finetuning step, which is why the earlier stage matters so much to the final result.

Finetuning Inside Transfer Learning

Finetuning is best understood as one way of doing transfer learning. Transfer learning is the broader idea of taking knowledge gained from one task and using it to speed up learning on a new, related task. The concept was first introduced by Bozinovski and Fulgosi in 1976. Finetuning is therefore a specific route within that larger idea, not a separate subject standing next to it.

Transfer learningbroader ideaKnowledge from onetaskgained on a source taskNew related tasklearning is sped upFinetuningone specific methodusesincludesaccelerates learning onapplies to
Transfer learning is the umbrella idea, and finetuning is one method that lives under it
In the real world

Google's multilingual translation system shows transferred knowledge enabling translation between a language pair with no direct training examples. The system learned from many language pairs, and that learned knowledge carried over to a pair it had never been trained on directly.

What Carries Over From the Base Model

Transfer learning helps most when target-task data is limited or expensive, because a base model trained on data-rich tasks can pass its knowledge along. Finetuning does not start from nothing. The capabilities the base model already has are the foundation, and adaptation builds the missing pieces on top of that foundation for the specific task.

Worked example

Adapting a General Model to a Support Desk

A base model can read and write general language but has not been trained on a particular company's support tickets. Which part of its ability carries over, and which part must be adapted?

  1. 1
    Identify the capability the base model already has

    The base model already handles general language. That part is the knowledge carried over from its earlier training, so the team does not need to teach it language from scratch.

  2. 2
    Identify the required capability that is missing

    The support desk needs answers in the company's own format and terminology. The base model does not have all of this, so it is one of the gaps that finetuning must close.

  3. 3
    Adapt on the target task

    Finetuning uses the target task data, which is the company's ticket examples, to adapt the base model so it performs well on the support desk job.

Result

The general language ability carries over unchanged in purpose, while the task-specific behavior is added through finetuning. The result is a finetuned model that serves the support desk, built from a base model that already had part of what the job required.

Base Model Versus Finetuned Model

The base model and the finetuned model are closely related, but they are prepared for different levels of usefulness. The base model has some capabilities, though not all of those the task requires. The finetuned model is the result of adapting that starting point so it performs well for the specific task. The side-by-side view below contrasts the two states.

Some requiredcapabilitiesAdapted to one taskNot all requiredcapabilitiesPerforms well on thattask
The base model covers part of the required capabilities, while the finetuned model is adapted for one specific task
AspectBase modelFinetuned model
Starting pointTrained on data-rich tasksBegins as a base model
CapabilitiesSome of those the task requiresAdapted so the task is handled well
Prepared forPartial usefulness across the workOne specific target task
RoleSource of transferred knowledgeResult of adapting that knowledge

Base model and finetuned model compared by the task each is prepared to perform

Mistakes About Finetuning and Transfer Learning

  • Common mistake

    Believing finetuning teaches a model entirely new knowledge

    Why it fails

    Finetuning starts from a base model that already has some of the required capabilities. Adaptation closes the gap; it does not replace what the model already knows.

    Do this instead

    Think of finetuning as adapting existing capabilities toward a specific task.

  • Common mistake

    Treating a base model as finished for every task

    Why it fails

    A base model has some capabilities, though not all of those the task requires.

    Do this instead

    Check whether the base model covers the specific task before relying on it directly.

  • Common mistake

    Treating transfer learning and finetuning as separate subjects

    Why it fails

    Finetuning is one way of doing transfer learning. Transfer learning is the broader umbrella.

    Do this instead

    Place finetuning inside transfer learning as one specific method.

  • Common mistake

    Assuming transfer learning is only needed when data is plentiful

Diagnosing a Model's Gap

EASY

A team has a base model trained on data-rich tasks. It handles general language well but cannot yet answer questions about their product catalog in the required format. Using the ideas from this article, explain which capability the base model already has, which required capability is missing, and what finetuning should do about the gap.

Hints
  • Ask which part of the job the base model can already handle
  • Ask what the target task requires that the base model does not yet have
  • Remember that finetuning adapts the base model rather than starting over

Key Takeaways

  1. 1
    A base model has some, but not all, of the capabilities a specific task requires
  2. 2
    Finetuning adapts the base model so it performs well on one specific task
  3. 3
    Finetuning is one method inside transfer learning, which uses knowledge from one task to speed up learning on a new, related task
  4. 4
    Transfer learning is most useful when target-task data is limited or expensive

At a glance

  • A base model has some, but not all, of the capabilities a specific task requires
  • Finetuning adapts the base model so it performs well on one specific task
  • Finetuning is one method inside transfer learning, which uses knowledge from one task to speed up learning on a new, related task
  • Transfer learning is most useful when target-task data is limited or expensive

Related concepts

More concepts starting with T