Flamingo is a visual language multimodal model introduced by DeepMind in 2022 that reads interleaved sequences of images, video and text and generates free-form text in response. In multimodal AI, it is best known for showing that a single pretrained model can perform new vision-language tasks through few-shot in-context learning, using only a handful of examples placed in the prompt instead of task-specific fine-tuning.
Its design keeps a pretrained vision encoder and a pretrained language model frozen and trains only a small set of new connecting layers. This approach preserved the knowledge of both components, reduced training cost and made Flamingo a reference architecture for later vision-language models in the field of artificial intelligence.
How the Flamingo architecture connects vision and language
Flamingo combines three building blocks: a frozen vision encoder, a trainable Perceiver Resampler and a frozen decoder-only language model augmented with gated cross-attention layers. Images pass through the encoder, the resampler compresses the resulting features into a fixed number of visual tokens, and the language model attends to those tokens while it predicts the next text token.
The original vision encoder is a Normalizer-Free ResNet (NFNet-F6) pretrained with a contrastive image-text objective similar to CLIP. The language backbone comes from the Chinchilla family, and both remain frozen during Flamingo training, which protects the language model from catastrophic forgetting of its text abilities.
The following table summarizes what each component does and whether its weights change during training.
| Component | Role | Trained during Flamingo training |
|---|---|---|
| Vision encoder | Turns each image or video frame into spatial feature maps | No, frozen after contrastive pretraining |
| Perceiver Resampler | Maps a variable number of features to 64 visual tokens | Yes |
| Gated cross-attention layers | Let text tokens attend to visual tokens | Yes |
| Language model layers | Model text and generate the output | No, frozen |
| Text embeddings for special tokens | Mark image positions and chunk boundaries | Yes, for the new tokens only |
Perceiver Resampler and gated cross-attention
The Perceiver Resampler solves the problem of variable input size. It uses a small set of learned latent queries that attend to all spatial and temporal features of an image or video, and it always outputs 64 visual tokens. This keeps the cost of cross-attention constant whether the input is one image or a clip with many frames.
The gated cross-attention dense blocks are inserted between the frozen language model layers. Each block applies cross-attention from text to visual tokens, followed by a feed-forward layer, and multiplies the result by a tanh gate initialized at zero. At the start of training the model therefore behaves exactly like the original language model, and visual information is blended in gradually as the gates open.
Flamingo also uses image-causal masking: each text token attends only to the visual tokens of the image that immediately precedes it in the sequence. Earlier images still influence the output indirectly through the language model’s self-attention, which lets the model handle arbitrarily interleaved inputs with many images.
The table below lists the three published model sizes and their language backbones.
| Model | Frozen language backbone | Total parameters |
|---|---|---|
| Flamingo-3B | Chinchilla 1.4B | About 3 billion |
| Flamingo-9B | Chinchilla 7B | About 9 billion |
| Flamingo-80B | Chinchilla 70B | About 80 billion |
Training data and multimodal in-context learning
Flamingo was trained on a mixture of web-scale datasets rather than on curated task data. The key ingredient is interleaved image-text data, collected from web pages where pictures and paragraphs appear in their natural order, because this format teaches the model to relate several images to surrounding text, which is exactly what a few-shot prompt looks like.
The training mixture, as described in the original work, combined the following sources.
| Dataset | Content | Contribution |
|---|---|---|
| M3W (MultiModal MassiveWeb) | About 43 million web pages with interleaved images and text | Teaches handling of multiple images in context |
| ALIGN | About 1.8 billion noisy image and alt-text pairs | Broad visual concept coverage |
| LTIP | About 312 million longer image-text pairs | Higher-quality descriptive captions |
| VTP | About 27 million short video-text pairs | Video understanding |
At inference, a user builds a prompt such as image, question, answer, image, question, answer, followed by a new image and question. Flamingo completes the pattern. This multimodal in-context learning allowed the 80B model to set a new few-shot state of the art on many benchmarks and, with 32 examples, to exceed fine-tuned models on six of sixteen tasks reported in the original evaluation.
How Flamingo compares with related vision-language models
Flamingo sits between contrastive models such as CLIP, which embed images and text but do not generate language, and later multimodal large language models that use a simple projector and visual instruction tuning. The comparison below shows where it differs.
| Approach | How vision reaches the language model | Typical adaptation |
|---|---|---|
| CLIP | No generation; shared embedding space | Zero-shot classification and retrieval |
| Flamingo | Gated cross-attention to resampled visual tokens | Few-shot prompting with interleaved examples |
| BLIP-2 | Querying transformer feeding soft prompts | Instruction tuning or fine-tuning |
| LLaVA-style models | Linear or MLP projector into the input sequence | Visual instruction tuning |
| Natively multimodal models | Images tokenized and trained jointly from the start | Prompting and instruction following |
The main architectural distinction is cross-attention fusion versus input-sequence fusion. Flamingo keeps visual tokens outside the language model’s context window, so many images add little sequence length, whereas projector-based models place visual tokens directly in the prompt and consume context budget for every image.
Limitations and legacy
Flamingo was never released as open weights, so practical work relies on open reproductions such as OpenFlamingo and IDEFICS, which follow the same design with publicly available components. Its known weaknesses are typical of early vision-language models:
- Multimodal hallucination, where the model describes objects or details that are not in the image.
- Sensitivity to prompt examples, so the choice and order of few-shot demonstrations change results noticeably.
- Weaker performance on fine-grained tasks such as reading small text, counting or precise spatial reasoning.
- High inference cost for the 80B variant and limited image resolution in the original setup.
- Inherited biases from uncurated web data in both the encoder and the language model.
Despite these limits, Flamingo established several ideas that remain standard: reusing frozen unimodal backbones, compressing visual features into a fixed token budget, and training on interleaved web documents to unlock in-context learning across modalities.
A plain-language summary
Flamingo is an AI system that can look at pictures and short videos and then write about them. It was built by joining two existing models. One model already understood images. The other already understood language.
The builders did not retrain those two models. Instead, they added small connecting layers between them. These layers act like an interpreter that passes what the eyes see to the part that writes. The key idea is that Flamingo learns a new task from a few examples shown in the request, much as a person learns a card game by watching a few rounds.
An example from practice
A research team at a museum wants short descriptions for thousands of digitized artworks but has no labeled training set. Using an open Flamingo-style model, the team writes a prompt with four example images, each followed by a description in the house style: object type, material, period and one notable visual detail.
For each new artwork, the team appends the image and the words “Description:” and lets the model complete the text. Curators then review the drafts. The team reports that most drafts need only light editing, while drafts for small inscriptions and damaged objects need full rewrites because the model sometimes invents details. The result is a faster cataloging workflow without collecting a dedicated training dataset.