wikillm

Paper · 2021-11-03 · cs.CV, cs.CL, cs.LG

An Empirical Study of Training End-to-End Vision-and-Language Transformers

METER is a fully transformer vision-language model trained end to end. A ViT or Swin image encoder and a BERT or RoBERTa text encoder are joined by six co-attention layers, pre-trained with masked language modeling and image-text matching on about 4M pairs. Author-reported VQAv2 test-std accuracy is 77.64, above region-feature VinVL's 76.60. A 14M-image version reaches 80.54.

Vision-language pre-trainingVision Transformer (ViT) backbonesMultimodal fusionMasked image modelingvision-languagepretrainingtransformer

arXivPDFCodeMarkdown19 min read

AI-compiled by claude-haiku-5-5 on 2026-10-24, not yet reviewed by a human. Every claim cites its source; check it when a detail matters.

In plain words

Vision-and-language models answer questions about pictures, check whether a caption fits an image, and search images by text. Most of the strong ones have so far looked at an image through a separate object detector that first cuts out regions. That detector is frozen during training and slow to run, so it limits the whole system.

This paper asks what happens if you drop the detector and use a plain image transformer, the same kind of model used for text, that splits the picture into patches. It then tests many design choices one at a time: which pre-trained image and text models to start from, how the two streams should share information, whether to use an encoder or an encoder-decoder, and which extra training tasks help. The resulting model, METER, reaches strong question-answering scores while using far fewer training images than the best rivals.

The paper also reports what did not help. Adding a task that asks the model to rebuild hidden image patches lowered scores in its tests, which contradicts results from detector-based models.

TL;DR

  • Fully transformer vision-language models can match detector-based ones if the design is chosen carefully. METER is the model that results from the study §1.
  • The best setup pairs a CLIP or Swin image encoder with a RoBERTa text encoder, fused by co-attention layers. It is pre-trained with masked language modeling and image-text matching only §3.3 §4.4.
  • Author-reported VQAv2 test-std accuracy is 77.64 with about 4M pre-training images, and 80.54 for a 14M-image, larger-backbone version tab. 8 tab. 10.
  • Pre-training the image patches to be reconstructed did not help in the authors' setup tab. 7.

Problem

Region-feature vision-language models use a frozen, pre-trained object detector to extract features. The authors note two problems: the detector is not perfect and is usually kept frozen during pre-training, which caps the model's capacity, and extracting region features is time-consuming §1 §2. Earlier fully transformer models (ViLT, ALBEF, visual parsing) reportedly lagged behind region-feature models on VQA §2. The paper asks whether a ViT-based model trained end to end can close that gap §1.

The study covers only 4 standard image-caption datasets and English text. The authors list scalability and non-English data as open limitations app. I.

Method

METER has four parts §3:

  1. Text encoder §3.1. The sentence is split into subwords and passed through a pre-trained text transformer (BERT, RoBERTa, ELECTRA, ALBERT or DeBERTa were tried). The default is RoBERTa §4.1.1. A linear layer maps its output to the fusion width of 768 meter_module.py.
  2. Vision encoder §3.1. The image is cut into patches and encoded by a pre-trained vision transformer. The paper compares the original ViT, DeiT, Distilled DeiT, CaiT, VOLO, BEiT, Swin and CLIP-ViT §3.1. The default is CLIP-ViT-224/32, and the best reported models use CLIP-ViT-224/16 or Swin §4.1.1 §4.5. A linear layer maps its output to 768 meter_module.py.
  3. Multimodal fusion §3.1 §3.3. The default fusion is co-attention. Each stream has its own stack of M = 6 layers. Each layer contains one self-attention block, one cross-attention block that attends to the other stream, and one feed-forward block bert_model.py. Both streams are updated from the states of the previous layer, so the two updates do not see each other's new values meter_module.py. The merged-attention alternative (one shared transformer over the concatenated tokens) was tested and scored lower §4.2 tab. 6.
  4. Heads §3.3. The first token of each stream goes through a pooler (dense plus tanh). The two pooled vectors are concatenated meter_module.py meter_module.py. Task heads sit on top: an MLP for VQA over 3129 answers, a two-way head for image-text matching, and a head for the NLVR2 and SNLI-VE tasks meter_module.py.

