All models

FLAVA

One transformer trio for images, text and both together, pretrained on 70M public image-text pairs.

Multimodal · 1,851 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (117 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Family
FLAVA
Parameters
241.4M
Operations
1,851
Framework
PyTorch
Recurrent
No
Published
CVPR 2022
Cited by
565 (as of 18 October 2026)
Authors
Amanpreet Singh, Ronghang Hu, Vedanuj Goswami and others
License
BSD-3-Clause
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m16576
Graph hash
5a06ff736bccf0307eb7536c42d61aa24a1a77a8aad1c3cf61fadb482f9363ad
Skeleton hash
4e42361cbfde4f2da08bc260eb852f356ea60b7e0b1a34f9875437824d46d3c8
Architecture hash
34bec42b404febc7a8518b8bd45962f7570964b1d4efe1856a216d5bf2e232cc
Diagram SHA-256
1276ecb286f375ac9de8c35a32570ae8a88cabf0bd7fcf724048f5f814e420db
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

The TorchMultimodal reference implementation of the FLAVA model class from facebookresearch/multimodal.

About this model's family

FLAVA is a foundational language and vision alignment model that explicitly targets vision, language, and their multimodal combination all at once. The motivation is that existing models are often either cross-modal (contrastive) or multi-modal (with earlier fusion) but not both, and often only target specific modalities or tasks. The paper validates it on 35 tasks across vision, NLP and multimodal domains.

The model has an image encoder, a text encoder and a multimodal encoder that fuses and aligns the two, all based on transformers. The image encoder is a ViT-B/16, and unusually the text encoder uses exactly the same ViT architecture, with different parameters. The multimodal encoder applies two learned linear projections to each image and text hidden state, concatenates them with an extra classification token, and runs a further transformer that allows cross-attention between the two modalities. The Hub card describes that multimodal encoder as a 6-layer encoder.

Pretraining mixes multimodal and unimodal objectives: contrastive, masked multimodal modeling and image-text matching on image-text pairs, plus masked image modeling and masked language modeling on unpaired images and text. The global contrastive loss back-propagates across all GPUs rather than only locally, which the authors found gives a noticeable gain. Masked multimodal modeling masks both the image patches and the text tokens and works on both modalities jointly. The multimodal corpus, called PMD for Public Multimodal Datasets, totals 70M image-text pairs with 68M unique images. That is around 6x smaller than CLIP's training data, and FLAVA works significantly better on language and multimodal tasks while slightly worse than CLIP on some vision-only tasks. The card also admits FLAVA doesn't work well on tasks containing scene text, given the lack of scene text in most public datasets.

Key idea. FLAVA combines dual and fusion encoder approaches into one holistic model, pretrained with objectives from both categories on unimodal and multimodal data, so a single model serves vision, language and vision-and-language tasks.

  • FLAVA
  • flava-full
  • foundational language and vision alignment model
  • vision-language model
  • multimodal foundation model
  • image-text
  • contrastive pretraining
  • masked multimodal modeling
  • PMD
  • public multimodal datasets
  • torchmultimodal
  • FlavaModel

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{singh2022flavafoundationallanguagevision,
      title={FLAVA: A Foundational Language And Vision Alignment Model}, 
      author={Amanpreet Singh and Ronghang Hu and Vedanuj Goswami and Guillaume Couairon and Wojciech Galuba and Marcus Rohrbach and Douwe Kiela},
      year={2022},
      eprint={2112.04482},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2112.04482}, 
}