Paper commentary
BLIP: Bootstrapping Language-Image Pre-training for Unified Vision-Language Understanding and Generation
BLIP bootstraps noisy web captions to unify vision-language understanding and generation
- Problem Most vision-language models handle either understanding or generation, not both. Scaling them on noisy web alt-texts also keeps adding noise, since those texts often misdescribe their images.
- Method BLIP pre-trains one network that runs in encoder, matching and decoder modes. A captioner writes synthetic captions for web images, and a filter removes noisy ones.
- Results BLIP reaches 80.6 recall@1 for COCO text retrieval, compared to 77.6 for ALBEF with the same 14M images.
Why noisy web pairs limit pre-training
Vision-language pre-training usually relies on image and alt-text pairs crawled from the web, because human annotation is too expensive to scale. Those alt-texts often fail to describe what is actually in the picture, so they give a weak signal for aligning vision and language. Simple rule-based filters remove only part of the noise. The damage is easy to miss, because scaling up the dataset keeps raising scores and hides it.
There is also a limit on the model side. Encoder-based models transfer poorly to text generation such as captioning, while encoder-decoder models have rarely been used for image-text retrieval. So each family covers only part of the task space, and neither excels at both understanding and generation.
One network with three working modes
The key idea is one network that runs in three modes, so most of its weights serve encoding, matching and generating alike. The image side is a vision transformer that cuts the image into patches and adds a [CLS] token for the global feature. The text side follows the BERT encoder. In the image-grounded encoder mode, each block gets one extra cross-attention layer between the self-attention layer and the feed-forward network, and the output of a [Encode] token becomes the joint image-text representation.
For generation, the image-grounded decoder swaps the bi-directional self-attention for causal self-attention, and a [Decode] token marks the start of a sequence. The decoder keeps the cross-attention layers and feed-forward networks of the encoder. The authors share every parameter except the self-attention layers, because that is where encoding and decoding differ.
The encoder looks at the whole input in both directions, while the decoder predicts each next token from what came before, which is why the two need separate attention. Sharing the rest saves parameters and training time while keeping the benefit of multi-task learning.
Each image-text pair needs one pass through the image encoder and three passes through the text side, one for each objective. The image-text contrastive loss activates the unimodal encoder and pulls matched image and text features together against negatives, with a momentum encoder supplying soft targets. The image-text matching loss adds a linear head that labels each pair as matched or unmatched, and it picks hard negatives by their contrastive similarity.
The language modeling loss trains the decoder with cross entropy and label smoothing of 0.1, which the authors set against the MLM loss common in VLP.
Bootstrapping the web captions
CapFilt starts from one pre-trained model and turns it into two specialists, a captioner and a filter. Both start from the same pre-trained MED and are fine-tuned on COCO separately. The captioner is trained with the LM loss, and for each web image it writes one synthetic caption. The filter is trained with ITC and ITM, and it removes any text whose ITM head predicts a mismatch with the image.
The surviving pairs are merged with the human-annotated pairs, and that merged set pre-trains a new model. The base pre-training set has 14M images from COCO, Visual Genome, Conceptual Captions, Conceptual 12M and SBU captions. A larger setting adds LAION, which has 115M images and noisier texts, and only one fifth of it is used each epoch.
ViT-B is the default backbone, pre-trained for 20 epochs with a batch size of 2880.
Captioner and filter together
With 14M images and ViT-B/16 backbones, the model trained on raw web texts reaches 78.4 recall@1 for text retrieval and 102.2 CIDEr on NoCaps. Applying both the captioner and the filter raises these to 80.6 and 105.1. Either module alone also gives gains, and the authors report that their effects combine rather than overlap.
The gains hold at larger scale, since with 129M images the bootstrapped ViT-B model reaches 81.9 recall@1 for text retrieval. Using a larger ViT-L captioner and filter also improves the base model, according to the authors.
Longer training and continued training
The bootstrapped dataset holds more texts, so each epoch takes longer, which raises the question of whether training length alone explains the gain. To test this, the web texts in the original dataset are replicated until the per-epoch sample count matches the bootstrapped set. The replicated run gives 78.3 recall@1 for text retrieval and 102.1 NoCaps CIDEr, close to the 78.4 and 102.2 of the unreplicated run.
So longer training on noisy web texts doesn't account for the improvement.
Continuing training from the earlier checkpoint on the bootstrapped data gives 80.6 recall@1 for text retrieval and 104.5 CIDEr on NoCaps. Training a new model on the same data reaches 80.6 and 105.1, so the new model is the better choice. The authors connect this to knowledge distillation, where a student usually isn't initialized from its teacher.
Caption diversity and shared weights
The alternative, beam search, returns the highest-probability captions. With 14M images, nucleus sampling gives 80.6 recall@1 for text retrieval and 105.1 NoCaps CIDEr, compared to 79.6 and 103.5 for beam search. Its filter noise ratio is higher, at 25% compared to 19% for beam search. The authors hypothesize that nucleus sampling yields more diverse captions with more new information, whereas beam search favours common captions.
Table 3 varies which layers the text encoder and decoder share. The authors attribute that drop to a conflict between the encoding and decoding tasks.
Sharing parameters between captioner and filter lowers the filter's noise ratio to 8%, compared to 25% when they are decoupled. Downstream scores fall, with text retrieval recall@1 at 79.8 when shared and 80.6 when decoupled. They attribute this to confirmation bias, since the filter lets more of the captioner's own noisy output through.
Retrieval and captioning against prior work
On COCO and Flickr30K the authors fine-tune with ITC and ITM, then re-rank the top candidates by ITM score, using k=256 for COCO and k=128 for Flickr30K. With the same 14M images as ALBEF, BLIP scores 80.6 recall@1 for text retrieval and 63.1 for image retrieval on COCO, compared to 77.6 and 60.7 for ALBEF. The authors report this as a 2.7% gain in average recall@1 over ALBEF.
For zero-shot retrieval, the COCO-finetuned model is transferred to Flickr30K without further tuning. With 14M images BLIP reaches 94.8 text-retrieval recall@1, compared to 94.1 for ALBEF. Scaling to 129M images lifts BLIP to 96.0, and the ViT-L variant reaches 96.7.
On the COCO Karpathy test split, the ViT-L variant reaches 136.7 CIDEr. LEMON's large variant scores 135.7 with 200M images, but it needs an object detector and 800×1333 inputs, while BLIP uses 384×384. So the captioning comparison is close, and the compute setups differ.
VQA, NLVR2, VisDial and video transfer
The authors treat VQA as generation: the encoder reads the image and question, and a decoder writes the answer under the LM loss. With 14M images BLIP gains 1.64% over ALBEF on the test set.
NLVR2 uses two cross-attention layers, one per image, merged by average pooling in the lower layers and by concatenation plus projection above. BLIP beats all methods except ALBEF, which runs an extra customized pre-training step. On VisDial v1.0 validation, BLIP scores an MRR of 69.41, compared to 69.10 for VD-ViLBERT.
The authors report that zero-shot BLIP beats models fine-tuned on the target video dataset by 12.4% in recall@1. For zero-shot video QA on MSRVTT-QA, BLIP scores 19.2, compared to 2.9 for VQA-T in the zero-shot setting. Eight frames per video are sampled for retrieval and 16 for QA, and their features are concatenated.
Limitations
The video transfer concatenates frame features and ignores all temporal information. The authors suggest that a TimeSformer-based video model fine-tuned on video could improve further, but they didn't run this. SNLI-VE is left out because its test data is reported to be noisy.
NLVR2 barely benefits from more web images, which the authors link to the domain gap between web and downstream data. LAION is used at one fifth per epoch because of its size. In these experiments the captioner and filter were fine-tuned only on COCO.
Paper info
- Authors
- Junnan Li, Dongxu Li, Caiming Xiong, Steven Hoi
- Venue
- arXiv · Preprint
- First published
- 2022-1-28
- Added
- 2026-11-12
- Updated
- 2022-2-15
- Version
- v2
- arXiv
- 2201.12086
- Category
- cs.CV
- Original paper terms
- CC BY 4.0
- What we show
- Paper info and commentary
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Quote from the paper
Junnan Li, Dongxu Li, Caiming Xiong, Steven Hoi (2022). BLIP: Bootstrapping Language-Image Pre-training for Unified Vision-Language Understanding and Generation. arXiv:2201.12086v2. https://arxiv.org/abs/2201.12086v2
BibTeX
@misc{li2022blip,
title = {{BLIP: Bootstrapping Language-Image Pre-training for Unified Vision-Language Understanding and Generation}},
author = {Junnan Li and Dongxu Li and Caiming Xiong and Steven Hoi},
year = {2022},
eprint = {2201.12086},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2201.12086v2}
}