The default text and vision encoders are not decoders. The paper tests an encoder-decoder variant with a 3-layer encoder and 3-layer decoder, and finds it weaker on the discriminative tasks §4.3 tab. 6.

Pre-training objectives

The default objectives are masked language modeling (MLM) and image-text matching (ITM) §3.3.

  • MLM §3.2. Mask 15% of caption tokens and predict the original tokens from the remaining text and the image.
  • ITM §3.2 §3.3. Each sample is a matched or mismatched image-caption pair with equal probability. A binary head decides whether they match.

The paper also tests masked image modeling (MIM) in two forms. Both mask 15% of the image patches §3.2:

  • In-batch negatives. The model must pick the original patch from the set of all patches in the batch. The probability is given by equation 1 §3.2 eq. 1.
  • Discrete codes. Each patch is replaced by a token from a VQ-VAE codebook, borrowed from DALL-E. The model predicts that token §3.2.

Neither variant is in the released code at this commit (see Paper vs code).

p(\mathbf{v}_i^k \mid [\mathbf{v}^{k,mask}; \mathbf{l}^{k}]) = \frac{e^{h(\mathbf{v}_i^k)^{\mathrm{T}} c(\mathbf{v}_i^k)}}{\sum_{j, k'} e^{h(\mathbf{v}_i^k)^{\mathrm{T}} c(\mathbf{v}_j^{k'})}} eq. 1

The loss at masked positions is the negative log of this probability §3.2. The paper says the model is trained with a loss similar to noise-contrastive estimation §3.2.

Pseudocode
# Pre-training loss: MLM + ITM, weight 1 each in the code  [§3.2] [§3.3]
# Input:  batch of matched image-caption pairs
# Output: scalar loss

def pretrain_loss(images, captions):
    # MLM pass: mask 15% of caption tokens, keep the image  [§3.2]
    masked_captions, targets = mask_tokens(captions, rate=0.15)
    text_feats, _, _ = meter_forward(masked_captions, images)
    # Predict the original token at each masked position  [§3.2]
    mlm_logits = mlm_head(text_feats)                  # (B, N, vocab)
    mlm_loss = cross_entropy(mlm_logits, targets)      # masked positions
    # ITM pass: keep half the images, swap in a random one for the rest
    # [§3.2] [code: meter/modules/objectives.py#L44-L50]
    labels = random_half_ones(batch_size)              # 1 = match
    mixed_images = swap_mismatched(images, labels)
    _, _, cls_feats = meter_forward(captions, mixed_images)
    itm_logits = itm_head(cls_feats)                   # (B, 2)
    itm_loss = cross_entropy(itm_logits, labels)
    return mlm_loss + itm_loss
Pseudocode
# Masked patch classification with in-batch negatives  [§3.2] [eq. 1]
# Follows the paper only: this MIM variant is not in the official code.

def mim_in_batch_loss(patches, masked_outputs, masked_index):
    # Original patch representations c(v) for every patch in the batch
    # [§3.2]
    candidates = original_patch_embedding(patches)     # (B * P, d)
    # Model outputs h(v) at the masked positions  [§3.2]
    queries = masked_outputs                           # (M, d)
    # Dot-product scores against all batch patches, then softmax  [eq. 1]
    scores = queries @ candidates.T                    # (M, B * P)
    # The target is the index of the original patch in the batch  [eq. 1]
    return cross_entropy(scores, masked_index)

Pre-training data

Four image-caption datasets: COCO, Visual Genome, Conceptual Captions and SBU Captions. Together they make about 4M images and about 9M image-caption pairs §3.3 app. A tab. 11. VQAv2 training uses its training and validation data, and its test-dev split is used as the development set. Visual Genome's VQA annotations are not used app. A.

Pseudocode
# LR per step  [§3.3] [code: meter/modules/meter_utils.py#L280-L295]
# base_lr = 1e-5 for the pre-trained encoders; cross-modal layers use 5x

def learning_rate(step, total_steps, base_lr):
    # Linear warm-up over the first 10% of steps  [§3.3]
    warmup_steps = int(0.1 * total_steps)
    if step < warmup_steps:
        return base_lr * step / warmup_steps
    # Linear decay to 0 at the last step  [§3.3] [code: meter/config.py#L64-L68]
    remaining = (total_steps - step) / (total_steps - warmup_steps)
    return base_lr * remaining

