April 16, 2021
A method for creating a vision-and-language (V&L) model is to extend a language model through structural modifications and V&L pre-training. Such an extension aims to make a V&L model inherit the capability of natural language understanding (NLU) from the original language model. To see how well this is achieved, we propose to evaluate V&L models using an NLU benchmark (GLUE). We compare five V&L models, including single-stream and dual-stream models, trained with the same pre-training. Dual-stream models, with their higher modality independence achieved by approximately doubling the number of parameters, are expected to preserve the NLU capability better. Our main finding is that the dual-stream scores are not much different than the single-stream scores, contrary to expectation. Further analysis shows that pre-training causes the performance drop in NLU tasks with few exceptions. These results suggest that adopting a single-stream structure and devising the pre-training could be an effective method for improving the maintenance of language knowledge in V&L extensions.
Pre-trained vision-and-language (V&L) models improve the performance of tasks that require an understanding of the V&L grounding, including visual question answering [1], referring expression comprehension [2], and image-text matching (ITM) [3]. Recent V&L tasks, such as multi-modal reading comprehension [4]–[7] and dialogue [8]–[10], require a deeper NLU as well as the grounding. Extending pre-trained language models (LMs) is an option for those tasks as this allows V&L models to inherit language knowledge from their source LMs. The typical extending consists of visual pre-training and structure such as the stream type; the single-stream inserts vision tokens into the input sequence of the LM, and the dual-stream uses another sequence for early visual encoding.
One of the remaining challenges is to understand how such extensions affect the pre-trained language knowledge. For example, [11] proposed the dual-stream model where part of the goal was to protect the learned LMs. The authors focused on evaluation with V&L tasks and did not evaluate their models with language-only tasks. [12] evaluated the extent of language knowledge loss in the single/dual-stream models against the source LM using language-only tasks. However, the difference between single-stream and dual-stream models was unclear because the pre-training was also different in their models.
In this paper, we investigate the effect of visual extensions in V&L models on language-only tasks1. [13] proposed a framework to unify transformer-based V&L models and compared some single/dual-stream models in the same setup. Based on their work, our study shows how these structural differences affect the performance of NLU using the GLUE [14] tasks.
In our experiments, fine-tuning of pre-trained V&L models shows that both single/dual-stream models perform worse than the source LM and that single-stream models perform slightly better than dual-stream models. Further, we fine-tune the models created by only structural modifications without pre-training. We observe that the single/dual modification alone has little effect on the GLUE scores, indicating the performance degradation is primarily caused by pre-training. We also see how the V&L models changed from the source LM by analyzing the changes in the model parameters and the problem sets that each model can solve. Our results suggest that it would be more effective to adopt a single stream, and devise pre-training strategies for maintaining language knowledge.
| Structure | Abbreviation in this paper | Stream | #param | Location format | Global image feat. | Vision type ID | Original paper |
|---|---|---|---|---|---|---|---|
| VisualBERT\(_{\rm CTRL}\) | VIS\(_{\rm CTRL}\) | Single | 112M | not used | head | from BERT | [15] |
| Uniter\(_{\rm CTRL}\) | UNI\(_{\rm CTRL}\) | 112M | LTRBA | head | from BERT | [16] | |
| VL-BERT\(_{\rm CTRL}\) | VL\(_{\rm CTRL}\) | 114M | LTRBA | head + added to each word | extended | [17] | |
| ViLBERT\(_{\rm CTRL}\) | VIL\(_{\rm CTRL}\) | 240M | LTRBA | head | not used | [11] | |
| LXMERT\(_{\rm CTRL}\) | LX\(_{\rm CTRL}\) | 209M | LTRBA | head | not used | [18] |
In this section, we describe the pre-trained V&L models used in our experiments. [13] proposed a framework for V&L models that consider a sequence of tokens in sentences as language information, and a sequence of recognized object regions as visual information. In their framework, they reproduced five existing models, VisualBERT [15], Uniter [16], VL-BERT [17], ViLBERT [11], and LXMERT [18], and made their controlled versions by modifying some parts for a fairer and easier comparison. We use these controlled versions.
We describe streams and embeddings, which are the basic factors of the model structures. We summarize the model structures in the controlled setup used in this experiment in Table 1.
V&L models can be divided into two categories based on how the vision and language sequences are encoded. Single-stream models, VisualBERT, Uniter, and VL-BERT, jointly process the vision and language sequences in a single encoder. Dual-stream models, ViLBERT and LXMERT, encode those sequences separately before encoding them jointly. ViLBERT is an early example of the dual-stream models and was proposed mainly to account for the differences in abstraction levels between vision and language, and to protect learned language models. In the controlled setup of [13], the stream type is identical to the original one in all models.
The major difference in embeddings is the use of global visual feature. The original VisualBERT, Uniter, and LXMERT do not use the global visual feature. ViLBERT has a token that represents the global visual feature at the beginning of vision sequences. VL-BERT inserts the global visual feature to the last of vision sequences and also adds the global visual feature to each token embedding in the language sequence. Object location is also expressed differently. The original VL-BERT and LXMERT use four attributes (left, top, right, bottom). In addition to the four attributes, the original ViLBERT uses area, and the original Uniter uses width, height, and area. VisualBERT does not use location information2.
The controlled setup is based on the structure of ViLBERT. For the global image feature, the setup inserts the average of vision tokens to the head of the vision sequence for all models. In addition to inserting the global visual feature, the controlled VL-BERT adds it to the respective tokens in the language sequence. For location, VisualBERT’s setup that do not use location information remain the same, while the other models use the five attributes. The five attributes are normalized by width or height. Another point is the token type for the vision tokens. In the controlled setup, the token type is not added for ViLBERT and LXMERT because they have separate streams. Of the single-stream models, VisualBERT and Uniter use BERT’s token type ID to specify vision tokens, while VL-BERT adds a new embedding to represent vision tokens.
We summarize the pre-training used in the controlled setup to train the five model structures described above. Note that we omit the detail of the pre-training used in each original paper here.
The five models were pre-trained on Google’s Conceptual Captions [19] corpus, which was collected from Web images and their alt-text HTML attributes. The corpus was filtered before training, and the size was approximately 2.7 M pairs as a result. Three tasks, masked language modelling (MLM), masked object classification (MOC), and ITM, were made from image-text pairs in the corpus. Given an image-text pair, the model predicts masked language tokens for MLM, the object class of masked vision tokens for MOC, and whether the pair is correct or not for ITM.
The weights of the five models were initialized with the pre-trained weights of BERT\(_{\rm BASE}\) if the corresponding weights were in BERT\(_{\rm BASE}\); otherwise (e.g., the weights of the vision encoder in dual-stream models), they were initialized randomly.
The GLUE benchmark [14] is a collection of diverse tasks for studying NLU systems. It consists of nine tasks: CoLA [20], SST-2 [21], MRPC [22], QQP3, STS-B [23], MNLI [24], QNLI [25], RTE [26]–[29], and WNLI [30]. STS-B is a single-valued regression task, and the others are classification tasks. We train the controlled pre-trained models on the training sets and evaluate them with the development sets. Figure 1 (left) shows the number of the training sentences in the corpora and their word overlap between the corpus used in the V&L pre-training.
We fine-tuned pre-trained models published by [13] 4. To use a script for the GLUE benchmark, we modified the model codes for Huggingface’s Transformers [31]5. We used the BERT-uncased tokenizer to tokenize sentences.
Because the GLUE tasks have no image input, we used a black image (of \(224 \times 224\) pixels) in our experiments. We followed the method of [13] for image processing; we input the images to the Faster R-CNN object detector [32] trained for the Bottom-Up and Top-Down model [33], and used the top 36 detected results (bounding boxes and feature vectors) as vision tokens6. We used the average of the vision tokens as a global visual token. Those vision tokens were fixed and used for both training and evaluation in all models.
In this study, we tried image completion with black images for tasks where no image is provided as a simple way to preserve the input format used in pre-training. However, there are many possible methods for complementing the image input. For example, a method as simple as the present one can use other images, a noise input, or learnable parameters. Examining the impact of image input completion methods remains as future work.
We adopted the method used in [13] for V&L tasks. We used a learnable linear layer to calculate the likelihood of document classes, such as entailment/neutral/contradiction. We input the element-wise product of two vectors made from the model’s output sequence into the linear layer. For those two vectors, we pooled the portions of the model’s output sequence that correspond to the vision input and to the language input, respectively, by taking the first token of each portion. This corresponds to taking the outputs of the [CLS] token (in the language sequence) and the global visual token.
We used a batch size of 64 and Adam for optimization. The learning rate was initialized at 2e-5 and decreased linearly. We trained for five epochs, evaluating the loss on the dev sets at the end of each epoch. Finally, we adopted the model with the lowest loss.
| GLUE (Language) | V&L | ||||||||||
| avg\(\uparrow\) (SD) | CoLA | SST-2 | MRPC | QQP | STS-B | MNLI | QNLI | RTE | WNLI | avg\(\uparrow\) | |
| BiLSTM | 66.7 | 17.6 | 87.5 | 77.9/85.1 | 85.3/82.0 | 71.6/72.0 | 66.7 | 77.0 | 58.5 | 56.3 | |
| BERT\(_{\rm BASE}\) | 77.3 (0.8) | 54.6 | 92.5 | 81.9/87.6 | 90.6/87.4 | 88.2/87.9 | 84.4 | 91.0 | 62.5 | 48.8 | |
| Model avg | 71.6 | 38.0 | 88.9 | 70.1/80.8 | 89.0/85.5 | 78.5/78.7 | 81.0 | 85.5 | 55.7 | 52.6 | 68.0 |
| VIS\(_{\rm CTRL}\) | 72.5 (1.2) | 38.6 | 89.4 | 71.9/82.1 | 89.4/86.0 | 81.8/81.7 | 81.8 | 87.0 | 56.6 | 53.1 | 69.2 |
| UNI\(_{\rm CTRL}\) | 71.4 (0.3) | 37.4 | 89.7 | 69.3/80.3 | 89.2/85.7 | 74.9/75.6 | 81.2 | 86.0 | 55.6 | 55.4 | 69.7 |
| VL\(_{\rm CTRL}\) | 72.4 (0.8) | 38.7 | 89.8 | 70.6/81.8 | 89.0/85.4 | 82.9/82.8 | 81.4 | 86.3 | 55.7 | 53.1 | 67.7 |
| VIL\(_{\rm CTRL}\) | 70.9 (0.8) | 36.1 | 90.4 | 69.0/79.4 | 88.6/85.0 | 77.7/78.0 | 80.1 | 83.8 | 53.7 | 55.4 | 69.8 |
| LX\(_{\rm CTRL}\) | 70.5 (0.2) | 39.0 | 90.2 | 69.8/80.4 | 89.0/85.4 | 75.3/75.3 | 80.7 | 84.2 | 57.2 | 46.0 | 63.6 |
Table 2 shows the results of the GLUE benchmark. In our experiment, we fine-tuned five V&L models and their source language model–BERT\(_{\rm BASE}\). We also cited the BiLSTM baseline from the GLUE paper. The Glue avg of five V&L models decrease compared to BERT\(_{\rm BASE}\). We can see a trend where the single-stream models perform slightly better than the dual-stream models. Note that this trend is consistent with the results of [12] for linguistic probing of the original Uniter and LXMERT. Although the difference is small, this suggests that the single-stream models can maintain more of BERT\(_{\rm BASE}\)’s knowledge.


