S IM VLM: S IMPLE V ISUAL L ANGUAGE M ODEL P RETRAINING WITH W EAK S UPERVISION
A BSTRACT
With recent progress in joint modeling of visual and textual representations,
Vision-Language Pretraining (VLP) has achieved impressive performance on many multimodal downstream tasks.
However, the requirement for expensive annotations including clean image captions and regional labels limits the scalability of existing approaches, and complicates the pretraining procedure with the introduction of multiple dataset-speciﬁc objectives.
In this work, we relax these constraints and present a minimalist pretraining framework, named Sim ple
V isual L anguage M odel ( SimVLM ).
Unlike prior work, SimVLM reduces the training complexity by exploiting large-scale weak supervision, and is trained end-to-end with a single preﬁx language modeling objective.
Without utilizing extra data or task-speciﬁc customization, the resulting model signiﬁcantly outperforms previous pretraining methods and achieves new state-of-the-art results on a wide range of discriminative and generative vision-language benchmarks, including VQA (+3.74% vqa-score), NLVR2 (+1.17% accuracy), SNLI-VE (+1.37% accuracy) and image captioning tasks (+10.1% average CIDEr score).
Furthermore, we demonstrate that SimVLM acquires strong generalization and transfer ability, enabling zero-shot behavior including open-ended visual question answering and cross-modality transfer.
I NTRODUCTION
Self-supervised textual representation learning (Devlin et al., 2018; Radford et al., 2018; 2019; Liu et al., 2019; Yang et al., 2019; Raffel et al., 2019; Brown et al., 2020) based on Transformers (Vaswani et al., 2017) has pushed the state of the art on a wide range of natural language processing (NLP) tasks (Rajpurkar et al., 2016;
Wang et al., 2018;
Sarlin et al., 2020).
One successful approach is to ﬁrst pretrain the model (e.g. BERT) on large-scale unlabled text corpora using masked language modeling (MLM) objective (Devlin et al., 2018), followed by ﬁnetuning on downstream tasks.
While this pretraining-ﬁnetuning paradigm has been widely adopted, recent work on autoregressive language models (LM) (Radford et al., 2019; Brown et al., 2020) such as GPT-3 has shown strong performance without ﬁnetuning by utilizing few-shot prompts (Liu et al., 2021), suggesting the text guided zero-shot generalization is a promising alternative.
Motivated by the success of textual representation pretraining, various efforts have been made to build the multi-modal (visual and textual) counterpart.
A line of work (Tan & Bansal, 2019; Lu et al., 2019;
Li et al., 2019; Chen et al., 2020b; Li et al., 2020; Su et al., 2020;
Zhang et al., 2021) has explored vision-language pretraining (VLP) that learns a joint representation of both modalities to be ﬁnetuned on vision-language (VL) benchmarks, such as visual question answering (VQA) (Goyal et al., 2017).
In order to capture the alignment between images and text, previous methods have extensively exploited two types of human-labeled datasets from multiple sources, which typically consist of the following steps.
Firstly, object detection datasets are used to train a supervised object detector (OD) which allows further extracting region-of-interest (ROI) features from images.
Next, datasets with aligned image-text pairs are used for MLM pretraining of a fusion model that usually takes as input the concatenation of the extracted ROI features and the paired text.
In addition, due to the limited scale of human annotated data, various task-speciﬁc auxiliary losses have been introduced in order to improve performance.
These design choices complicate the pretraining protocol of VLP, creating a bottleneck for further quality improvement.
What is more, such pretraining-ﬁnetuning based approaches usually lack the zero-shot capability, just like their language counterparts.
In comparison, another line of work (Radford et al., 2021; Ramesh et al., 2021;
Jia et al., 2021) utilizes weakly labeled/aligned data crawled from the web to perform pretraining, achieving good performance and certain zero-shot learning capability on image classiﬁcation and image-text retrieval.
Nonetheless, these methods mainly focus on speciﬁc tasks of consideration and thus may not serve as a generic pretraining-ﬁnetuning representation for VL benchmarks.
In light of these disadvantages of the existing techniques, we are interested in building a VLP model that: (1) can be seamlessly plugged into the pretraining-ﬁnetuning paradigm and achieve competitive performance on standard VL benchmarks; (2) does not require a complicated pretraining protocol as in previous methods; and (3) has the potential towards text guided zero-shot generalization in cross-modal settings.
To this end, we propose SimVLM , standing for Sim ple V isual L anguage
M odel, which signiﬁcantly simpliﬁes VLP by solely exploiting language modeling objectives on weakly aligned image-text pairs (Jia et al., 2021).
In a nutshell, SimVLM consists of the following components:
• Objective .
It is trained end-to-end from scratch with a single objective of Preﬁx Language Modeling (PreﬁxLM), which can not only naturally perform text generation as GPT-3, but also process contextual information in a bidirectional manner as BERT does.
• Architecture .
The framework employs ViT/CoAtNet (Dosovitskiy et al., 2021; Dai et al., 2021) and directly takes raw images as inputs.
These models can also ﬁt the large-scale data and are readily compatible with the PreﬁxLM objective.
• Data .
These setups relieve the requirement for object detection and allow the model to utilize the large-scale weakly labeled dataset, which has better potential towards zero-shot generalization.
Not only is SimVLM simpler, requiring neither object detection pretraining nor auxiliary losses, but it also obtains better performance than previous work.
Empirically, SimVLM consistently outperforms existing VLP models and achieves new state-of-the-art results on 6 VL benchmarks without additional data nor task-speciﬁc customization.
Besides, it acquires stronger generalization in visual-language understanding that empowers zero-shot image captioning and open-ended VQA.
In particular, SimVLM learns uniﬁed multimodal representation that enables zero-shot cross-modality transfer, where the model is ﬁnetuned on text-only data and directly evaluated on image-and-text test examples without further training.
Our results suggest that generative VLP can not only match existing MLM-based methods on VL tasks but also demonstrate promising zero-shot potential.
R ELATED W ORK
Recent years have seen a rapid progress made in vision-language pretraining (Uppal et al., 2020;
Han et al., 2021; Khan et al., 2021).
While a variety of approaches have been proposed, a large portion of them require object detection for image region feature regression or tagging as part of the pre-training objectives (Tan & Bansal, 2019; Su et al., 2020;
Li et al., 2019; Chen et al., 2020b;
Gan et al., 2020; Li et al., 2020; Yu et al., 2021;
Li et al., 2021; Zhang et al., 2021;
Hu et al., 2021;
Cho et al., 2021).
These methods rely on a strong object detection model like Fast(er) R-CNN (Ren et al., 2015), which is often trained on human annotated data sets like Visual Genome (Krishna et al., 2016).
Using such labeled training data as a prerequisite increases the cost of building the training pipeline, and makes the approach less scalable.
Some recent efforts have also explored VLP without object detection module (Xu et al., 2021;
Kim et al., 2021; Huang et al., 2021), but they only use clean pretraining data with small scales and thus their zero-shot capability is limited.
On the other hand, multiple cross-modality loss functions have been proposed as part of the training objectives, for example image-text matching (Tan & Bansal, 2019;
Lu et al., 2019; Xu et al., 2021), masked region classiﬁcation/feature regression (Tan & Bansal, 2019; Chen et al., 2020b), object attribute prediction (Xu et al., 2021), contrastive loss (Li et al., 2020; 2021), word-region alignment (Chen et al., 2020b) word-patch alignment (Kim et al., 2021).
They are often mixed with other objectives including image caption generation and masked language modeling to form compound pre-training losses.
This creates the challenge of balancing among different losses and datasets, and thus complicates the optimization procedure.
Our work by contrast, follows a minimalist approach that takes raw image inputs and makes use of only the language modeling loss, without resorting to auxiliary models like faster R-CNN for image region detection.
Motivated by recent works (Radford et al., 2021; Ramesh et al., 2021; Jia et al., 2021; Tsimpoukelli et al., 2021) that illustrate zero-shot learning in certain image-text tasks, we train our model using large-scale weakly labeled data only.
While concurrent work (Shen et al., 2021) has explored building on top of models pretrained with such dataset, we focus on pretraining from scratch to explore the limit of generative VLP.
S IM VLM 3. B ACKGROUND
The bidirectional Masked Language Modeling (MLM) has been one of the most popular selfsupervised training objectives for textual representation learning.
As demonstrated by BERT (Devlin et al., 2018), it is based on the idea of denoising autoencoder such that the model is trained to recover the corrupted tokens in a document.
Speciﬁcally, given a text sequence x , a subset of tokens x m are randomly sampled and a corrupted sequence x \ m is constructed by replacing tokens in x m with a special [MASK] token.
The training objective is to reconstruct x m from the context x \ m by minimizing the negative log-likelihood:
[Equation]
where θ is the trainable parameters of the model and D is the pretraining data.
This approach learns contextualized representations that can be further ﬁnetuned for downstream tasks.
The MLM-style pretraining has been widely adopted in previous VLP models, whereby the input is an image-text pair and the model needs to predict masked tokens by leveraging image ROI features.
Alternatively, the unidirectional Language Modeling (LM) trains the model to directly maximize the likelihood of the sequence x under the forward autoregressive factorization:
[Equation]
Compared with MLM, the LM pretraining has also been shown to be highly effective for multiple
NLP tasks (Radford et al., 2018).
More importantly, it facilitates the model with strong generation capability that enables text induced zero-shot generalization without ﬁnetuning (Brown et al., 2020).
While MLM has become the de facto approach in VLP models reviewed above, the generative LM has been understudied.
3. P ROPOSED O BJECTIVE : P REFIX L ANGUAGE M ODELING
Motivated by the zero-shot capability introduced by pre-training with LM loss, we propose to pretain vision-language representation using the Preﬁx Language Modeling (PreﬁxLM) .
PreﬁxLM differs from the standard LM such that it enables bi-directional attention on the preﬁx sequence (e.g. x <T p in Eq.
(3)), and only conducts autoregressive factorization on the remaining tokens (e.g. x ≥ T p in Eq.
During pretraining, a preﬁx sequence of tokens of (a randomly selected) length T p is truncated from input sequence and the training objective becomes:
[Equation]
Intuitively, images can be considered as preﬁx for their textual descriptions as they often appear before text in a web document.
Therefore, for a given image-text pair, we prepend image feature sequence of length T i to the text sequence, and enforce the model to sample a preﬁx of length
T p ≥ T i to calculate LM loss on text data only (an example is shown in Figure 1).
Compared to prior MLM style VLP methods, our PreﬁxLM model under the sequence-to-sequence framework not only enjoys the bidirectional contextualized representation as in MLM, but also can perform text generation similar to LM.
3. A RCHITECTURE
We adopt Transformer as the backbone of our model due to its success for both language and vision tasks (Devlin et al., 2018; Dosovitskiy et al., 2021).
Differently from standard LM, PreﬁxLM enables bidirectional attention within the preﬁx sequence, and thus it is applicable for both decoder-only and encoder-decoder sequence-to-sequence language models.
In our preliminary experiments, we found that the inductive bias introduced by encoder-decoder model which decouples encoding from generation is conducive to the improvement of downstream task.
An overview of our model architecture is depicted in Figure 1.
For the visual modality, inspired by
ViT (Dosovitskiy et al., 2021) and CoAtNet
(Dai et al., 2021), our model receives the raw image x ∈ R H × W × C and maps it into ﬂattened 1D sequence of patches x p ∈ R T
i × D as input for the transformer, where D is the ﬁxed hidden size of the transformer layers and T i =
HWP 2 is the length of the image tokens for a given patch size P .
Following Dai et al.
(2021), we use a convolution (Conv) stage consist of the ﬁrst three blocks of ResNet (He et al., 2016) to extract contextualized patches, which we ﬁnd advantageous over the naive linear projection (equivalent to 1 × 1 Conv layer) used in
ViT, consistent with the observation from (Xiao et al., 2021).
For the textual modality, we follow the standard practice to tokenize the input sentence into sub-word tokens (Kudo & Richardson, 2018), and the embeddings are learned for a ﬁxed vocabulary.
To retain positional information, we add two trainable 1D positional embeddings for image and text inputs separately, and we additionally add 2D relative attention for the image patches within transformer layers (Dai et al., 2021).
Notice that we do not add extra modality type embeddings for which we found no improvement in our experiment.
We study the effects of various components of the model in Section 4.4.
3. D ATASETS
Since our approach does not rely on an object detection module and only operates with raw image patch inputs, we pretrain all model parameters from scratch using large-scale noisy image-text data, which has better potential for zero-shot generalization.
Speciﬁcally, we use the image and alt-text pairs introduced in Jia et al.
(2021), which are crawled from the web with minimal post-processing.
On the other hand, our formulation of PreﬁxLM is modality-agnostic and thus we can additionally include text-only corpora to compensate for noisy text supervision in the alt-text data.
As shown later in our experiments, this uniﬁed PreﬁxLM formulation reduces the modality discrepancy and improves the model quality.
[Table]
Compared to prior VLP methods consisting of two pretraining stages and multiple auxiliary objectives, our model only requires one-pass pretraining using a single language modeling loss in an end-to-end manner, hence the name Simple Visual Language Model (SimVLM).
E XPERIMENTS
We conduct systematic experiments on a diversiﬁed set of visual-linguistic benchmarks, including visual question answering, image captioning, visual reasoning, visual entailment, and multimodal translation.
We not only examine our model as a general-purpose VL representation learning in the pretraining-ﬁnetuning paradigm, but also study its zero-shot generalization towards open-ended VL understanding.
4. S ETUP
Our models are implemented with the Lingvo framework (Shen et al., 2019).
We follow the setup in ViT (Dosovitskiy et al., 2021) to explore 3 variants of SimVLM, namely “Base”, “Large”, and “Huge”, such that each variant follows the same setting as its corresponding ViT variant.
All models are pretrained from scratch for about 1M steps on the training set of ALIGN (Jia et al., 2021) and the Colossal Clean Crawled Corpus (C4) dataset presented in Raffel et al.
We mix the two pretraining datasets within each batch, which contains 4,096 image-text pairs (ALIGN) andtext-only documents (C4), sharded across 512 TPU v3 chips (Jouppi et al., 2017).
More pretraining settings are detailed in Appendix B.1.
After pretrained, our model is ﬁnetuned and evaluated on six vision-language benchmarks, including three discriminative tasks:
VQA v2 (Goyal et al., 2017), SNLI-VE
(Xie et al., 2019), and NLVR (Suhr et al., 2018); as well as three generative tasks: CoCo captioning (Chen et al., 2015), NoCaps (Agrawal et al., 2019), and Multi30k (Elliott et al., 2016).
We additionally examine its zero-shot generalization and performance on single-modality tasks.
Details of tasks considered and the ﬁnetuning process are outlined in Appendix B.2.
4. C OMPARISON WITH EXISTING APPROACHES
To examine the quality of vision-language pretraining, we ﬁrst compare SimVLM on the popular multi-modal tasks with state-of-the-art (SOTA) VLP methods including LXMERT (Tan & Bansal, 2019), VL-T5 (Cho et al., 2021), UNITER (Chen et al., 2020b), OSCAR (Li et al., 2020), Villa (Gan et al., 2020), SOHO (Huang et al., 2021), UNIMO (Li et al., 2021), and VinVL (Zhang et al., 2021).
As can be seen in Table 1, SimVLM outperforms all existing models and achieves new SOTA results on all tasks considered, often by a signiﬁcant margin.
This demonstrates our generative pretraining approach is competitive with MLM-based models and that simple framework with weak supervision is sufﬁcient to learn high-quality multi-modal representations. [Table]
) c Cornia et al.
For the discriminative tasks, the SimVLM base already outperforms all prior methods while using less capacity, and the SimVLM huge obtains almost 4 points absolute score improvement compared to the previous SOTA (VinVL), pushing the single model performance above 80% on VQA for the ﬁrst time.
In addition, SimVLM also consistently outperforms prior methods on NLVR2 and
SNLI-VE, illustrating its capability of processing more complex visual-linguistic reasoning.
For the generation tasks including image captioning and image translation, SimVLM also shows large improvements using naive ﬁnetuning techniques.
Our model outperforms on 3 out of 4 metrics on the public “Karpathy” 5k test split of CoCo captioning as well as the NoCaps benchmark than prior methods trained with more complex reinforcement learning approach of CIDEr optimization (Rennie et al., 2017).
Finally, SimVLM is also effective for image translation of Multi30k from
English to German.
These experiments demonstrate that our model can be seamlessly plugged into the pretraining-ﬁnetuning paradigm with superior performance, utilizing minimalist pretraining and ﬁnetuning procedures.
4. Z ERO -S HOT G ENERALIZATION
A crucial beneﬁt of generative modeling and scaling with weak supervision is the potential of zeroshot generalization.
Models (Brown et al., 2020; Radford et al., 2021; Jia et al., 2021) have been shown capable of performing few-shot or zero-shot transfer from pretrained models to downstream datasets, even across language boundaries (Lample & Conneau, 2019).
In this section, we showcase three different settings of zero-shot applications less explored in prior VLP work, including transferring to unseen tasks, modalities and/or testing instances.
4.3. Z ERO - SHOT /F EW - SHOT I MAGE C APTIONING
The pretraining procedure of SimVLM can be interpreted as a noisy image captioning objective on real-world web corpus.
Thus, it is natural to ask how well this caption ability generalizes to other datasets in a zero-shot/few-shot manner.
To this end, we take the pretrained SimVLM model, and directly decode on image captioning benchmarks for the zero-shot setting while ﬁnetune on 1% training data for 5 epochs for the few-shot setting.
We also found that using a preﬁx prompt “ A picture of ” improves the quality of decoded captions, similar to the ﬁnding in Radford et al.
As shown in Table 2, the zero-shot/few-shot performance (Appendix D) of SimVLM is competitive with fully supervised baselines on CoCo, and it also demonstrates strong generalization on the concept-rich NoCaps benchmark by achieving better scores than pretrained models.
Figure 2 (a) illustrates sample captions generated by our model (Appendix A).
SimVLM is able to not only capture real-world concepts but also provide a detailed description of the visual input.
For example, the decoded samples are able to explain complex scenes with multiple objects (e.g. “people”, “table with drinks”, “dark restaurant”).
Besides, the model also shows understanding of ﬁne-grained abstraction such as speciﬁc car brand and model (e.g. “Aston Martin”, “Vantage”).
SimVLM even performs [Table] robustly on challenging images that could be tricky for human, such as abstract or dark pictures.
These all illustrate that our model learns a wide range of real-world concepts that generalize well in a zero-shot manner.
4.3. Z ERO - SHOT CROSS - MODALITY T RANSFER
Existing pretraining methods have been shown to be successful in transferring knowledge across heterogeneous data spaces.
For example, multilingual language models (Devlin et al., 2018; Lample & Conneau, 2019) enable zero-shot cross-lingual transfer such that the model is only ﬁnetuned using training data from a source language (typically English) and evaluated on the target language without further training.
Inspired by this setup, we explore a novel zero-shot cross-modality transfer paradigm of utilizing VLP models, and evaluate how well our model generalizes across modalities.
Since text training data are usually cheaper to obtain compared to visual data, we ﬁnetune SimVLM on text-only downstream data and then directly evaluate the zero-shot transfer on joint VL tasks.
Speciﬁcally, We utilize SNLI-VE and Multi30k to examine the zero-shot transfer performance.
For
SNLI-VE, we ﬁnetune on three text-only NLI datasets such that the premise sentence is used as the encoder’s input while the hypothesis is fed to the decoder, and a similar classiﬁer head is trained on the embedding of the last token in the decoder.
At inference, the ﬁnetuned model is evaluated by taking the premise image as the encoder input and the corresponding hypothesis sentence to the decoder.
As shown in Table 3, SimVLM performs competitively with fully supervised baselines including UNITER under the zero-shot setting.
As a sanity check, we also mask out the image feature to predict using the hypothesis only, and ﬁnd our models can only obtain results close to random guess (average scores of 34.31 / 34.62).
This results in performance close to random guess hence demonstrating the effectiveness of SimVLM’s cross-modality transfer ability.
In addition, SimVLM is also capable of domain adaption by transferring from the MNLI dataset to SNLI-VE, whereby data comes not only from a different modality but also another domain.
We also ﬁnd it possible to transfer across different languages and modalities using SimVLM.
Specifically, we utilize the German image captioning task from WMT 2016 of Multi30k for evaluation, where our model is ﬁnetuned on English-German text-only translation data followed by decoding with image-only input in the encoder.
Table 3 shows that SimVLM is capable of transferring knowledge across modalities and languages in generative tasks, achieving comparable performance to supervised baselines (decoded examples shown in Figure 2 (b)).
These results suggest zero-shot cross-modality transfer emerges with the scaling of weakly labeled data.
4.3. O PEN - ENDED VQA
On the VQA benchmark, the best performing models to date formulate the problem as a discriminative task of multi-label classiﬁcation over a predeﬁned 3,129 answer candidates, often consisting of short factual terms.
In real-world applications, however, it is hard to deﬁne a closed set of candidate answers that covering all possible scenarios, making the true open-ended VQA a challenging setup.
[Table]
Generative models such as SimVLM provide an alternative solution towards this challenge by generating free-form textual answers without being constrained to predeﬁned answers.
To this end, we ﬁnetune SimVLM using the PreﬁxLM loss described above where we treat the concatenation of the image and the question as the preﬁx, and train the model to generate answers.
[Table]
We then compare the generative approach with classiﬁcation methods in Table 4.
Firstly, we follow Cho et al.
and evaluate model performance on questions with rare answers in the Karpathy-test split.
Here, outof-domain questions are deﬁned as those with best-scoring answer not included in the 3, candidates.
Results show that SimVLM outperforms both discriminative and generative baselines on all splits.
More importantly, the generative SimVLM signiﬁcantly improves on the out-of-domain split by over 17 points, demonstrating its strong generalization.
However, this setup mainly focuses on rare answers and it remains unclear how well the model generalizes to common unseen answers.
We therefore proceed to investigate a more challenging setup where we randomly select 2,085 (about two-thirds of 3,129) in-domain answers and partition both train and validation sets into two splits based on whether their best-scoring answers are included in the selected set or not.
We then only ﬁnetune
SimVLM on the in-domain split of the train set and evaluate on the entire validation set.
The “Partial Train” column in Table 4 shows that the generative SimVLM is also competent in this setup by scoring reasonably well on over 1,000 unseen answers.
Overall, we found the generative SimVLM performs competitively with its discriminative counterpart in the standard setup, and works generally better in the out-of-domain case.
Note that we use the exact matching between generated answers and human labels for score calculation in the above experiment, however it is possible that the model generates appropriate answers in different formats or synonyms.
Therefore, in addition to the quantitative study above, we show qualitative generation results in Figure 2 (c).
It can be observed that SimVLM is able to generate answers not included in the 3,129 candidate set (e.g. “surgeon” and “wood carving”), demonstrating that SimVLM can transfer knowledge from the pretraining corpus to VQA.
It is thus natural to ask whether SimVLM can perform zero-shot VQA without ﬁnetuning at all.
In our experiments, we found that SimVLM is able to “answer” by completing prompting sentences, as shown in Figure(d).
Nonetheless, we also observed that the model falls short in generating meaningful answers to the real questions.
We hypothesize that this is due to the low quality of the pretraining data in which most textual descriptions are short and noisy.
To verify our assumption, we continue the pretraining process on the cleaner WIT dataset (Srinivasan et al., 2021) for 50k steps.
Examples in Figure 2 (e) show that open-ended VQA ability emerges in SimVLM such that it can generate related responses after ﬁnetuning on the knowledge-rich wikipedia dataset. 4. A NALYSIS
[Table]
Single-Modality Tasks.
Since SimVLM performs well on joint vision-language benchmarks, it is natural to ask how well the learned representations perform on tasks of single modality.
We hope to gain deeper insights into the model behavior by examining its performance on these benchmarks, but it is not our intention to achieve state-of-the-art on singlemodality tasks.
In Table 7 (Appendix C), we compare SimVLM with existing VLP models on the GLUE benchmark (Wang et al., 2018), where we mainly follow the text processing procedure in Raffel et al.
and train our model to classify the fully formatted input without token type embeddings.
SimVLM performs better than existing VLP methods and competitively with BERT, indicating that it has good language understanding ability.
Additionally, we also compute the top-1 accuracy on ImageNet following the linear evaluation protocol in Table 5.
Note that our model is not pretrained with a discriminative task such as the contrastive loss, hence we use an average pooling of encoder outputs as image features.
Results verify that our model has also learned high-quality image representation.
Ablation Study.
To study the contributions from each model component, we conduct ablation study on SimVLM small models with an embedding dimension of 512 and 8 layers.
We make comparisons on VQA in Table 6.
First, we compare encoder-decoder models with decoder-only models of comparable model size, and ﬁnd that decoder-only model performs signiﬁcantly worse on VQA.
This suggests the inductive bias of separating bidirectional encoding from unidirectional decoding is beneﬁcial for joint VL representation learning.
Next, we study the effectiveness of pretraining objectives and results show that the PreﬁxLM objective outperforms both span corruption (Raffel et al., 2019) and naive LM, illustrating the importance of using a uniﬁed objective formulation for both image-text and text-only data.
Moreover, we ablate the contribution of datasets.
While weakly aligned image-text data are required for bridging the gap between visual and textual representations, text-only corpora also improves the model quality.
This is probably because textual signals are extremely noisy in the former and thus the model relies on the later to acquire better language understanding.
In addition, we experimented with 10% ALIGN and CC-3M (Sharma et al., 2018) datasets, and conﬁrms the importance of data scaling.
We then study the effect of the convolution stage and ﬁnd it critical for VL performance.
Following Dai et al.
(2021), we experiment with using either the ﬁrst 2/3/4 ResNet Conv blocks, and empirically observe that the 3 conv block setup works best.
This indicates that image and text have different levels of representation granularity and thus utilizing contextualized patches is beneﬁcial.
C ONCLUSION
In this work, we present a simple yet effective framework of vision-language pretraining.
Unlike prior works using object proposal systems and auxiliary losses, our model processes whole image as patches and is trained end-to-end with a single preﬁx language modeling objective.
Our work suggests a promising alternative to existing VLP paradigm and we hope our work may inspire future research on generative VLP. A CKNOWLEDGMENTS
We would like to thank Hieu Pham, Chao Jia, Andrew Dai, Bowen Zhang, Zhifeng Chen, Ruoming
Pang, Douglas Eck, Claire Cui and Yonghui Wu for helpful discussions, Krishna Srinivasan, Samira Daruki, Nan Du and Aashi Jain for help with data preparation, Chao Jia, Zhen Li, Jonathan Shen, Colin Raffel and Sharan Narang for assistance on experimental settings, and others in the Google Brain team for support throughout this project.
A G ENERATED E XAMPLES
Examples generated by SimVLM of various types are shown in Figure 2.
We use either image-only or image-text preﬁx inputs in the encoder, and use the decoder to generate sufﬁx text.
[Table]
B E XPERIMENTAL D ETAILS B. P RETRAINING
Our models are pretrained according to the methodology described in Section 3.
For the Transformer, each variant follows the same setting as its corresponding ViT variant.
For the Conv stage, we use the ﬁrst three blocks (excluding the Conv stem) of ResNet-101 and ResNet-152 (He et al., 2016) for our Base and Large models respectively, and a larger variant of ResNet-152 with more channels for the Huge model (matching its hidden dimension size).
We always use a ﬁxed patch size of 16 × 16.
During pretraining, we utilize the resolution of 224 × 224, resulting in a patch sequence of length 14 × 14 as visual tokens.
For the textual input, we use a vocabulary size of 32,000 and a max sequence length of 256 in both the encoder and the decoder.
We also share parameters between the embedding and the decoder softmax output layer (Press & Wolf, 2016).
All parameters are shared across visual and textual inputs except the Conv stage and positional embeddings.
We pretrain on large-scale web datasets for both image-text and text-only inputs.
For joint vision and language data, we exploit the training set of ALIGN (Jia et al., 2021), which contains about 1.8B noisy image-text pairs.
Notice that we do not use any extra data preprocessing or ﬁltering, except simple random resized cropping.
For the text-only copora, we use the Colossal Clean Crawled
Corpus (C4) dataset presented in Raffel et al.
and followed their preprocessing steps.
The dataset contains about 800GB of web crawled documents.
All models are pretrained for about 1M steps from scratch to optimize for the single PreﬁxLM objective in Eq.3.
We use the AdamW optimizer (Loshchilov & Hutter, 2017) with β 1 = 0 .
9 , β 2 = 0 .
999 and weight decay of 0.01.
We warm up the learning rate for the ﬁrst 2% of updates to a peak value of 5 × 10 − 4 , and then linearly decay it afterwards.
Dropout is not used during the pretraining stage.
We mix the two pretraining datasets within each batch, which contains 4,096 image-text pairs and 512 text-only documents, sharded across 512 TPU v3 chips (Jouppi et al., 2017).
B. F INETUNING
After pretraining, our model is ﬁnetuned on various downstream tasks.
Similar to the pretraining stage, we use the AdamW optimizer with the same Beta values, while we tune the learning rate in { 1 × 10 − 5 , 2 × 10 − 5 , 5 × 10 − 5 } .
We also enable regularization methods of Dropout (set to 0.1) and stochastic depth (only applied to Conv stage and encoder with a ﬁxed dropout rate of 0.1)
(Huang et al., 2016) during the ﬁnetuning stage.
Following standard practice, we use the corresponding dev split to ﬁnd the best setting and report the result on the test split.
We consider 5 types of downstream tasks listed below:
Visual question answering:
This task requires the model to answer questions about input images, and has been the most widely used VL benchmark.
Following prior work, we use the VQA v (Goyal et al., 2017) and formulate the task as a classiﬁcation problem over 3,129 most frequent answers in the training set.
The raw image and the corresponding question are used as inputs to the encoder and the decoder respectively, and a task-speciﬁc linear classiﬁer is trained to predict answer based on activation corresponding to the last question token from the decoder.
We use a resolution of 480 × 480 for the image and all positional parameters are adapted using linear interpolation.
Visual entailment: The SNLI-VE (Xie et al., 2019) dataset is adapted from SNLI (Bowman et al., 2015), which is originally designed to predict the relation between a premise sentence and a hypothesis sentence as either entailment, neutral or contradiction, a task known as natural language inference (NLI).
For the VL variant, the premise is based on the content of an image rather than textual descriptions.
We ﬁnetune SimVLM similarly to VQA, such that the image and the sentence are fed to encoder and decoder separately, and the classiﬁer is trained to predict the three relations.
Visual reasoning:
The NLVR2 (Suhr et al., 2018) dataset tests the model’s ability of jointly reasoning over the language and multiple images by asking whether a textual description is true based on a pair of two images.
Following Zhang et al.
(2021), we create two input pairs, each consisting of one image and the textual description, and generate output embeddings for both using the same setup above.
The two embeddings are then concatenated for ﬁnal prediction.
Image captioning: The captioning task requires a model to generate natural language descriptions of input images.
We consider two datasets CoCo (Chen et al., 2015) and NoCaps (Agrawal et al., 2019), both ﬁnetuned using the CoCo training data.
For SimVLM, it is straightforward to ﬁrst encode the image in the encoder and then generate captions using the decoder.
Note that in contrast to prior work that apply task-speciﬁc tricks such as CIDEr optimization (Rennie et al., 2017), our model is trained with naive cross-entropy loss only.
Multimodal translation: The goal of multimodal translation is to translate image descriptions in source language to target language, for which image inputs can be taken advantage of as grounding signal.
We train and evaluate on the Multi30k (Elliott et al., 2016) dataset.
We utilize the PreﬁxLM described in previous sections such that the source sentence, together with the image inputs, are fed to the encoder, which will be translated to the target language by the decoder.
C M ODEL P ERFORMANCE ON L ANGUAGE - ONLY T ASK
We compare our model with prior VLP methods on natural language understanding (NLU) tasks on the GLUE benchmark (Wang et al., 2018) in Table 7.
D E RRATUM
We found an error in reporting the zero-shot COCO evaluations in the ﬁrst version of this paper.
This mistake does NOT affect all other results and the numbers have been updated.
Meanwhile, we also added few-shot results in addition to zero-shot results on both MsCOCO and NoCaps in Table 2, to provide a more comprehensive view of capacities in SimVLM models.
Hence, our main claims and conclusions still hold.