Downstream fine-tuning

Fine-tuning uses a learning-rate grid search over {1e-6, 2e-6, 5e-6, 1e-5} and image resolutions {288, 384, 576} app. A. RandAugment is applied during fine-tuning app. A. Downstream tasks are VQAv2, NLVR2, SNLI-VE, and Flickr30k and COCO image-text retrieval. Retrieval is tested both zero-shot (Flickr30k) and after fine-tuning §3.3.

Hyperparameters

NameValueWhereNotes
Pre-training steps100k§3.3 app. A config.pyCode caps epochs at 10 config.py
Pre-training batch size4096§3.3 app. A config.pyPer-GPU batch is set at run time
OptimizerAdamW§3.3 app. A meter_utils.py
AdamW betas, eps(0.9, 0.98), 1e-8not stated meter_utils.pyPaper gives no betas or eps
Weight decay0.01not stated config.pyNot applied to biases or LayerNorm
LR, pre-trained encoders1e-5§3.3 config.py
LR, cross-modal layers5e-5 (5x)§3.3 config.py
LR, MLM and ITM heads5e-5 (5x)not stated config.py meter_utils.pyPaper is silent on heads
Warm-up10% of steps§3.3 config.pyCode takes a fraction
Decaylinear to 0§3.3 config.pyPower 1, end LR 0
Hidden size768§3.3 config.py
Attention heads12§3.3 config.py
Cross-modal layers M6 per stream§3.3 config.pyEach: self-attn, cross-attn, FFN
FFN width3072config.pyPaper gives no FFN width; 4 x 768 in code
Dropout0.1not stated config.py
MLM mask rate15%§3.2 §3.3 config.py
Whole-word maskingon in pre-training confignot stated config.pySee Paper vs code
Max text length50 in pre-training confignot stated config.pyDefault in code is 40 config.py
ITM positive fraction50%§3.2 §3.3 objectives.py
Pre-training image size224 or 384 (paper)§3.3 config.pySee Paper vs code
Patch size16 or 32 (CLIP)config.pyPaper: CLIP-ViT-224/16 and /32
Pre-training compute8 A100 GPUs: about 3 days (CLIP/32), 8 days (Swin, CLIP/16)app. A
Pre-training datasetsCOCO, VG, CC, SBU§3.3 app. A config.pyCode calls CC gcc

Fine-tuning settings in the released named configs config.py:

TaskLRBatchEpochsImage sizeHead LR multiplierSource
VQAv25e-65121057650config.py
NLVR21e-52561028810config.py
SNLI-VE2e-664538410config.py
COCO IR/TR5e-6512103845config.py
Flickr30k IR/TR5e-6512103845config.py

The paper gives the grid of learning rates and image resolutions app. A but does not say which grid point was chosen for each task. The code's named configs use one value per task, all within that grid. The head multipliers and the 15 negatives per image for COCO and Flickr retrieval config.py are not in the paper.

Inference cost: about 53 ms per VQA instance (CLIP-ViT) and 59 ms (Swin) on one V100 GPU app. B tab. 12.

Results

Author-reported. Setup: models pre-trained on image-caption data, fine-tuned or zero-shot on the listed tasks. Ablations use VQAv2 test-dev and Flickr30k zero-shot retrieval §4.1 §4.2 §4.3 §4.4. Headline comparison is in tab. 8 and tab. 9.

Ablation: text encoder without VLP tab. 2

Vision encoder CLIP-ViT-224/32, no vision-language pre-training. Results are on test-dev or validation sets. SQuAD and MNLI are copied from their papers tab. 2 caption.

Text encoderVQAv2 AccVE AccFlickr IR R@1Flickr TR R@1SQuAD EMMNLI Acc
Emb-only67.1374.8549.0668.20--
ELECTRA69.2276.5741.8058.3086.888.8
CLIP69.3175.3754.9673.80--
DeBERTa69.4076.7451.5067.7087.288.8
BERT69.5676.2749.6066.6076.384.3
RoBERTa69.6976.5349.8668.9084.687.6
ALBERT (xlarge)69.9476.2052.2068.7086.487.9

All other rows are base-size models tab. 2.

Ablation: vision encoder without VLP tab. 3

RoBERTa text encoder tab. 3.