Figure 1: Left: The number of training sentences vs. the Simpson coefficient between the GLUE and CC (training) corpora.Right: The correlation between the Simpson coefficient and the model score.The model scores were averaged over the five V&L models and normalized with BERT\(_{\rm BASE}\)’s score..
V&L models perform lower than the BiLSTM baseline for some tasks, including MRPC, RTE, and WNLI. Figure 1 (right) shows the correlation between the word overlap between the corpus for pre-training and the GLUE task corpora and the GLUE score. We can see a positive correlation between those two variables. Although we do not conclude clearly because word overlap and the number of training data also correlate, word overlap could have a large impact on task performance.
| weight | weight (LN) | bias | bias (LN) | |
|---|---|---|---|---|
| #layers | 75 | 25 | 72 | 25 |
| VIS\(_{\rm CTRL}\) | 0.9218 | 0.9999 | 0.9963 | 0.9973 |
| UNI\(_{\rm CTRL}\) | 0.9197 | 0.9999 | 0.9966 | 0.9971 |
| VL\(_{\rm CTRL}\) | 0.9193 | 0.9999 | 0.9964 | 0.9968 |
| VIL\(_{\rm CTRL}\) | 0.9218 | 0.9999 | 0.9934 | 0.9895 |
| LX\(_{\rm CTRL}\) | 0.9208 | 0.9998 | 0.9926 | 0.9935 |
We expected the model inference to be closer to BERT’s inference if a model has parameters closer to BERT. Therefore, we calculated the cosine similarity of the corresponding parameters between pre-trained models and BERT to indicate the degree to which the parameters had changed. Table 3 shows the averaged cosine similarity. We flattened parameters and calculated their similarity as vectors. We can see that the parameters of the single-stream and dual-stream models changed by the same extent. This suggests that separating streams alone may not be sufficient for knowledge maintenance.
| Successful models | ||||
| Both | BERT\(_{\rm BASE}\) | V&L | Neither | |
| VIS\(_{\rm CTRL}\) | 0.722 | 0.080 | 0.049 | 0.150 |
| UNI\(_{\rm CTRL}\) | 0.717 | 0.085 | 0.050 | 0.149 |
| VL\(_{\rm CTRL}\) | 0.700 | 0.102 | 0.053 | 0.146 |
| VIL\(_{\rm CTRL}\) | 0.710 | 0.091 | 0.049 | 0.150 |
| LX\(_{\rm CTRL}\) | 0.691 | 0.111 | 0.065 | 0.134 |
Table 4 shows the results of aggregating the GLUE classification task problems into four categories: solvable by both BERT\(_{\rm BASE}\) and V&L models, BERT\(_{\rm BASE}\) only, V&L model only, and neither model. We defined success in a given problem as answering correctly in at least two out of three experimental runs. To make Table 4, we first calculated the tables of successful models for each GLUE task and V&L model and second averaged the tables for the tasks. For all five models, there are approximately 5% of problems that they only can solve. This category shows the positive impact of V&L pre-training on NLU. Problems that both models can solve tended to be more common for the single-stream models. This supports the finding that these models retain more language knowledge.
The difference of corpora for the last pre-training between BERT (mainly English Wikipedia) and the V&L models (images’ alt-texts) might affect the complexity of the sentences in the problem sets that can be solved only by BERT and only by the V&L models. Thus, we analyzed the distributions of some metrics (sentence length, readability). However, we found no significant difference between the two sets in each model. We show the distributions in Appendix 8.
The last column of Table 2 shows the V&L scores for the V&L models. We calculated these scores by averaging the results on the five V&L tasks reported in [13]. Their tasks cover four groups widely used to test V&L models: VQA, image–text retrieval, referring expressions, and multi-modal verification. Comparing the V&L and GLUE scores, we cans see that no model is best in both respects at the same time. There is room for improvement in the V&L extension.
| Mod. only | Mod.+V&L PT | |
|---|---|---|
| VIS\(_{\rm CTRL}\) | 77.4 (1.00) | 72.5 (0.94) |
| UNI\(_{\rm CTRL}\) | 77.9 (1.01) | 71.4 (0.92) |
| VL\(_{\rm CTRL}\) | 39.5 (0.51) | 72.4 (0.94) |
| VIL\(_{\rm CTRL}\) | 75.6 (0.98) | 70.9 (0.92) |
| LX\(_{\rm CTRL}\) | 78.4 (1.01) | 70.5 (0.91) |
To further analyze the impact of structural modification, we fine-tuned models with only structural modifications (Mod. only). Table 5 shows a comparison between the GLUE scores of the Mod-only models and the full models (Mod+V&L-PT). Except for VL\(_{\rm CTRL}\), the Mod-only models achieve a score comparable to BERT\(_{\rm BASE}\), and the GLUE score decreases for the Mod+V&L-PT models. The fact that the structural modification preserves the score of the GLUE tasks in most cases suggests that the main factor for the drop in the GLUE tasks is V&L pre-training. This observation emphasizes the impact of pre-training on maintaining the language knowledge. Note that a possible reason for the exception of VL\(_{\rm CTRL}\) is that the global visual feature added to the language embeddings may break the language knowledge.
The number of V&L model works that focus on both V&L tasks and language-only tasks has increased [34]–[37]. [34] proposed a V&L neural architecture and trained it on a language model in a visual context. They demonstrated that their architecture outperforms its equivalent trained on language alone in perplexity and stated that language is inseparable from its physical context. Although it is not clear whether methods that improve the perplexity of language modeling can also apply to maintain the performance of downstream tasks, the strategy of improving models with reference to human cognition would be an important direction. More recently, [36] achieved better performance on language-only tasks than their base model with pre-training on three types of corpora (text, image, and image–text pairs) at the same time. [35] reported that adding separated extractors for vision and language on top of a single-stream encoder can help maintain language knowledge.
In this paper, we fine-tuned V&L models extended from a language model (LM) to an NLU benchmark to compare their NLU performance. We used five V&L models, including single-stream and dual-stream models, pre-trained in the same setup. The benchmark scores of those models decreased compared with their source LM. We also found that the single-stream models tended to retain (slightly) more language knowledge than the dual-stream models, and that the main cause of the drop in the NLU tasks can be pre-training. Our observations suggest that adopting a single stream and devising pre-training strategies could be effective, at least for preserving the language knowledge.
We would like to thank Takuma Udagawa, Taku Sakamoto, and the anonymous reviewers for their insightful comments. This work was supported by JSPS KAKENHI Grant Number 21H03502.
| Dataset | Task | Size | #vocab. | Word ov btw CC | |
|---|---|---|---|---|---|
| V&L pre-training | |||||
| CC | CAP | 2.8M | 48,360 | 1 | |
| CC (val) | CAP | 14K | 10,442 | 0.63 | |
| GLUE benchmark | |||||
| WNLI | NLI | 635 | 1.622 | 0.08 | |
| RTE | NLI | 2.5K | 23,341 | 0.24 | |
| MRPC | P/S | 3.7K | 13,926 | 0.26 | |
| STS-B | P/S | 5.7K | 16,436 | 0.25 | |
| CoLA | SS | 8.6K | 7,845 | 0.19 | |
| SST-2 | SS | 67K | 14,816 | 0.26 | |
| QNLI | NLI | 104K | 148,413 | 0.29 | |
| QQP | P/S | 364K | 193,041 | 0.28 | |
| MNLI | NLI | 393K | 167,790 | 0.34 | |
Table ¿tbl:table:overall46sd? shows the SDs to the averaged scores of V&L models on the GLUE tasks’ development sets.
l & avg& CoLA& SST-2 BERT\(_{\rm BASE}\)& 77.3 (0.8) & 54.6 (1.1) & 92.5 (0.1) VIS\(_{\rm
CTRL}\)& 72.5 (1.2) & 38.6 (7.3) & 89.4 (0.4) UNI\(_{\rm CTRL}\)& 71.4 (0.3) & 37.4 (6.5) & 89.7 (0.5) VL\(_{\rm CTRL}\)& 72.4 (0.8) & 38.7 (1.5) &
89.8 (0.9) VIL\(_{\rm CTRL}\)& 70.9 (0.8) & 36.1 (6.0) & 90.4 (0.5) LX\(_{\rm CTRL}\)& 70.5 (0.2) & 39.0 (6.1) & 90.2 (0.5)
& MRPC& QQP& STS-B BERT\(_{\rm BASE}\)& 81.9 / 87.6 (0.6) / (0.5) & 90.6 / 87.4 (0.0) / (0.1) & 88.2 / 87.9 (0.3) / (0.3) VIS\(_{\rm CTRL}\)& 71.9 / 82.1 (1.4) / (0.8) & 89.4 / 86.0 (0.1) / (0.1) & 81.8 / 81.7 (4.0) / (3.6) UNI\(_{\rm CTRL}\)& 74.9 / 75.6 (2.0) / (2.2) & 69.3 / 80.3 (0.8) / (0.7)
& 89.2 / 85.7 (0.1) / (0.1) VL\(_{\rm CTRL}\)& 70.6 / 81.8 (0.5) / (0.3) & 89.0 / 85.4 (0.3) / (0.4) & 82.9 / 82.8 (2.3) / (1.9) VIL\(_{\rm CTRL}\)& 69.0 / 79.4 (1.3) /
(2.1) & 88.6 / 85.0 (0.2) / (0.1) & 77.7 / 78.0 (1.2) / (0.9) LX\(_{\rm CTRL}\)& 69.8 / 80.4 (1.3) / (1.1) & 89.0 / 85.4 (0.1) / (0.2) & 75.3 / 75.3 (0.8) / (0.7)
& MNLI& QNLI& RTE& WNLI BERT\(_{\rm BASE}\)& 84.2 (0.1) & 91.0 (0.4) & 62.5 (1.5) & 48.8 (5.8) VIS\(_{\rm CTRL}\)& 81.6 (0.2) & 87.0 (1.1) & 56.6 (1.9) & 53.1 (4.6) UNI\(_{\rm CTRL}\)& 80.9 (0.4) & 86.0 (1.0) & 55.6 (2.4) & 55.4 (1.3) VL\(_{\rm CTRL}\)& 81.2 (0.2) & 86.3 (0.1) & 55.7 (1.4) & 53.1 (3.5) VIL\(_{\rm CTRL}\)& 79.9 (0.5) & 83.8 (0.6) & 53.7 (0.9) & 55.4 (1.8) LX\(_{\rm CTRL}\)& 80.4 (0.2) & 84.2 (0.2) & 57.2 (3.4) & 46.0 (9.2)
We show the distributions of sentence length and readability mentioned in Section 4.2 in Figure 2 and Figure 3, respectively.
The source code for our experiments is available at https://github.com/Alab-NII/eval_vl_glue↩︎
If alignments between words and regions are provided, VisualBERT adds the same position embeddings to matched word and region tokens instead.↩︎
We checked that our implementation reproduced original results with a V&L task, NLVR\(^2\) [3].↩︎
Although the image was monochromatic black, 36 bounding boxes with different features were detected.↩︎