Glossary term
Glossary term
Foundations
Training a pre-trained model further on domain-specific data to specialise its behavior.
A second, task-specific training pass performed on a pre-trained model to refine its parameters for a specific use case. For example, the full training sequence for some large language models is as follows:
Pre-training: Train a large language model on a vast general dataset, such as all the English language Wikipedia pages.
Fine-tuning: Train the pre-trained model to perform a specific task, such as responding to medical queries. Fine-tuning typically involves hundreds or thousands of examples focused on the specific task.
As another example, the full training sequence for a large image model is as follows:
Pre-training: Train a large image model on a vast general image dataset, such as all the images in Wikimedia commons.
Fine-tuning: Train the pre-trained model to perform a specific task, such as generating images of orcas.
Fine-tuning can entail any combination of the following strategies:
Modifying all of the pre-trained model's existing parameters. This is sometimes called full fine-tuning.
Modifying only some of the pre-trained model's existing parameters (typically, the layers closest to the output layer), while keeping other existing parameters unchanged (typically, the layers closest to the input layer). See parameter-efficient tuning.
Adding more layers, typically on top of the existing layers closest to the output layer.
Fine-tuning is a form of transfer learning. As such, fine-tuning might use a different loss function or a different model type than those used to train the pre-trained model. For example, you could fine-tune a pre-trained large image model to produce a regression model that returns the number of birds in an input image.
Compare and contrast fine-tuning with the following terms:
See Fine-tuning in Machine Learning Crash Course for more information.
Bloomberg built BloombergGPT by fine-tuning a 50B parameter model on 363B tokens of financial data - achieving significant improvements on financial NLP tasks (NER, sentiment, Q&A) vs. general-purpose LLMs.
Harvey AI fine-tunes GPT-4 on millions of legal documents and case law to create a legal-specific AI - outperforming base GPT-4 on bar exam questions and contract-review tasks by 15+ percentage points.
OpenAI's fine-tuning API is used by a customer-service platform to fine-tune GPT-3.5-turbo on 10,000 company-specific Q&A pairs - achieving a 40% reduction in out-of-scope responses vs. the base model.
Created for this library
An enterprise legal team fine-tunes an open-weights LLM on its labeled NDAs to outperform a general-purpose prompt-only approach.
A speech recognition vendor fine-tunes its acoustic model on call-center audio per client to lift accuracy on each client's vocabulary.
A retail brand fine-tunes a foundation model on its product catalog so the chatbot uses brand tone and accurate product names.
Definition source: Google for Developers Machine Learning Glossary | Creative Commons Attribution 4.0 License