Vision encoderVQAv2VEFlickr IR R@1Flickr TR R@1ImageNet
Distilled DeiT B-384/1667.8476.1734.8452.1085.2
BEiT B-224/1668.4575.2832.2459.8085.2
DeiT B-384/1668.9275.9733.3850.9082.9
ViT B-384/1669.0976.3540.3059.8083.97
CLIP B-224/3269.6976.5349.8668.90-
VOLO 4-448/3271.4476.4240.9061.4086.8
CaiT M-384/3271.5276.6238.9661.3086.1
CLIP B-224/1671.7577.5457.6476.90-
Swin B-384/3272.3877.6552.3069.5086.4

ImageNet numbers are copied from their papers tab. 3.

Ablation: encoders with VLP tab. 4

Results on VQAv2 test-dev and Flickr30k zero-shot retrieval tab. 4.

Text encoderVision encoderVQAv2Flickr IR R@1Flickr TR R@1
Embed-onlyCLIP-3273.9960.3274.10
BERTCLIP-3274.9866.0878.10
BERTCLIP-1676.7074.5287.20
RoBERTaCLIP-3274.6765.5076.60
RoBERTaCLIP-1677.1976.6489.60
RoBERTaSwin76.4371.6885.30

The text says CLIP-ViT-224/16 reaches 77.19 and 77.20 on test-dev and test-std §4.1.2. The table lists only test-dev tab. 4.

Ablation: learning rates tab. 5

VQAv2 test-dev and Flickr30k zero-shot retrieval tab. 5.

Bottom LRTop LRVQAv2Flickr IR R@1Flickr TR R@1
1e-51e-573.1648.8063.70
2e-52e-573.6653.1467.20
3e-53e-573.7756.4870.90
5e-55e-573.5452.4865.90
1e-55e-574.9866.0878.10

Image resolution during fine-tuning matters: raising it from 224 to 576 improves VQA by about 3 points for CLIP-ViT-224/32 and about 1 point for CLIP-ViT-224/16 §4.1.2 fig. 5.

Ablation: multimodal fusion tab. 6

VQAv2 test-dev and Flickr30k zero-shot retrieval tab. 6.

FusionDecoderVQAv2Flickr IR R@1Flickr TR R@1
Merged attention (12 layers)no74.0057.4673.10
Co-attention (6 + 6 layers)no74.9866.0878.10
Co-attention (6 + 6 layers)yes74.7348.9671.60

Ablation: pre-training objectives tab. 7

VQAv2 test-dev and Flickr30k zero-shot retrieval tab. 7.

ObjectivesVQAv2Flickr IR R@1Flickr TR R@1
MLM74.19--
ITM72.6353.7471.00
MLM + ITM74.9866.0878.10
MLM + ITM + MIM (in-batch negatives)74.0162.1276.90
MLM + ITM + MIM (discrete code)74.2159.8076.30

Comparison with prior models tab. 8 tab. 9

Table 8 covers VQAv2, NLVR2, SNLI-VE and zero-shot Flickr30k retrieval. Rows are grouped by pre-training size. A "-" means the source table has no value.

Model (pre-train images)VQA test-devVQA test-stdNLVR2 devNLVR2 testSNLI-VE devSNLI-VE testZS IR@1ZS IR@5ZS IR@10ZS TR@1ZS TR@5ZS TR@10
ALBEF (14M)75.8476.0482.5583.1480.8080.9182.896.398.194.199.599.7
SimVLM BASE (1.8B)77.8778.1481.7281.7784.2084.15------
SimVLM HUGE (1.8B)80.0380.3484.5385.1586.2186.32------
UNITER LARGE73.8274.0279.1279.9879.3979.3868.7489.2093.8683.6095.7097.70
VILLA LARGE74.6974.8779.7681.4780.1880.02------
UNIMO LARGE75.0675.27--81.1180.63------
VinVL LARGE76.5276.6082.6783.98--------
PixelBERT74.4574.5576.577.2--------
CLIP-ViL (RN50x4)76.4876.70--80.6180.20------
ViLT71.26-75.7076.13--55.082.589.873.293.696.5
Visual Parsing74.0074.1777.6178.05--------
ALBEF (4M)74.5474.7080.2480.5080.1480.3076.893.796.790.598.899.7
METER-Swin BASE (4M)76.4376.4282.2382.4780.6180.4571.6891.8095.3085.3097.7099.20
METER-CLIP-ViT BASE (4M)77.6877.6482.3383.0580.8681.1979.6094.9697.2890.9098.3099.50

