BLIP (Bootstrapping Language-Image Pre-training) is a vision-language pretraining framework that trains one model family to both understand and generate text about images, and that improves its own noisy web training data by generating and filtering captions. Within Multimodal AI, BLIP sits between purely contrastive models such as CLIP and later multimodal large language models, because it combines retrieval, matching and caption generation in a single architecture.
The original BLIP was introduced by Salesforce Research in 2022, and its successor BLIP-2 followed in 2023 with a different design that connects a frozen image encoder to a frozen large language model through a small trainable bridge. Both versions became widely used baselines for image captioning, visual question answering and image-text retrieval.
How BLIP combines understanding and generation
BLIP is built on a multimodal mixture of encoder-decoder (MED), a Transformer design that can run in three modes while sharing most of its parameters. A Vision Transformer (ViT) encodes the image into patch embeddings, and a BERT-style text Transformer processes the caption in whichever mode the training objective requires.
Each mode is paired with its own loss function. Training all three objectives jointly is what lets a single checkpoint serve both discriminative and generative tasks, which earlier models typically handled with separate architectures.
| Mode | Training objective | What it learns |
|---|---|---|
| Unimodal encoder | Image-text contrastive loss (ITC) | Aligned embeddings for fast retrieval |
| Image-grounded text encoder | Image-text matching loss (ITM) | Fine-grained judgment of whether a pair matches |
| Image-grounded text decoder | Language modeling loss (LM) | Generating captions conditioned on the image |
The encoder modes use bidirectional self-attention, while the decoder uses causal self-attention so that it predicts each token from the preceding ones. Cross-attention layers inject visual features into the text branch in the grounded modes. The ITM objective relies on hard negative mining, selecting non-matching pairs that the contrastive head finds similar, which forces the model to learn subtle distinctions.
Bootstrapping captions with CapFilt
The bootstrapping in the name refers to CapFilt (captioning and filtering), a dataset-cleaning procedure. Web-scraped alt text is often irrelevant, generic or wrong, so training directly on it limits quality. CapFilt fine-tunes two copies of the pretrained model on a small human-annotated dataset such as COCO and then applies them to the large web corpus.
- The captioner, an image-grounded decoder, generates a synthetic caption for each web image using nucleus sampling for diversity.
- The filter, an image-grounded encoder trained with ITM, scores both the original alt text and the synthetic caption.
- Pairs that the filter judges as non-matching are removed, and the cleaned dataset is used to pretrain a new model.
The original paper reported consistent gains across retrieval and captioning benchmarks after CapFilt. A key finding was that diverse sampled captions helped more than deterministic beam-search captions, even though sampled text is noisier, because diversity adds new information. The approach anticipated the later widespread practice of synthetic recaptioning for training multimodal models.
BLIP-2 and the Querying Transformer
BLIP-2 keeps the bootstrapping idea but changes the architecture to reduce training cost. Instead of training vision and language components end to end, it freezes a pretrained image encoder (for example a ViT-g from EVA-CLIP) and a pretrained language model (such as OPT or Flan-T5), and trains only a lightweight Querying Transformer (Q-Former) between them.
The Q-Former uses a fixed set of 32 learnable query vectors that attend to the image features through cross-attention and output a compact visual summary. That summary is projected into the language model’s input space as a soft visual prompt. Training happens in two stages: representation learning with ITC, ITM and image-grounded generation, then generative learning that connects the Q-Former output to the frozen language model.
| Property | BLIP | BLIP-2 |
|---|---|---|
| Language component | Trained BERT-style text Transformer | Frozen large language model |
| Vision component | ViT trained with the model | Frozen pretrained ViT |
| Bridge module | Cross-attention layers in text branch | Q-Former with learned queries |
| Trainable parameters | All parameters | Roughly 100-200 million in the bridge |
| Main strength | Retrieval and captioning | Zero-shot instructed generation |
The frozen-backbone design made BLIP-2 far cheaper to train than end-to-end models of similar capability, and the Q-Former became an influential pattern. Later systems such as InstructBLIP added visual instruction tuning on top of it, while many recent models replaced the Q-Former with a simpler multimodal projector.
How BLIP compares with related multimodal models
BLIP is best understood by its training objectives, not only by its benchmark scores. The table places it next to frequently compared models in the same field.
| Model | Core objective | Generates text | Typical use |
|---|---|---|---|
| CLIP | Contrastive only | No | Zero-shot classification, retrieval |
| BLIP | Contrastive, matching, captioning | Yes | Captioning, retrieval, VQA |
| CoCa | Contrastive plus captioning | Yes | Captioning and classification |
| BLIP-2 | Q-Former bridge to frozen LLM | Yes | Zero-shot VQA and captioning |
| Flamingo | Gated cross-attention into frozen LLM | Yes | Few-shot interleaved tasks |
Compared with CLIP, BLIP adds an explicit matching head that re-ranks candidates more accurately, at the cost of slower inference because every candidate pair must pass through the grounded encoder. Compared with modern multimodal large language models, BLIP-2 offers weaker instruction following and dialogue ability, but remains a compact and well-understood option.
Practical use, limitations and common mistakes
Practitioners use BLIP checkpoints for automatic caption generation, dataset annotation, retrieval re-ranking and lightweight visual question answering. Captions produced by BLIP are also used to prepare training data for text-to-image diffusion models, where accurate descriptions improve prompt adherence.
| Problem | Cause | Mitigation |
|---|---|---|
| Generic captions | Short training captions | Use prompts or longer-caption fine-tuning |
| Hallucinated objects | Language prior outweighs visual evidence | Verify with ITM score or grounding model |
| Slow retrieval at scale | ITM scores every pair | Retrieve with ITC first, re-rank top-k with ITM |
| Poor text reading | Low input resolution | Use OCR or a document-focused model |
| Inherited bias | Web-scale training data | Audit outputs before production use |
The most frequent design mistake is running ITM over an entire collection; the standard pattern is a two-stage retrieve-then-rerank pipeline. Another limitation is resolution: BLIP models typically process images at 224 to 384 pixels, which is insufficient for dense documents, charts or small text. Users should also remember that a fluent caption is not evidence of correctness, because multimodal hallucination affects BLIP as it affects larger models.
A plain-language summary
BLIP is a computer model that looks at pictures and talks about them. It can write a caption, answer a question about an image or find the photo that matches a sentence.
To learn, it needed millions of pictures with descriptions. Many descriptions found online were wrong or useless. So BLIP wrote its own better captions and threw away the bad pairs. Then it trained again on the cleaner data. It is like a student who rewrites messy class notes before studying from them.
BLIP-2 took a shortcut. It reused two models that were already trained, one for images and one for language, and taught only a small connector between them.
An example from practice
An online retailer with a catalog of about 400,000 product photos needs searchable descriptions, but most images carry only a product code. The data team runs BLIP-2 captioning on every image overnight on a single GPU server, producing short descriptions such as color, object type and setting.
For search, the team indexes contrastive embeddings for all photos. When a shopper types a query such as a navy linen shirt on a beach, the system first retrieves the top 100 candidates by embedding similarity and then re-ranks them with the matching score. Staff review a random sample of 1,000 captions and correct systematic errors, such as confused fabric types.
The result is searchable coverage for nearly the entire catalog within a week, with human review limited to a small sample instead of manual tagging of every image.