BLIP-2: Bootstrapping Language-Image Pre-training with Frozen Image Encoders and Large Language Models
Written for the Research library (claude-opus-5-5) from the paper text. Original — arxiv.org/pdf/2301.12597
Summary
Training vision-language models end to end with ever-larger networks has become very expensive. BLIP-2 avoids this by reusing existing unimodal components: an image encoder and a large language model, both kept frozen. A small trainable module called the Querying Transformer (Q-Former) connects them. It uses a fixed set of learnable queries to pull out the visual information that matters for text. Training happens in two phases. First, the Q-Former is paired with the frozen image encoder and learns text-relevant visual features through contrastive, matching and caption-generation objectives on image-text pairs. Second, its outputs are fed to a frozen LLM, such as OPT or FlanT5, so the LLM can read them as input. With far fewer trainable parameters than competitors, the approach reaches state-of-the-art results in VQA, captioning and image-text retrieval. It also enables zero-shot image-to-text generation that follows instructions. The work shows that strong multimodal systems can be built cheaply by connecting off-the-shelf models, and better unimodal backbones can be swapped in later.
Key points
- On zero-shot VQAv2, BLIP-2 beats Flamingo80B by 8.7% while training 54× fewer parameters.
- Q-Former details:
- It has 188M parameters and is initialised from BERT base, with randomly initialised cross-attention layers.
- It outputs 32 queries of dimension 768, a much smaller bottleneck than the 257×1024 features produced by ViT-L/14.
- The first-stage objectives are ITC, ITM and ITG, each applied with a different self-attention mask between queries and text.
- Adding ITG raises COCO retrieval R@1 from 84.5 to 85.4 (image→text) and from 67.2 to 68.3 (text→image).
- BLIP-2 ViT-g, fine-tuned on COCO, reaches 97.6 / 89.7 R@1 on zero-shot Flickr30K retrieval (image→text / text→image).
- Limitations:
- Few-shot in-context examples do not improve VQA. The authors blame pre-training data that contains only one image-text pair per sample.
- The model inherits LLM risks such as bias and offensive output.
- Code is released in Salesforce's LAVIS repository.
Cited by
- Qwen-VL: A Versatile Vision-Language Model for Understanding, Localization, Text Reading, and Beyond
- Qwen2.5-VL Technical Report
- InternVL: Scaling up Vision Foundation Models and Aligning for Generic Visual-Linguistic Tasks
- MiniGPT-v2: large language model as a unified interface for vision-language multi-task learning
- ShareGPT4V: Improving Large Multi-Modal Models with Better Captions
- Shikra: Unleashing Multimodal LLM's Referential Dialogue Magic
- How Far Are We to GPT-4V? Closing the Gap to Commercial Multimodal Models with Open-Source Suites
- An Image is Worth 1/2 Tokens After Layer 2: Plug-and-Play Inference Acceleration for Large Vision-Language Models
- Are We on the Right Way for Evaluating Large Vision-Language Models?
- Qwen-Audio: Advancing Universal Audio Understanding via Unified Large-Scale Audio-Language Models
- InstructBLIP: Towards General-purpose Vision-Language Models with Instruction Tuning
- MME: A Comprehensive Evaluation Benchmark for Multimodal Large Language Models
- Video-MME: The First-Ever Comprehensive Evaluation Benchmark of Multi-modal LLMs in Video Analysis
- Retrieval-Augmented Generation for Large Language Models: A Survey
- HallusionBench: An Advanced Diagnostic Suite for Entangled Language Hallucination and Visual Illusion in Large Vision-Language Models
- CogAgent: A Visual Language Model for GUI Agents
- Language Is Not All You Need: Aligning Perception with Language Models
- A Survey on Hallucination in Large Language Models: Principles, Taxonomy, Challenges, and Open Questions
- VisualWebArena: Evaluating Multimodal Agents on Realistic Visual Web Tasks
- OBELICS: An Open Web-Scale Filtered Dataset of Interleaved Image-Text Documents
- What matters when building vision-language models?
- Evaluating Object Hallucination in Large Vision-Language Models
- MVBench: A Comprehensive Multi-modal Video Understanding Benchmark
- SEED-Bench: Benchmarking Multimodal LLMs with Generative Comprehension
- VideoChat: Chat-Centric Video Understanding
- Video-LLaVA: Learning United Visual Representation by Alignment Before Projection
- VILA: On Pre-training for Visual Language Models
- Improved Baselines with Visual Instruction Tuning
- Mitigating Hallucination in Large Multi-Modal Models via Robust Instruction Tuning
- MMBench: Is Your Multi-modal Model an All-around Player?
- OCRBench: On the Hidden Mystery of OCR in Large Multimodal Models
- Visual Instruction Tuning
- MathVista: Evaluating Mathematical Reasoning of Foundation Models in Visual Contexts
- Video-ChatGPT: Towards Detailed Video Understanding via Large Vision and Language Models
- A Comprehensive Overview of Large Language Models
- Kosmos-2: Grounding Multimodal Large Language Models to the World
- HuggingGPT: Solving AI Tasks with ChatGPT and its Friends in Hugging Face
- Aligning Large Multimodal Models with Factually Augmented RLHF
- ViperGPT: Visual Inference via Python Execution for Reasoning
- SALMONN: Towards Generic Hearing Abilities for Large Language Models
- CogVLM: Visual Expert for Pretrained Language Models
- Qwen2-VL: Enhancing Vision-Language Model's Perception of the World at Any Resolution
- Visual ChatGPT: Talking, Drawing and Editing with Visual Foundation Models
- The Rise and Potential of Large Language Model Based Agents: A Survey
- Qwen2.5-Omni Technical Report
- Qwen3-Omni Technical Report
- The Dawn of LMMs: Preliminary Explorations with GPT-4V(ision)
- MiniCPM-V: A GPT-4V Level MLLM on Your Phone
- mPLUG-Owl: Modularization Empowers Large Language Models with Multimodality
- MM-Vet: Evaluating Large Multimodal Models for Integrated Capabilities
- MMMU: A Massive Multi-discipline Multimodal Understanding and Reasoning Benchmark for Expert AGI
- Instruction Tuning for Large Language Models: A Survey
- LLaMA-Adapter: Efficient Fine-tuning of Language Models with Zero-init Attention
- Video-LLaMA: An Instruction-tuned Audio-Visual Language Model for Video Understanding
- GPT-4V(ision) is a Generalist Web Agent, if Grounded
- MiniGPT-4: Enhancing Vision-Language Understanding with Advanced Large Language Models
Cite
@misc{li2023blip,
title = {{BLIP-2: Bootstrapping Language-Image Pre-training with Frozen Image Encoders and Large Language Models}},
author = {Li, Junnan and Li, Dongxu and Savarese, Silvio and Hoi, Steven},
year = {2023},
doi = {10.48550/arxiv.2301.12597},
eprint = {2301.12597},
archivePrefix = {arXiv},
url = {https://doi.org/10.48550/arxiv.2301.12597}
}References
- Agrawal, H., Anderson, P., Desai, K., Wang, Y., Chen, X., Jain, R., Johnson, M., Batra, D., Parikh, D., and Lee, S. nocaps: novel object captioning at scale. In ICCV, pp. 8947–8956, 2019. find
- Alayrac, J., Donahue, J., Luc, P., Miech, A., Barr, I., Hasson, Y., Lenc, K., Mensch, A., Millican, K., Reynolds, M., Ring, R., Rutherford, E., Cabi, S., Han, T., Gong, Z., Samangooei, S., Monteiro, M., Menick, J., Borgeaud, S., Brock, A., Nematzadeh, A., Sharifzadeh, S., Binkowski, M., Barreira, R.… find our card
- Brown, T. B., Mann, B., Ryder, N., Subbiah, M., Kaplan, J., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell, A., Agarwal, S., Herbert-Voss, A., Krueger, G., Henighan, T., Child, R., Ramesh, A., Ziegler, D. M., Wu, J., Winter, C., Hesse, C., Chen, M., Sigler, E., Litwin, M., Gray, S., Ch… find
- Changpinyo, S., Sharma, P., Ding, N., and Soricut, R. Conceptual 12M: Pushing web-scale image-text pre-training to recognize long-tail visual concepts. In CVPR, 2021. find
- Webson, A., Gu, S. S., Dai, Z., Suzgun, M., Chen, X., Chowdhery, A., Narang, S., Mishra, G., Yu, A., Zhao, V. Y., Huang, Y., Dai, A. M., Yu, H., Petrov, S., Chi, E. H., Dean, J., Devlin, J., Roberts, A., Zhou, D., Le, Q. V., and Wei, J. Scaling instruction-finetuned language models. arXiv preprint a… find
- Dai, W., Hou, L., Shang, L., Jiang, X., Liu, Q., and Fung, P. Enabling multimodal generation on CLIP via vision-language knowledge distillation. In Muresan, S., Nakov, P., and Villavicencio, A. (eds.), ACL Findings, pp. 2383– 2395, 2022. find
- Devlin, J., Chang, M., Lee, K., and Toutanova, K. BERT: pre-training of deep bidirectional transformers for language understanding. In Burstein, J., Doran, C., and Solorio, T. (eds.), NAACL, pp. 4171–4186, 2019. find
- Dong, L., Yang, N., Wang, W., Wei, F., Liu, X., Wang, Y., Gao, J., Zhou, M., and Hon, H. Unified language model pre-training for natural language understanding and generation. In Wallach, H. M., Larochelle, H., Beygelzimer, A., d’Alché-Buc, F., Fox, E. B., and Garnett, R. (eds.), NeurIPS, pp. 13042… find our card
- Fang, Y., Wang, W., Xie, B., Sun, Q., Wu, L., Wang, X., Huang, T., Wang, X., and Cao, Y. Eva: Exploring the limits of masked visual representation learning at scale. arXiv preprint arXiv:2211.07636, 2022. — [arXiv:2211.07636](https://arxiv.org/abs/2211.07636) find
- Chen, J., Guo, H., Yi, K., Li, B., and Elhoseiny, M. Visu-algpt: Data-efficient adaptation of pretrained language models for image captioning. In CVPR, pp. 18009–18019, 2022a. find
- Goyal, Y., Khot, T., Summers-Stay, D., Batra, D., and Parikh, D. Making the V in VQA matter: Elevating the role of image understanding in visual question answering. In CVPR, pp. 6325–6334, 2017. find our card
- Chen, X., Wang, X., Changpinyo, S., Piergiovanni, A. J., Padlewski, P., Salz, D., Goodman, S., Grycner, A., Mustafa, B., Beyer, L., Kolesnikov, A., Puigcerver, J., Ding, N., Rong, K., Akbari, H., Mishra, G., Xue, L., Thapliyal, A., Bradbury, J., Kuo, W., Seyedhosseini, M., Jia, C., Ayan, B. K., Riqu… find our card
- Guo, J., Li, J., Li, D., Tiong, A. M. H., Li, B., Tao, D., and Hoi, S. C. H. From images to textual prompts: Zero-shot VQA with frozen large language models. In CVPR, 2022. find
- Chen, Y., Li, L., Yu, L., Kholy, A. E., Ahmed, F., Gan, Z., Cheng, Y., and Liu, J. UNITER: universal image-text representation learning. In ECCV, volume 12375, pp. 104–120, 2020. find our card
- Cho, J., Lei, J., Tan, H., and Bansal, M. Unifying vision-and-language tasks via text generation. arXiv preprint arXiv:2102.02779, 2021. — [arXiv:2102.02779](https://arxiv.org/abs/2102.02779) find
- Chung, H. W., Hou, L., Longpre, S., Zoph, B., Tay, Y., Fedus, W., Li, E., Wang, X., Dehghani, M., Brahma, S., Hoffmann, J., Borgeaud, S., Mensch, A., Buchatskaya, E., Cai, T., Rutherford, E., Casas, D. d. L., Hendricks, L. A., Welbl, J., Clark, A., Hennigan, T., Noland, E., Millican, K., Driessche,… find
- Hudson, D. A. and Manning, C. D. GQA: A new dataset for real-world visual reasoning and compositional question answering. In CVPR, pp. 6700–6709, 2019. find our card
- Jia, C., Yang, Y., Xia, Y., Chen, Y.-T., Parekh, Z., Pham, H., Le, Q. V., Sung, Y., Li, Z., and Duerig, T. Scaling up visual and vision-language representation learning with noisy text supervision. arXiv preprint arXiv:2102.05918, 2021. find our card
- Jin, W., Cheng, Y., Shen, Y., Chen, W., and Ren, X. A good prompt is worth millions of parameters: Low-resource prompt-based learning for vision-language models. In Muresan, S., Nakov, P., and Villavicencio, A. (eds.), ACL, pp. 2763–2775, 2022. find
- Radford, A., Kim, J. W., Hallacy, C., Ramesh, A., Goh, G., Agarwal, S., Sastry, G., Askell, A., Mishkin, P., Clark, J., et al. Learning transferable visual models from natural language supervision. arXiv preprint arXiv:2103.00020, 2021. find our card
- Krishna, R., Zhu, Y., Groth, O., Johnson, J., Hata, K., Kravitz, J., Chen, S., Kalantidis, Y., Li, L., Shamma, D. A., Bernstein, M. S., and Fei-Fei, L. Visual genome: Connecting language and vision using crowdsourced dense image annotations. IJCV, 123(1):32–73, 2017. find our card
- Schuhmann, C., Vencu, R., Beaumont, R., Kaczmarczyk, R., Mullis, C., Katta, A., Coombes, T., Jitsev, J., and Komatsuzaki, A. Laion-400m: Open dataset of clip-filtered 400 million image-text pairs. arXiv preprint arXiv:2111.02114, 2021. find our card
- Li, J., Selvaraju, R. R., Gotmare, A. D., Joty, S., Xiong, C., and Hoi, S. Align before fuse: Vision and language representation learning with momentum distillation. In NeurIPS, 2021. find
- Sharma, P., Ding, N., Goodman, S., and Soricut, R. Conceptual captions: A cleaned, hypernymed, image alt-text dataset for automatic image captioning. In Gurevych, I. and Miyao, Y. (eds.), ACL, pp. 2556–2565, 2018. find our card
- Li, J., Li, D., Xiong, C., and Hoi, S. C. H. BLIP: bootstrapping language-image pre-training for unified vision-language understanding and generation. In ICML, pp. 12888–12900, 2022. find our card
- Li, X., Yin, X., Li, C., Zhang, P., Hu, X., Zhang, L., Wang, L., Hu, H., Dong, L., Wei, F., Choi, Y., and Gao, J. Oscar: Object-semantics aligned pre-training for vision-language tasks. In ECCV, pp. 121–137, 2020. find our card
- Lin, T., Maire, M., Belongie, S. J., Hays, J., Perona, P., Ramanan, D., Dollár, P., and Zitnick, C. L. Microsoft COCO: common objects in context. In Fleet, D. J., Pajdla, T., Schiele, B., and Tuytelaars, T. (eds.), ECCV, volume 8693, pp. 740–755, 2014. find our card
- Loshchilov, I. and Hutter, F. Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101, 2017. find
- Mañas, O., Rodrı́guez, P., Ahmadi, S., Nematzadeh, A., Goyal, Y., and Agrawal, A. MAPL: parameter-efficient adaptation of unimodal pre-trained models for vision-language few-shot prompting. In EACL, 2023. find
- Marino, K., Rastegari, M., Farhadi, A., and Mottaghi, R. Okvqa: A visual question answering benchmark requiring external knowledge. In CVPR, 2019. find
- Ordonez, V., Kulkarni, G., and Berg, T. L. Im2text: Describing images using 1 million captioned photographs. In Shawe-Taylor, J., Zemel, R. S., Bartlett, P. L., Pereira, F. C. N., and Weinberger, K. Q. (eds.), NIPS, pp. 1143–1151, 2011. find
- Plummer, B. A., Wang, L., Cervantes, C. M., Caicedo, J. C., Hockenmaier, J., and Lazebnik, S. Flickr30k entities: Collecting region-to-phrase correspondences for richer image-to-sentence models. In ICCV, pp. 2641–2649, 2015. find
- Tan, H. and Bansal, M. LXMERT: learning cross-modality encoder representations from transformers. In Inui, K., Jiang, J., Ng, V., and Wan, X. (eds.), EMNLP, pp. 5099– 5110, 2019. find our card
- Tiong, A. M. H., Li, J., Li, B., Savarese, S., and Hoi, S. C. H. Plug-and-play VQA: zero-shot VQA by conjoining large pretrained models with zero training. In EMNLP Findings, 2022. find
- Tsimpoukelli, M., Menick, J., Cabi, S., Eslami, S. M. A., Vinyals, O., and Hill, F. Multimodal few-shot learning with frozen language models. In Ranzato, M., Beygelzimer, A., Dauphin, Y. N., Liang, P., and Vaughan, J. W. (eds.), NeurIPS, pp. 200–212, 2021. find our card
- Wang, P., Yang, A., Men, R., Lin, J., Bai, S., Li, Z., Ma, J., Zhou, C., Zhou, J., and Yang, H. OFA: unifying architectures, tasks, and modalities through a simple sequence-to-sequence learning framework. In Chaudhuri, K., Jegelka, S., Song, L., Szepesvári, C., Niu, G., and Sabato, S. (eds.), ICML,… find our card
- Wang, W., Bao, H., Dong, L., and Wei, F. Vlmo: Unified vision-language pre-training with mixture-of-modality-experts. arXiv preprint arXiv:2111.02358, 2021a. — [arXiv:2111.02358](https://arxiv.org/abs/2111.02358) find
- Wang, W., Bao, H., Dong, L., Bjorck, J., Peng, Z., Liu, Q., Aggarwal, K., Mohammed, O. K., Singhal, S., Som, S., and Wei, F. Image as a foreign language: Beit pretraining for all vision and vision-language tasks. arXiv preprint arXiv:2208.10442, 2022b. — [arXiv:2208.10442](https://arxiv.org/abs/2208.10442) find
- Wang, Z., Yu, J., Yu, A. W., Dai, Z., Tsvetkov, Y., and Cao, Y. Simvlm: Simple visual language model pretraining with weak supervision. arXiv preprint arXiv:2108.10904, 2021b. find our card
- Yao, L., Huang, R., Hou, L., Lu, G., Niu, M., Xu, H., Liang, X., Li, Z., Jiang, X., and Xu, C. FILIP: fine-grained interactive language-image pre-training. In ICLR, 2022. find
- Yu, J., Wang, Z., Vasudevan, V., Yeung, L., Seyedhosseini, M., and Wu, Y. Coca: Contrastive captioners are image-text foundation models. arXiv preprint arXiv:2205.01917, 2022. find our card
- Yuan, L., Chen, D., Chen, Y., Codella, N., Dai, X., Gao, J., Hu, H., Huang, X., Li, B., Li, C., Liu, C., Liu, M., Liu, Z., Lu, Y., Shi, Y., Wang, L., Wang, J., Xiao, B., Xiao, Z., Yang, J., Zeng, M., Zhou, L., and Zhang, P. Florence: A new foundation model for computer vision. arXiv preprint arXiv:2… — [arXiv:2111.11432](https://arxiv.org/abs/2111.11432) find
- Zhai, X., Wang, X., Mustafa, B., Steiner, A., Keysers, D., Kolesnikov, A., and Beyer, L. Lit: Zero-shot transfer with locked-image text tuning. In CVPR, pp. 18102–18112, 2022. find
- Zhang, P., Li, X., Hu, X., Yang, J., Zhang, L., Wang, L., Choi, Y., and Gao, J. Vinvl: Making visual representations matter in vision-language models. arXiv preprint arXiv:2101.00529, 2021. — [arXiv:2101.00529](https://arxiv.org/abs/2101.00529) find
- Zhang, S., Roller, S., Goyal, N., Artetxe, M., Chen, M., Chen, S., Dewan, C., Diab, M. T., Li, X., Lin, X. V., Mihaylov, T., Ott, M., Shleifer, S., Shuster, K., Simig, D., Koura, P. S., Sridhar, A., Wang, T., and Zettlemoyer, L. OPT: open pre-trained transformer language models. arXiv preprint arXiv… find
- LLM FlanT5 XL OPT 2.7B OPT 6.7B 5 1000 1e-5 256 (0.9,0.999) 0.05 0 364 “a photo of” 5 1 0.95 Fine-tuning epochs Warmup steps Learning rate Batch size AdamW β Weight decay Drop path Image resolution Prompt Inference beam size Layer-wise learning rate decay for ViT *Table 7. Hyperparameters for fine-t… find