Table 9 covers fine-tuned Flickr30k and COCO retrieval. Columns are IR@1/5/10 and TR@1/5/10.

Model (pre-train images)Flickr IR@1IR@5IR@10TR@1TR@5TR@10COCO IR@1IR@5IR@10TR@1TR@5TR@10
ALBEF (14M)85.697.598.995.999.8100.060.784.390.577.694.397.2
UNITER LARGE75.5694.0896.7687.3098.0099.2052.9379.9387.9565.6888.5693.76
VILLA LARGE76.2694.2496.8487.9097.5098.80------
UNIMO LARGE78.0494.2497.1289.4098.9099.80------
VinVL LARGE------58.883.590.375.492.996.2
PixelBERT71.592.195.887.098.999.550.177.686.263.687.593.6
ViLT64.488.793.883.596.798.642.772.983.161.586.392.7
Visual Parsing73.593.196.487.098.499.5------
ALBEF (4M)82.896.798.494.399.499.856.881.589.273.191.496.0
METER-Swin BASE (4M)79.0295.5898.0492.4099.0099.5054.8581.4189.3172.9692.0296.26
METER-CLIP-ViT BASE (4M)82.2296.3498.3694.3099.6099.9057.0882.6690.0776.1693.1696.82

The paper's headline: METER-CLIP-ViT BASE reaches 77.64 on VQAv2 test-std, 1.04 above VinVL (76.60) and 1.6 above ALBEF (14M) (76.04), using 4M images §4.5 tab. 8.

Scaling tab. 10

Pre-training on about 14M images (COCO, CC, CC12M, SBU, VG; about 20M pairs) with a CoSwin-Huge vision backbone and RoBERTa-base §4.5. The VQAv2 results:

Model (pre-train images)VQA test-devVQA test-std
SimVLM BASE (1.8B)77.8778.14
SimVLM HUGE (1.8B)80.0380.34
METER-CoSwin HUGE (14M)80.3380.54

Analysis tab. 11 to tab. 17

Pre-training dataset statistics tab. 11:

DatasetImagesCaptions
COCO113K567K
Visual Genome108K5.4M
Conceptual Captions3.1M3.1M
SBU Captions875K875K

Inference time, ms per VQA instance on one V100 app. B tab. 12. The "Time (ViLT)" column is copied from the ViLT paper and used different hardware app. B:

ModelTime (from ViLT)Time (ours)VQAv2 test-std
ViLBERT920-70.55
VisualBERT925-70.80
LXMERT900-72.42
UNITER-Base900-72.70
OSCAR-Base900-73.16
VinVL-Base650-75.95
PixelBERT-X152160-74.45
CLIP-ViL (RN50x4)-5776.70
ViLT152671.26
ALBEF (14M)-5276.04
METER-Swin BASE-5976.42
METER-CLIP-ViT BASE-5377.64

Image captioning, COCO, maximum-likelihood training app. C tab. 13:

Model (pre-train images)BLEUMETEORCIDErSPICE
OSCAR BASE (4M)36.530.3123.723.1
VinVL BASE (5.6M)38.230.3129.323.6
SimVLM BASE (1.8B)39.032.9134.824.0
METER-CLIP-ViT BASE (4M)38.830.0128.223.0

For generation, the generated tokens attend to each other without the causal mask, and decoding uses beam size 5 app. C.

Multi-scale feature fusion (gated sum over encoder layers, see equation 2) app. D tab. 14:

o(x_i) = h(x_i^N) + \sum_{j=0}^{N-1} g(h(x_i^j))\, h(x_i^j) eq. 2, app. D

ModelFusionVQAv2 w/o VLPVQAv2 with VLPFlickr IR R@1 (with VLP)Flickr TR R@1 (with VLP)
METER-Swin BASEwithout72.3876.4371.6885.30
METER-Swin BASEwith72.9176.3170.5883.70
METER-CLIP-ViT BASEwithout71.7577.1976.6489.60
METER-CLIP-ViT BASEwith72.9277.0676.2688.00

Fusion helps without pre-training and hurts after it app. D tab. 14. The Flickr columns are reported only with VLP.

Unimodal results after VLP app. F.

