A foundation model is an AI model pretrained on broad data so it can be used for many tasks. This reduces the need to train a model from scratch for each task. For example, you can use a single language model for translation, then change the instructions to have it answer questions.
This definition follows the report released by a Stanford research team in August 2021.
What does a model learn during pretraining?
During pretraining, a model learns patterns it can later use for many tasks. BERT, released in 2018, masked parts of sentences and predicted the original wording from the surrounding context. The wording before masking served as the correct answer.
Learning from cues in the data itself in this way is called self-supervised learning. Large amounts of text can be used for training without someone writing the correct answer for each sentence. The BERT researchers used the context the model learned this way to find answers in passages.
Foundation models can identify regions of interest in existing data as well as generate new content.
How foundation models and generative AI differ
Foundation models are defined by how broadly they can reuse what they have learned. Generative AI refers to the ability to create new outputs. A single model can belong to both categories.
| Term | Defining criterion | Research example |
|---|---|---|
| Foundation model | Broad pretraining and the ability to handle many tasks | Using BERT for question answering and for judging how sentences relate in meaning |
| Large language model (LLM) | Ability to process language after training on large amounts of language data | Using GPT-3 to produce translations and answer questions |
| Generative AI | Ability to create new text, images, or other outputs from an input | Using a diffusion model to generate an image that matches a text description |
| Transformer | Neural network architecture that assigns weights to relationships between input elements | Used in translation research published in 2017 and later in BERT |
For example, CLIP scores how well a photo matches a description. When classifying a photo, it picks the candidate description that best matches the photo. This is an example of using a foundation model without creating a new image.
Comparing prompting and fine-tuning
When you give a model a new task, prompting leaves its internal values unchanged, while fine-tuning changes them. The internal values a model adjusts during training are called parameters. In the 2020 GPT-3 paper, the largest model had 1,750 parameters.
| Method | How the model is given the task | Changes to parameters | Example from research |
|---|---|---|---|
| Prompting | Include instructions or examples in the request | The request does not change them | Show GPT-3 translation examples, then ask it to translate a new sentence |
| Fine-tuning | Train the model further on data suited to the task | Adjust some or all of them | Train BERT on questions and answer spans so it can extract answers from passages |
In the GPT-3 experiments, the translation examples served as context for that request. For the examples to keep influencing the next request, they must remain in the context. With fine-tuning, the values changed during training are saved and used for later inputs as well.
Examples by task
Models in the same field can serve different purposes depending on what they output. In image tasks alone, a model might label a photo or mark the boundary of a particular region in an image. The table below shows what each task produces.
| Task | Input given to the model | Output |
|---|---|---|
| Translation with GPT-3 | The source text and an instruction specifying the target language | A sentence translated into another language |
| Document question answering with BERT | A passage and a question that can be answered from it | The span of the passage that contains the answer |
| Photo classification with CLIP | A photo and phrases describing the candidate categories | The candidate that best matches the photo |
| Image generation with a diffusion model | A description of the scene to create | An image generated to reflect the description |
| Medical image segmentation with MedSAM | A medical image and a box around the region of interest | A mask showing the area occupied by the target |
Identifying and counting objects in the same photo
How well a model identifies the types of objects in a photo does not tell you how well it can count them. For example, matching a photo of a bicycle to the description “bicycle” is classification. To say how many bicycles are in the same photo, the model must distinguish each bicycle from the others.
The 2021 CLIP paper presented results for photo classification without additional training. The researchers reported that counting objects under the same conditions was difficult. For photo search, how well a photo matches the description is a more direct measure. For inventory counts, the difference from the actual quantity is more direct.
Errors in services that use a shared model
When several services use the same underlying model, they can inherit its weaknesses. The Stanford report describes the tendency to rely on a shared model even for different uses as “homogenization.” HELM, a study evaluating language models, separately measured accuracy, whether performance held up when the wording changed, and other factors.