All models

vision-text-dual-encoder (base dual encoder)

A ViT image encoder and a BERT text encoder joined by two projection layers into a shared embedding space.

Multimodal · 612 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 (24 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

Parameters
196.7M
Operations
612
Framework
PyTorch
Recurrent
No
Published
CVPR 2022
Cited by
401 (as of 22 October 2026)
Authors
Xiaohua Zhai, Xiao Wang, Basil Mustafa and others
Name in source
vision-text-dual-encoder:base-dual-encoder
License
Apache-2.0
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
m10915
Graph hash
e3a586619c6da5904926a894a6e97bb441fb28dbe297cebeac9c55b1f2d2e756
Skeleton hash
0a726275985ba8760cb6ba4b0570deb6796c21da6dd6a744ea99e3510cb93258
Architecture hash
60ceaf7e5dbd1965c2a996d4c5caf16825112ac9cf8621de638132cb8f1fa880
Diagram SHA-256
0d0e0cbc75467203ceb44bf537fa54884d2911d6a65af3cca193f11cf547ab30
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

VisionTextDualEncoder pairs two existing encoders: any pretrained vision model such as ViT, BEiT or DeiT on one side, and any pretrained text model such as RoBERTa or BERT on the other. Two projection layers sit on top of the encoders and map their output embeddings into a shared latent space. Those projection layers are randomly initialized, so the model should be fine-tuned on a downstream task before use.

The intended training is CLIP-like contrastive image-text training, which aligns the two sets of embeddings so the model can then be used for zero-shot vision tasks such as image classification or retrieval. Its reference point is the paper LiT: Zero-Shot Transfer with Locked-image Text Tuning, which showed that contrastive learning on pre-trained, locked or frozen, image and text models improves new zero-shot vision tasks.

In the LiT study, locked pre-trained image models combined with unlocked text models worked best. The authors describe this as teaching a text model to read out good representations from a pre-trained image model for new tasks. With a pre-trained ViT-g/14 image model, the LiT paper reports 85.2% zero-shot transfer accuracy on the ImageNet test set and 82.5% on the ObjectNet test set.

Key idea. The LiT paper found that contrastive tuning of image and text models works best when the pre-trained image model is locked and the text model is unlocked.

  • vision text dual encoder
  • visiontextdualencoder
  • visiontextdualencodermodel
  • vision-text-dual-encoder
  • dual encoder
  • contrastive image-text training
  • zero-shot image classification
  • image-text retrieval
  • locked-image tuning

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

Cite the paper

@misc{zhai2022litzeroshottransferlockedimage,
      title={LiT: Zero-Shot Transfer with Locked-image text Tuning}, 
      author={Xiaohua Zhai and Xiao Wang and Basil Mustafa and Andreas Steiner and Daniel Keysers and Alexander Kolesnikov and Lucas Beyer},
      year={2022},
      eprint={2111.07991},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2111.07991}, 
}