Text encoder (RoBERTa-base)Before VLPAfter VLP
QQP91.31 ± 0.1591.34 ± 0.08
MNLI87.53 ± 0.2487.38 ± 0.18
QNLI92.61 ± 0.3492.67 ± 0.06
SST294.38 ± 0.2093.92 ± 0.50
CoLA58.72 ± 0.7357.88 ± 0.79
MRPC91.03 ± 0.5990.57 ± 0.78
STS-B90.15 ± 0.1889.93 ± 0.46
RTE71.24 ± 3.0770.28 ± 2.00

Linear probe on CIFAR, image encoder before and after VLP (text encoder RoBERTa-base) app. F tab. 16:

Image encoderCIFAR-10 beforeCIFAR-100 beforeCIFAR-10 afterCIFAR-100 after
Swin-Base-384/3297.0089.1597.9990.26
CLIP-ViT-224/1695.8582.6094.9281.90

The authors report that VLP helps Swin's image features and not CLIP's app. F.

Pre-training dataset ablation, CLIP-ViT-224/32 and BERT-base-uncased, 50k steps per dataset app. G tab. 17:

Pre-training dataVQAv2Flickr IR R@1Flickr TR R@1
COCO72.9546.3860.20
CC73.0539.8455.50
SBU70.1421.5235.90
VG73.5439.2449.30
COCO + CC + SBU + VG74.9866.0878.10

The authors credit data size and domain similarity: CC and VG are the largest, and COCO matches the downstream domain most closely app. G.

Correlation between vision-language and single-modality performance app. E fig. 6: Pearson r = -0.09 (p = 0.88) against language tasks and r = 0.41 (p = 0.36) against vision tasks, which the authors read as little or no correlation app. E.

Paper vs code

Official code: github.com/zdou0830/METER, linked from the abstract. Cloned at commit f4f09345b26ee21add0a756d06598e3c04726345. License MIT, from the repository LICENSE file. The README also names ViLT (Apache-2.0) as the source of borrowed parts README.md.

Checked against the paper: AdamW optimizer, 100k steps, batch 4096, 1e-5 base and 5x cross-modal LR, 10% warm-up with linear decay to 0, hidden 768, 12 heads, 6 cross-modal layers, 15% MLM, 50/50 ITM §3.3 [config values as cited above]. No discrepancy found in these.

Discrepancies:

  • Pre-training image size. The paper says images are resized to 224 or 384 depending on the ViT §3.3. The pre-training named config uses 224 config.py. The README's pre-training example uses 288 for CLIP-ViT/16 with RoBERTa README.md, and the released pre-trained checkpoint is also listed at 288 README.md. The comparison section also gives 288 for the best CLIP model §4.5.
  • ITM head input. The paper describes a classifier on a [CLS]-style token of the joint sequence §3.2. The code classifies the concatenation of the pooled text and pooled image vectors meter_module.py with an input width of 2 x 768 meter_module.py.
  • Head learning rate. The paper specifies 1e-5 and 5e-5 for encoders and the cross-modal module §3.3. The code also multiplies MLM and ITM heads by 5 config.py meter_utils.py. The paper does not mention this.
  • RandAugment. The paper says RandAugment is applied during fine-tuning app. A. The default transform in the code has no RandAugment transform.py. The augmented version is selected by the clip_randaug named config config.py, and the README's fine-tuning commands use it README.md.
  • Whole-word masking. The paper does not mention it. The pre-training named config enables it config.py. A code comment says whole-word masking does not work with RoBERTa config.py, yet the README pairs this named config with RoBERTa README.md.
  • Masked image modeling. Neither MIM variant (in-batch negatives, discrete codes) is in this repository at this commit. A search of the objectives module finds no MIM code. The results in tab. 7 cannot be reproduced from this release.

The authors read the MIM result as a sign that conclusions from region-based models may not carry over to patch-based models §4.4.

  • Merged attention and encoder-decoder. The released model runs only the co-attention path meter_module.py. The config has no option for merged attention, a decoder, or the embedding-only text encoder config.py.
  • 14M scaling run. No CoSwin-Huge or 14M-image config exists in this repository. The released configs cover Swin base and large, and CLIP ViT-B/16 and /32 config.py.
  • VQA loss. The paper does not state the VQA loss. The code uses binary cross-entropy with logits, scaled by the number of answers (3129) objectives.py.
  • Retrieval loss. The paper does not state it. The code uses a softmax over one positive and 15 negative captions per image, with the positive at index 0 objectives.py config.py.
  • Position embeddings at new resolutions. The compiled paper does not say how positional embeddings change with image size. The code interpolates them when a checkpoint is loaded at a new resolution meter_module.py meter_module.py.

