BLIP

Also known as: Bootstrapping Language-Image Pre-training · BLIP-2

On this page 7

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.

ModeTraining objectiveWhat it learns
Unimodal encoderImage-text contrastive loss (ITC)Aligned embeddings for fast retrieval
Image-grounded text encoderImage-text matching loss (ITM)Fine-grained judgment of whether a pair matches
Image-grounded text decoderLanguage modeling loss (LM)Generating captions conditioned on the image
The three operating modes of the BLIP architecture

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.

  1. The captioner, an image-grounded decoder, generates a synthetic caption for each web image using nucleus sampling for diversity.
  2. The filter, an image-grounded encoder trained with ITM, scores both the original alt text and the synthetic caption.
  3. 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.

PropertyBLIPBLIP-2
Language componentTrained BERT-style text TransformerFrozen large language model
Vision componentViT trained with the modelFrozen pretrained ViT
Bridge moduleCross-attention layers in text branchQ-Former with learned queries
Trainable parametersAll parametersRoughly 100-200 million in the bridge
Main strengthRetrieval and captioningZero-shot instructed generation
Comparison of BLIP and BLIP-2

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.

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.

ModelCore objectiveGenerates textTypical use
CLIPContrastive onlyNoZero-shot classification, retrieval
BLIPContrastive, matching, captioningYesCaptioning, retrieval, VQA
CoCaContrastive plus captioningYesCaptioning and classification
BLIP-2Q-Former bridge to frozen LLMYesZero-shot VQA and captioning
FlamingoGated cross-attention into frozen LLMYesFew-shot interleaved tasks
BLIP and neighboring vision-language approaches

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.

ProblemCauseMitigation
Generic captionsShort training captionsUse prompts or longer-caption fine-tuning
Hallucinated objectsLanguage prior outweighs visual evidenceVerify with ITM score or grounding model
Slow retrieval at scaleITM scores every pairRetrieve with ITC first, re-rank top-k with ITM
Poor text readingLow input resolutionUse OCR or a document-focused model
Inherited biasWeb-scale training dataAudit outputs before production use
Typical BLIP pitfalls and how to address them

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.