Pitfalls

  • Table and figure numbers are assigned by source order. The compiled PDF was not available for checking, so the numbers used here (for example tab. 8 for the main comparison) follow the LaTeX order of the source. Check them against the PDF before citing externally.
  • Appendix letters are also assigned by source order. Implementation Details is app. A and Limitations is app. I. These are inferred from the \appendix sections.
  • Test-dev and test-std differ. Ablations use test-dev; the headline 77.64 uses test-std. Table 8 gives the METER-CLIP test-dev value as 77.68. Compare numbers only within one table and one split.
  • Equation numbering. Equation 1 is the in-batch MIM probability §3.2. Equation 2 is in appendix D. Its number is inferred from source order.
  • Pre-training data totals. Table 11 sums to about 4.2M images and about 9.9M captions. The text says about 4M images and about 9M pairs app. A.
  • Two forward passes per step. The code runs one forward pass for MLM (masked text, matched image) and a separate one for ITM (unmasked text, mismatched image) objectives.py objectives.py. This doubles the encoder cost per step relative to a single pass. The paper does not say whether it does this.
  • ITM pairing. The code uses an exact half-and-half split within each batch, drawn with a random permutation objectives.py. The paper says each sample is matched or mismatched with equal probability §3.2, a per-sample statement.
  • Layer-wise learning rates. Implement the parameter groups explicitly. The paper gives 1e-5 and 5e-5. The code also applies 5x to heads and uses separate weight-decay groups for biases and LayerNorm meter_utils.py.
  • Simultaneous stream updates. Both streams in each cross-modal layer read the previous layer's states. A sequential implementation (text first, then image on the new text states) would differ meter_module.py.
  • Resolution changes. Fine-tuning at 288, 384 or 576 requires interpolating the CLIP positional embeddings, which the paper does not describe in its main text. The code does this when loading a checkpoint meter_module.py.
  • Text inconsistency. The text gives CLIP-ViT-224/16's VQA as 77.19 (test-dev) and 77.20 (test-std) §4.1.2. Table 4 lists only test-dev tab. 4. Table 8's 77.64 test-std is the headline model, a different comparison, so do not mix the two.
  • Scaling run. The 14M-image result tab. 10 has no released config (see Paper vs code). The paper does not state its reproduction cost.
  • Compute. 8 A100 GPUs for 3 to 8 days per model app. A. The paper gives no per-run cost for the ablations.
  • Retrieval negatives. The code uses 15 negatives per image config.py. The paper does not state the number.

Lineage

  • Builds on the region-feature vision-language line the paper reviews (for example LXMERT, ViLBERT, UNITER, VinVL) and on fully transformer models ViLT, ALBEF and visual parsing §2 tab. 1. None of these has a card in this wiki yet.
  • Uses pre-trained encoders CLIP-ViT, Swin, RoBERTa, BERT and DeBERTa, all cited in §3.1.
  • Compared against: VinVL and ALBEF on VQAv2 and retrieval tab. 8 tab. 9; SimVLM on VQAv2 and captioning tab. 10 tab. 13.
  • The MIM variants follow BEiT's use of discrete codes §3.2, but the paper reports that they hurt in its setting tab. 7.

Source and license

Adapted from “An Empirical Study of Training End-to-End Vision-and-Language Transformers” by Zi-Yi Dou, Yichong Xu, Zhe Gan, Jianfeng Wang, Shuohang Wang, Lijuan Wang, Chenguang Zhu, Pengchuan Zhang, Lu Yuan, Nanyun Peng, Zicheng Liu, Michael Zeng (arXiv:2111.02387), used under CC BY 4.0. Changes: condensed and restructured for implementation, with tables, equations and algorithms taken from the paper and its code, each cited to its source. Not affiliated with or endorsed by the authors. Code citations refer to https://github.com/zdou0830/METER at commit f4f09345b26e (MIT). Any quoted code is shown under that license.