ZHANGYUXUAN-zR commited on
Commit
7e4ada5
·
verified ·
1 Parent(s): c089b0a

Add files using upload-large-folder tool

Browse files
parse/dev/83LJRUzXWj/83LJRUzXWj.md ADDED
@@ -0,0 +1,355 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Convolutions Die Hard: Open-Vocabulary Segmentation with Single Frozen Convolutional CLIP
2
+
3
+ Qihang $\mathbf { V } \mathbf { u } ^ { 1 }$ , $\mathbf { J u H e } ^ { 2 }$ , Xueqing Deng1, Xiaohui Shen1, Liang-Chieh Chen1 1 ByteDance 2 The Johns Hopkins University
4
+
5
+ # Abstract
6
+
7
+ Open-vocabulary segmentation is a challenging task requiring segmenting and recognizing objects from an open set of categories in diverse environments. One way to address this challenge is to leverage multi-modal models, such as CLIP, to provide image and text features in a shared embedding space, which effectively bridges the gap between closed-vocabulary and open-vocabulary recognition. Hence, existing methods often adopt a two-stage framework to tackle the problem, where the inputs first go through a mask generator and then through the CLIP model along with the predicted masks. This process involves extracting features from raw images multiple times, which can be ineffective and inefficient. By contrast, we propose to build everything into a single-stage framework using a shared Frozen Convolutional CLIP backbone, which not only significantly simplifies the current two-stage pipeline, but also remarkably yields a better accuracy-cost trade-off. The resulting single-stage system, called FC-CLIP, benefits from the following observations: the frozen CLIP backbone maintains the ability of open-vocabulary classification and can also serve as a strong mask generator, and the convolutional CLIP generalizes well to a larger input resolution than the one used during contrastive image-text pretraining. Surprisingly, FC-CLIP advances state-of-the-art results on various benchmarks, while running practically fast. Specifically, when training on COCO panoptic data only and testing in a zero-shot manner, FC-CLIP achieve 26.8 PQ, 16.8 AP, and 34.1 mIoU on ADE20K, 18.2 PQ, 27.9 mIoU on Mapillary Vistas, 44.0 PQ, 26.8 AP, 56.2 mIoU on Cityscapes, outperforming the prior art under the same setting by $+ 4 . 2$ PQ, $+ 2 . 4$ AP, $+ 4 . 2$ mIoU on ADE20K, $+ 4 . 0$ PQ on Mapillary Vistas and $+ 2 0 . 1$ PQ on Cityscapes, respectively. Additionally, the training and testing time of FC-CLIP is $7 . 5 \times$ and $6 . 6 \times$ significantly faster than the same prior art, while using $5 . 9 \times$ fewer total model parameters. Meanwhile, FC-CLIP also sets a new state-of-the-art performance across various open-vocabulary semantic segmentation datasets. Code and models are available at https://github.com/bytedance/fc-clip.
8
+
9
+ # 1 Introduction
10
+
11
+ Panoptic segmentation [44] is a complex computer vision task that aims to predict a set of nonoverlapping masks, each with its corresponding class label. It combines the tasks of semantic segmentation [37] and instance segmentation [34], making it a challenging problem to solve. Many methods [43, 87, 18, 83, 51, 93, 20, 94, 53] have been proposed to tackle this problem, and a significant progress has been made in terms of panoptic quality (PQ). However, due to the high cost of annotating such a fine-grained dataset [54, 22], the number of semantic classes is typically limited to a few dozens or hundreds. This restriction hinders the further application of existing approaches to real-world settings, where the number of possible semantic classes is unlimited.
12
+
13
+ ![](images/421dc1efec208feccec5a8ed08ca72dba279c8c5a4e7d13967936f14f48ba000.jpg)
14
+ Figure 1: $k$ -means visualization on top of frozen CLIP backbone features w.r.t. different input resolutions. Both ViT-based and CNN-based CLIP produces semantic-meaningful features. However, when scaling up the input resolutions, we note that ViT-based CLIP features turn noisier, while CNN-based ones are smoother and generalize better. The smoother feature map is preferable for mask-pooling modules in our design.
15
+
16
+ To overcome the limitations of closed-vocabulary segmentation, open-vocabulary segmentation [48, 90, 29, 25] has been proposed. These approaches uses text embeddings of category names [97], represented in natural language, as label embeddings, instead of learning them from the training dataset. By doing so, models can classify objects from a wider vocabulary, which improves their ability to handle a broader range of categories. To ensure that meaningful embeddings are provided, a pretrained text encoder [23, 70, 57, 69] is typically used. This encoder can effectively capture the semantic meaning of words and phrases, which is critical for open-vocabulary segmentation.
17
+
18
+ Multi-modal models, such as CLIP [69] and ALIGN [40], have shown promise for open-vocabulary segmentation due to their ability to learn aligned image-text feature representations from large-scale Internet data [74]. SimBaseline [90] and OVSeg [52] are two recent methods that use a two-stage framework to adapt CLIP for open-vocabulary segmentation. In these methods, images are first processed by a heavy mask generator [36, 20] to obtain mask proposals, and then each masked image crop is generated and fed into a frozen CLIP model for classification. MaskCLIP [25] extends this approach to open-vocabulary panoptic segmentation, but additionally leverages mask proposals as attention masks in the CLIP backbone to efficiently avoid multiple forwarding processes for the masked crops. More recently, ODISE [89] employs a stable diffusion UNet [72, 71] as a frozen backbone for mask generator, which significantly boosts the state-of-the-art performance. However, despite these advances, they still rely on a two-stage framework, where the mask generator and CLIP classifier extract features from raw images separately, resulting in inefficiency and ineffectiveness.
19
+
20
+ A natural question thus arises as to whether it is possible to unify the mask generator and CLIP classifier into a single-stage framework for open-vocabulary segmentation. Sharing the feature extractor between them is a straightforward solution, but it poses two challenges. First, fine-tuning CLIP backbone can disrupt the alignment between image and text features, resulting in a much worse performance on out-of-vocabulary categories. Existing methods [90, 52, 25, 89] rely on another separate backbone for mask generator, increasing model size and computational costs. Second, CLIP models are typically pretrained on relatively lower-resolution inputs, while dense prediction tasks require a much higher resolution for optimal performance. This makes it difficult to directly apply CLIP-pretrained backbones to downstream dense prediction tasks, particularly ViT-based CLIP models [26], where careful treatments are required (e.g., side adapter [17, 91], or cost aggregation [101, 21]). Consequently, existing methods [25, 89] perform mask segmentation and CLIP classification at different input scales, leading to sub-optimal performance.
21
+
22
+ To alleviate the two challenges, we propose to build both mask generator and CLIP classifier on top of a shared Frozen Convolutional CLIP backbone, resulting in a single-stage framework FC-CLIP. Its design is based on the following observations. The frozen CLIP backbone ensures that the pretrained image-text feature alignment is intact, allowing out-of-vocabulary classification. It can also serve as a strong mask generator by appending a lightweight pixel decoder and mask decoder [20, 94]. The convolutional CLIP, based on a Convolutional Neural Network (CNN) [47], empirically shows a better generalization ability compared to ViT-based CLIP [26], when the input size scales up. This echoes the success of fully convolutional networks [60] in dense prediction tasks. Both observations are critical for developing a single-stage framework, but they have been overlooked and undiscovered by existing two-stage pipelines [25, 89]. In Fig. 1, we visualize the learned visual representation of ViT-based and CNN-based CLIP via $k$ -means clustering [59]. As shown in the figure, the features learned by CNN-based CLIP are more robust across different input sizes.
23
+
24
+ Surprisingly, the adoption of a single frozen convolutional CLIP as the shared feature extractor results in an extremely simple yet effective design. Specifically, the single-stage FC-CLIP consists of three modules built upon a shared frozen convolutional CLIP backbone: a class-agnostic mask generator, an in-vocabulary classifier, and an out-of-vocabulary classifier (see Fig. 2 for comparison between pipelines). The proposed method not only enjoys a simple design, but also comes with a very low cost for both training and testing. As a comparison, our model has only 238M frozen parameters and 21M trainable parameters, against the state-of-the-art work ODISE [89] that has 1494M frozen and 28M trainable parameters. Furthermore, our model training only takes 25.6 V100 GPU days, which is $7 . 5 \times$ faster compared to ODISE’s 192 V100 GPU days. During inference, our model also runs $6 . 6 \times$ faster. Although FC-CLIP enjoys a simple design, it still outperforms previous methods across multiple datasets. Trained on COCO panoptic dataset only, FC-CLIP surpasses prior state-of-the-art ODISE [89] significantly in a zero-shot manner. Specifically, FC-CLIP achieves 26.8 PQ $( + 3 . 4 )$ , 18.2 PQ $( + 4 . 0 ) $ , and 44.0 PQ $( + 2 0 . 1 )$ on ADE20K, Mapillary Vistas, and Cityscapes, respectively.
25
+
26
+ As panoptic segmentation unifies semantic and instance segmentation, FC-CLIP naturally extends to open-vocabulary semantic and instance segmentation. With the same model trained on COCO panoptic data only (i.e., no task-specific fine-tuning), FC-CLIP achieves state-of-the-art performance on open-vocabulary instance and semantic segmentation. Specifically, FC-CLIP achieves $1 6 . 8 \mathrm { A P }$ on ADE20K, surpassing the state-of-art ODISE [89] by $+ 2 . 4$ . FC-CLIP also outperforms the state-of-art specialized open-vocabulary semantic segmentation model SAN [91] by $+ 1 . 1$ and $+ 1 . 1$ mIoU on the challenging ADE20K-847 (A-847) and PASCAL-Context-459 (PC-459) benchmarks, respectively.
27
+
28
+ In summary, through the lens of a careful re-design of existing two-stage open-vocabulary segmentation models, we establish a simple, strong, and fast baseline for the community. The proposed FC-CLIP adopts a single-stage framework by exploiting a shared frozen convolutional CLIP, which not only advances the state-of-the-art performances on multiple benchmarks, but also enjoys a practically fast training and inference speed. We hope our study will inspire future research on efficient single-stage open-vocabulary segmentation models.
29
+
30
+ # 2 Related Work
31
+
32
+ Vision-language models target at encoding vision and language jointly in a fusion model. Early works [78, 16, 98] extract visual representations by pretrained object detectors and fine-tune on downstream tasks with language supervision. Recently, with the breakthrough of large language models [23, 3], rapid progress has been made in this field. CLIP [69] and ALIGN [40] demonstrate that pretraining dual-encoder models with contrastive objectives on large-scale noisy image-text pairs can learn representation with cross-modal alignment ability and show strong performance in zero-shot downstream tasks. The following works [95, 1, 92] further confirm these points and achieve impressive results in zero-shot transfer learning such as open-vocabulary image recognition.
33
+
34
+ Closed-vocabulary segmentation can be divided into three types according to the semantics of the grouping pixels, i.e. semantic, instance and panoptic segmentation. Semantic segmentation interprets high-level category semantic concepts. Prior works [9, 72, 10, 11, 13, 28, 96, 86, 99, 30] mainly treat this task as a per-pixel classification problem and build their models on top of the idea of FCN [60]. Instance segmentation groups foreground pixels into different object instances. Starting from Mask RCNN [36], prior works [42, 56, 12, 6, 2, 8, 80, 84, 66] mainly address this task with mask classification, where a set of bounding boxes and binary masks are predicted. Panoptic segmentation seeks for holistic scene understanding including both stuff and things. The pioneering work [44] and prevalent ones [55, 43, 87, 18, 50, 82, 14, 67] decompose the problem into various proxy tasks and merge the results in the end. Recently, following DETR [7], most works [83, 76, 19, 20, 51, 93, 94, 39, 49, 77] present end-to-end solutions based on the idea of mask classification. Standing on their shoulders, our proposed method builds on top of the pixel decoder and mask decoder of Mask2Former [20] by additionally exploiting the open-vocabulary recognition ability from CLIP [69].
35
+
36
+ ![](images/145e50b35132b4f6bbd418a7573e6d7f442c94af26cb54a19820007c343c33db.jpg)
37
+ Figure 2: Comparisons between open-vocabulary panoptic segmentation pipelines. Left: Existing methods [25, 89] adopt a two-stage pipeline, where the first stage employs a high-resolution image to generate class-agnostic masks, and the second stage feeds both the low-resolution image and predicted masks to a frozen CLIP backbone for open-vocabulary recognition. This incurs heavy computation, as image features are extracted multiple times. Middle: A naïve single-stage framework builds everything together and fine-tunes the CLIP backbone, breaking the pretrained alignment between images and texts. Right: Our single-stage framework FC-CLIP employs a shared frozen convolutional CLIP, where "frozen CLIP" maintains the open-vocabulary recognition and can serve as a strong mask generator, and "convolutional CLIP" generalizes well to large input sizes. Note that the predicted masks are used for CLIP recognition in all three schemes (not shown for simplicity).
38
+
39
+ Open-vocabulary segmentation aims at segmenting arbitrary classes including those that can not be accessed during the training procedure. Priors works [48, 29, 90, 52, 24, 88, 101, 91, 104, 62, 102, 32] perform open-vocabulary semantic segmentation through leveraging large pretrained vision-language models [69, 40, 71]. Recently, MaskCLIP [25] presents a two-stage pipeline, which consists of a class-agnostic mask generator and a frozen CLIP [69] encoder for cross-modal alignment, and thus expands the scope of the CLIP models into open-vocabulary panoptic segmentation. ODISE [89] digs out the innate potential of pretrained text-image diffusion models [71] in terms of the ability to present open concepts in the representation space for performing strong open-vocabulary panoptic segmentation. FreeSeg [68] encodes multi-granularity concepts into a compact textural abstraction, enabling generalizability to arbitrary text description. Unlike those methods, we propose a singlestage framework by exploiting a single frozen convolutional CLIP backbone, resulting in a simpler, faster, and stronger model than existing works.
40
+
41
+ We also note that the pioneering work F-VLM [46] builds an open-vocabulary detection framework on top of a frozen CLIP backbone. However, FC-CLIP differs from it with a totally different observation and motivation. Specifically, our work was initially motivated by the state-of-art open-vocabulary segmentation model ODISE [89], which found that the CLIP backbone extracts noisier features than diffusion models (Figure B. 1. in [89]), leading to inferior segmentation results (which justifies their adoption of diffusion models). Their observation motivated us to look deeply into the problem. Interestingly, our discoveries show that both ViT-based (used by ODISE [89]) and CNN-based CLIP can produce semantic-meaningful features. However, when scaling up the input resolutions, we discover that ViT-based CLIP features turn noisier, while CNN-based ones are smoother and generalize better across input sizes. F-VLM [46] also empirically found that a frozen CLIP can provide meaningful features for object detection. However, they did not choose CNN-based CLIP on purpose and thus did not compare carefully between ViT-based and CNN-based CLIP backbones. On the other hand, in our paper, we have provided careful ablation studies on ViT-based and CNNbased CLIP, where we observe that even though both ViT-based and CNN-based CLIP initially have comparable performance at resolution 224, CNN-based CLIP shows better and more robust performance when input resolution scales up.
42
+
43
+ ![](images/4bc84f63ef1e86053e84eacd0a6406a0b8cf125a36e19bd9f9f34ee8ca8d3001.jpg)
44
+ Figure 3: Overview of FC-CLIP, which contains three main components: mask generator, an in-vocabulary (in-vocab) classifier, and an out-of-vocabulary (out-vocab) classifier. All components build on top of a shared frozen covolutional CLIP backbone. The pixel decoder and mask decoder follow the design of Mask2Former, and generate class-agnostic masks. The in-vocabulary classifier yields the class embeddings by mask-pooling over final pixel features from pixel decoder. During testing, FC-CLIP additionally exploits the out-of-vocabulary classifier by mask-pooling over frozen CLIP backbone features, and the final class prediction is obtained by geometric ensembling both classifiers. Note that the text embeddings are obtained by feeding category names into a CLIP text encoder, which are done beforehand and cached in memory, thus causing no additional costs. Also, the class-agnostic mask proposals are fed to the mask pooling modules (not shown for simplicity).
45
+
46
+ # 3 Method
47
+
48
+ In this section, we first define the problem of open-vocabulary segmentation. We then introduce the existing two-stage pipeline, followed by our proposed single-stage framework FC-CLIP.
49
+
50
+ Problem Definition Open-vocabulary segmentation aims to segment the image $\mathbf { I } \in \mathbb { R } ^ { H \times W \times 3 }$ into a set of masks with associated semantic labels:
51
+
52
+ $$
53
+ \{ y _ { i } \} _ { i = 1 } ^ { K } = \{ ( m _ { i } , c _ { i } ) \} _ { i = 1 } ^ { K } .
54
+ $$
55
+
56
+ The K ground truth masks mi ∈ {0, 1}H×W contain the corresponding ground truth class label $c _ { i }$ . During training, a fixed set of class labels $C _ { t r a i n }$ is used, while during inference, another set of categories $C _ { t e s t }$ is used. In the open-vocabulary setting, $C _ { t e s t }$ may contain novel categories unseen during training, i.e., $C _ { t r a i n } \neq C _ { t e s t }$ . We follow previous works [25, 89] and assume the availability of the category names of $C _ { t e s t }$ (represented in natural language) during testing.
57
+
58
+ Two-Stage Open-Vocabulary Segmentation Existing works [90, 52, 25, 89] adopt a two-stage pipeline for open-vocabulary segmentation. The first stage contains a class-agnostic mask generator $\mathcal { M }$ with parameters $\theta _ { \mathcal { M } }$ that generates a set of $N$ mask proposals $\{ \hat { m } _ { i } \} _ { i = 1 } ^ { N } \stackrel { \smile } { \in } \mathbb { R } ^ { N \times H \times W }$ , given the input image $\mathbf { I }$ :
59
+
60
+ $$
61
+ \{ \hat { m } _ { i } \} _ { i = 1 } ^ { N } = \mathcal { M } ( \mathbf { I } ; \boldsymbol { \theta } _ { \mathcal { M } } ) .
62
+ $$
63
+
64
+ In the second stage, a CLIP adapter $\mathcal { P }$ takes both image $\mathbf { I }$ and mask proposals $\{ \hat { m } _ { i } \} _ { i = 1 } ^ { N }$ as inputs, where the latter input is used to guide the frozen CLIP model $C L I P ^ { * }$ ( $^ *$ denotes frozen). The adapter performs mask classification through forwarding processes with either masked crops [90, 52] or masked attention [25, 89]:
65
+
66
+ $$
67
+ \{ \hat { c } _ { i } \} _ { i = 1 } ^ { N } = \mathcal { P } ( \mathbf { I } , \{ \hat { m } _ { i } \} _ { i = 1 } ^ { N } ; C L I P ^ { * } ) ,
68
+ $$
69
+
70
+ where $\{ \hat { c } _ { i } \} _ { i = 1 } ^ { N } \in \mathbb { R } ^ { N \times | C | }$ refers to the predicted class probabilities for the $N$ predicted masks, $C \in \{ C _ { t r a i n } , C _ { t e s t } \}$ depending on training or testing phase, and $| C |$ is the category size.
71
+
72
+ Although this framework has achieved impressive open-vocabulary segmentation performance, it has two limitations. First, the image features are extracted twice, once for mask generation and the other for mask classification. The double feature extractions incur heavy computation, making it costly to scale up backbone parameters. Second, the mask generator often requires high-resolution inputs (e.g., $1 0 2 4 \times 1 0 2 4 )$ , whereas the CLIP model is usually pretrained with lower-resolution images (e.g.,
73
+
74
+ $2 2 4 \times 2 2 4 )$ . The two-stage pipeline thus needs to feed high-resolution images into the mask generator and low-resolution images into the CLIP classifier, making the model inefficient.
75
+
76
+ Naïve Single-Stage Open-Vocabulary Segmentation To avoid increasing the model size and computational cost of duplicate feature extractions, one may naïvely formulate everything together into a single-stage framework $\mathcal { F }$ , where both mask generator and mask classifier share the same CLIP-pretrained backbone $C L I P$ (not frozen) for extracting features from an input image I:
77
+
78
+ $$
79
+ \{ \hat { m } _ { i } , \hat { c } _ { i } \} _ { i = 1 } ^ { N } = \mathcal { F } ( \mathbf { I } ; C L I P , \theta _ { M } ) .
80
+ $$
81
+
82
+ However, we empirically discover that fine-tuning this naïve single-stage framework causes a misalignment between image and text features in the pretrained CLIP model, leading to sub-optimal performance, especially for novel unseen classes. It also increases the training costs by $2 . 1 \times$ to 52.8 GPU days. Interestingly, our experiments also show that a frozen CLIP backbone can provide sufficient features for mask generation, while preserving the image-text aligned representation. Nevertheless, we still face another challenge, where CLIP models are usually pretrained on lowresolution images (e.g., $2 2 4 \times 2 2 4 )$ ), whereas segmentation models prefer higher-resolution inputs (e.g., $8 0 0 \times 1 3 3 3$ for COCO, or $1 0 2 4 \times 2 0 4 8$ for Cityscapes). This discrepancy results in the significant performance degradation, when applying a frozen CLIP on large input images. Digging into the details, we found that it is related to the popular ViT [26] backbone used in CLIP that does not transfer well to different input sizes, which could be alleviated by extra careful designs (e.g., side adapter [17, 91], or cost aggregation [101, 21]). On the other hand, CNN-based CLIP models (such as ResNet [35] and ConvNeXt [58]) exhibit better generalization ability to different input sizes, due to their fully convolutional nature [60]. Additionally, the CNN-based CLIP backbone, extracting multi-scale feature maps, can be used as a simple plug-in module into modern closed-vocabulary segmentation models [20, 94]. Motivated by the observations, we thus propose FC-CLIP, a simple yet effective single-stage open-vocabulary segmentation framework built entirely on a single frozen convolutional CLIP backbone $C L I P _ { C N N } ^ { * }$ :
83
+
84
+ $$
85
+ \{ \hat { m } _ { i } , \hat { c } _ { i } \} _ { i = 1 } ^ { N } = \mathcal { F } ( \mathbf { I } ; C L I P _ { C N N } ^ { * } , \boldsymbol { \theta } _ { M } ) .
86
+ $$
87
+
88
+ FC-CLIP The proposed FC-CLIP leverages the semantic features of a frozen CNN-based CLIP backbone for both mask generation and CLIP classification. Unlike previous works [90, 52, 25, 89], which often train a separate mask generator and ignore the potential reuse of CLIP’s semantic features, we incorporate the CNN-based CLIP backbone into the state-of-the-art segmentation method Mask2Former [20]. We note that FC-CLIP is a general meta-architecture that can build on top of several modern segmentation methods [20, 94]. Our approach offers several advantages. By freezing and sharing the backbone features, our model is significantly more efficient during both training and testing (i.e., avoiding feature duplication). The CNN-based CLIP backbone not only transfers well to different input resolutions (from its pretrained image size), but also generates multi-scale feature maps, seamlessly compatible with modern segmentation methods [20, 94]. At a high level, FC-CLIP consists of three components: class-agnostic mask generator, in-vocabulary classifier, and out-of-vocabulary classifier. We detail each component below.
89
+
90
+ Class-Agnostic Mask Generator Following Mask2Former [20], we use a pixel decoder enhanced with multi-scale deformable attention [103] to improve the features extracted from the frozen CNNbased CLIP backbone. The enhanced pixel features, together with a set of object queries [7, 83], are then passed through a series of mask decoders, where each consists of masked cross-attention [20], self-attention [81], and a feed-forward network. The resulting segmentation logits are obtained by performing a matrix multiplication between the object query and pixel features. The predicted masks are matched with ground-truth masks in a one-to-one manner through Hungarian matching [45] and are supervised accordingly. Moreover, as the number of object queries is often greater than the number of labeled masks, only a subset of predicted masks are optimized through this matching process. We apply no penalty to the remaining unmatched proposals, which ensures that more mask proposals are obtained.
91
+
92
+ In-Vocabulary Classifier Once the mask proposals are predicted, they are classified with category text embedding in a contrastive manner, where the class embeddings for each mask and category text embeddings are projected into a common embedding space. That is, the predicted class probability by in-vocabulary classifier is defined as follows: $\forall i = 1 , \ldots , N$
93
+
94
+ $$
95
+ \hat { c } _ { i , i n } = s o f t m a x ( \frac { 1 } { T } \left[ c o s ( { \bf v } _ { i } , { \bf t } _ { 1 } ) , c o s ( { \bf v } _ { i } , { \bf t } _ { 2 } ) , \cdots , c o s ( { \bf v } _ { i } , { \bf t } _ { | C | } ) \right] ) ,
96
+ $$
97
+
98
+ where $T$ is a learnable temperature parameter with initialization of 0.07 to control the sharpness of the distribution, cos is cosine distance measurement, $\mathbf { v } _ { i }$ is the class embeddings for $i$ -th predicted mask, which is obtained by mask pooling over the final pixel features from pixel decoder, similar to [29]. $\mathbf { t } _ { j }$ is the category name’s text embeddings of class $j$ , which is obtained by feeding the category name to a CLIP-pretrained text encoder. Note that these category text embeddings only need to be generated once. They are then kept in memory to serve as text classifiers, and thus it incurs negligible additional cost during training. This forms our in-vocabulary classifier.
99
+
100
+ Out-of-Vocabulary Classifier During inference, however, we notice that using the in-vocabulary classifier alone fails to generalize to completely novel unseen classes, as the model is only trained on a finite set of categories and thus could not recognize diverse novel concepts. To address this issue, we introduce an out-of-vocabulary classifier, which applies mask pooling to the frozen CLIP backbone features, aiming to borrow the pretrained (intact) open-vocabulary recognition ability from CLIP. Unlike the other two-stage methods [90, 52, 25, 89], where one or multiple forward processes of CLIP are needed, the adopted out-of-vocabulary classifier introduces marginal additional costs, since the backbone features are already extracted (and only lightweight mask-pooling is performed). The predicted class probability by out-of-vocabulary classifier $\hat { c } _ { i , o u t }$ is then obtained in a manner similar to Eq. (6) by replacing $\mathbf { v } _ { i }$ with the mask-pooled features over frozen CLIP backbone features. This classifier strictly maintains the original CLIP feature distribution, allowing us to better recognize brand new categories. Note that the out-of-vocabulary classifier is only performed during testing.
101
+
102
+ Combining In- and Out-of-Vocabulary Classifiers Following prior works [31, 29, 46, 89], we employ geometric ensemble to fuse the classification scores between in-vocabulary and out-ofvocabulary classifiers. That is, $\forall j = 1 , \ldots , | C |$
103
+
104
+ $$
105
+ \hat { c } _ { i } ( j ) = \left\{ \begin{array} { l l } { ( \hat { c } _ { i , i n } ( j ) ) ^ { ( 1 - \alpha ) } \cdot ( \hat { c } _ { i , o u t } ( j ) ) ^ { \alpha } , } & { \mathrm { i f ~ } j \in C _ { t r a i n } } \\ { ( \hat { c } _ { i , i n } ( j ) ) ^ { ( 1 - \beta ) } \cdot ( \hat { c } _ { i , o u t } ( j ) ) ^ { \beta } , } & { \mathrm { o t h e r w i s e } } \end{array} \right.
106
+ $$
107
+
108
+ where $\hat { c } _ { i } ( j )$ denotes the $j$ -th element of $\hat { c } _ { i }$ , and the underscripts $_ { i n }$ and out refer to in-vocabulary and out-of-vocabulary classifier, respectively. $\alpha , \beta \in [ 0 , 1 ]$ balance the predictions between in- and out-of-vocabulary classifiers for seen and novel unseen categories.
109
+
110
+ # 4 Experimental Results
111
+
112
+ Herein, we provide implementation details of FC-CLIP in Sec. 4.1. After setting the stage, we introduce our main results, compared with state-of-the-art methods and ablations studies in Sec. 4.2.
113
+
114
+ # 4.1 Implementation Details
115
+
116
+ Architecture We use ConvNeXt-Large CLIP [58, 69] backbones from OpenCLIP [38]1 pretrained on LAION-2B [74] dataset. On top of the CLIP backbone, we build the mask generator, following Mask2Former [20]. Nine mask decoders are employed to generate the class-agnostic masks by taking as inputs the enhanced pixel features and a set of object queries. For in-vocabulary classification, following [29], the class embeddings are obtained by mask-pooling the pixel features from the pixel decoder’s final output. Afterwards, the classification logits (before softmax) is obtained by matrix multiplication between the predicted class embeddings and categories’ text embeddings.
117
+
118
+ Training Strategy We follow [20] and adopt the same training recipe and losses without any special design. The training is optimized with AdamW [41, 61] optimizer and weight decay 0.05. We use a crop size of $1 0 2 4 \times 1 0 2 4$ . We employ the learning rate $1 ^ { ^ { \bullet } \times 1 0 ^ { - 4 } }$ and a multi-step decay schedule. The training batch size is 16, and the model is trained for 50 epochs on COCO panoptic training set [54].
119
+
120
+ Inference Strategy During inference, the shorted side of input images will be resized to 800 while ensuring longer side not exceeds 1333. For Cityscapes and Mapillary Vistas, we increase the shorter side size to 1024. We adopt mask-wise merging scheme [20] for the mask predictions. The out-of-vocabulary classifier is only performed during inference by mask-pooling over the frozen CLIP backbone features. The final classification results are then obtained by geometric ensembling in- and out-of-vocabulary classifiers [31, 29, 46, 89], as in Eq. (7), where we default $\alpha = 0 . 4$ and $\beta = 0 . 8$ . Following prior arts, we also adopt prompt engineering from [29, 89] and prompt templates from [31, 52]. If not specified, FC-CLIP is only trained on COCO panoptic dataset [54]. Following prior works [29, 89], we zero-shot evaluate the model on ADE20K [100], Cityscapes [22], and Mapillary Vistas [64] for open-vocabulary panoptic segmentation. We also report open-vocabulary semantic segmentation results on those datasets along with PASCAL datasets [27, 63]. The panoptic segmentation results are evaluated with the panoptic quality (PQ) [44], Average Precision (AP), and mean intersection-over-union (mIoU), and semantic segmentation is evaluated with mIoU [27]. Note that all results are obtained with the same single checkpoint trained on COCO panoptic data only.
121
+
122
+ Table 1: Open-vocabulary panoptic segmentation performance on ADE20K. The proposed FCCLIP demonstrates better performances than prior arts, while using much fewer frozen parameters. We provide more results in the supplementary material
123
+
124
+ <table><tr><td></td><td>params (M)</td><td>zero-shot test dataset</td><td>ADE20K</td><td>training dataset COCO</td><td></td></tr><tr><td>method</td><td>frozen</td><td>trainable PQ</td><td>AP mIoU</td><td>PQ</td><td>AP mIoU</td></tr><tr><td>MaskCLIP[25]</td><td>304 63</td><td>15.1</td><td>6.0 23.7</td><td>1 -</td><td>-</td></tr><tr><td>FreeSeg [68]</td><td>- 1</td><td>16.3</td><td>6.5 24.6</td><td>1 =</td><td>-</td></tr><tr><td>ODISE [89]</td><td>1494 28 28</td><td>22.6 14.4 13.9</td><td>29.9</td><td>55.4 46.0</td><td>65.2</td></tr><tr><td>ODISE [89] (caption)</td><td>1494</td><td>23.4</td><td>28.7</td><td>45.6 38.4</td><td>52.4</td></tr><tr><td>FC-CLIP (ours)</td><td>200</td><td>21 26.8</td><td>16.8 34.1</td><td>54.4 44.6</td><td>63.7</td></tr></table>
125
+
126
+ Table 2: Open-vocabulary panoptic segmentation performance on street-view datasets. The proposed FC-CLIP demonstrates better transferability to street-view dataset
127
+
128
+ <table><tr><td rowspan="2"></td><td colspan="8">zero-shot test dataset</td></tr><tr><td colspan="3">Mapillary Vistas</td><td colspan="4">Cityscapes</td></tr><tr><td>method</td><td>PQ</td><td>SQ</td><td>RQ</td><td>mIoU</td><td>PQ SQ</td><td>RQ</td><td>AP</td><td>mIoU</td></tr><tr><td>ODISE [89]</td><td>14.2</td><td>61.0</td><td>17.2</td><td>-</td><td>23.9 75.3</td><td>29.0</td><td>1</td><td>-</td></tr><tr><td>FC-CLIP (ours)</td><td>18.2</td><td>57.7</td><td>22.9</td><td>27.9</td><td>44.0 75.4</td><td>53.6</td><td>26.8</td><td>56.2</td></tr></table>
129
+
130
+ # 4.2 Results
131
+
132
+ We summarize the main results for open-vocabulary panoptic segmentation and semantic segmentation in Tab. 1, Tab. 2 and Tab. 3, where we train FC-CLIP on COCO train set with panoptic annotation and evaluate it on various datasets in a zero-shot manner.
133
+
134
+ Open-Vocabulary Panoptic Segmentation Evaluation on ADE20K In Tab. 1, we compare our FC-CLIP with other state-of-the-art methods on ADE20K [100], the main test-bed of zero-shot open-vocabulary panoptic segmentation. As shown in the table, our method achieves significantly better performance compared to MaskCLIP [25], with $+ 1 1 . 7$ PQ, $+ 1 0 . 8$ AP and $+ 1 0 . 4$ mIoU, even though we use fewer frozen $\left( - 6 6 \mathbf { M } \right)$ and trainable $\left( { - 4 2 \mathbf { M } } \right)$ parameters. When compared to the concurrent methods FreeSeg [68] and ODISE [89], the advantage of FC-CLIP persists. FC-CLIP is $+ 1 0 . 5$ PQ, $+ 1 0 . 3$ AP, and $+ 9 . 5$ mIoU better than FreeSeg without using COCO-Stuff annotations [5] (which contains more semantic classes than COCO-Panoptic). Our PQ, AP, mIoU score are also $+ 4 . 2$ , $+ 2 . 4$ , $+ 4 . 2$ higher than ODISE under the same training settings. Compared to ODISE with caption [15] for supervision, our model still outperforms it by $+ 3 . 4 \mathrm { P Q }$ , setting a new state-of-the-art record. Meanwhile, it is noticeable that our model has $6 . 3 \times ( 5 . 9 \times )$ significantly fewer frozen (total) parameters compared to ODISE, which utilizes a strong large backbone from stable diffusion [71] for feature extraction.
135
+
136
+ Open-Vocabulary Panoptic Segmentation Evaluation on Street-View Datasets In Tab. 2, we evaluate on Cityscapes and Mapillary Vistas, which focus on street driving scenes. Compared to state-of-the-art method ODISE, FC-CLIP achieves better performances on both datasets. Specifically, it outperforms ODISE by $+ 4 . 0$ PQ and $+ 2 0 . 1$ PQ on Mapillary Vistas and Cityscapes, respectively. Notably, FC-CLIP has a slightly lower SQ, which indicates our mask generator is actually weaker than the one in ODISE, which utilizes a much larger backbone.
137
+
138
+ Open-Vocabulary Semantic Segmentation Evaluation Although our model was trained on COCO panoptic data only, it also performs well on open-vocabulary semantic segmentation. In Tab. 3, we report our model’s performance on various benchmarks against other open-vocabulary segmentation models, where FC-CLIP shows an overall superior performance. Specifically, with the same training annotations used, FC-CLIP outperforms MaskCLIP by $+ 6 . 6$ , $+ 8 . 2$ , $+ 1 0 . 4$ , $+ 1 2 . 5$ mIoU across A-847, PC-459, A-150, and PC-59, respectively. Compared to methods with caption annotations, FC-CLIP persists its advantages, where it outperforms ODISE (caption) by $+ 3 . 8$ , $+ 4 . 4$ , $+ 5 . 4$ , $+ 3 . 1$ mIoU across datasets A-847, PC-459, A-150, PC-59 respectively. Against other open-vocabulary semantic segmentation methods, our model maintains its advantages across different datasets, despite being trained solely with panoptic annotations. Furthermore, it demonstrates comparable performance to state-of-the-art open-vocabulary semantic segmentation methods, which utilize the COCO-Stuff dataset as their training set. The COCO-Stuff dataset comprises 171 classes, 38 more classes than COCO-Panoptic, and offers highly desirable annotations for semantic segmentation tasks. It is worth mentioning that these methods build their approach on top of ViT-L (with extra designs [91]), resulting in a significantly larger model size compared to our deployed ConvNeXt-L (304M vs. 198M). Despite the disparity in model size, FC-CLIP remains competitive in terms of performance. Specifially, FC-CLIP outperforms state-of-the-art open-vocabulary semantic segmentation method SAN [91] by 1.1 and 1.1 mIoU on the challenging A-847 and PC-459 datasets.
139
+
140
+ Table 3: Open-vocabulary semantic segmentation performance. The proposed FC-CLIP also demonstrates state-of-the-art performances on open-vocabulary semantic segmentation
141
+
142
+ <table><tr><td rowspan="2">method</td><td rowspan="2">training dataset</td><td colspan="5">mIoU</td></tr><tr><td>A-847 PC-459 A-150 PC-59</td><td></td><td></td><td></td><td>PAS-21 PAS-20</td></tr><tr><td>SPNet [85]</td><td>Pascal VOC[27]</td><td>-</td><td>-</td><td>1</td><td>24.3</td><td>18.3</td><td>-</td></tr><tr><td>ZS3Net [4]</td><td>Pascal VOC [27]</td><td>-</td><td></td><td></td><td>19.4</td><td>38.3</td><td>-</td></tr><tr><td>LSeg [48]</td><td>Pascal VOC[27]</td><td>-</td><td>-</td><td>1</td><td>-</td><td>47.4</td><td>-</td></tr><tr><td>GroupViT[88]</td><td>GCC[75]+YFCC[79]</td><td>4.3</td><td>4.9</td><td>10.6</td><td>25.9</td><td>50.7</td><td>52.3</td></tr><tr><td>SimBaseline [90]</td><td>COCO Stuff [5]</td><td>-</td><td>-</td><td>15.3</td><td>-</td><td>74.5</td><td>-</td></tr><tr><td>ZegFormer [24]</td><td>COCO Stuff [5]</td><td>1</td><td>1</td><td>16.4</td><td>1</td><td>73.3</td><td>=</td></tr><tr><td>LSeg+ [48, 29]</td><td>COCO Stuff [5]</td><td>3.8</td><td>7.8</td><td>18.0</td><td>46.5</td><td>-</td><td></td></tr><tr><td>OVSeg [52]</td><td>COCO Stuff [5]</td><td>9.0</td><td>12.4</td><td>29.6</td><td>55.7</td><td>=</td><td>94.5</td></tr><tr><td>SAN [91]</td><td>COCO Stuff [5]</td><td>13.7</td><td>17.1</td><td>33.3</td><td>60.2</td><td>-</td><td>95.5</td></tr><tr><td>OpenSeg [29]</td><td>COCO Panoptic + COCO Caption</td><td>6.3</td><td>9.0</td><td>21.1</td><td>42.1</td><td>-</td><td>-</td></tr><tr><td>ODISE [89] (caption)</td><td>COCO Panoptic + COCO Caption</td><td>11.0</td><td>13.8</td><td>28.7</td><td>55.3</td><td>82.7</td><td>-</td></tr><tr><td>MaskCLIP[25]</td><td>COCO Panoptic</td><td>8.2</td><td>10.0</td><td>23.7</td><td>45.9</td><td>-</td><td>-</td></tr><tr><td>ODISE [89]</td><td>COCO Panoptic</td><td>11.1</td><td>14.5</td><td>29.9</td><td>57.3</td><td>84.6</td><td>-</td></tr><tr><td>FC-CLIP (ours)</td><td>COCO Panoptic</td><td>14.8</td><td>18.2</td><td>34.1</td><td>58.4</td><td>81.8</td><td>95.4</td></tr></table>
143
+
144
+ Table 4: FPS comparison. All results are obtained with one V100 GPU, CUDA 11.6 and PyTorch 1.13, by taking the average runtime on the entire validation set, including post-processing time
145
+
146
+ <table><tr><td>method</td><td>ADE20K</td><td>COCO</td></tr><tr><td>ODISE[89]</td><td>0.41</td><td>0.39</td></tr><tr><td>FC-CLIP (ours)</td><td>2.71 (6.61×)</td><td>2.76 (7.08×)</td></tr></table>
147
+
148
+ Inference Speed We provide a comparison of FPS (frames per second) in Tab. 4. The proposed FC-CLIP not only demonstrates superior performances, but also enjoys a significant fast inference time: FC-CLIP runs $6 . 6 1 \times$ and $7 . 0 8 \times$ faster than ODISE evaluated on ADE20K and COCO datasets, respectively.
149
+
150
+ Training on ADE20K and Evaluating on COCO We further validate the effectiveness of FC-CLIP by using a different training dataset. Specifically, we follow [68, 89] to train our model on ADE20K dataset with panoptic annotation, and evaluate it on COCO panoptic dataset. As shown in Tab. 5, FC-CLIP outperforms FreeSeg [68] by $+ 1 0 . 5$ PQ, and ODISE [89] by $+ 2 . 0$ PQ on COCO dataset. Notably, our model actually has a lower SQ $( - 1 . 4 )$ compared to ODISE, which utilizes a much larger backbone and thus has a stronger mask generator. Nevertheless, FC-CLIP still outperforms ODISE significantly with a simple yet effective design.
151
+
152
+ Fine-tuning CLIP Backbone Harms Performance on Novel Vocabularies We validate the necessity of freezing CLIP backbone to ensure a better generalization to novel vocabularies. We compare the performance of trainable CLIP variant and frozen CLIP variant in Fig. 4, where we use the same mask proposals to ensure a fair comparison. Specifically, we compare the performance on
153
+
154
+ Table 5: Results of training on ADE20K panoptic and evaluating on COCO panoptic val set. The proposed FC-CLIP performs better than prior arts, even in the different setting (i.e., trained on ADE20K and zero-shot evaluated on COCO)
155
+
156
+ <table><tr><td rowspan="2">method</td><td colspan="2">zero-shot test dataset</td><td colspan="2">training dataset ADE20K</td></tr><tr><td>COCO PQ SQ</td><td>RQ</td><td>PQ SQ</td><td>RQ</td></tr><tr><td>FreeSeg [68]</td><td>16.5 72.0</td><td>21.6</td><td>- -</td><td>-</td></tr><tr><td>ODISE [89]</td><td>25.0 79.4</td><td>30.4</td><td>31.4 77.9</td><td>36.9</td></tr><tr><td>FC-CLIP (ours)</td><td>27.0 78.0</td><td>32.9</td><td>41.9 78.2</td><td>50.2</td></tr></table>
157
+
158
+ ![](images/4c173f274a4b226910b94b406e37d2bfd7e857b78f04f471eb13149fd2af5166.jpg)
159
+ Figure 4: Trainable CLIP vs. Frozen CLIP, with per-class PQ analysis. We show 10 common classes (labeled in green) shared by COCO and ADE20K, and 10 novel classes (labeled in red) that are only in ADE20K. The frozen CLIP demonstrates a much better recognition ability for novel classes, while performing similarly for the seen classes.
160
+
161
+ 10 seen classes, which are shared by both COCO and ADE20K (e.g., person, sky), and 10 unseen classes, which are only included in ADE20K dataset (e.g., arcade machine, dishwasher). As shown in the figure, tuning CLIP backbone leads to a worse performance on unseen concepts, which breaks the CLIP feature alignment and thus loses its recognition ability on a much wider vocabulary.
162
+
163
+ # 5 Conclusion
164
+
165
+ In this work, we have presented FC-CLIP, a simple yet effective single-stage framework for openvocabulary segmentation. FC-CLIP shows great potential by building everything on top of a shared frozen convolutional CLIP backbone, which not only significantly reduces training and testing costs, but also establishes a strong baseline on multiple benchmarks. Our study demonstrates how to better adapt a pretrained CLIP model for downstream dense prediction tasks, which we hope will shed the light on unleashing CLIP’s potential for other various downstream tasks.
166
+
167
+ Limitations FC-CLIP presents a simple single-stage open-vocabulary segmentation framework with state-of-the-art performance. We note that there exist some interesting research topics to be explored in the near future, such as better unleashing CLIP’s potential in both mask segmentation and classification, how to deal with conflict or overlapping vocabularies (e.g., cat vs. cat head), etc.
168
+
169
+ Broader Impact FC-CLIP shows great potential for segmenting and naming every object in the scene, which could facilitate many applications including intelligent home assistants, robots, selfdriving, etc. Yet it relies on CLIP model pre-trained on the Internet data that may be biased, which calls for future research for calibration to avoid misuse.
170
+
171
+ # References
172
+
173
+ [1] Jean-Baptiste Alayrac, Jeff Donahue, Pauline Luc, Antoine Miech, Iain Barr, Yana Hasson, Karel Lenc, Arthur Mensch, Katherine Millican, Malcolm Reynolds, et al. Flamingo: a visual language model for few-shot learning. In NeurIPS, 2022.
174
+ [2] Daniel Bolya, Chong Zhou, Fanyi Xiao, and Yong Jae Lee. Yolact: Real-time instance segmentation. In ICCV, 2019.
175
+ [3] Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. In NeurIPS, 2020.
176
+ [4] Maxime Bucher, Tuan-Hung Vu, Matthieu Cord, and Patrick Pérez. Zero-shot semantic segmentation. In NeurIPS, 2019.
177
+ [5] Holger Caesar, Jasper Uijlings, and Vittorio Ferrari. Coco-stuff: Thing and stuff classes in context. In CVPR, 2018.
178
+ [6] Zhaowei Cai and Nuno Vasconcelos. Cascade r-cnn: Delving into high quality object detection. In CVPR, 2018.
179
+ [7] Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. In ECCV, 2020.
180
+ [8] Kai Chen, Jiangmiao Pang, Jiaqi Wang, Yu Xiong, Xiaoxiao Li, Shuyang Sun, Wansen Feng, Ziwei Liu, Jianping Shi, Wanli Ouyang, et al. Hybrid task cascade for instance segmentation. In CVPR, 2019.
181
+ [9] Liang-Chieh Chen, George Papandreou, Iasonas Kokkinos, Kevin Murphy, and Alan L Yuille. Semantic image segmentation with deep convolutional nets and fully connected crfs. In ICLR, 2015.
182
+ [10] Liang-Chieh Chen, George Papandreou, Iasonas Kokkinos, Kevin Murphy, and Alan L Yuille. Deeplab: Semantic image segmentation with deep convolutional nets, atrous convolution, and fully connected crfs. IEEE TPAMI, 2017.
183
+ [11] Liang-Chieh Chen, George Papandreou, Florian Schroff, and Hartwig Adam. Rethinking atrous convolution for semantic image segmentation. arXiv:1706.05587, 2017.
184
+ [12] Liang-Chieh Chen, Alexander Hermans, George Papandreou, Florian Schroff, Peng Wang, and Hartwig Adam. Masklab: Instance segmentation by refining object detection with semantic and direction features. In CVPR, 2018.
185
+ [13] Liang-Chieh Chen, Yukun Zhu, George Papandreou, Florian Schroff, and Hartwig Adam. Encoderdecoder with atrous separable convolution for semantic image segmentation. In ECCV, 2018.
186
+ [14] Liang-Chieh Chen, Huiyu Wang, and Siyuan Qiao. Scaling wide residual networks for panoptic segmentation. arXiv:2011.11675, 2020.
187
+ [15] Xinlei Chen, Hao Fang, Tsung-Yi Lin, Ramakrishna Vedantam, Saurabh Gupta, Piotr Dollár, and C Lawrence Zitnick. Microsoft coco captions: Data collection and evaluation server. arXiv:1504.00325, 2015.
188
+ [16] Yen-Chun Chen, Linjie Li, Licheng Yu, Ahmed El Kholy, Faisal Ahmed, Zhe Gan, Yu Cheng, and Jingjing Liu. Uniter: Universal image-text representation learning. In ECCV, 2020.
189
+ [17] Zhe Chen, Yuchen Duan, Wenhai Wang, Junjun He, Tong Lu, Jifeng Dai, and Yu Qiao. Vision transformer adapter for dense predictions. In ICLR, 2023.
190
+ [18] Bowen Cheng, Maxwell D Collins, Yukun Zhu, Ting Liu, Thomas S Huang, Hartwig Adam, and Liang-Chieh Chen. Panoptic-DeepLab: A Simple, Strong, and Fast Baseline for Bottom-Up Panoptic Segmentation. In CVPR, 2020.
191
+ [19] Bowen Cheng, Alexander G Schwing, and Alexander Kirillov. Per-pixel classification is not all you need for semantic segmentation. In NeurIPS, 2021.
192
+ [20] Bowen Cheng, Ishan Misra, Alexander G Schwing, Alexander Kirillov, and Rohit Girdhar. Maskedattention mask transformer for universal image segmentation. In CVPR, 2022.
193
+ [21] Seokju Cho, Heeseong Shin, Sunghwan Hong, Seungjun An, Seungjun Lee, Anurag Arnab, Paul Hongsuck Seo, and Seungryong Kim. Cat-seg: Cost aggregation for open-vocabulary semantic segmentation. arXiv:2303.11797, 2023.
194
+ [22] Marius Cordts, Mohamed Omran, Sebastian Ramos, Timo Rehfeld, Markus Enzweiler, Rodrigo Benenson, Uwe Franke, Stefan Roth, and Bernt Schiele. The cityscapes dataset for semantic urban scene understanding. In CVPR, 2016.
195
+ [23] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In NAACL, 2019.
196
+ [24] Jian Ding, Nan Xue, Gui-Song Xia, and Dengxin Dai. Decoupling zero-shot semantic segmentation. In CVPR, 2022.
197
+ [25] Zheng Ding, Jieke Wang, and Zhuowen Tu. Open-vocabulary universal image segmentation with maskclip. In ICML, 2023.
198
+ [26] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. In ICLR, 2021.
199
+ [27] Mark Everingham, Luc Van Gool, Christopher KI Williams, John Winn, and Andrew Zisserman. The pascal visual object classes (voc) challenge. IJCV, 88:303–338, 2010.
200
+ [28] Jun Fu, Jing Liu, Haijie Tian, Yong Li, Yongjun Bao, Zhiwei Fang, and Hanqing Lu. Dual attention network for scene segmentation. In CVPR, 2019.
201
+ [29] Golnaz Ghiasi, Xiuye Gu, Yin Cui, and Tsung-Yi Lin. Scaling open-vocabulary image segmentation with image-level labels. In ECCV, 2022.
202
+ [30] Jiaqi Gu, Hyoukjun Kwon, Dilin Wang, Wei Ye, Meng Li, Yu-Hsin Chen, Liangzhen Lai, Vikas Chandra, and David Z Pan. Multi-scale high-resolution vision transformer for semantic segmentation. In CVPR, 2022.
203
+ [31] Xiuye Gu, Tsung-Yi Lin, Weicheng Kuo, and Yin Cui. Open-vocabulary object detection via vision and language knowledge distillation. In ICLR, 2022.
204
+ [32] Xiuye Gu, Yin Cui, Jonathan Huang, Abdullah Rashwan, Xuan Yang, Xingyi Zhou, Golnaz Ghiasi, Weicheng Kuo, Huizhong Chen, Liang-Chieh Chen, and David A Ross. Dataseg: Taming a universal multi-dataset multi-task segmentation model. NeurIPS, 2023.
205
+ [33] Tanmay Gupta, Arash Vahdat, Gal Chechik, Xiaodong Yang, Jan Kautz, and Derek Hoiem. Contrastive learning for weakly supervised phrase grounding. In ECCV, 2020.
206
+ [34] Bharath Hariharan, Pablo Arbeláez, Ross Girshick, and Jitendra Malik. Simultaneous detection and segmentation. In ECCV, 2014.
207
+ [35] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016.
208
+ [36] Kaiming He, Georgia Gkioxari, Piotr Dollár, and Ross Girshick. Mask r-cnn. In ICCV, 2017.
209
+ [37] Xuming He, Richard S Zemel, and Miguel Á Carreira-Perpiñán. Multiscale conditional random fields for image labeling. In CVPR, 2004.
210
+ [38] Gabriel Ilharco, Mitchell Wortsman, Ross Wightman, Cade Gordon, Nicholas Carlini, Rohan Taori, Achal Dave, Vaishaal Shankar, Hongseok Namkoong, John Miller, Hannaneh Hajishirzi, Ali Farhadi, and Ludwig Schmidt. Openclip, July 2021. URL https://doi.org/10.5281/zenodo.5143773.
211
+ [39] Jitesh Jain, Jiachen Li, MangTik Chiu, Ali Hassani, Nikita Orlov, and Humphrey Shi. Oneformer: One transformer to rule universal image segmentation. In CVPR, 2023.
212
+ [40] Chao Jia, Yinfei Yang, Ye Xia, Yi-Ting Chen, Zarana Parekh, Hieu Pham, Quoc Le, Yun-Hsuan Sung, Zhen Li, and Tom Duerig. Scaling up visual and vision-language representation learning with noisy text supervision. In ICML, 2021.
213
+ [41] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2015.
214
+ [42] Alexander Kirillov, Evgeny Levinkov, Bjoern Andres, Bogdan Savchynskyy, and Carsten Rother. Instancecut: from edges to instances with multicut. In CVPR, 2017.
215
+ [43] Alexander Kirillov, Ross Girshick, Kaiming He, and Piotr Dollár. Panoptic feature pyramid networks. In CVPR, 2019.
216
+ [44] Alexander Kirillov, Kaiming He, Ross Girshick, Carsten Rother, and Piotr Dollár. Panoptic segmentation. In CVPR, 2019.
217
+ [45] Harold W Kuhn. The hungarian method for the assignment problem. Naval research logistics quarterly, 2(1-2):83–97, 1955.
218
+ [46] Weicheng Kuo, Yin Cui, Xiuye Gu, AJ Piergiovanni, and Anelia Angelova. F-vlm: Open-vocabulary object detection upon frozen vision and language models. In ICLR, 2023.
219
+ [47] Yann LeCun, Léon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998.
220
+ [48] Boyi Li, Kilian Q Weinberger, Serge Belongie, Vladlen Koltun, and René Ranftl. Language-driven semantic segmentation. In ICLR, 2022.
221
+ [49] Feng Li, Hao Zhang, Shilong Liu, Lei Zhang, Lionel M Ni, Heung-Yeung Shum, et al. Mask dino: Towards a unified transformer-based framework for object detection and segmentation. In CVPR, 2023.
222
+ [50] Qizhu Li, Xiaojuan Qi, and Philip HS Torr. Unifying training and inference for panoptic segmentation. In CVPR, 2020.
223
+ [51] Zhiqi Li, Wenhai Wang, Enze Xie, Zhiding Yu, Anima Anandkumar, Jose M Alvarez, Tong Lu, and Ping Luo. Panoptic segformer. In CVPR, 2022.
224
+ [52] Feng Liang, Bichen Wu, Xiaoliang Dai, Kunpeng Li, Yinan Zhao, Hang Zhang, Peizhao Zhang, Peter Vajda, and Diana Marculescu. Open-vocabulary semantic segmentation with mask-adapted clip. In CVPR, 2023.
225
+ [53] James Liang, Tianfei Zhou, Dongfang Liu, and Wenguan Wang. Clustseg: Clustering for universal segmentation. In ICML, 2023.
226
+ [54] Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollár, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In ECCV, 2014.
227
+ [55] Huanyu Liu, Chao Peng, Changqian Yu, Jingbo Wang, Xu Liu, Gang Yu, and Wei Jiang. An end-to-end network for panoptic segmentation. In CVPR, 2019.
228
+ [56] Shu Liu, Lu Qi, Haifang Qin, Jianping Shi, and Jiaya Jia. Path aggregation network for instance segmentation. In CVPR, 2018.
229
+ [57] Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. Roberta: A robustly optimized bert pretraining approach. arXiv:1907.11692, 2019.
230
+ [58] Zhuang Liu, Hanzi Mao, Chao-Yuan Wu, Christoph Feichtenhofer, Trevor Darrell, and Saining Xie. A convnet for the 2020s. In CVPR, 2022.
231
+ [59] Stuart Lloyd. Least squares quantization in pcm. IEEE transactions on information theory, 28(2):129–137, 1982.
232
+ [60] Jonathan Long, Evan Shelhamer, and Trevor Darrell. Fully convolutional networks for semantic segmentation. In CVPR, 2015.
233
+ [61] Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. In ICLR, 2019.
234
+ [62] Chaofan Ma, Yuhuan Yang, Yanfeng Wang, Ya Zhang, and Weidi Xie. Open-vocabulary semantic segmentation with frozen vision-language models. In BMVC, 2022.
235
+ [63] Roozbeh Mottaghi, Xianjie Chen, Xiaobai Liu, Nam-Gyu Cho, Seong-Whan Lee, Sanja Fidler, Raquel Urtasun, and Alan Yuille. The role of context for object detection and semantic segmentation in the wild. In CVPR, 2014.
236
+ [64] Gerhard Neuhold, Tobias Ollmann, Samuel Rota Bulo, and Peter Kontschieder. The mapillary vistas dataset for semantic understanding of street scenes. In ICCV, 2017.
237
+ [65] Jordi Pont-Tuset, Jasper Uijlings, Soravit Changpinyo, Radu Soricut, and Vittorio Ferrari. Connecting vision and language with localized narratives. In ECCV, 2020.
238
+ [66] Siyuan Qiao, Liang-Chieh Chen, and Alan Yuille. Detectors: Detecting objects with recursive feature pyramid and switchable atrous convolution. In CVPR, 2021.
239
+ [67] Siyuan Qiao, Yukun Zhu, Hartwig Adam, Alan Yuille, and Liang-Chieh Chen. Vip-deeplab: Learning visual perception with depth-aware video panoptic segmentation. In CVPR, 2021.
240
+ [68] Jie Qin, Jie Wu, Pengxiang Yan, Ming Li, Ren Yuxi, Xuefeng Xiao, Yitong Wang, Rui Wang, Shilei Wen, Xin Pan, et al. Freeseg: Unified, universal and open-vocabulary image segmentation. In CVPR, 2023.
241
+ [69] Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. In ICML, 2021.
242
+ [70] Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. TMLR, 21(1):5485–5551, 2020.
243
+ [71] Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Björn Ommer. High-resolution image synthesis with latent diffusion models. In CVPR, 2022.
244
+ [72] Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In MICCAI, 2015.
245
+ [73] Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael S. Bernstein, Alexander C. Berg, and Li Fei-Fei. Imagenet large scale visual recognition challenge. IJCV, 115:211–252, 2015.
246
+ [74] Christoph Schuhmann, Romain Beaumont, Richard Vencu, Cade Gordon, Ross Wightman, Mehdi Cherti, Theo Coombes, Aarush Katta, Clayton Mullis, Mitchell Wortsman, et al. Laion-5b: An open large-scale dataset for training next generation image-text models. In NeurIPS, 2022.
247
+ [75] Piyush Sharma, Nan Ding, Sebastian Goodman, and Radu Soricut. Conceptual captions: A cleaned, hypernymed, image alt-text dataset for automatic image captioning. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 2556–2565, 2018.
248
+ [76] Robin Strudel, Ricardo Garcia, Ivan Laptev, and Cordelia Schmid. Segmenter: Transformer for semantic segmentation. In ICCV, 2021.
249
+ [77] Shuyang Sun, Weijun Wang, Qihang Yu, Andrew Howard, Philip Torr, and Liang-Chieh Chen. Remax: Relaxing for better training on efficient panoptic segmentation. NeurIPS, 2023.
250
+ [78] Hao Tan and Mohit Bansal. Lxmert: Learning cross-modality encoder representations from transformers. In EMNLP, 2019.
251
+ [79] Bart Thomee, David A Shamma, Gerald Friedland, Benjamin Elizalde, Karl Ni, Douglas Poland, Damian Borth, and Li-Jia Li. Yfcc100m: The new data in multimedia research. Communications of the ACM, 59 (2):64–73, 2016.
252
+ [80] Zhi Tian, Chunhua Shen, and Hao Chen. Conditional convolutions for instance segmentation. In ECCV, 2020.
253
+ [81] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NeurIPS, 2017.
254
+ [82] Huiyu Wang, Yukun Zhu, Bradley Green, Hartwig Adam, Alan Yuille, and Liang-Chieh Chen. AxialDeepLab: Stand-Alone Axial-Attention for Panoptic Segmentation. In ECCV, 2020.
255
+ [83] Huiyu Wang, Yukun Zhu, Hartwig Adam, Alan Yuille, and Liang-Chieh Chen. Max-deeplab: End-to-end panoptic segmentation with mask transformers. In CVPR, 2021.
256
+ [84] Xinlong Wang, Rufeng Zhang, Tao Kong, Lei Li, and Chunhua Shen. SOLOv2: Dynamic and fast instance segmentation. In NeurIPS, 2020.
257
+ [85] Yongqin Xian, Subhabrata Choudhury, Yang He, Bernt Schiele, and Zeynep Akata. Semantic projection network for zero-and few-label semantic segmentation. In CVPR, 2019.
258
+ [86] Enze Xie, Wenhai Wang, Zhiding Yu, Anima Anandkumar, Jose M Alvarez, and Ping Luo. Segformer: Simple and efficient design for semantic segmentation with transformers. In NeurIPS, 2021.
259
+ [87] Yuwen Xiong, Renjie Liao, Hengshuang Zhao, Rui Hu, Min Bai, Ersin Yumer, and Raquel Urtasun. Upsnet: A unified panoptic segmentation network. In CVPR, 2019.
260
+ [88] Jiarui Xu, Shalini De Mello, Sifei Liu, Wonmin Byeon, Thomas Breuel, Jan Kautz, and Xiaolong Wang. Groupvit: Semantic segmentation emerges from text supervision. In CVPR, 2022.
261
+ [89] Jiarui Xu, Sifei Liu, Arash Vahdat, Wonmin Byeon, Xiaolong Wang, and Shalini De Mello. Openvocabulary panoptic segmentation with text-to-image diffusion models. In CVPR, 2023.
262
+ [90] Mengde Xu, Zheng Zhang, Fangyun Wei, Yutong Lin, Yue Cao, Han Hu, and Xiang Bai. A simple baseline for zero-shot semantic segmentation with pre-trained vision-language model. In ECCV, 2022.
263
+ [91] Mengde Xu, Zheng Zhang, Fangyun Wei, Han Hu, and Xiang Bai. Side adapter network for openvocabulary semantic segmentation. In CVPR, 2023.
264
+ [92] Jiahui Yu, Zirui Wang, Vijay Vasudevan, Legg Yeung, Mojtaba Seyedhosseini, and Yonghui Wu. Coca: Contrastive captioners are image-text foundation models. TMLR, 2022.
265
+ [93] Qihang Yu, Huiyu Wang, Dahun Kim, Siyuan Qiao, Maxwell Collins, Yukun Zhu, Hartwig Adam, Alan Yuille, and Liang-Chieh Chen. Cmt-deeplab: Clustering mask transformers for panoptic segmentation. In CVPR, 2022.
266
+ [94] Qihang Yu, Huiyu Wang, Siyuan Qiao, Maxwell Collins, Yukun Zhu, Hartwig Adam, Alan Yuille, and Liang-Chieh Chen. k-means Mask Transformer. In ECCV, 2022.
267
+ [95] Lu Yuan, Dongdong Chen, Yi-Ling Chen, Noel Codella, Xiyang Dai, Jianfeng Gao, Houdong Hu, Xuedong Huang, Boxin Li, Chunyuan Li, et al. Florence: A new foundation model for computer vision. arXiv:2111.11432, 2021.
268
+ [96] Yuhui Yuan, Xilin Chen, and Jingdong Wang. Object-contextual representations for semantic segmentation. In ECCV, 2020.
269
+ [97] Alireza Zareian, Kevin Dela Rosa, Derek Hao Hu, and Shih-Fu Chang. Open-vocabulary object detection using captions. In CVPR, 2021.
270
+ [98] Pengchuan Zhang, Xiujun Li, Xiaowei Hu, Jianwei Yang, Lei Zhang, Lijuan Wang, Yejin Choi, and Jianfeng Gao. Vinvl: Revisiting visual representations in vision-language models. In CVPR, 2021.
271
+ [99] Sixiao Zheng, Jiachen Lu, Hengshuang Zhao, Xiatian Zhu, Zekun Luo, Yabiao Wang, Yanwei Fu, Jianfeng Feng, Tao Xiang, Philip HS Torr, et al. Rethinking semantic segmentation from a sequence-to-sequence perspective with transformers. In CVPR, 2021.
272
+ [100] Bolei Zhou, Hang Zhao, Xavier Puig, Sanja Fidler, Adela Barriuso, and Antonio Torralba. Scene parsing through ade20k dataset. In CVPR, 2017.
273
+ [101] Chong Zhou, Chen Change Loy, and Bo Dai. Extract free dense labels from clip. In ECCV, 2022.
274
+ [102] Ziqin Zhou, Yinjie Lei, Bowen Zhang, Lingqiao Liu, and Yifan Liu. Zegclip: Towards adapting clip for zero-shot semantic segmentation. In CVPR, 2023.
275
+ [103] Xizhou Zhu, Weijie Su, Lewei Lu, Bin Li, Xiaogang Wang, and Jifeng Dai. Deformable detr: Deformable transformers for end-to-end object detection. In ICLR, 2021.
276
+ [104] Xueyan Zou, Zi-Yi Dou, Jianwei Yang, Zhe Gan, Linjie Li, Chunyuan Li, Xiyang Dai, Jianfeng Wang, Lu Yuan, Nanyun Peng, Lijuan Wang, Yong Jae Lee, and Jianfeng Gao. Generalized decoding for pixel, image, and language. In CVPR, 2023.
277
+
278
+ Appendix In the following supplementary materials, we present additional experimental results pertaining to the design of FC-CLIP. Our supplementary analysis also includes comparisons against other methods that specifically address open-vocabulary semantic segmentation, ensemble methods, and hyperparameter tuning. Furthermore, we provide a quantitative comparison between ViT-based CLIP and CNN-based CLIP across varying input sizes, along with additional visualizations and comprehensive dataset details.
279
+
280
+ # 6 Additional Experimental Results
281
+
282
+ Fine-tuning or Freezing CLIP Backbone in FC-CLIP In this study, we provide a comprehensive analysis of the impact of fine-tuning or freezing the CLIP backbone in our framework. We specifically focus on the $\mathrm { P Q } ^ { \mathrm { s e e n } }$ and $\mathrm { P Q } ^ { \mathrm { u n s e e n } }$ metrics, which evaluate the performance for classes that overlap and do not overlap between the training and testing datasets, respectively. To determine whether a class is seen or unseen, we adopt the prompt engineering technique described in [29], which provides synonyms or subcategories of classes. Specifically, if any category name in test dataset overlaps with a category name in training dataset, we consider it as a seen class; otherwise unseen. As discussed in the main paper, the proposed FC-CLIP contains three components: a class-agnostic mask generator, an in-vocabulary classifier, and an out-of-vocabulary classifier. We thus explore using frozen or trainable CLIP for each component, and summarize the results in Tab. 6. To ensure a fair comparison, all "trainable" modules utilize the same weights, resulting in identical mask proposals and in-vocabulary classification results. Moreover, we note that the first row in Tab. 6 with trainable mask generator and in-vocabulary classifier, can be considered as an approximation to OpenSeg [29] in our framework. Our findings reveal that an in-vocabulary classifier built upon a trainable CLIP backbone achieves a higher $\mathrm { P Q } ^ { \mathrm { s e e n } }$ score (37.9 compared to 32.4), but experiences a decrease in PQunseen (2.6 compared to 12.6) compared to a frozen out-of-vocabulary classifier. Consequently, a model that incorporates a trainable CLIP backbone for all components yields a PQ of 24.1, which is 2.7 lower than our final model (last row) that relies on a single frozen CLIP backbone. Using a trainable mask generator and in-vocabulary classifier, along with a frozen out-of-vocabulary classifier boosts the performance but requires maintaining one trainable and one frozen CLIP weights, resulting in $2 \times$ more backbone parameters. In summary, our observations demonstrate that building the entire framework upon a frozen CLIP backbone is not only effective but also efficient, providing a better balance between $\mathrm { P Q } ^ { \mathrm { s e e n } }$ and $\mathrm { P Q } ^ { \mathrm { u n s e e n } }$ metrics.
283
+
284
+ Table 6: Effects of fine-tuning or freezing the CLIP backbone for each module in FC-CLIP. Building all three modules upon a single frozen CLIP backbone attains best performance. Note that our mask generator and in-vocabulary classifier use the same backbone following [20, 29, 94], and thus it is infeasible (denoted as N/A) for the setting in the 2nd last row. Our final setting is labeled in gray
285
+
286
+ <table><tr><td>mask generator</td><td>in-vocabulary classifier</td><td>out-of-vocabulary classifier</td><td>PQ</td><td>PQseen</td><td>PQunseen</td></tr><tr><td>trainable</td><td>trainable</td><td>1</td><td>17.7</td><td>37.9</td><td>2.6</td></tr><tr><td>trainable</td><td>-</td><td>frozen</td><td>21.1</td><td>32.4</td><td>12.6</td></tr><tr><td>trainable</td><td>trainable</td><td>trainable</td><td>24.1</td><td>38.9</td><td>13.1</td></tr><tr><td>trainable</td><td>trainable</td><td>frozen</td><td>25.4</td><td>40.0</td><td>14.6</td></tr><tr><td>trainable</td><td>frozen</td><td>frozen</td><td>N/A</td><td>N/A</td><td>N/A</td></tr><tr><td>frozen</td><td>frozen</td><td>frozen</td><td>26.8</td><td>39.5</td><td>17.3</td></tr></table>
287
+
288
+ Evaluation with Grounding PQ and Grounding mIoU It is worth emphasizing that despite the absence of grounding loss [33, 97, 29, 89] during training, our model exhibits exceptional grounding segmentation capabilities. Tab. 7 presents the grounding PQ and grounding mIoU scores of FCCLIP, following the evaluation methodology outlined in [29]. In this evaluation, we exclusively employ ground-truth classes as text query inputs to assess the effectiveness of concept grounding. Compared to OpenSeg [29], FC-CLIP achieves a substantial performance improvement, with notable enhancements of $+ 1 1 . 6$ , $+ 9 . 1$ , $+ 1 3 . 1$ , and $+ 1 7 . 7$ on A-847, PC-459, A-150, and PC-59, respectively. Even when compared to OpenSeg trained with the Localized Narrative dataset [65], which enables training on a significantly larger vocabulary, FC-CLIP still surpasses it with improvements of $+ 8 . 0$ , $+ 2 . 2 , + 8 . 6$ and $+ 1 3 . 4$ on A-847, PC-459, A-150 and PC-59, respectively, underscoring the grounding proficiency of FC-CLIP.
289
+
290
+ Table 7: Grounding segmentation performance. The proposed FC-CLIP also demonstrates stateof-the-art performances on grounding segmentation. MV: Mapillary Vistas
291
+
292
+ <table><tr><td></td><td>grounding PQ</td><td colspan="5">grounding mloU</td></tr><tr><td>method</td><td>ADE20K Cityscapes MV</td><td colspan="5">|A-847 PC-459 A-150 PC-59 PAS-21 PAS-20</td></tr><tr><td>ALIGN [40, 29]</td><td>- =</td><td>17.8 1</td><td>21.8</td><td>25.7 34.2</td><td>1</td><td>-</td></tr><tr><td>ALIGN w/ proposal [40, 29]</td><td></td><td>17.3</td><td>19.7 25.3</td><td>32.0</td><td></td><td></td></tr><tr><td>LSeg+ [48,29]</td><td></td><td>10.5</td><td>17.1 30.8</td><td>56.7</td><td></td><td></td></tr><tr><td>OpenSeg [29]</td><td></td><td>21.8</td><td>32.1 41.0</td><td>57.2</td><td>-</td><td></td></tr><tr><td>OpenSeg [29] w/L. Narr</td><td>- -</td><td>- 25.4</td><td>39.0</td><td>45.5 61.5</td><td>-</td><td>-</td></tr><tr><td>FC-CLIP (ours)</td><td>38.4 48.1</td><td>21.5 33.4</td><td>41.2</td><td>54.1 74.9</td><td>88.7</td><td>98.5</td></tr></table>
293
+
294
+ Table 8: Ensemble methods comparison with zero-shot evaluation (PQ) on ADE20K. Our method is robust to different ensemble methods (arithmetic and geometric). The results show that it is preferable to bias towards using the in-vocabulary classifier for seen classes and the out-of-vocabulary classifier for unseen classes. Our final setting $( \alpha = 0 . 4 , \beta = 0 . 8 )$ is labeled in gray
295
+
296
+ <table><tr><td>method</td><td>arithmetic</td><td>geometric</td></tr><tr><td>(a=0.0,β=0.0)</td><td>17.8</td><td>17.8</td></tr><tr><td>(α = 1.0,β = 1.0)</td><td>21.9</td><td>21.9</td></tr><tr><td>(α = 0.0,β = 1.0)</td><td>25.3</td><td>25.3</td></tr><tr><td>(α = 1.0,β = 0.0)</td><td>17.5</td><td>17.5</td></tr><tr><td>(a = 0.5,β = 0.5)</td><td>25.0</td><td>25.3</td></tr><tr><td>(α = 0.5, β = 0.6)</td><td>25.6</td><td>26.4</td></tr><tr><td>(α = 0.5,β = 0.7)</td><td>25.5</td><td>26.7</td></tr><tr><td>(α = 0.5,β = 0.8)</td><td>25.4</td><td>26.6</td></tr><tr><td>(α = 0.4,β = 0.6)</td><td>25.1</td><td>25.6</td></tr><tr><td>(α = 0.4,β = 0.7)</td><td>25.6</td><td>26.4</td></tr><tr><td>(α = 0.4,β = 0.8)</td><td>25.6</td><td>26.8</td></tr><tr><td>(α = 0.4, β = 0.9)</td><td>25.4</td><td>25.8</td></tr></table>
297
+
298
+ Table 9: Quantitative results of ViT-based CLIP and CNN-based CLIP when input size (denoted as "res") varies for panoptic segmentation on COCO and ADE20K. All results are obtained by applying CLIP directly as a mask classifier with the same mask proposals from ODISE [89]
299
+
300
+ <table><tr><td>CLIP backbone</td><td>COCO PQ @res 224 448 672 896 1120</td><td>ADE20K PQ @res 224 448 672 896 1120</td></tr><tr><td>ViT-L/14</td><td>19.3 22.5 20.6 18.5 14.9</td><td>11.9 13.7 12.6 11.6 9.1</td></tr><tr><td>ConvNeXt-L</td><td></td><td></td></tr><tr><td></td><td>17.3 23.5 27.0 28.6 29.3</td><td>9.3 12.8 14.8 16.0 15.9</td></tr></table>
301
+
302
+ Ensemble In-Vocabulary and Out-of-Vocabulary Classifiers In Tab. 8, we present experiments conducted to evaluate the impact of ensemble methods and ensemble parameters on the performance of the in-vocabulary and out-of-vocabulary classifiers. Specifically, we examine two ensemble methods: arithmetic and geometric. The arithmetic method involves a linear combination of the in-vocabulary classifier and the out-of-vocabulary classifier, while the geometric method is defined as shown in Equation (7) of main paper. It is worth noting that FC-CLIP exhibits robustness to different ensemble methods, with both methods displaying a consistent trend within the explored hyper-parameter ranges. However, the geometric ensemble consistently outperforms the arithmetic ensemble by a slight margin. Additionally, we observe that preference is given to values of $\alpha \leq 0 . 5$ and $\beta \geq 0 . 5$ , which biases the model towards using the in-vocabulary classifier for seen classes and the out-of-vocabulary classifier for unseen classes. We also explore extreme cases, including $\alpha = 0 . 0$ and $\beta = 0 . 0$ (i.e., exclusively utilizing the in-vocabulary classifier for every class), $\alpha = 1 . 0$ and $\beta = 1 . 0$ (i.e., exclusively utilizing the out-of-vocabulary classifier for every class), $\alpha = 0 . 0$ and $\beta = 1 . 0$ (i.e., using the in-vocabulary classifier for seen classes and the out-of-vocabulary classifier for unseen classes), and $\alpha = 1 . 0$ and $\beta = 0 . 0$ (i.e., using the out-of-vocabulary classifier for seen classes and the in-vocabulary classifier for unseen classes). The results align with our observations that it is preferable to bias towards the in-vocabulary classifier for seen classes and the out-of-vocabulary classifier for unseen classes.
303
+
304
+ Table 10: Quantitative results of ViT-based CLIP and CNN-based CLIP when input size (denoted as "res") varies for ImageNet-1k classification.
305
+
306
+ <table><tr><td>CLIP backbone</td><td>Accuracy ( @res 224336 448 560 672 784896</td></tr><tr><td>ViT-L/14</td><td>75.3 74.3 71.3 67.5 63.1 58.5 53.9</td></tr><tr><td>ConvNeXt-L</td><td>75.1 77.1 76.8 74.2 69.8 65.6 58.4</td></tr></table>
307
+
308
+ Table 11: Open-vocabulary segmentation performance with different backbones and segmentation frameworks. All models are trained on COCO and tested on the other datasets in a zero-shot manner. MV: Mapillary Vistas. $^ *$ : kMaX-DeepLab with multi-scale deformable attention [103]
309
+
310
+ <table><tr><td rowspan="2">method</td><td rowspan="2">backbone</td><td colspan="3"> panoptic datasets (PQ)</td><td rowspan="2"></td><td colspan="3">semantic datasets (mIoU)</td></tr><tr><td>ADE</td><td>Cityscapes MV</td><td>A-847</td><td>PC-459</td><td>PC-59</td><td>PAS-21</td></tr><tr><td>FC-CLIP</td><td>R50 [35, 69]</td><td>17.9</td><td>40.3</td><td>15.9</td><td>7.1</td><td>12.9</td><td>50.5</td><td>75.9</td></tr><tr><td>FC-CLIP</td><td>R101 [35,69]</td><td>19.1</td><td>40.9</td><td>16.7</td><td>7.7</td><td>12.3</td><td>48.9</td><td>77.6</td></tr><tr><td>FC-CLIP</td><td>R50×4[69]</td><td>21.8</td><td>42.2</td><td>17.4</td><td>8.7</td><td>13.1</td><td>54.0</td><td>79.0</td></tr><tr><td>FC-CLIP</td><td>R50×16 [69]</td><td>22.5</td><td>42.0</td><td>17.8</td><td>10.3</td><td>15.7</td><td>56.4</td><td>80.7</td></tr><tr><td>FC-CLIP</td><td>R50×64 [69]</td><td>22.8</td><td>42.7</td><td>18.2</td><td>10.8</td><td>16.2</td><td>55.7</td><td>80.3</td></tr><tr><td>FC-CLIP w/ kMaX</td><td>ConvNeXt-L [58,38]</td><td>24.5</td><td>43.0</td><td>17.0</td><td>11.4</td><td>15.0</td><td>57.4</td><td>84.7</td></tr><tr><td>FC-CLIP w/ kMaX*</td><td>ConvNeXt-L [58, 38]</td><td>26.4</td><td>40.2</td><td>17.4</td><td>13.6</td><td>17.5</td><td>57.1</td><td>81.2</td></tr><tr><td>FC-CLIP</td><td>ConvNeXt-L [58,38]</td><td>26.8</td><td>44.0</td><td>18.2</td><td>14.8</td><td>18.2</td><td>58.4</td><td>81.8</td></tr></table>
311
+
312
+ Quantitative ViT-based CLIP vs. CNN-based CLIP when Input Size Scales Training our model solely with ViT-based CLIP, without any additional modifications [101, 17, 91, 21], is infeasible. Furthermore, applying ViT to large input sizes is computationally expensive. Therefore, to evaluate the effects of using ViT- or CNN-based CLIP in our framework, we incorporate them into our out-ofvocabulary classifier, which is performed only during inference. To ensure a fair comparison, we use the same mask proposals and disable the geometric ensemble scheme. We also perform experiment on the ImageNet [73] benchmark to ensure a comprehensive comaprison. In Tab. 9 and Tab. 10, we conduct an ablation study to analyze the impact of different input resolutions for CLIP models. We consider both ViT-based (ViT-L/14) and CNN-based (ConvNeXt-L) CLIP models. By employing them as zero-shot classifiers and varying the input resolutions, we observe that CNN-based CLIP demonstrates superior generalization ability as the input size scales up. Specifically, we observe that the ViT-L/14 CLIP has a higher PQ and Accuracy at a lower resolution (i.e., input size 224), but suffers from a higher resolution, which leads existing two-stage methods [90, 52, 25, 91, 89] to adopt different input resolutions for mask generator and classifier branches. On the contrary, FC-CLIP provides a simple solution by adopting a CNN-based CLIP that generalizes well to different input sizes.
313
+
314
+ FC-CLIP with Different Backbones and Different Segmentation Frameworks Though we majorly report FC-CLIP results with ConvNeXt-L [58, 69] backbone in Mask2Former [20] framework. We note that FC-CLIP can be easily incorporated with different backbones and segmentation frameworks. Specifically, we experiment FC-CLIP with different backbones (e.g., ResNet [35]) and different segmentation architecture (e.g., kMaX-DeepLab [94]). As shown in Tab. 11, FC-CLIP demonstrates superior performance across different backbones and frameworks.
315
+
316
+ Visualization We provide visualization on ADE20K val set in Fig. 5.
317
+
318
+ # 7 Datasets Information and Licenses
319
+
320
+ The datasets we used for training and/or testing FC-CLIP are described as follows.
321
+
322
+ COCO: We train FC-CLIP on COCO data with panoptic annotation [54]. We follow the 2017 splits which include $1 1 8 k$ images for train split and $5 k$ images for val split. If not specified, we train our model on the COCO train split and report results on val set of various datasets.
323
+
324
+ License: Creative Commons Attribution 4.0 License
325
+
326
+ URL: https://cocodataset.org/#home
327
+
328
+ ![](images/6d945a983934e5f4e46d3f6c8d08c51a60561977f3204409808abcc4583cf137.jpg)
329
+ Figure 5: Visualization examples of FC-CLIP on ADE20K val set. FC-CLIP is trained on COCO panoptic training set and zero-shot evaluated on ADE20K validation set.
330
+
331
+ ADE20k: ADE20k [100] covers a wide range of indoor and outdoor scenes, with $2 k$ val images. We evaluate FC-CLIP on both the version with 847 classes (A-847) and the more widely-used version with 150 frequent categories (A-150).
332
+
333
+ License: Creative Commons BSD-3 License
334
+
335
+ URL: https://groups.csail.mit.edu/vision/datasets/ADE20K/
336
+
337
+ Cityscapes: Cityscapes [22] focuses on semantic understanding of urban street scenes. We use the fine data includes 500 images for validation set.
338
+
339
+ License: This dataset is made freely available to academic and non-academic entities for noncommercial purposes such as academic research, teaching, scientific publications, or personal experimentation.
340
+
341
+ URL: https://www.cityscapes-dataset.com/
342
+
343
+ Mapillary Vistas: Mapillary Vistas [64] is a large-scale traffic-related dataset, including $2 k$ images for validation purposes.
344
+
345
+ License: Creative Commons Attribution NonCommercial Share Alike (CC BY-NC-SA) license
346
+
347
+ URL: https://www.mapillary.com/dataset/vistas
348
+
349
+ Pascal Context: Pascal Context [63] covers a wide variety of indoor and outdoor scenes and includes $5 k$ val images. We evaluate FC-CLIP on both its full version (PC-459) with 459 classes and the more common version (PC-59) with 59 classes.
350
+
351
+ URL: https://www.cs.stanford.edu/\~roozbeh/pascal-context/
352
+
353
+ Pascal VOC: Pascal VOC [27] contains $1 . 5 k$ val images with 20 foreground classes and 1 background class. Due to the ambiguity in definition of “background", we assign the background class to the pixels predicted as PC-59 categories that are not in Pascal VOC following [29], which leads to PAS-21. We also evaluate the model with background class excluded, which leads to PAS-20.
354
+
355
+ URL: http://host.robots.ox.ac.uk/pascal/VOC/
parse/dev/9Vrb9D0WI4/9Vrb9D0WI4.md ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/9Vrb9D0WI4/9Vrb9D0WI4_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/9Vrb9D0WI4/9Vrb9D0WI4_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/BT03V9Re9a/BT03V9Re9a.md ADDED
@@ -0,0 +1,491 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # EmbedDistill: A Geometric Knowledge Distillation for Information Retrieval
2
+
3
+ Anonymous Author(s)
4
+ Affiliation
5
+ Address
6
+ email
7
+
8
+ # Abstract
9
+
10
+ 1 Large neural models (such as Transformers) achieve state-of-the-art performance
11
+ 2 for information retrieval (IR). In this paper, we aim to improve distillation methods
12
+ 3 that pave the way for the resource-efficient deployment of such models in practice.
13
+ 4 Inspired by our theoretical analysis of the teacher-student generalization gap for
14
+ 5 IR models, we propose a novel distillation approach that leverages the relative
15
+ 6 geometry among queries and documents learned by the large teacher model. Unlike
16
+ 7 existing teacher score-based distillation methods, our proposed approach employs
17
+ 8 embedding matching tasks to provide a stronger signal to align the representations
18
+ 9 of the teacher and student models. In addition, it utilizes query generation to
19
+ 10 explore the data manifold to reduce the discrepancies between the student and the
20
+ 11 teacher where training data is sparse. Furthermore, our analysis also motivates
21
+ 12 novel asymmetric architectures for student models which realizes better embedding
22
+ 13 alignment without increasing online inference cost. On standard benchmarks like
23
+ 14 MSMARCO, we show that our approach successfully distills from both dual
24
+ 15 encoder (DE) and cross-encoder (CE) teacher models to 1/10th size asymmetric
25
+ 16 students that can retain $9 5 . 9 7 \%$ of the teacher performance.
26
+
27
+ # 17 1 Introduction
28
+
29
+ 18 Neural models for information retrieval (IR) are increasingly used to model the true ranking function
30
+ 19 in various applications, including web search [38], recommendation [65], and question-answering
31
+ 20 (QA) [6]. Notably, the recent success of Transformers [59]-based pre-trained language models [11,
32
+ 21 30, 49] on a wide range of natural language understanding tasks has also prompted their utilization in
33
+ 22 IR to capture query-document relevance [see, e.g., 10, 34, 43, 26, 20].
34
+ 23 A typical IR system comprises two stages: (1) A retriever first selects a small subset of potentially
35
+ 24 relevant candidate documents (out of a large collection) for a given query; and (2) A re-ranker then
36
+ 25 identifies a precise ranking among the candidates provided by the retriever. Dual-encoder (DE)
37
+ 26 models are the de-facto architecture for retrievers [26, 20]. Such models independently embed queries
38
+ 27 and documents into a common space, and capture their relevance by simple operations on these
39
+ 28 embeddings such as the inner product. This enables offline creation of a document index and supports
40
+ 29 fast retrieval during inference via efficient maximum inner product search implementations [12, 19],
41
+ 30 with online query embedding generation primarily dictating the inference latency. Cross-encoder (CE)
42
+ 31 models, on the other hand, are preferred as re-rankers, owing to their excellent performance [43, 9, 62].
43
+ 32 A CE model jointly encodes a query-document pair while enabling early interaction among query
44
+ 33 and document features. Employing a CE model for retrieval is often infeasible, as it would require
45
+ 34 processing a given query with every document in the collection at inference time. In fact, even in
46
+ 35 the re-ranking stage, the inference cost of CE models is high enough [22] to warrant exploration of
47
+ 36 efficient alternatives [14, 22, 37]. Across both architectures, scaling to larger models brings improved
48
+ 37 performance at increased computational cost [41, 39].
49
+ 38 Knowledge distillation [5, 13] provides a general strategy to address the prohibitive inference cost
50
+ 39 associated with high-quality large neural models. In the IR literature, most existing distillation
51
+ 40 methods only rely on the teacher’s query-document relevance scores [see, e.g., 31, 14, 8, 51, 56] or
52
+ 41 their proxies [16]. However, given that neural IR models are inherently embedding-based, it is natural
53
+ 42 to ask: Is it useful to go beyond matching of the teacher and student models’ scores, and directly aim
54
+ 43 to align their embedding spaces?
55
+ 44 With this in mind, we propose a novel distillation method for IR models that utilizes an embedding
56
+ 45 matching task to train student models. The proposed method is inspired by our rigorous treatment
57
+ 46 of the generalization gap between the teacher and student models in IR settings. Our theoretical
58
+ 47 analysis of the teacher-student generalization gap further suggests novel design choices involving
59
+ 48 asymmetric configurations for student DE models, intending to further reduce the gap by better
60
+ 49 aligning teacher and student embedding spaces. Notably, our proposed distillation method supports
61
+ 50 cross-architecture distillation and improves upon existing (score-based) distillation methods for both
62
+ 51 retriever and re-ranker models. When distilling a large teacher DE model into a smaller student DE
63
+ 52 model, for a given query (document), one can minimize the distance between the query (document)
64
+ 53 embeddings of the teacher and student (after compatible projection layers to account for dimension
65
+ 54 mismatch, if any). In contrast, a teacher CE model doesn’t directly provide document and query
66
+ 55 embeddings, and so to effectively employ embedding matching-based distillation requires modifying
67
+ 56 the scoring layer with dual-pooling [61] and adding various regularizers. Both of these changes
68
+ 57 improve geometry of teacher embeddings and facilitate effective knowledge transfer to the student
69
+ 58 DE model via embedding matching-based distillation.
70
+
71
+ 59 Our key contributions toward improving IR models via distillation are:
72
+
73
+ • We provide the first rigorous analysis of the teacher-student generalization gap for IR settings which captures the role of alignment of embedding spaces of the teacher and student towards reducing the gap (Sec. 3). Inspired by our analysis, we propose a novel distillation approach for neural IR models, namely EmbedDistill, that goes beyond score matching and aligns the embedding spaces of the teacher and student models (Sec. 4). We also show that EmbedDistill can leverage synthetic data to improve a student by further aligning the embedding spaces of the teacher and student (Sec. 4.3). Our analysis motivates novel distillation setups. Specifically, we consider a student DE model with an asymmetric configuration, consisting of a small query encoder and a frozen document encoder inherited from the teacher. This significantly reduces inference latency of query embedding generation, while leveraging the teachers’ high-quality document index (Sec. 4.1). We provide a comprehensive empirical evaluation of EmbedDistill (Sec. 5) on two standard IR benchmarks – Natural Questions [23] and MSMARCO [40]. We also evaluate EmbedDistill on BEIR benchmark [57] which is used to measure the zero-shot performance of an IR model.
74
+
75
+ 74 Note that prior works have utilized embedding alignment during distillation for non-IR setting [see,
76
+ 75 e.g., 52, 55, 18, 1, 64, 7]. However, to the best of our knowledge, our work is the first to study
77
+ 76 embedding matching-based distillation method for IR settings which requires addressing multiple
78
+ 77 IR-specific challenges such as cross-architecture distillation, partial representation alignment, and en
79
+ 78 abling novel asymmetric student configurations. Furthermore, unlike these prior works, our proposed
80
+ 79 method is theoretically justified to reduce the teacher-student performance gap.
81
+
82
+ # 80 2 Background
83
+
84
+ 81 Let Q and $\mathrm { \Phi _ { \mathrm { ~ \mathcal { D } ~ } } }$ denote the query and document spaces, respectively. An IR model is equivalent to
85
+ 82 a scorer $s : \Omega \times \mathcal { D } \mathbb { R }$ , i.e., it assigns a (relevance) score $s ( q , d )$ for a query-document pair
86
+ 83 $( \boldsymbol { q } , \boldsymbol { d } ) \in \Omega \times \mathcal { D }$ . Ideally, we want to learn a scorer such that $s ( q , d ) > s ( q , d ^ { \prime } )$ iff the document $d$ is
87
+ 84 more relevant to the query $q$ than document $d ^ { \prime }$ . We assume access to $n$ labeled training examples
88
+ 85 $\mathcal { S } _ { n } = \{ ( q _ { i } , \mathbf { d } _ { i } , \mathbf { y } _ { i } ) \} _ { i \in [ n ] } .$ . Here, $\mathbf { d } _ { i } = ( d _ { i , 1 } , \dots , d _ { i , L } ) \in \mathcal { D } ^ { L } , \forall i \in [ n ]$ , denotes a list of $L$ documents
89
+ 86 and $\mathbf { y } _ { i } = ( y _ { i , 1 } , \ldots , y _ { i , L } ) \in \{ 0 , 1 \} ^ { L }$ denotes the corresponding labels such that $y _ { i , j } = 1$ iff the
90
+ 87 document $d _ { i , j }$ is relevant to the query $q _ { i }$ . Given $\mathcal { S } _ { n }$ , we learn an IR model by minimizing
91
+
92
+ $$
93
+ R ( s ; \mathbb { S } _ { n } ) : = { \frac { 1 } { n } } \sum _ { i \in [ n ] } \ell { \bigl ( } s _ { q _ { i } , \mathbf { d } _ { i } } , \mathbf { y } _ { i } { \bigr ) } ,
94
+ $$
95
+
96
+ 88 where $s _ { q _ { i } , \mathbf { d } _ { i } } : = ( s ( q _ { i } , d _ { 1 , i } ) , \ldots , s ( q _ { i } , d _ { 1 , L } ) )$ and $\ell \left( s _ { q _ { i } , \mathbf { d } _ { i } } , \mathbf { y } _ { i } \right)$ denotes the loss $s$ incurs on $\left( q _ { i } , \mathbf { d } _ { i } , \mathbf { y } _ { i } \right)$ .
97
+ 89 Due to space constraint, we defer concrete choices for the loss function $\ell$ to Appendix A.
98
+ 90 While this learning framework is general enough to work with any IR models, next, we formally
99
+ 91 introduce two families of Transformer-based IR models that are prevalent in the recent literature.
100
+
101
+ # 92 2.1 Transformer-based IR models: Cross-encoders and Dual-encoders
102
+
103
+ Let query $q = \left( q ^ { 1 } , \ldots , q ^ { m _ { 1 } } \right)$ and document $d = ( d ^ { 1 } , \ldots , d ^ { m _ { 2 } } )$ consist of $m _ { 1 }$ and $m _ { 2 }$ tokens, respectively. We now discuss how Transformers-based CE and DE models process the $( q , d )$ pair.
104
+
105
+ 95 Cross-encoder model. Let $p = [ q ; d ]$ be the sequence obtained by concatenating $q$ and $d$ . Further,
106
+ 96 let $\tilde { p }$ be the sequence obtained by adding special tokens such [CLS] and [SEP] to $p$ . Given an
107
+ 97 encoder-only Transformer model Enc, the relevance score for the $( q , d )$ pair is
108
+
109
+ $$
110
+ s ( q , d ) = \langle w , \mathrm { p o o l } \bigl ( \mathrm { E n c } ( \tilde { p } ) \bigr ) \rangle = \langle w , \mathrm { e m b } _ { q , d } \rangle ,
111
+ $$
112
+
113
+ 98 where $w$ is a $d$ -dimensional classification vector, and $\mathrm { p o o l } ( \cdot )$ denotes a pooling operation that
114
+ 99 transforms the contextualized token embeddings $\operatorname { E n c } ( \tilde { p } )$ to a joint embedding vector $\mathtt { e m b } _ { q , d }$ . [CLS]-
115
+ 100 pooling is a common operation that simply outputs the embedding of the [CLS] token as $\mathtt { e m b } _ { q , d }$ .
116
+
117
+ Dual-encoder model. Let $\tilde { q }$ and $\tilde { d }$ be the sequences obtained by adding appropriate special tokens to $q$ and $d$ , respectively. A DE model comprises two (encoder-only) Transformers $\operatorname { E n c } _ { Q }$ and $\mathrm { E n c } _ { D }$ , which we call query and document encoders, respectively.1 Let $\mathsf { e m b } _ { q } = \mathrm { p o o l } \big ( \mathrm { E n c } _ { Q } ( \tilde { q } ) \big )$ and $\mathsf { e m b } _ { d }$ $= \mathrm { p o o l } \big ( \mathrm { E n c } _ { D } ( \tilde { d } ) \big )$ denote the query and document embeddings, respectively. Now, one can define $s ( q , d ) = \langle \mathbf { e m b } _ { q } , \mathbf { e m b } _ { d } \rangle$ to be the relevance score assigned to the $( q , d )$ pair by the DE model.
118
+
119
+ # 2.2 Score-based distillation for IR models
120
+
121
+ Most distillation schemes for IR [e.g., 31, 14, 8] rely on teacher relevance scores. Given a training set $\mathcal { S } _ { n }$ and a teacher with scorer $s ^ { \mathrm { t } }$ , one learns a student with scorer $s ^ { \mathrm { s } }$ by minimizing
122
+
123
+ $$
124
+ R ( s ^ { \mathrm { s } } , s ^ { \mathrm { t } } ; \mathcal { S } _ { n } ) = \frac { 1 } { n } \sum _ { i \in [ n ] } \ell _ { \mathrm { d } } \big ( s _ { q , \mathbf { d } _ { i } } ^ { \mathrm { s } } , s _ { q , \mathbf { d } _ { i } } ^ { \mathrm { t } } \big ) ,
125
+ $$
126
+
127
+ where $\ell _ { \mathrm { d } }$ captures the discrepancy between $s ^ { \mathrm { s } }$ and $s ^ { \mathrm { t } }$ . See Appendix A for common choices for $\ell _ { \mathrm { d } }$
128
+
129
+ # 10 3 Teacher-student generalization gap: Inspiration for embedding alignment
130
+
131
+ 111 Our main objective is to devise novel distillation methods to realize high-performing student DE
132
+ 112 models. As a first step in this direction, we rigorously study the teacher-student generalization
133
+ 113 gap as realized by standard (score-based) distillation in IR settings. Informed by our analysis, we
134
+ 114 subsequently identify novel ways to improve the student model’s performance. In particular, our
135
+ 115 analysis suggests two natural directions to reduce the teacher-student generalization gap: 1) enforcing
136
+ 116 tighter alignment between embedding spaces of teacher and student models; and 2) exploring novel
137
+ 117 asymmetric configuration for student DE model.
138
+ 118 Let $R ( s ) = \mathbb { E } \left[ \ell \left( s _ { q , \mathbf { d } } , \mathbf { y } \right) \right]$ be the population version of the empirical risk in Eq. 1, which measures
139
+ 119 the test time performance of the IR model defined by the scorer $s$ . Thus, $R ( s ^ { \mathrm { s } } ) - R ( s ^ { \mathrm { t } } )$ denotes the
140
+ 120 teacher-student generalization gap. In the following result, we bound this quantity (see Appendix C.1
141
+ 121 for a formal statement and proof). We focus on distilling a teacher DE model to a student DE model
142
+ 122 and $L = 1$ (cf. Sec. 2) as it leads to easier exposition without changing the main takeaways. Our
143
+ 123 analysis can be extended to $L > 1$ or CE to DE distillation with more complex notation.
144
+ 124 Theorem 3.1 (Teacher-student generalization gap (informal)). Let $\mathcal { F }$ and G denote the function
145
+ 125 classes for the query and document encoders for the student model, respectively. Suppose that the
146
+ 126 score-based distillation loss $\ell _ { \mathrm { d } }$ in Eq. 3 is based on binary cross entropy loss (Eq. 12 in Appendix A).
147
+ 127 Let one-hot (label-dependent) loss \` in Eq. 1 be the binary cross entropy loss (Eq. 10 in Appendix $A$ ).
148
+ 128 Further, assume that all encoders have the same output dimension and embeddings have their $\ell _ { 2 }$ -norm
149
+ 129 bounded by $K$ . Then, we have
150
+
151
+ $$
152
+ \begin{array} { r l } & { R ( s ^ { \mathrm { s } } ) - R ( s ^ { \mathrm { t } } ) \leq \displaystyle \mathcal { E } _ { n } ( \mathcal { F } , \mathfrak { G } ) + 2 K R _ { \mathrm { E m b } , Q } ( \mathfrak { t } , { \mathrm { s } } ; \mathcal { S } _ { n } ) + 2 K R _ { \mathrm { E m b } , D } ( \mathfrak { t } , { \mathrm { s } } ; \mathcal { S } _ { n } ) } \\ & { \qquad + \Delta ( s ^ { \mathrm { t } } ; \mathcal { S } _ { n } ) + K ^ { 2 } \bigl ( \mathbb { E } \left[ \left. \sigma ( s _ { q , d } ^ { \mathrm { t } } ) - y \right. \right] + \displaystyle \frac { 1 } { n } \sum _ { i \in [ n ] } \big \vert \sigma ( s _ { q , d _ { i } } ^ { \mathrm { t } } ) - y _ { i } \big \vert \big ) , } \end{array}
153
+ $$
154
+
155
+ 1 It is common to employ dual-encoder models where query and document encoders are shared.
156
+
157
+ ![](images/9e8e766c8265c2e75b6fcdbafd8432533c6448ff8ac70fa51c8e0ab6a64802df.jpg)
158
+ Figure 1: Proposed distillation method with query embedding matching. Left: The setting where student employs an asymmetric DE configuration with a small query encoder and a large (non-trainable) document encoder inherited from the teacher DE model. The smaller query encoder ensures small latency for encoding query during inference, and large document encoder leads to a good quality document index. Right: Similarly the setting of CE to DE distillation using EmbedDistill, with teacher CE model employing dual pooling.
159
+
160
+ where 130 $\begin{array} { r } { \mathcal { E } _ { n } ( \mathcal { F } , \mathcal { G } ) : = \operatorname* { s u p } _ { s ^ { \mathrm { s } } \in \mathcal { F } \times \mathcal { G } } \big | R ( s ^ { \mathrm { s } } , s ^ { \mathrm { t } } ; \mathbb { S } _ { n } ) - \mathbb { E } \ell _ { \mathrm { d } } \big ( s _ { q , d } ^ { \mathrm { s } } , s _ { q , d } ^ { \mathrm { t } } \big ) \big | , } \end{array}$ ; $\sigma$ denotes the sigmoid function; and 131 $\Delta ( s ^ { \mathrm { t } } ; \mathcal { S } _ { n } )$ denotes the deviation between the empirical risk (on $\mathcal { S } _ { n }$ ) and population risk of the 132 teacher $s ^ { \mathrm { t } }$ . Here, $R _ { \mathrm { E m b } , Q } ( \mathrm { t } , \mathrm { s } ; \mathcal { S } _ { n } )$ and $R _ { \mathrm { E m b } , D } ( \mathrm { t } , \mathrm { s } ; \mathcal { S } _ { n } )$ measure misalignment between teacher and 133 student embeddings by focusing on queries and documents, respectively (cf. Eq. 7 & 8 in Sec. 4.1).
161
+
162
+ 134 The last three quantities in the bound in Thm. 3.1, namely $\Delta ( s ^ { \mathrm { t } } ; \mathbb { S } _ { n } ) , \mathbb { E } [ | \sigma ( s _ { q , d } ^ { \mathrm { t } } ) - y | ]$ , and
163
+ 135 $\begin{array} { r } { \frac { 1 } { n } \sum _ { i \in [ n ] } | \sigma ( s _ { q _ { i } , d _ { i } } ^ { \mathrm { t } } ) - y _ { i } | } \end{array}$ , are independent of the underlying student model. These terms solely
164
+ 136 depend on the quality of the underlying teacher model $s ^ { \mathrm { t } }$ . That said, the teacher-student gap can be
165
+ 137 made small by reducing the following three terms: 1) uniform deviation of the student’s empirical
166
+ 138 distillation risk from its population version $\mathcal { E } _ { n } ( \mathcal { F } , \mathcal { G } ) ; 2 )$ misalignment between teacher student query
167
+ 139 embeddings $R _ { \mathrm { E m b } , Q } ( \mathrm { t } , \mathrm { s } ; \mathcal { S } _ { n } )$ ; and 3) misalignment between teacher student document embeddings
168
+ 140 $R _ { \mathrm { E m b } , D } ( \mathrm { t } , \mathrm { s } ; \mathcal { S } _ { n } )$ .
169
+ 141 The last two terms motivate us to propose an embedding matching-based distillation that explicitly
170
+ 142 aims to minimize these terms during student training. Even more interestingly, these terms also
171
+ 143 inspire an asymmetric $D E$ configuration for the student which strikes a balance between the goals of
172
+ 144 reducing the misalignment between the embeddings of teacher and student (by inheriting teacher’s
173
+ 145 document encoder) and ensuring serving efficiency (small inference latency) by employing a small
174
+ 146 query encoder. Before discussing these proposals in detail in Sec. 4 and Fig. 1, we explore the first
175
+ 147 term $\textstyle { \mathcal { E } } _ { n } ( { \mathcal { F } } , { \mathcal { G } } )$ and highlight how our proposals also have implications for reducing this term. Towards
176
+ 148 this, the following result bounds $\mathcal { E } _ { n } ( \mathcal { F } , \mathcal { G } )$ . Due to space constraints, we present an informal statement
177
+ 149 of the result (see Appendix C.2 for a more precise statement and proof).
178
+ 150 Proposition 3.2. Let $\ell _ { \mathrm { d } }$ be a distillation loss which is $L _ { \ell _ { \mathrm { d } } }$ -Lipschitz in its first argument. Let $\mathcal { F }$ and G
179
+ 151 denote the function classes for the query and document encoders, respectively. Further assume that,
180
+ 152 for each query and document encoder in our function class, the query and document embeddings
181
+ 153 have their $\ell _ { 2 }$ -norm bounded by $K$ . Then,
182
+
183
+ $$
184
+ { \mathcal E } _ { n } ( \mathcal F , \mathcal G ) \leq { \mathbb E } _ { \mathcal S _ { n } } \frac { 4 8 K L _ { \ell _ { \mathrm { d } } } } { \sqrt { n } } \int _ { 0 } ^ { \infty } \sqrt { \log \left( N ( u , \mathcal F ) N ( u , \mathcal G ) \right) } d u .
185
+ $$
186
+
187
+ Furthermore, with a fixed document encoder, i.e., 154 $\mathcal { G } = \{ g ^ { * } \}$ ,
188
+
189
+ $$
190
+ \mathcal { E } _ { n } ( \mathcal { F } , \{ g * \} ) \leq \mathbb { E } _ { \mathcal { S } _ { n } } \frac { 4 8 K L _ { \ell _ { \mathrm { d } } } } { \sqrt { n } } \int _ { 0 } ^ { \infty } \sqrt { \log N ( u , \mathcal { F } ) } d u .
191
+ $$
192
+
193
+ 155 Here, $N ( u , \cdot )$ is the $u$ -covering number of a function class.
194
+
195
+ 156 Note that Eq. 5 and Eq. 6 correspond to uniform deviation when we train without and with a frozen
196
+ 157 document encoder, respectively. It is clear that the bound in Eq. 6 is less than or equal to that in
197
+ 158 Eq. 5 (because $N ( u , \mathcal { G } ) \ge 1$ for any $u ^ { \cdot }$ ), which alludes to desirable impact of employing a frozen
198
+ 159 document encoder as one of our proposal seeks to do via inheriting teacher’s document encoder (for
199
+ 160 instance in an asymmetric DE configuration). Furthermore, our proposal of employing an embedding
200
+ 161 matching task will regularize the function class of query encoders; effectively reducing it to ${ \mathcal { F } } ^ { \prime }$ with
201
+ 162 $| \mathcal { F } ^ { \prime } | \leq | \bar { \mathcal { F } } |$ . The same holds true for document encoder function class when document encoder is
202
+ 163 trainable (as in Eq. 5), leading to an effective function class ${ \mathcal { G } } ^ { \prime }$ with $| \mathcal { G } ^ { \prime } | \leq | \mathcal { G } |$ . Since we would have
203
+ 164 $N ( u , \mathcal { F } ^ { \prime } ) \leq N ( u , \mathcal { F } )$ and $N ( u , \mathcal { G } ^ { \prime } ) \leq N ( u , \mathcal { G } )$ , this suggests desirable implications of embedding
204
+ 165 matching for reducing the uniform deviation bound.
205
+
206
+ # 166 4 Embedding-matching based distillation
207
+
208
+ 7 Informed by our analysis of teacher-student generalization gap in Sec. 3, we propose EmbedDistill – a
209
+ 68 novel distillation method that explicitly focuses on aligning the embedding spaces of the teacher and
210
+ 69 student. Our proposal goes beyond existing distillation methods in the IR literature that only use the
211
+ 70 teacher scores. Next, we introduce EmbedDistill for two prevalent settings: (1) distilling a large DE
212
+ 71 model to a smaller DE model; 2 and (2) distilling a CE model to a DE model.
213
+
214
+ # 172 4.1 DE to DE distillation
215
+
216
+ 173 Given a $( q , d )$ pair, let $\mathsf { e m b } _ { q } ^ { \mathrm { t } }$ and $\mathtt { e m b } _ { d } ^ { \mathrm { t } }$ be the query and document embeddings produced by the
217
+ 174 query encoder $\mathrm { E n c } _ { Q } ^ { \mathrm { t } }$ and document encoder $\mathrm { E n c } _ { D } ^ { \mathrm { t } }$ of the teacher DE model, respectively. Similarly,
218
+ 175 let $\mathsf { e m b } _ { q } ^ { \mathrm { s } }$ and $\mathsf { e m b } _ { d } ^ { \mathrm { s } }$ denote the query and document embeddings produced by a student DE model
219
+ 176 with $( \dot { \mathrm { E n c } } _ { Q } ^ { \mathrm { s } } , \mathrm { E n c } _ { D } ^ { \mathrm { s } } )$ as its query and document encoders. Now, EmbedDistill optimizes the following
220
+ 177 embedding alignment losses in addition to the score-matching loss from Sec. 2.2 to align query and
221
+ 178 document embeddings of the teacher and student:
222
+
223
+ $$
224
+ \begin{array} { r l } & { R _ { \mathrm { E m b } , Q } ( \mathrm { t } , \mathrm { s } ; \mathbb { S } _ { n } ) = \displaystyle \frac { 1 } { n } \sum _ { q \in \mathcal { S } _ { n } } \| \mathbf { e m b } _ { q } ^ { \mathrm { t } } - \mathrm { p r o j } \big ( \mathbf { e m b } _ { q } ^ { \mathrm { s } } \big ) \| ; } \\ & { R _ { \mathrm { E m b } , D } ( \mathrm { t } , \mathrm { s } ; \mathbb { S } _ { n } ) = \displaystyle \frac { 1 } { n } \sum _ { d \in \mathcal { S } _ { n } } \| \mathbf { e m b } _ { d } ^ { \mathrm { t } } - \mathrm { p r o j } \big ( \mathbf { e m b } _ { d } ^ { \mathrm { s } } \big ) \| . } \end{array}
225
+ $$
226
+
227
+ 179 Asymmetric DE. We also propose a novel student DE configuration where the student employs the
228
+ 180 teacher’s document encoder (i.e., $\mathrm { E n c } _ { D } ^ { \mathrm { s } } = \mathrm { E n c } _ { D } ^ { \mathrm { t } } ,$ ) and only train its query encoder, which is much
229
+ 181 smaller compared to the teacher’s query encoder. For such a setting, it is natural to only employ the
230
+ 182 embedding matching loss in Eq. 7 as the document embeddings are aligned by design (cf. Fig. 1a).
231
+ 183 Note that this asymmetric student DE does not incur an increase in latency despite the use of a
232
+ 184 large teacher document encoder. This is because the large document encoder is only needed to
233
+ 185 create a good quality document index offline, and only the query encoder is evaluated at inference
234
+ 186 time. Also, the similarity search cost is not increased as the projection layer ensures the same small
235
+ 187 embedding dimension as in the symmetric DE student. Thus, for DE to DE distillation, we prescribe
236
+ 188 the asymmetric DE configuration universally. Our theoretical analysis (cf. Sec. 3) and experimental
237
+ 189 results (cf. Sec. 5) suggest that the ability to inherit the document tower from the teacher DE model
238
+ 190 can drastically improve the final performance, especially when combined with query embedding
239
+ 191 matching task (cf. Eq. 7).
240
+
241
+ # 4.2 CE to DE distillation
242
+
243
+ 193 Given that CE models jointly encode query-document pairs, individual query and document embed
244
+ 94 dings are not readily available to implement embedding matching losses as per Eq. 7 and 8. This
245
+ 95 makes it challenging to employ EmbedDistill for CE to DE distillation.
246
+
247
+ As a naïve solution, for a $( q , d )$ pair, one can simply match a joint transformation of the student’s query embedding $\mathsf { e m b } _ { q } ^ { \mathrm { s } }$ and document embedding $\mathsf { e m b } _ { d } ^ { \mathrm { s } }$ to the teacher’s joint embedding $\mathtt { e m b } _ { q , d } ^ { \mathrm { t } }$ , produced by (single) teacher encoder $\operatorname { E n c } ^ { t }$ . However, we observed that including such an embedding matching task often leads to severe over-fitting, and results in a poor student. Since $s ^ { \mathrm { t } } ( q , d ) = \langle \bar { w } , \mathtt { e m b } _ { q , d } ^ { \mathrm { t } } \rangle$ , during CE model training, the joint embeddings $\mathtt { e m b } _ { q , d } ^ { \mathrm { t } }$ for relevant and irrelevant $( q , d )$ pairs are encouraged to be aligned with $w$ and $- w$ , respectively. This produces degenerate embeddings that do not capture semantic query-to-document relationships. We notice that even the final query and document token embeddings lose such semantic structure (cf. Appendix G.2). Thus, a teacher CE model with $s ^ { \mathrm { t } } ( q , d ) = \langle w , \mathsf { e m b } _ { q , d } ^ { \mathrm { t } } \rangle$ does not add value for distillation beyond score-matching; in fact, it hurts to include naïve embedding matching. Next, we propose a modified CE model training strategy that facilitates EmbedDistill.
248
+
249
+ CE models with dual pooling. A dual pooling scheme is employed in the scoring layer to produce two embeddings $\mathsf { e m b } _ { q \gets ( q , d ) } ^ { \mathrm { t } }$ and $\mathsf { e m b } _ { d ( q , d ) } ^ { \mathrm { t } }$ from a CE model that serve as the proxy query and document embeddings, respectively. Accordingly, we define the relevance score as $s ^ { \mathrm { t } } ( q , d ) \ =$ $\langle \mathbf { e m b } _ { q ( q , d ) } ^ { \mathrm { t } } , \mathbf { e m b } _ { d ( q , d ) } ^ { \mathrm { t } } \rangle$ . We explore two variants of dual pooling: (1) special token-based pooling that pools from [CLS] and [SEP]; and (2) segment-based weighted mean pooling that separately
250
+
251
+ Table 1: Full recall performance of various student DE models on NQ dev set, including symmetric DE student model (67.5M or 11.3M transformer for both encoders), and asymmetric DE student model (67.5M or 11.3M transformer as query encoder and document embeddings inherited from the teacher). All distilled students used the same teacher (110.1M parameter BERT-base models as both encoders), with the full Recall $\textcircled { \omega } 5 = 7 2 . 3 $ , Recall $\textcircled { \omega } 2 0 = 8 6 . 1 $ , and Recall $\textcircled { a } 1 0 0 = 9 3 . 6 $ .
252
+
253
+ <table><tr><td rowspan="2">Method</td><td colspan="3">6-Layer (67.5M)</td><td colspan="3">4-Layer (11.3M)</td></tr><tr><td></td><td>R@5 R@20R@100</td><td></td><td></td><td>R@5 R@20R@100</td><td></td></tr><tr><td>Train student directly</td><td>36.2</td><td>59.7</td><td>80.0</td><td>24.8</td><td>44.7</td><td>67.5</td></tr><tr><td>+ Distill from teacher</td><td>65.3</td><td>81.6</td><td>91.2</td><td>44.3</td><td>64.9</td><td>81.0</td></tr><tr><td>+ Inherit doc embeddings</td><td>69.9</td><td>83.9</td><td>92.3</td><td>56.3</td><td>70.9</td><td>82.5</td></tr><tr><td>+ Query embedding matching</td><td>72.7</td><td>86.5</td><td>93.9</td><td>61.2</td><td>75.2</td><td>85.1</td></tr><tr><td>+ Query generation</td><td>73.4</td><td>86.3</td><td>93.8</td><td>64.3</td><td>77.8</td><td>87.9</td></tr><tr><td>Train student using only embedding matching and</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>inherit doc embeddings</td><td>71.4</td><td>84.9</td><td>92.6</td><td>64.6</td><td>50.2</td><td>76.8</td></tr><tr><td>+ Query generation</td><td>71.8</td><td>85.0</td><td>93.0</td><td>54.2</td><td>68.9</td><td>80.8</td></tr></table>
254
+
255
+ Table 2: Performance of EmbedDistill for DE to DE distillation on NQ test set. While prior works listed in the table rely on techniques such as negative mining and multistage training, we explore the orthogonal direction of embedding-matching that improves single-stage distillation, which can be combined with them.
256
+
257
+ <table><tr><td>Method</td><td>#Layers</td><td>R@20</td><td>R@100</td></tr><tr><td>DPR [20]</td><td>12</td><td>78.4</td><td>85.4</td></tr><tr><td>DPR + PAQ[47]</td><td>12</td><td>84.0</td><td>89.2</td></tr><tr><td>DPR + PAQ[47]</td><td>24</td><td>84.7</td><td>89.2</td></tr><tr><td>ACNE [60]</td><td>12</td><td>81.9</td><td>87.5</td></tr><tr><td>RocketQA [48]</td><td>12</td><td>82.7</td><td>88.5</td></tr><tr><td>MSS-DPR[53]</td><td>12</td><td>84.0</td><td>89.2</td></tr><tr><td>MSS-DPR[53]</td><td>24</td><td>84.8</td><td>89.8</td></tr><tr><td>Our teacher [63]</td><td>12 (220.2M)</td><td>85.4</td><td>90.0</td></tr><tr><td>EmbedDistill</td><td>6 (67.5M)</td><td>85.1</td><td>89.8</td></tr><tr><td>EmbedDistill</td><td>4 (11.3M)</td><td>81.2</td><td>87.4</td></tr></table>
258
+
259
+ 12 performs weighted averaging on the query and document segments of the final token embeddings.
260
+ 13 See Appendix B for details.
261
+
262
+ In addition to dual pooling, we also utilize a reconstruction loss during the CE training, which measures the likelihood of predicting each token of the original input from the final token embeddings. This loss encourages reconstruction of query and document tokens based on the final token embeddings and prevents the degeneration of the token embeddings during training. Given proxy embeddings from the teacher CE, we can perform EmbedDistill with the embedding matching loss defined in Eq. 7 and Eq. 8 (cf. Fig. 1b).
263
+
264
+ # 4.3 Task-specific online data generation
265
+
266
+ Data augmentation as a general technique has been previously considered in the IR literature [see, e.g., 45, 47, 17], especially in data-limited, out-of-domain, or zero-shot settings. As EmbedDistill aims to align the embeddings spaces of the teacher and student, the ability to generate similar queries or documents can naturally help enforce such an alignment globally on the task-specific manifold. Given a set of unlabeled task-specific query and document pairs $\mathbb { U } _ { m }$ , we can further add the embedding matching losses $R _ { \mathrm { E m b , Q } } ( \mathrm { t } , \mathrm { s } ; \mathcal { U } _ { m } )$ or $R _ { \mathrm { E m b , D } } ( \mathrm { t } , \mathrm { s } ; \mathcal { U } _ { m } )$ to our training objective. Interestingly, for DE to DE distillation setting, our approach can even benefit from a large collection of task-specific queries $\Omega ^ { \prime }$ or documents $\mathrm { \textmathcal { D } ^ { \prime } }$ . Here, we can independently employ embedding matching losses $R _ { \mathrm { E m b , Q } } ( \mathrm { t } , \mathrm { s } ; \Omega ^ { \prime } )$ or $R _ { \mathrm { E m b , D } } ( \mathrm { t } , \mathrm { s } ; \mathcal { D } ^ { \prime } )$ that focus on queries and documents, respectively. Please refer to Appendix E describing how the task-specific data were generated.
267
+
268
+ # 5 Experiments
269
+
270
+ We now conduct a comprehensive evaluation of the proposed distillation approach. Specifically, we highlight the utility of the approach for both DE to DE and CE to DE distillation. We also showcase the benefits of combining our distillation approach with query generation methods.
271
+
272
+ # 5.1 Setup
273
+
274
+ Benchmarks and evaluation metrics. We consider two popular IR benchmarks — Natural Questions (NQ) [24] and MSMARCO [40], which focus on finding the most relevant passage/document given a question and a search query, respectively. NQ provides both standard test and dev sets, whereas MSMARCO provides only the dev set that are widely used for common benchmarks. In what follows, we use the terms query (document) and question (passages) interchangeably. For NQ, we use the standard full recall (strict) as well as the relaxed recall metric [20] to evaluate the retrieval performance. For MSMARCO, we focus on the standard metrics Mean Reciprocal Rank $( \mathbf { M } \mathbf { R } \mathbf { R } ) @ 1 0$ , and normalized Discounted Cumulative Gain $( \mathrm { n D C G } ) @ 1 0$ to evaluate both re-ranking and retrieval performance. For the re-ranking, we restrict to re-ranking only the top 1000 candidate document provided as part of the dataset to be fair, while some works use stronger methods to find better top 1000 candidates for re-ranking (resulting in higher evaluation numbers) See Appendix D for a detailed discussion on these evaluation metrics. Finally, we also evaluate EmbedDistill on the BEIR benchmark [57] in terms of nDCG $@ 1 0$ and recall $@ 1 0 0$ metrics.
275
+
276
+ 9 Model architectures. We follow the standard Transformers-based IR model architectures similar to Karpukhin et al. [20], Qu et al. [48], Oguz et al. ˘ [47]. We utilized various sizes of DE models based on BERT-base [11] (12-layer, 768 dim, 110M parameters), DistilBERT [55] (6-layer, 768 dim, 67.5M parameters $- \sim 2 / 3$ of base), or BERT-mini [58] (4-layer, 256 dim, 11.3M parameters $- \sim 1 / 1 0$ of base). For query generation (cf. Sec. 4.3), we employ BART-base [27], an encoder-decoder model, to generate similar questions from each training example’s input question (query). We randomly mask $\bar { 1 } 0 \%$ of tokens and inject zero mean Gaussian noise with $\sigma = \{ 0 . 1 , 0 . 2 \}$ between the encoder and decoder. See Appendix E for more details on query generation and Appendix F.1 for hyperparameters.
277
+
278
+ # 5.2 DE to DE distillation
279
+
280
+ We employ AR2 $[ 6 3 ] ^ { 3 }$ and SentenceBERTv5 $[ 5 0 ]$ as teacher DE models for NQ and MSMARCO. Note that both models are based on BERT-base. For DE to DE distillation, we consider two kinds of configurations for the student DE model: (1) Symmetric: We use identical question and document encoders. We evaluate DistilBERT and BERT-mini on both datasets. (2) Asymmetric: The student inherits document embeddings from the teacher DE model and are not trained during the distillation. For query encoder, we use DistilBERT or BERT-mini which are smaller than document encoder.
281
+
282
+ Student DE model training. We train student DE models using a combination of (i) one-hot loss (cf. Eq. 9 in Appendix A) on training data; (ii) distillation loss in (cf. Eq. 11 in Appendix A); and (iii) em
283
+
284
+ Table 3: Performance of various DE models on MSMARCO dev set for both $r e$ -ranking and retrieval tasks (full corpus). The teacher model (110.1M parameter BERT-base models as both encoders) for re-ranking achieves MRR $@ 1 0$ of 36.8 and that for retrieval get MRR $@ 1 0$ of 37.2. The table shows performance (in MRR $@ 1 0$ ) of the symmetric DE student model (67.5M or 11.3M transformer as both encoders), and asymmetric DE student model $( 6 7 . 5 \mathrm { M }$ or $1 1 . 3 \mathbf { M }$ transformer as query encoder and document embeddings inherited from the teacher).
285
+
286
+ <table><tr><td rowspan="2">Method</td><td colspan="2">Re-ranking</td><td colspan="2">Retrieval</td></tr><tr><td>67.5M</td><td>11.3M</td><td>67.5M</td><td>11.3M</td></tr><tr><td>Train student directly</td><td>27.0</td><td>23.0</td><td>22.6</td><td>18.6</td></tr><tr><td>+ Distill from teacher</td><td>34.6</td><td>30.4</td><td>35.0</td><td>28.6</td></tr><tr><td>+ Inherit doc embeddings</td><td>35.2</td><td>32.1</td><td>35.7</td><td>30.3</td></tr><tr><td>+ Query embedding matching</td><td>36.2</td><td>35.0</td><td>35.4</td><td>40.8</td></tr><tr><td>+ Query generation</td><td>36.2</td><td>34.4</td><td>37.2</td><td>34.8</td></tr><tr><td>Train student using only embedding matching and</td><td></td><td></td><td></td><td></td></tr><tr><td>inherit doc embeddings</td><td>36.5</td><td>33.5</td><td>36.6</td><td>31.4</td></tr><tr><td>+ Query generation</td><td>36.4</td><td>34.1</td><td>36.7</td><td>32.8</td></tr></table>
287
+
288
+ bedding matching loss in Eq. 7. We used [CLS]-pooling for all student encoders. Unlike DPR [20] or AR2, we do not use hard negatives from BM25 or other models, which greatly simplifies our distillation procedure.
289
+
290
+ Results and discussion. To understand the impact of various proposed configurations and losses, we train models by sequentially adding components and evaluate their retrieval performance on NQ and MSMARCO dev set as shown in Table 1 and Table 3 respectively. (See Table 6 in Appendix F.2 for performance on NQ in terms of the relaxed recall and Table 7 in Appendix F.3 for MSMARCO in terms of $\mathrm { n D C G G } 1 0 .$ )
291
+
292
+ We begin by training a symmetric DE without distillation. As expected, moving to distillation brings in considerable gains. Next, we swap the student document encoder with document embeddings from the teacher (non-trainable), which leads to a good jump in the performance. Now we can introduce EmbedDistill with Eq. 7 for aligning query representations between student and teacher. The two losses are combined with weight of 1.0 (except for BERT-mini models in the presence of query generation with 5.0). This improves performance significantly, e.g.,it provides ${ \sim } 3$ and ${ \sim } 5 $ points increase in recall $\textcircled { \alpha } 5$ on NQ with students based on DistilBERT and BERT-mini, respectively (Table 1). We further explore the utility of EmbedDistill in aligning the teacher and student embedding spaces in Appendix G.1.
293
+
294
+ On top of the two losses (standard distillation and embedding matching), we also use $R _ { \mathrm { E m b , Q } } ( \mathrm { t } , \mathrm { s } ; \Omega ^ { \prime } )$ from Sec. 4.3 on 2 additional questions (per input question) generated from BART. We also try a variant where we eliminate the standard distillation loss and only employ the embedding matching loss in Eq. 7 along with inheriting teacher’s document embeddings. This configuration without the standard distillation loss leads to excellent performance (with query generation again providing additional gains in most cases.)
295
+
296
+ It is worth highlighting that DE models trained with the proposed methods (e.g., asymmetric DE with embedding matching and generation) achieve $9 9 \%$ of the performance in both NQ/MSMARCO tasks with a query encoder that is 2/3rd the size of that of the teacher. Furthermore, even with 1/10th size of the query encoder, our proposal can achieve $9 5 . 9 7 \%$ of the performance. This is particularly useful for latency critical applications with minimal impact on the final performance.
297
+
298
+ Finally, we take our best student models, i.e., one trained using with additional embedding matching loss and using data augmentation from query generation, and evaluate on test sets. We compare with various prior work and note that most prior work used considerably bigger models in terms of parameters, depth (12 or 24 layers), or width (upto 1024 dims). For NQ test set results are reported in Table 2, but as MSMARCO does not have any public test set, we instead present results for the BEIR benchmark in Table 4. Note we also provide evaluation of our SentenceBERT teacher achieving very high performance on the benchmark which can be of independent interest (please refer to Appendix F.4 for details). For both NQ and BEIR, our approach obtains competitive student model with fewer than $50 \%$ of the parameters: even with 6 layers, our student model is very close $( 9 8 - 9 9 \%$ ) to its teacher.
299
+
300
+ Table 4: Average BEIR performance of our DE teacher and EmbedDistill student models and their numbers of trainable parameters. Both models are trained on MSMARCO and evaluated on 14 other datasets (the average does not include MSMARCO). The full table is at Appendix F.4. With EmbedDistill, student materializes most of the performance of the teacher on the unforeseen datasets.
301
+
302
+ <table><tr><td>Method</td><td>#Layers</td><td>nDCG@10</td><td>R@100</td></tr><tr><td>DPR [21]</td><td>12</td><td>22.5</td><td>47.7</td></tr><tr><td>ANCE [60]</td><td>12</td><td>40.5</td><td>60.0</td></tr><tr><td>TAS-B [15]</td><td>6</td><td>42.8</td><td>64.8</td></tr><tr><td>GenQ [57]</td><td>6</td><td>42.5</td><td>64.2</td></tr><tr><td>Our teacher [50]</td><td>12 (220.2M)</td><td>45.7</td><td>65.1</td></tr><tr><td>EmbedDistill</td><td>6 (67.5M)</td><td>44.0</td><td>63.5</td></tr></table>
303
+
304
+ # 5.3 CE to DE distillation
305
+
306
+ We consider two CE teachers for MSMARCO reranking task5 : a standard [CLS]-pooled CE teacher, and the Dual-pooled CE teacher (cf. Sec. 4.2). Both teachers are based on RoBERTa-base and trained on triples in the training set for 300K steps with crossentropy loss.
307
+
308
+ Student DE model training. We considered the following distillation variants: standard score-based distillation from the [CLS]-pooled teacher, and our novel Dual-pooled CE teacher (with and without embedding matching loss). For each variant, we initialize encoders of the student DE model with two RoBERTabase models and train for 500K steps on the training triples. We performed the naïve joint embedding matching for the [CLS]-pooled teacher (cf. Sec. 4.2) and employed the query embedding matching (cf. Eq.7) for the Dual-pooled CE teacher. In either case, embedding-matching loss is added on top of the standard cross entropy loss with the weight of 1.0 (when used).
309
+
310
+ Table 5: Performance of DE models distilled from [CLS]-pooled and Dual-pooled CE models on MSMARCO re-ranking task (original top $1 0 0 0 \ \mathrm { d e v } )$ . While both teacher models perform similarly, embedding matching-based distillation only works with the Dual-pooled teacher. See Appendix F for $\mathrm { n D C G } @ 1 0$ metric.
311
+
312
+ <table><tr><td>Method</td><td>MRR@10</td></tr><tr><td>[CLS]-pooled teacher</td><td>37.1</td></tr><tr><td>Dual-pooled teacher</td><td>37.0</td></tr><tr><td>Standard distillation from [CLs]-pooled teacher</td><td>33.0</td></tr><tr><td>+Joint matching</td><td>32.4</td></tr><tr><td>Standard distillation from Dual-pooled teacher</td><td>33.3</td></tr><tr><td>+Query matching</td><td>33.7</td></tr></table>
313
+
314
+ Results and discussion. Table 5 evaluates the effectiveness of the dual pooling and the embedding matching for CE to DE distillation. As described in Sec. 4.2, the traditional [CLS]-pooled teacher did not provide any useful embedding for the embedding matching (see Appendix G.2 for the further analysis of the resulting embedding space). However, with the Dual-pooled teacher, embedding matching does boost student’s performance.
315
+
316
+ # 6 Related work
317
+
318
+ Here, we position our EmbedDistill work with respect to prior work on distillation and data augmentation for Transformers-based IR models. We also cover prior efforts on aligning representations during distillation for non-IR settings. Unlike our problem setting where the DE student is factorized, these works mainly consider distilling a single large Transformer into a smaller one.
319
+
320
+ Distillation for IR. Traditional distillation techniques have been widely applied in the IR literature, often to distill a teacher CE model to a student DE model [28, 8]. Recently, distillation from a DE
321
+
322
+ 353 model (with complex late interaction) to another DE model (with inner-product scoring) has also been
323
+ 354 considered [29, 15]. As for distilling across different model architectures, Lu et al. [31], Izacard and
324
+ 355 Grave [16] consider distillation from a teacher CE model to a student DE model. Hofstätter et al. [14]
325
+ 356 conduct an extensive study of knowledge distillation across a wide-range of model architectures. Most
326
+ 357 existing distillation schemes for IR rely on only teacher scores; by contrast, we propose a geometric
327
+ 358 approach that also utilizes the teacher embeddings. Many recent efforts [48, 51, 56] show that iterative
328
+ 359 multi-stage (self-)distillation improves upon single-stage distillation [48, 51, 56]. These approaches
329
+ 360 use a model from the previous stage to obtain labels [56] as well as mine harder-negatives [60]. We
330
+ 361 only focus on the single-stage distillation in this paper. Multi-stage procedures are complementary to
331
+ 362 our work, as one can employ our proposed embedding-matching approach in various stages of such a
332
+ 363 procedure. Interestingly, we demonstrate in Sec. 5 that our proposed EmbedDistill can successfully
333
+ 364 benefit from high quality models trained with such complex procedures [50, 63]. In particular, our
334
+ 365 single-stage distillation method can transfer almost all of their performance gains to even smaller
335
+ 366 models. Also to showcase that our method brings gain orthogonal to how teacher was trained, we
336
+ 367 conduct experiments with single-stage trained teacher in Appendix F.5.
337
+ 368 Distillation with representation alignments. Outside of the IR context, a few prior works proposed
338
+ 369 to utilize alignment between hidden layers during distillation [52, 55, 18, 1, 64]. Chen et al. [7] utilize
339
+ 370 the representation alignment to re-use teacher’s classification layer for image classification. Unlike
340
+ 371 these works, our work is grounded in a rigorous theoretical understanding of the teacher-student
341
+ 372 (generalization) gap for IR models. Further, our work differs from these as it needs to address multiple
342
+ 373 challenges presented by an IR setting: 1) cross-architecture distillation such as CE to DE distillation;
343
+ 374 2) partial representation alignment of query or document representations as opposed to aligning for
344
+ 375 the entire input, i.e., a query-documents pair; and 3) catering representation alignment approach to
345
+ 376 novel IR setups such as asymmetric DE configuration. To the best of our knowledge, our work is first
346
+ 377 in the IR literature that goes beyond simply matching scores (or its proxies) for distillation.
347
+
348
+ Semi-supervised learning for IR. Data augmentation or semi-supervised learning has been previously used to ensure data efficiency in IR [see, e.g., 35, 66]. More interestingly, data augmentation have enabled performance improvements as well. Doc2query [45, 44] performs document expansion by generating queries that are relevant to the document and appending those queries to the document. Query expansion has also been considered, e.g., for document re-ranking [67]. Notably, generating synthetic (query, passage, answer) triples from a text corpus to augment existing training data for QA systems also leads to significant gains [2, 47]. Furthermore, even zero-shot approaches, where no labeled query-document pairs are used, can also perform competitively to supervised methods [26, 17, 33, 54]. Unlike these works, we utilize query-generation capability to ensure tighter alignment between the embedding spaces of the teacher and student.
349
+
350
+ Richer transformers-based architectures for IR. Besides DE and CE models (cf. Sec. 2), intermediate configurations [36, 22, 42, 32] have been proposed. Such models independently encode query and document before applying a more complex late interaction between the two. Nogueira et al. [46] explore generative encoder-decoder style model for re-ranking. In this paper, we focus on basic DE/CE models to showcase the benefits of our proposed geometric distillation approach. Exploring embedding matching for aforementioned architectures is an interesting avenue for future work.
351
+
352
+ # 394 7 Conclusion
353
+
354
+ We propose EmbedDistill — a novel distillation method for IR that goes beyond simple score matching. En route, we provide a theoretical understanding of the teacher-student generalization gap in an IR setting which not only motivated EmbedDistill but also inspired new design choices for the student DE models: (a) reusing the teacher’s document encoder in the student and (b) aligning query embeddings of the teacher and student. This simple approach delivers consistent quality and computational gains in practical deployments and we demonstrate them on MSMARCO, NQ, and BEIR benchmarks. Finally, we found EmbedDistill retains $9 5 . 9 7 \%$ of the teacher performance to with 1/10th size students.
355
+
356
+ Limitations. As discussed in Sec. 4.2 and 5.3, EmbedDistill requires modifications in the CE scoring function to be effective. In terms of underlying IR model architectures, we only explore Transformerbased models in our experiments; primarily due to their widespread utilization. That said, we expect our results to extend to non-Transformer architectures such as MLPs. Finally, we note that our experiments only consider NLP domains, and exploring other modalities (e.g., vision) or multi-modal settings (e.g., image-to-text search) is left as an interesting avenue for future work.
357
+
358
+ 408 References [1] Gustavo Aguilar, Yuan Ling, Yu Zhang, Benjamin Yao, Xing Fan, and Chenlei Guo. Knowledge distillation from internal representations. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 7350–7357, 2020. [2] Chris Alberti, Daniel Andor, Emily Pitler, Jacob Devlin, and Michael Collins. Synthetic QA corpora generation with roundtrip consistency. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 6168–6173, Florence, Italy, July 2019. Association for Computational Linguistics. doi: 10.18653/v1/P19-1620. URL https://aclanthology.org/P19-1620. [3] Yoshua Bengio and Jean-SÉbastien Senecal. Adaptive importance sampling to accelerate training of a neural probabilistic language model. IEEE Transactions on Neural Networks, 19 (4):713–722, 2008. doi: 10.1109/TNN.2007.912312. [4] Olivier Bousquet, Stéphane Boucheron, and Gábor Lugosi. Introduction to Statistical Learning Theory, pages 169–207. Springer Berlin Heidelberg, Berlin, Heidelberg, 2004. ISBN 978-3-540-28650-9. doi: 10.1007/978-3-540-28650-9_8. URL https://doi.org/10.1007/ 978-3-540-28650-9_8. [5] Cristian Bucila, Rich Caruana, and Alexandru Niculescu-Mizil. Model compression. In ˇ Proceedings of the 12th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’06, pages 535–541, New York, NY, USA, 2006. ACM. [6] Danqi Chen, Adam Fisch, Jason Weston, and Antoine Bordes. Reading Wikipedia to answer open-domain questions. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1870–1879, Vancouver, Canada, July 2017. Association for Computational Linguistics. doi: 10.18653/v1/P17-1171. URL https://aclanthology.org/P17-1171. [7] Defang Chen, Jian-Ping Mei, Hailin Zhang, Can Wang, Yan Feng, and Chun Chen. Knowledge distillation with the reused teacher classifier. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 11933–11942, 2022. [8] Xuanang Chen, Ben He, Kai Hui, Le Sun, and Yingfei Sun. Simplified tinybert: Knowledge distillation for document retrieval. In Djoerd Hiemstra, Marie-Francine Moens, Josiane Mothe, Raffaele Perego, Martin Potthast, and Fabrizio Sebastiani, editors, Advances in Information Retrieval, pages 241–248, Cham, 2021. Springer International Publishing. ISBN 978-3-030- 72240-1. [9] Zhuyun Dai and Jamie Callan. Deeper text understanding for IR with contextual neural language modeling. In Benjamin Piwowarski, Max Chevalier, Éric Gaussier, Yoelle Maarek, Jian-Yun Nie, and Falk Scholer, editors, Proceedings of the 42nd International ACM SIGIR Conference on Research and Development in Information Retrieval, SIGIR 2019, Paris, France, July 21-25, 2019, pages 985–988. ACM, 2019. [10] Zhuyun Dai and Jamie Callan. Context-aware sentence/passage term importance estimation for first stage retrieval. arXiv preprint arXiv:1910.10687, 2019. [11] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: pre-training of deep bidirectional transformers for language understanding. In Jill Burstein, Christy Doran, and Thamar Solorio, editors, Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACLHLT 2019, Minneapolis, MN, USA, June 2-7, 2019, Volume 1 (Long and Short Papers), pages 4171–4186. Association for Computational Linguistics, 2019.
359
+ 453 [12] Ruiqi Guo, Philip Sun, Erik Lindgren, Quan Geng, David Simcha, Felix Chern, and Sanjiv Kumar. Accelerating large-scale inference with anisotropic vector quantization. In International Conference on Machine Learning, 2020. URL https://arxiv.org/abs/1908.10396. [13] Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network, 2015.
360
+
361
+ 458 [14] Sebastian Hofstätter, Sophia Althammer, Michael Schröder, Mete Sertkan, and Allan Hanbury.
362
+ 459 Improving efficient neural ranking models with cross-architecture knowledge distillation. CoRR,
363
+ 460 abs/2010.02666, 2020. URL https://arxiv.org/abs/2010.02666.
364
+ 61 [15] Sebastian Hofstätter, Sheng-Chieh Lin, Jheng-Hong Yang, Jimmy Lin, and Allan Hanbury.
365
+ 62 Efficiently teaching an effective dense retriever with balanced topic aware sampling. In Pro
366
+ 63 ceedings of the 44th International ACM SIGIR Conference on Research and Development in
367
+ 64 Information Retrieval, SIGIR ’21, page 113–122, New York, NY, USA, 2021. Association
368
+ 65 for Computing Machinery. ISBN 9781450380379. doi: 10.1145/3404835.3462891. URL
369
+ 66 https://doi.org/10.1145/3404835.3462891.
370
+ [16] Gautier Izacard and Edouard Grave. Distilling knowledge from reader to retriever for question
371
+ 68 answering. In International Conference on Learning Representations, 2021. URL https:
372
+ 69 //openreview.net/forum?id=NTEz-6wysdb.
373
+ 70 [17] Gautier Izacard, Mathild Caron, Lucas Hosseini, Sebastian Riedel, Piotr Bojanowski, Armand
374
+ 71 Joulin, and Edouard Grave. Unsupervised dense information retrieval with contrastive learning.
375
+ 72 arXiv preprint arXiv:2112.09118, 2021.
376
+ [18] Xiaoqi Jiao, Yichun Yin, Lifeng Shang, Xin Jiang, Xiao Chen, Linlin Li, Fang Wang, and
377
+ 74 Qun Liu. TinyBERT: Distilling BERT for natural language understanding. In Findings of the
378
+ 75 Association for Computational Linguistics: EMNLP 2020, pages 4163–4174, Online, November
379
+ 76 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.findings-emnlp.372.
380
+ 77 URL https://aclanthology.org/2020.findings-emnlp.372.
381
+ 78 [19] Jeff Johnson, Matthijs Douze, and Hervé Jégou. Billion-scale similarity search with gpus. IEEE
382
+ 79 Transactions on Big Data, 7(3):535–547, 2021. doi: 10.1109/TBDATA.2019.2921572.
383
+ 80 [20] Vladimir Karpukhin, Barlas Oguz, Sewon Min, Patrick Lewis, Ledell Wu, Sergey Edunov,
384
+ 81 Danqi Chen, and Wen-tau Yih. Dense passage retrieval for open-domain question answering.
385
+ 82 In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Process
386
+ 83 ing (EMNLP), pages 6769–6781, Online, November 2020. Association for Computational
387
+ 84 Linguistics.
388
+ 85 [21] Vladimir Karpukhin, Barlas Oguz, Sewon Min, Patrick Lewis, Ledell Wu, Sergey Edunov, ˘
389
+ 86 Danqi Chen, and Wen-tau Yih. Dense passage retrieval for open-domain question answering.
390
+ 87 arXiv preprint arXiv:2004.04906, 2020.
391
+ 88 [22] Omar Khattab and Matei Zaharia. ColBERT: Efficient and Effective Passage Search via
392
+ 89 Contextualized Late Interaction over BERT, page 39–48. Association for Computing Machinery,
393
+ 90 New York, NY, USA, 2020. ISBN 9781450380164.
394
+ [23] Tom Kwiatkowski, Jennimaria Palomaki, Olivia Redfield, Michael Collins, Ankur Parikh, Chris
395
+ 92 Alberti, Danielle Epstein, Illia Polosukhin, Jacob Devlin, Kenton Lee, Kristina Toutanova, Llion
396
+ 93 Jones, Matthew Kelcey, Ming-Wei Chang, Andrew M. Dai, Jakob Uszkoreit, Quoc Le, and Slav
397
+ 94 Petrov. Natural questions: A benchmark for question answering research. Transactions of the
398
+ 95 Association for Computational Linguistics, 7:452–466, 2019. doi: 10.1162/tacl_a_00276. URL
399
+ 96 https://aclanthology.org/Q19-1026.
400
+ 97 [24] Tom Kwiatkowski, Jennimaria Palomaki, Olivia Redfield, Michael Collins, Ankur Parikh, Chris
401
+ 98 Alberti, Danielle Epstein, Illia Polosukhin, Jacob Devlin, Kenton Lee, et al. Natural questions: a
402
+ 99 benchmark for question answering research. Transactions of the Association for Computational
403
+ 00 Linguistics, 7:453–466, 2019.
404
+ 01 [25] Michel Ledoux and Michel Talagrand. Probability in Banach spaces. Springer-Verlag, 1991.
405
+ 02 [26] Kenton Lee, Ming-Wei Chang, and Kristina Toutanova. Latent retrieval for weakly supervised
406
+ 03 open domain question answering. In Anna Korhonen, David R. Traum, and Lluís Màrquez,
407
+ 04 editors, Proceedings of the 57th Conference of the Association for Computational Linguistics,
408
+ 05 ACL 2019, Florence, Italy, July 28- August 2, 2019, Volume 1: Long Papers, pages 6086–6096.
409
+ 06 Association for Computational Linguistics, 2019.
410
+ 507 [27] Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer
411
+ 508 Levy, Veselin Stoyanov, and Luke Zettlemoyer. BART: Denoising sequence-to-sequence pre
412
+ 509 training for natural language generation, translation, and comprehension. In Proceedings of
413
+ 510 the 58th Annual Meeting of the Association for Computational Linguistics, pages 7871–7880,
414
+ 511 Online, July 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.acl-main.
415
+ 512 703. URL https://aclanthology.org/2020.acl-main.703.
416
+ 513 [28] Canjia Li, Andrew Yates, Sean MacAvaney, Ben He, and Yingfei Sun. Parade: Passage repre
417
+ 514 sentation aggregation for document reranking. arXiv preprint arXiv:2008.09093, 2020.
418
+ 515 [29] Sheng-Chieh Lin, Jheng-Hong Yang, and Jimmy Lin. In-batch negatives for knowledge dis
419
+ 516 tillation with tightly-coupled teachers for dense retrieval. In Proceedings of the 6th Work
420
+ 517 shop on Representation Learning for NLP (RepL4NLP-2021), pages 163–173, Online, August
421
+ 518 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.repl4nlp-1.17. URL
422
+ 519 https://aclanthology.org/2021.repl4nlp-1.17.
423
+ 520 [30] Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike
424
+ 521 Lewis, Luke Zettlemoyer, and Veselin Stoyanov. Roberta: A robustly optimized bert pretraining
425
+ 522 approach. arXiv preprint arXiv:1907.11692, 2019.
426
+ 523 [31] Wenhao Lu, Jian Jiao, and Ruofei Zhang. Twinbert: Distilling knowledge to twin-structured
427
+ 524 compressed bert models for large-scale retrieval. In Proceedings of the 29th ACM International
428
+ 525 Conference on Information & Knowledge Management, CIKM ’20, page 2645–2652, New
429
+ 526 York, NY, USA, 2020. Association for Computing Machinery. ISBN 9781450368599. doi:
430
+ 527 10.1145/3340531.3412747. URL https://doi.org/10.1145/3340531.3412747.
431
+ 528 [32] Yi Luan, Jacob Eisenstein, Kristina Toutanova, and Michael Collins. Sparse, dense, and
432
+ 529 attentional representations for text retrieval. Transactions of the Association for Computational
433
+ 530 Linguistics, 9:329–345, 2021. doi: 10.1162/tacl_a_00369. URL https://aclanthology.org/
434
+ 531 2021.tacl-1.20.
435
+ 532 [33] Ji Ma, Ivan Korotkov, Yinfei Yang, Keith Hall, and Ryan McDonald. Zero-shot neural pas
436
+ 533 sage retrieval via domain-targeted synthetic question generation. In Proceedings of the 16th
437
+ 534 Conference of the European Chapter of the Association for Computational Linguistics: Main
438
+ 535 Volume, pages 1075–1088, Online, April 2021. Association for Computational Linguistics. doi:
439
+ 536 10.18653/v1/2021.eacl-main.92. URL https://aclanthology.org/2021.eacl-main.92.
440
+ 537 [34] Sean MacAvaney, Andrew Yates, Arman Cohan, and Nazli Goharian. CEDR: Contextualized
441
+ 538 embeddings for document ranking. In Proceedings of the 42nd International ACM SIGIR
442
+ 539 Conference on Research and Development in Information Retrieval, SIGIR’19, page 1101–1104,
443
+ 540 New York, NY, USA, 2019. Association for Computing Machinery. ISBN 9781450361729. doi:
444
+ 541 10.1145/3331184.3331317. URL https://doi.org/10.1145/3331184.3331317.
445
+ 542 [35] Sean MacAvaney, Andrew Yates, Kai Hui, and Ophir Frieder. Content-based weak supervision
446
+ 543 for ad-hoc re-ranking. In Proceedings of the 42nd International ACM SIGIR Conference on
447
+ 544 Research and Development in Information Retrieval, SIGIR’19, page 993–996, New York, NY,
448
+ 545 USA, 2019. Association for Computing Machinery. ISBN 9781450361729. doi: 10.1145/
449
+ 546 3331184.3331316. URL https://doi.org/10.1145/3331184.3331316.
450
+ 547 [36] Sean MacAvaney, Franco Maria Nardini, Raffaele Perego, Nicola Tonellotto, Nazli Goharian,
451
+ 548 and Ophir Frieder. Efficient Document Re-Ranking for Transformers by Precomputing Term
452
+ 549 Representations, page 49–58. Association for Computing Machinery, New York, NY, USA,
453
+ 550 2020. ISBN 9781450380164.
454
+ 551 [37] Aditya Menon, Sadeep Jayasumana, Ankit Singh Rawat, Seungyeon Kim, Sashank Reddi,
455
+ 552 and Sanjiv Kumar. In defense of dual-encoders for neural ranking. In Kamalika Chaudhuri,
456
+ 553 Stefanie Jegelka, Le Song, Csaba Szepesvari, Gang Niu, and Sivan Sabato, editors, Proceedings
457
+ 554 of the 39th International Conference on Machine Learning, volume 162 of Proceedings of
458
+ 555 Machine Learning Research, pages 15376–15400. PMLR, 17–23 Jul 2022. URL https:
459
+ 556 //proceedings.mlr.press/v162/menon22a.html.
460
+
461
+ [38] Bhaskar Mitra and Nick Craswell. An introduction to neural information retrieval. Foundations and Trends® in Information Retrieval, 13(1):1–126, 2018. ISSN 1554-0669. doi: 10.1561/ 1500000061. URL http://dx.doi.org/10.1561/1500000061. 560 [39] Arvind Neelakantan, Tao Xu, Raul Puri, Alec Radford, Jesse Michael Han, Jerry Tworek, Qiming Yuan, Nikolas Tezak, Jong Wook Kim, Chris Hallacy, et al. Text and code embeddings by contrastive pre-training. arXiv preprint arXiv:2201.10005, 2022. [40] Tri Nguyen, Mir Rosenberg, Xia Song, Jianfeng Gao, Saurabh Tiwary, Rangan Majumder, and Li Deng. MS MARCO: A human generated machine reading comprehension dataset. In Tarek Richard Besold, Antoine Bordes, Artur S. d’Avila Garcez, and Greg Wayne, editors, Proceedings of the Workshop on Cognitive Computation: Integrating neural and symbolic approaches 2016, volume 1773 of CEUR Workshop Proceedings. CEUR-WS.org, 2016. [41] Jianmo Ni, Chen Qu, Jing Lu, Zhuyun Dai, Gustavo Hernandez Abrego, Ji Ma, Vincent Zhao, Yi Luan, Keith Hall, Ming-Wei Chang, and Yinfei Yang. Large dual encoders are generalizable retrievers. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pages 9844–9855, Abu Dhabi, United Arab Emirates, December 2022. Association for Computational Linguistics. URL https://aclanthology.org/2022.emnlp-main.669. [42] Ping Nie, Yuyu Zhang, Xiubo Geng, Arun Ramamurthy, Le Song, and Daxin Jiang. DC-BERT: decoupling question and document for efficient contextual encoding. In Jimmy Huang, Yi Chang, Xueqi Cheng, Jaap Kamps, Vanessa Murdock, Ji-Rong Wen, and Yiqun Liu, editors, Proceedings of the 43rd International ACM SIGIR conference on research and development in Information Retrieval, SIGIR 2020, Virtual Event, China, July 25-30, 2020, pages 1829–1832. ACM, 2020. doi: 10.1145/3397271.3401271. URL https://doi.org/10.1145/3397271.3401271. [43] Rodrigo Nogueira and Kyunghyun Cho. Passage re-ranking with BERT. CoRR, abs/1901.04085, 2019. URL http://arxiv.org/abs/1901.04085. [44] Rodrigo Nogueira, Jimmy Lin, and AI Epistemic. From doc2query to doctttttquery. Online preprint, 6, 2019. [45] Rodrigo Nogueira, Wei Yang, Jimmy Lin, and Kyunghyun Cho. Document expansion by query prediction. arXiv preprint arXiv:1904.08375, 2019. [46] Rodrigo Nogueira, Zhiying Jiang, Ronak Pradeep, and Jimmy Lin. Document ranking with a pretrained sequence-to-sequence model. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 708–718, Online, November 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.findings-emnlp.63. URL https: //aclanthology.org/2020.findings-emnlp.63. [47] Barlas Oguz, Kushal Lakhotia, Anchit Gupta, Patrick Lewis, Vladimir Karpukhin, Aleksandra ˘ Piktus, Xilun Chen, Sebastian Riedel, Wen-tau Yih, Sonal Gupta, et al. Domain-matched pre-training tasks for dense retrieval. arXiv preprint arXiv:2107.13602, 2021. [48] Yingqi Qu, Yuchen Ding, Jing Liu, Kai Liu, Ruiyang Ren, Wayne Xin Zhao, Daxiang Dong, Hua Wu, and Haifeng Wang. RocketQA: An optimized training approach to dense passage retrieval for open-domain question answering. In Kristina Toutanova, Anna Rumshisky, Luke Zettlemoyer, Dilek Hakkani-Tür, Iz Beltagy, Steven Bethard, Ryan Cotterell, Tanmoy Chakraborty, and Yichao Zhou, editors, Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL-HLT 2021, Online, June 6-11, 2021, pages 5835–5847. Association for Computational Linguistics, 2021. [49] Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J. Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. Journal of Machine Learning Research, 21(140):1–67, 2020. URL http://jmlr.org/papers/v21/20-074.html. [50] Nils Reimers, Iryna Gurevych, and Iryna Gurevych. Sentence-BERT: Sentence embeddings using siamese bert-networks. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing. Association for Computational Linguistics, 11 2019. URL http://arxiv.org/abs/1908.10084.
462
+
463
+ [51] Ruiyang Ren, Yingqi Qu, Jing Liu, Wayne Xin Zhao, Qiaoqiao She, Hua Wu, Haifeng Wang, and Ji-Rong Wen. Rocketqav2: A joint training method for dense passage retrieval and passage re-ranking. In Proceedings of EMNLP, 2021.
464
+ [52] Adriana Romero, Nicolas Ballas, Samira Ebrahimi Kahou, Antoine Chassang, Carlo Gatta, and Yoshua Bengio. Fitnets: Hints for thin deep nets. arXiv preprint arXiv:1412.6550, 2014.
465
+ [53] Devendra Sachan, Mostofa Patwary, Mohammad Shoeybi, Neel Kant, Wei Ping, William L. Hamilton, and Bryan Catanzaro. End-to-end training of neural retrievers for open-domain question answering. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 6648–6662, Online, August 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.acl-long.519. URL https: //aclanthology.org/2021.acl-long.519.
466
+ [54] Devendra Singh Sachan, Mike Lewis, Mandar Joshi, Armen Aghajanyan, Wen-tau Yih, Joelle Pineau, and Luke Zettlemoyer. Improving passage retrieval with zero-shot question generation. arXiv preprint arXiv:2204.07496, 2022.
467
+ [55] Victor Sanh, Lysandre Debut, Julien Chaumond, and Thomas Wolf. Distilbert, a distilled version of bert: smaller, faster, cheaper and lighter. arXiv preprint arXiv:1910.01108, 2019.
468
+ [56] Keshav Santhanam, Omar Khattab, Jon Saad-Falcon, Christopher Potts, and Matei Zaharia. Colbertv2: Effective and efficient retrieval via lightweight late interaction. CoRR, abs/2112.01488, 2021.
469
+ [57] Nandan Thakur, Nils Reimers, Andreas Rücklé, Abhishek Srivastava, and Iryna Gurevych. BEIR: A heterogeneous benchmark for zero-shot evaluation of information retrieval models. In Thirty-fifth Conference on Neural Information Processing Systems Datasets and Benchmarks Track (Round 2), 2021. URL https://openreview.net/forum?id=wCu6T5xFjeJ.
470
+ [58] Iulia Turc, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Well-read students learn better: On the importance of pre-training compact models. arXiv preprint arXiv:1908.08962, 2019.
471
+ [59] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Proceedings of the 31st International Conference on Neural Information Processing Systems, NIPS’17, page 6000–6010, Red Hook, NY, USA, 2017. Curran Associates Inc. ISBN 9781510860964.
472
+ [60] Lee Xiong, Chenyan Xiong, Ye Li, Kwok-Fung Tang, Jialin Liu, Paul N. Bennett, Junaid Ahmed, and Arnold Overwijk. Approximate nearest neighbor negative contrastive learning for dense text retrieval. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id $=$ zeFrfgyZln.
473
+ [61] Nishant Yadav, Nicholas Monath, Rico Angell, Manzil Zaheer, and Andrew McCallum. Efficient nearest neighbor search for cross-encoder models using matrix factorization. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pages 2171–2194, Abu Dhabi, United Arab Emirates, December 2022. Association for Computational Linguistics. URL https://aclanthology.org/2022.emnlp-main.140.
474
+ [62] Zeynep Akkalyoncu Yilmaz, Wei Yang, Haotian Zhang, and Jimmy Lin. Cross-domain modeling of sentence-level evidence for document retrieval. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 3490–3496, Hong Kong, China, November 2019. Association for Computational Linguistics.
475
+ [63] Hang Zhang, Yeyun Gong, Yelong Shen, Jiancheng Lv, Nan Duan, and Weizhu Chen. Adversarial retriever-ranker for dense text retrieval. In International Conference on Learning Representations, 2022. URL https://openreview.net/forum?id=MR7XubKUFB.
476
+ [64] Linfeng Zhang and Kaisheng Ma. Improve object detection with feature-based knowledge distillation: Towards accurate and efficient detectors. In International Conference on Learning Representations, 2020.
477
+
478
+ 660 [65] Shuai Zhang, Lina Yao, Aixin Sun, and Yi Tay. Deep learning based recommender system:
479
+ 661 A survey and new perspectives. ACM Comput. Surv., 52(1), feb 2019. ISSN 0360-0300. doi:
480
+ 662 10.1145/3285029. URL https://doi.org/10.1145/3285029.
481
+ 663 [66] Chen Zhao, Chenyan Xiong, Jordan Boyd-Graber, and Hal Daumé III. Distantly-supervised
482
+ 664 dense retrieval enables open-domain question answering without evidence annotation. In
483
+ 665 Proceedings of the 2021 Conference on Empirical Methods in Natural Language Process
484
+ 666 ing, pages 9612–9622, Online and Punta Cana, Dominican Republic, November 2021. As
485
+ 667 sociation for Computational Linguistics. doi: 10.18653/v1/2021.emnlp-main.756. URL
486
+ 668 https://aclanthology.org/2021.emnlp-main.756.
487
+ 669 [67] Zhi Zheng, Kai Hui, Ben He, Xianpei Han, Le Sun, and Andrew Yates. BERT-QE: Con
488
+ 670 textualized Query Expansion for Document Re-ranking. In Findings of the Association for
489
+ 671 Computational Linguistics: EMNLP 2020, pages 4718–4728, Online, November 2020. As
490
+ 672 sociation for Computational Linguistics. doi: 10.18653/v1/2020.findings-emnlp.424. URL
491
+ 673 https://aclanthology.org/2020.findings-emnlp.424.
parse/dev/BT03V9Re9a/BT03V9Re9a_content_list.json ADDED
@@ -0,0 +1,1171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "EmbedDistill: A Geometric Knowledge Distillation for Information Retrieval ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 191,
8
+ 122,
9
+ 808,
10
+ 171
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Anonymous Author(s) \nAffiliation \nAddress \nemail ",
17
+ "bbox": [
18
+ 423,
19
+ 222,
20
+ 578,
21
+ 276
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "Abstract ",
28
+ "text_level": 1,
29
+ "bbox": [
30
+ 462,
31
+ 313,
32
+ 535,
33
+ 329
34
+ ],
35
+ "page_idx": 0
36
+ },
37
+ {
38
+ "type": "text",
39
+ "text": "1 Large neural models (such as Transformers) achieve state-of-the-art performance \n2 for information retrieval (IR). In this paper, we aim to improve distillation methods \n3 that pave the way for the resource-efficient deployment of such models in practice. \n4 Inspired by our theoretical analysis of the teacher-student generalization gap for \n5 IR models, we propose a novel distillation approach that leverages the relative \n6 geometry among queries and documents learned by the large teacher model. Unlike \n7 existing teacher score-based distillation methods, our proposed approach employs \n8 embedding matching tasks to provide a stronger signal to align the representations \n9 of the teacher and student models. In addition, it utilizes query generation to \n10 explore the data manifold to reduce the discrepancies between the student and the \n11 teacher where training data is sparse. Furthermore, our analysis also motivates \n12 novel asymmetric architectures for student models which realizes better embedding \n13 alignment without increasing online inference cost. On standard benchmarks like \n14 MSMARCO, we show that our approach successfully distills from both dual \n15 encoder (DE) and cross-encoder (CE) teacher models to 1/10th size asymmetric \n16 students that can retain $9 5 . 9 7 \\%$ of the teacher performance. ",
40
+ "bbox": [
41
+ 148,
42
+ 343,
43
+ 766,
44
+ 565
45
+ ],
46
+ "page_idx": 0
47
+ },
48
+ {
49
+ "type": "text",
50
+ "text": "17 1 Introduction ",
51
+ "text_level": 1,
52
+ "bbox": [
53
+ 148,
54
+ 588,
55
+ 312,
56
+ 606
57
+ ],
58
+ "page_idx": 0
59
+ },
60
+ {
61
+ "type": "text",
62
+ "text": "18 Neural models for information retrieval (IR) are increasingly used to model the true ranking function \n19 in various applications, including web search [38], recommendation [65], and question-answering \n20 (QA) [6]. Notably, the recent success of Transformers [59]-based pre-trained language models [11, \n21 30, 49] on a wide range of natural language understanding tasks has also prompted their utilization in \n22 IR to capture query-document relevance [see, e.g., 10, 34, 43, 26, 20]. \n23 A typical IR system comprises two stages: (1) A retriever first selects a small subset of potentially \n24 relevant candidate documents (out of a large collection) for a given query; and (2) A re-ranker then \n25 identifies a precise ranking among the candidates provided by the retriever. Dual-encoder (DE) \n26 models are the de-facto architecture for retrievers [26, 20]. Such models independently embed queries \n27 and documents into a common space, and capture their relevance by simple operations on these \n28 embeddings such as the inner product. This enables offline creation of a document index and supports \n29 fast retrieval during inference via efficient maximum inner product search implementations [12, 19], \n30 with online query embedding generation primarily dictating the inference latency. Cross-encoder (CE) \n31 models, on the other hand, are preferred as re-rankers, owing to their excellent performance [43, 9, 62]. \n32 A CE model jointly encodes a query-document pair while enabling early interaction among query \n33 and document features. Employing a CE model for retrieval is often infeasible, as it would require \n34 processing a given query with every document in the collection at inference time. In fact, even in \n35 the re-ranking stage, the inference cost of CE models is high enough [22] to warrant exploration of \n36 efficient alternatives [14, 22, 37]. Across both architectures, scaling to larger models brings improved \n37 performance at increased computational cost [41, 39]. \n38 Knowledge distillation [5, 13] provides a general strategy to address the prohibitive inference cost \n39 associated with high-quality large neural models. In the IR literature, most existing distillation \n40 methods only rely on the teacher’s query-document relevance scores [see, e.g., 31, 14, 8, 51, 56] or \n41 their proxies [16]. However, given that neural IR models are inherently embedding-based, it is natural \n42 to ask: Is it useful to go beyond matching of the teacher and student models’ scores, and directly aim \n43 to align their embedding spaces? \n44 With this in mind, we propose a novel distillation method for IR models that utilizes an embedding \n45 matching task to train student models. The proposed method is inspired by our rigorous treatment \n46 of the generalization gap between the teacher and student models in IR settings. Our theoretical \n47 analysis of the teacher-student generalization gap further suggests novel design choices involving \n48 asymmetric configurations for student DE models, intending to further reduce the gap by better \n49 aligning teacher and student embedding spaces. Notably, our proposed distillation method supports \n50 cross-architecture distillation and improves upon existing (score-based) distillation methods for both \n51 retriever and re-ranker models. When distilling a large teacher DE model into a smaller student DE \n52 model, for a given query (document), one can minimize the distance between the query (document) \n53 embeddings of the teacher and student (after compatible projection layers to account for dimension \n54 mismatch, if any). In contrast, a teacher CE model doesn’t directly provide document and query \n55 embeddings, and so to effectively employ embedding matching-based distillation requires modifying \n56 the scoring layer with dual-pooling [61] and adding various regularizers. Both of these changes \n57 improve geometry of teacher embeddings and facilitate effective knowledge transfer to the student \n58 DE model via embedding matching-based distillation. ",
63
+ "bbox": [
64
+ 147,
65
+ 619,
66
+ 825,
67
+ 689
68
+ ],
69
+ "page_idx": 0
70
+ },
71
+ {
72
+ "type": "text",
73
+ "text": "",
74
+ "bbox": [
75
+ 145,
76
+ 695,
77
+ 825,
78
+ 902
79
+ ],
80
+ "page_idx": 0
81
+ },
82
+ {
83
+ "type": "text",
84
+ "text": "",
85
+ "bbox": [
86
+ 147,
87
+ 92,
88
+ 825,
89
+ 174
90
+ ],
91
+ "page_idx": 1
92
+ },
93
+ {
94
+ "type": "text",
95
+ "text": "",
96
+ "bbox": [
97
+ 145,
98
+ 181,
99
+ 825,
100
+ 388
101
+ ],
102
+ "page_idx": 1
103
+ },
104
+ {
105
+ "type": "text",
106
+ "text": "59 Our key contributions toward improving IR models via distillation are: ",
107
+ "bbox": [
108
+ 148,
109
+ 393,
110
+ 635,
111
+ 409
112
+ ],
113
+ "page_idx": 1
114
+ },
115
+ {
116
+ "type": "text",
117
+ "text": "• We provide the first rigorous analysis of the teacher-student generalization gap for IR settings which captures the role of alignment of embedding spaces of the teacher and student towards reducing the gap (Sec. 3). Inspired by our analysis, we propose a novel distillation approach for neural IR models, namely EmbedDistill, that goes beyond score matching and aligns the embedding spaces of the teacher and student models (Sec. 4). We also show that EmbedDistill can leverage synthetic data to improve a student by further aligning the embedding spaces of the teacher and student (Sec. 4.3). Our analysis motivates novel distillation setups. Specifically, we consider a student DE model with an asymmetric configuration, consisting of a small query encoder and a frozen document encoder inherited from the teacher. This significantly reduces inference latency of query embedding generation, while leveraging the teachers’ high-quality document index (Sec. 4.1). We provide a comprehensive empirical evaluation of EmbedDistill (Sec. 5) on two standard IR benchmarks – Natural Questions [23] and MSMARCO [40]. We also evaluate EmbedDistill on BEIR benchmark [57] which is used to measure the zero-shot performance of an IR model. ",
118
+ "bbox": [
119
+ 173,
120
+ 419,
121
+ 826,
122
+ 623
123
+ ],
124
+ "page_idx": 1
125
+ },
126
+ {
127
+ "type": "text",
128
+ "text": "74 Note that prior works have utilized embedding alignment during distillation for non-IR setting [see, \n75 e.g., 52, 55, 18, 1, 64, 7]. However, to the best of our knowledge, our work is the first to study \n76 embedding matching-based distillation method for IR settings which requires addressing multiple \n77 IR-specific challenges such as cross-architecture distillation, partial representation alignment, and en \n78 abling novel asymmetric student configurations. Furthermore, unlike these prior works, our proposed \n79 method is theoretically justified to reduce the teacher-student performance gap. ",
129
+ "bbox": [
130
+ 147,
131
+ 626,
132
+ 826,
133
+ 710
134
+ ],
135
+ "page_idx": 1
136
+ },
137
+ {
138
+ "type": "text",
139
+ "text": "80 2 Background ",
140
+ "text_level": 1,
141
+ "bbox": [
142
+ 150,
143
+ 722,
144
+ 310,
145
+ 738
146
+ ],
147
+ "page_idx": 1
148
+ },
149
+ {
150
+ "type": "text",
151
+ "text": "81 Let Q and $\\mathrm { \\Phi _ { \\mathrm { ~ \\mathcal { D } ~ } } }$ denote the query and document spaces, respectively. An IR model is equivalent to \n82 a scorer $s : \\Omega \\times \\mathcal { D } \\mathbb { R }$ , i.e., it assigns a (relevance) score $s ( q , d )$ for a query-document pair \n83 $( \\boldsymbol { q } , \\boldsymbol { d } ) \\in \\Omega \\times \\mathcal { D }$ . Ideally, we want to learn a scorer such that $s ( q , d ) > s ( q , d ^ { \\prime } )$ iff the document $d$ is \n84 more relevant to the query $q$ than document $d ^ { \\prime }$ . We assume access to $n$ labeled training examples \n85 $\\mathcal { S } _ { n } = \\{ ( q _ { i } , \\mathbf { d } _ { i } , \\mathbf { y } _ { i } ) \\} _ { i \\in [ n ] } .$ . Here, $\\mathbf { d } _ { i } = ( d _ { i , 1 } , \\dots , d _ { i , L } ) \\in \\mathcal { D } ^ { L } , \\forall i \\in [ n ]$ , denotes a list of $L$ documents \n86 and $\\mathbf { y } _ { i } = ( y _ { i , 1 } , \\ldots , y _ { i , L } ) \\in \\{ 0 , 1 \\} ^ { L }$ denotes the corresponding labels such that $y _ { i , j } = 1$ iff the \n87 document $d _ { i , j }$ is relevant to the query $q _ { i }$ . Given $\\mathcal { S } _ { n }$ , we learn an IR model by minimizing ",
152
+ "bbox": [
153
+ 145,
154
+ 746,
155
+ 825,
156
+ 847
157
+ ],
158
+ "page_idx": 1
159
+ },
160
+ {
161
+ "type": "equation",
162
+ "img_path": "images/1e39e33bfc672160e5afe97fc2a6a3100b81ff30e630feccffed9209d70fc4a5.jpg",
163
+ "text": "$$\nR ( s ; \\mathbb { S } _ { n } ) : = { \\frac { 1 } { n } } \\sum _ { i \\in [ n ] } \\ell { \\bigl ( } s _ { q _ { i } , \\mathbf { d } _ { i } } , \\mathbf { y } _ { i } { \\bigr ) } ,\n$$",
164
+ "text_format": "latex",
165
+ "bbox": [
166
+ 375,
167
+ 847,
168
+ 620,
169
+ 878
170
+ ],
171
+ "page_idx": 1
172
+ },
173
+ {
174
+ "type": "text",
175
+ "text": "88 where $s _ { q _ { i } , \\mathbf { d } _ { i } } : = ( s ( q _ { i } , d _ { 1 , i } ) , \\ldots , s ( q _ { i } , d _ { 1 , L } ) )$ and $\\ell \\left( s _ { q _ { i } , \\mathbf { d } _ { i } } , \\mathbf { y } _ { i } \\right)$ denotes the loss $s$ incurs on $\\left( q _ { i } , \\mathbf { d } _ { i } , \\mathbf { y } _ { i } \\right)$ . \n89 Due to space constraint, we defer concrete choices for the loss function $\\ell$ to Appendix A. \n90 While this learning framework is general enough to work with any IR models, next, we formally \n91 introduce two families of Transformer-based IR models that are prevalent in the recent literature. ",
176
+ "bbox": [
177
+ 145,
178
+ 882,
179
+ 826,
180
+ 912
181
+ ],
182
+ "page_idx": 1
183
+ },
184
+ {
185
+ "type": "text",
186
+ "text": "",
187
+ "bbox": [
188
+ 153,
189
+ 90,
190
+ 825,
191
+ 119
192
+ ],
193
+ "page_idx": 2
194
+ },
195
+ {
196
+ "type": "text",
197
+ "text": "92 2.1 Transformer-based IR models: Cross-encoders and Dual-encoders ",
198
+ "text_level": 1,
199
+ "bbox": [
200
+ 151,
201
+ 131,
202
+ 674,
203
+ 147
204
+ ],
205
+ "page_idx": 2
206
+ },
207
+ {
208
+ "type": "text",
209
+ "text": "Let query $q = \\left( q ^ { 1 } , \\ldots , q ^ { m _ { 1 } } \\right)$ and document $d = ( d ^ { 1 } , \\ldots , d ^ { m _ { 2 } } )$ consist of $m _ { 1 }$ and $m _ { 2 }$ tokens, respectively. We now discuss how Transformers-based CE and DE models process the $( q , d )$ pair. ",
210
+ "bbox": [
211
+ 160,
212
+ 152,
213
+ 823,
214
+ 183
215
+ ],
216
+ "page_idx": 2
217
+ },
218
+ {
219
+ "type": "text",
220
+ "text": "95 Cross-encoder model. Let $p = [ q ; d ]$ be the sequence obtained by concatenating $q$ and $d$ . Further, \n96 let $\\tilde { p }$ be the sequence obtained by adding special tokens such [CLS] and [SEP] to $p$ . Given an \n97 encoder-only Transformer model Enc, the relevance score for the $( q , d )$ pair is ",
221
+ "bbox": [
222
+ 147,
223
+ 185,
224
+ 825,
225
+ 229
226
+ ],
227
+ "page_idx": 2
228
+ },
229
+ {
230
+ "type": "equation",
231
+ "img_path": "images/232d1d99c29c1217fee5922a4d63d83e243c14d7113e0daebe6114c3664367aa.jpg",
232
+ "text": "$$\ns ( q , d ) = \\langle w , \\mathrm { p o o l } \\bigl ( \\mathrm { E n c } ( \\tilde { p } ) \\bigr ) \\rangle = \\langle w , \\mathrm { e m b } _ { q , d } \\rangle ,\n$$",
233
+ "text_format": "latex",
234
+ "bbox": [
235
+ 349,
236
+ 232,
237
+ 647,
238
+ 251
239
+ ],
240
+ "page_idx": 2
241
+ },
242
+ {
243
+ "type": "text",
244
+ "text": "98 where $w$ is a $d$ -dimensional classification vector, and $\\mathrm { p o o l } ( \\cdot )$ denotes a pooling operation that \n99 transforms the contextualized token embeddings $\\operatorname { E n c } ( \\tilde { p } )$ to a joint embedding vector $\\mathtt { e m b } _ { q , d }$ . [CLS]- \n100 pooling is a common operation that simply outputs the embedding of the [CLS] token as $\\mathtt { e m b } _ { q , d }$ . ",
245
+ "bbox": [
246
+ 143,
247
+ 257,
248
+ 826,
249
+ 300
250
+ ],
251
+ "page_idx": 2
252
+ },
253
+ {
254
+ "type": "text",
255
+ "text": "Dual-encoder model. Let $\\tilde { q }$ and $\\tilde { d }$ be the sequences obtained by adding appropriate special tokens to $q$ and $d$ , respectively. A DE model comprises two (encoder-only) Transformers $\\operatorname { E n c } _ { Q }$ and $\\mathrm { E n c } _ { D }$ , which we call query and document encoders, respectively.1 Let $\\mathsf { e m b } _ { q } = \\mathrm { p o o l } \\big ( \\mathrm { E n c } _ { Q } ( \\tilde { q } ) \\big )$ and $\\mathsf { e m b } _ { d }$ $= \\mathrm { p o o l } \\big ( \\mathrm { E n c } _ { D } ( \\tilde { d } ) \\big )$ denote the query and document embeddings, respectively. Now, one can define $s ( q , d ) = \\langle \\mathbf { e m b } _ { q } , \\mathbf { e m b } _ { d } \\rangle$ to be the relevance score assigned to the $( q , d )$ pair by the DE model. ",
256
+ "bbox": [
257
+ 161,
258
+ 305,
259
+ 825,
260
+ 383
261
+ ],
262
+ "page_idx": 2
263
+ },
264
+ {
265
+ "type": "text",
266
+ "text": "2.2 Score-based distillation for IR models ",
267
+ "text_level": 1,
268
+ "bbox": [
269
+ 173,
270
+ 395,
271
+ 475,
272
+ 410
273
+ ],
274
+ "page_idx": 2
275
+ },
276
+ {
277
+ "type": "text",
278
+ "text": "Most distillation schemes for IR [e.g., 31, 14, 8] rely on teacher relevance scores. Given a training set $\\mathcal { S } _ { n }$ and a teacher with scorer $s ^ { \\mathrm { t } }$ , one learns a student with scorer $s ^ { \\mathrm { s } }$ by minimizing ",
279
+ "bbox": [
280
+ 163,
281
+ 416,
282
+ 823,
283
+ 445
284
+ ],
285
+ "page_idx": 2
286
+ },
287
+ {
288
+ "type": "equation",
289
+ "img_path": "images/0bd96b1c2623c7a655d314d317dd3df2a4222cf585c2095d076ea81857ecb16f.jpg",
290
+ "text": "$$\nR ( s ^ { \\mathrm { s } } , s ^ { \\mathrm { t } } ; \\mathcal { S } _ { n } ) = \\frac { 1 } { n } \\sum _ { i \\in [ n ] } \\ell _ { \\mathrm { d } } \\big ( s _ { q , \\mathbf { d } _ { i } } ^ { \\mathrm { s } } , s _ { q , \\mathbf { d } _ { i } } ^ { \\mathrm { t } } \\big ) ,\n$$",
291
+ "text_format": "latex",
292
+ "bbox": [
293
+ 354,
294
+ 448,
295
+ 642,
296
+ 478
297
+ ],
298
+ "page_idx": 2
299
+ },
300
+ {
301
+ "type": "text",
302
+ "text": "where $\\ell _ { \\mathrm { d } }$ captures the discrepancy between $s ^ { \\mathrm { s } }$ and $s ^ { \\mathrm { t } }$ . See Appendix A for common choices for $\\ell _ { \\mathrm { d } }$ ",
303
+ "bbox": [
304
+ 158,
305
+ 484,
306
+ 816,
307
+ 501
308
+ ],
309
+ "page_idx": 2
310
+ },
311
+ {
312
+ "type": "text",
313
+ "text": "10 3 Teacher-student generalization gap: Inspiration for embedding alignment ",
314
+ "text_level": 1,
315
+ "bbox": [
316
+ 156,
317
+ 515,
318
+ 818,
319
+ 534
320
+ ],
321
+ "page_idx": 2
322
+ },
323
+ {
324
+ "type": "text",
325
+ "text": "111 Our main objective is to devise novel distillation methods to realize high-performing student DE \n112 models. As a first step in this direction, we rigorously study the teacher-student generalization \n113 gap as realized by standard (score-based) distillation in IR settings. Informed by our analysis, we \n114 subsequently identify novel ways to improve the student model’s performance. In particular, our \n115 analysis suggests two natural directions to reduce the teacher-student generalization gap: 1) enforcing \n116 tighter alignment between embedding spaces of teacher and student models; and 2) exploring novel \n117 asymmetric configuration for student DE model. \n118 Let $R ( s ) = \\mathbb { E } \\left[ \\ell \\left( s _ { q , \\mathbf { d } } , \\mathbf { y } \\right) \\right]$ be the population version of the empirical risk in Eq. 1, which measures \n119 the test time performance of the IR model defined by the scorer $s$ . Thus, $R ( s ^ { \\mathrm { s } } ) - R ( s ^ { \\mathrm { t } } )$ denotes the \n120 teacher-student generalization gap. In the following result, we bound this quantity (see Appendix C.1 \n121 for a formal statement and proof). We focus on distilling a teacher DE model to a student DE model \n122 and $L = 1$ (cf. Sec. 2) as it leads to easier exposition without changing the main takeaways. Our \n123 analysis can be extended to $L > 1$ or CE to DE distillation with more complex notation. \n124 Theorem 3.1 (Teacher-student generalization gap (informal)). Let $\\mathcal { F }$ and G denote the function \n125 classes for the query and document encoders for the student model, respectively. Suppose that the \n126 score-based distillation loss $\\ell _ { \\mathrm { d } }$ in Eq. 3 is based on binary cross entropy loss (Eq. 12 in Appendix A). \n127 Let one-hot (label-dependent) loss \\` in Eq. 1 be the binary cross entropy loss (Eq. 10 in Appendix $A$ ). \n128 Further, assume that all encoders have the same output dimension and embeddings have their $\\ell _ { 2 }$ -norm \n129 bounded by $K$ . Then, we have ",
326
+ "bbox": [
327
+ 140,
328
+ 546,
329
+ 825,
330
+ 645
331
+ ],
332
+ "page_idx": 2
333
+ },
334
+ {
335
+ "type": "text",
336
+ "text": "",
337
+ "bbox": [
338
+ 140,
339
+ 648,
340
+ 825,
341
+ 736
342
+ ],
343
+ "page_idx": 2
344
+ },
345
+ {
346
+ "type": "text",
347
+ "text": "",
348
+ "bbox": [
349
+ 142,
350
+ 738,
351
+ 826,
352
+ 823
353
+ ],
354
+ "page_idx": 2
355
+ },
356
+ {
357
+ "type": "equation",
358
+ "img_path": "images/11c308b15d41794b2f59564e2d203ecf8c86758f810d2c800124d122c2f4d600.jpg",
359
+ "text": "$$\n\\begin{array} { r l } & { R ( s ^ { \\mathrm { s } } ) - R ( s ^ { \\mathrm { t } } ) \\leq \\displaystyle \\mathcal { E } _ { n } ( \\mathcal { F } , \\mathfrak { G } ) + 2 K R _ { \\mathrm { E m b } , Q } ( \\mathfrak { t } , { \\mathrm { s } } ; \\mathcal { S } _ { n } ) + 2 K R _ { \\mathrm { E m b } , D } ( \\mathfrak { t } , { \\mathrm { s } } ; \\mathcal { S } _ { n } ) } \\\\ & { \\qquad + \\Delta ( s ^ { \\mathrm { t } } ; \\mathcal { S } _ { n } ) + K ^ { 2 } \\bigl ( \\mathbb { E } \\left[ \\left. \\sigma ( s _ { q , d } ^ { \\mathrm { t } } ) - y \\right. \\right] + \\displaystyle \\frac { 1 } { n } \\sum _ { i \\in [ n ] } \\big \\vert \\sigma ( s _ { q , d _ { i } } ^ { \\mathrm { t } } ) - y _ { i } \\big \\vert \\big ) , } \\end{array}\n$$",
360
+ "text_format": "latex",
361
+ "bbox": [
362
+ 222,
363
+ 828,
364
+ 774,
365
+ 888
366
+ ],
367
+ "page_idx": 2
368
+ },
369
+ {
370
+ "type": "text",
371
+ "text": "1 It is common to employ dual-encoder models where query and document encoders are shared. ",
372
+ "bbox": [
373
+ 191,
374
+ 897,
375
+ 753,
376
+ 912
377
+ ],
378
+ "page_idx": 2
379
+ },
380
+ {
381
+ "type": "image",
382
+ "img_path": "images/9e8e766c8265c2e75b6fcdbafd8432533c6448ff8ac70fa51c8e0ab6a64802df.jpg",
383
+ "image_caption": [
384
+ "Figure 1: Proposed distillation method with query embedding matching. Left: The setting where student employs an asymmetric DE configuration with a small query encoder and a large (non-trainable) document encoder inherited from the teacher DE model. The smaller query encoder ensures small latency for encoding query during inference, and large document encoder leads to a good quality document index. Right: Similarly the setting of CE to DE distillation using EmbedDistill, with teacher CE model employing dual pooling. "
385
+ ],
386
+ "image_footnote": [],
387
+ "bbox": [
388
+ 212,
389
+ 83,
390
+ 808,
391
+ 195
392
+ ],
393
+ "page_idx": 3
394
+ },
395
+ {
396
+ "type": "text",
397
+ "text": "where 130 $\\begin{array} { r } { \\mathcal { E } _ { n } ( \\mathcal { F } , \\mathcal { G } ) : = \\operatorname* { s u p } _ { s ^ { \\mathrm { s } } \\in \\mathcal { F } \\times \\mathcal { G } } \\big | R ( s ^ { \\mathrm { s } } , s ^ { \\mathrm { t } } ; \\mathbb { S } _ { n } ) - \\mathbb { E } \\ell _ { \\mathrm { d } } \\big ( s _ { q , d } ^ { \\mathrm { s } } , s _ { q , d } ^ { \\mathrm { t } } \\big ) \\big | , } \\end{array}$ ; $\\sigma$ denotes the sigmoid function; and 131 $\\Delta ( s ^ { \\mathrm { t } } ; \\mathcal { S } _ { n } )$ denotes the deviation between the empirical risk (on $\\mathcal { S } _ { n }$ ) and population risk of the 132 teacher $s ^ { \\mathrm { t } }$ . Here, $R _ { \\mathrm { E m b } , Q } ( \\mathrm { t } , \\mathrm { s } ; \\mathcal { S } _ { n } )$ and $R _ { \\mathrm { E m b } , D } ( \\mathrm { t } , \\mathrm { s } ; \\mathcal { S } _ { n } )$ measure misalignment between teacher and 133 student embeddings by focusing on queries and documents, respectively (cf. Eq. 7 & 8 in Sec. 4.1). ",
398
+ "bbox": [
399
+ 142,
400
+ 280,
401
+ 826,
402
+ 342
403
+ ],
404
+ "page_idx": 3
405
+ },
406
+ {
407
+ "type": "text",
408
+ "text": "134 The last three quantities in the bound in Thm. 3.1, namely $\\Delta ( s ^ { \\mathrm { t } } ; \\mathbb { S } _ { n } ) , \\mathbb { E } [ | \\sigma ( s _ { q , d } ^ { \\mathrm { t } } ) - y | ]$ , and \n135 $\\begin{array} { r } { \\frac { 1 } { n } \\sum _ { i \\in [ n ] } | \\sigma ( s _ { q _ { i } , d _ { i } } ^ { \\mathrm { t } } ) - y _ { i } | } \\end{array}$ , are independent of the underlying student model. These terms solely \n136 depend on the quality of the underlying teacher model $s ^ { \\mathrm { t } }$ . That said, the teacher-student gap can be \n137 made small by reducing the following three terms: 1) uniform deviation of the student’s empirical \n138 distillation risk from its population version $\\mathcal { E } _ { n } ( \\mathcal { F } , \\mathcal { G } ) ; 2 )$ misalignment between teacher student query \n139 embeddings $R _ { \\mathrm { E m b } , Q } ( \\mathrm { t } , \\mathrm { s } ; \\mathcal { S } _ { n } )$ ; and 3) misalignment between teacher student document embeddings \n140 $R _ { \\mathrm { E m b } , D } ( \\mathrm { t } , \\mathrm { s } ; \\mathcal { S } _ { n } )$ . \n141 The last two terms motivate us to propose an embedding matching-based distillation that explicitly \n142 aims to minimize these terms during student training. Even more interestingly, these terms also \n143 inspire an asymmetric $D E$ configuration for the student which strikes a balance between the goals of \n144 reducing the misalignment between the embeddings of teacher and student (by inheriting teacher’s \n145 document encoder) and ensuring serving efficiency (small inference latency) by employing a small \n146 query encoder. Before discussing these proposals in detail in Sec. 4 and Fig. 1, we explore the first \n147 term $\\textstyle { \\mathcal { E } } _ { n } ( { \\mathcal { F } } , { \\mathcal { G } } )$ and highlight how our proposals also have implications for reducing this term. Towards \n148 this, the following result bounds $\\mathcal { E } _ { n } ( \\mathcal { F } , \\mathcal { G } )$ . Due to space constraints, we present an informal statement \n149 of the result (see Appendix C.2 for a more precise statement and proof). \n150 Proposition 3.2. Let $\\ell _ { \\mathrm { d } }$ be a distillation loss which is $L _ { \\ell _ { \\mathrm { d } } }$ -Lipschitz in its first argument. Let $\\mathcal { F }$ and G \n151 denote the function classes for the query and document encoders, respectively. Further assume that, \n152 for each query and document encoder in our function class, the query and document embeddings \n153 have their $\\ell _ { 2 }$ -norm bounded by $K$ . Then, ",
409
+ "bbox": [
410
+ 143,
411
+ 351,
412
+ 825,
413
+ 457
414
+ ],
415
+ "page_idx": 3
416
+ },
417
+ {
418
+ "type": "text",
419
+ "text": "",
420
+ "bbox": [
421
+ 140,
422
+ 462,
423
+ 825,
424
+ 587
425
+ ],
426
+ "page_idx": 3
427
+ },
428
+ {
429
+ "type": "text",
430
+ "text": "",
431
+ "bbox": [
432
+ 140,
433
+ 590,
434
+ 825,
435
+ 646
436
+ ],
437
+ "page_idx": 3
438
+ },
439
+ {
440
+ "type": "equation",
441
+ "img_path": "images/326c29d672076b07bd805a807d02da369fc6c4dedc1ae7eb2533897292601151.jpg",
442
+ "text": "$$\n{ \\mathcal E } _ { n } ( \\mathcal F , \\mathcal G ) \\leq { \\mathbb E } _ { \\mathcal S _ { n } } \\frac { 4 8 K L _ { \\ell _ { \\mathrm { d } } } } { \\sqrt { n } } \\int _ { 0 } ^ { \\infty } \\sqrt { \\log \\left( N ( u , \\mathcal F ) N ( u , \\mathcal G ) \\right) } d u .\n$$",
443
+ "text_format": "latex",
444
+ "bbox": [
445
+ 299,
446
+ 651,
447
+ 699,
448
+ 685
449
+ ],
450
+ "page_idx": 3
451
+ },
452
+ {
453
+ "type": "text",
454
+ "text": "Furthermore, with a fixed document encoder, i.e., 154 $\\mathcal { G } = \\{ g ^ { * } \\}$ , ",
455
+ "bbox": [
456
+ 142,
457
+ 691,
458
+ 568,
459
+ 707
460
+ ],
461
+ "page_idx": 3
462
+ },
463
+ {
464
+ "type": "equation",
465
+ "img_path": "images/918425106a258915d668fc81d44fd7b5136ee48ca438dd0a7849746e810d0b3d.jpg",
466
+ "text": "$$\n\\mathcal { E } _ { n } ( \\mathcal { F } , \\{ g * \\} ) \\leq \\mathbb { E } _ { \\mathcal { S } _ { n } } \\frac { 4 8 K L _ { \\ell _ { \\mathrm { d } } } } { \\sqrt { n } } \\int _ { 0 } ^ { \\infty } \\sqrt { \\log N ( u , \\mathcal { F } ) } d u .\n$$",
467
+ "text_format": "latex",
468
+ "bbox": [
469
+ 323,
470
+ 712,
471
+ 674,
472
+ 746
473
+ ],
474
+ "page_idx": 3
475
+ },
476
+ {
477
+ "type": "text",
478
+ "text": "155 Here, $N ( u , \\cdot )$ is the $u$ -covering number of a function class. ",
479
+ "bbox": [
480
+ 142,
481
+ 751,
482
+ 558,
483
+ 767
484
+ ],
485
+ "page_idx": 3
486
+ },
487
+ {
488
+ "type": "text",
489
+ "text": "156 Note that Eq. 5 and Eq. 6 correspond to uniform deviation when we train without and with a frozen \n157 document encoder, respectively. It is clear that the bound in Eq. 6 is less than or equal to that in \n158 Eq. 5 (because $N ( u , \\mathcal { G } ) \\ge 1$ for any $u ^ { \\cdot }$ ), which alludes to desirable impact of employing a frozen \n159 document encoder as one of our proposal seeks to do via inheriting teacher’s document encoder (for \n160 instance in an asymmetric DE configuration). Furthermore, our proposal of employing an embedding \n161 matching task will regularize the function class of query encoders; effectively reducing it to ${ \\mathcal { F } } ^ { \\prime }$ with \n162 $| \\mathcal { F } ^ { \\prime } | \\leq | \\bar { \\mathcal { F } } |$ . The same holds true for document encoder function class when document encoder is \n163 trainable (as in Eq. 5), leading to an effective function class ${ \\mathcal { G } } ^ { \\prime }$ with $| \\mathcal { G } ^ { \\prime } | \\leq | \\mathcal { G } |$ . Since we would have \n164 $N ( u , \\mathcal { F } ^ { \\prime } ) \\leq N ( u , \\mathcal { F } )$ and $N ( u , \\mathcal { G } ^ { \\prime } ) \\leq N ( u , \\mathcal { G } )$ , this suggests desirable implications of embedding \n165 matching for reducing the uniform deviation bound. ",
490
+ "bbox": [
491
+ 140,
492
+ 776,
493
+ 826,
494
+ 916
495
+ ],
496
+ "page_idx": 3
497
+ },
498
+ {
499
+ "type": "text",
500
+ "text": "166 4 Embedding-matching based distillation ",
501
+ "text_level": 1,
502
+ "bbox": [
503
+ 142,
504
+ 89,
505
+ 534,
506
+ 107
507
+ ],
508
+ "page_idx": 4
509
+ },
510
+ {
511
+ "type": "text",
512
+ "text": "7 Informed by our analysis of teacher-student generalization gap in Sec. 3, we propose EmbedDistill – a \n68 novel distillation method that explicitly focuses on aligning the embedding spaces of the teacher and \n69 student. Our proposal goes beyond existing distillation methods in the IR literature that only use the \n70 teacher scores. Next, we introduce EmbedDistill for two prevalent settings: (1) distilling a large DE \n71 model to a smaller DE model; 2 and (2) distilling a CE model to a DE model. ",
513
+ "bbox": [
514
+ 153,
515
+ 114,
516
+ 825,
517
+ 184
518
+ ],
519
+ "page_idx": 4
520
+ },
521
+ {
522
+ "type": "text",
523
+ "text": "172 4.1 DE to DE distillation ",
524
+ "text_level": 1,
525
+ "bbox": [
526
+ 150,
527
+ 195,
528
+ 359,
529
+ 212
530
+ ],
531
+ "page_idx": 4
532
+ },
533
+ {
534
+ "type": "text",
535
+ "text": "173 Given a $( q , d )$ pair, let $\\mathsf { e m b } _ { q } ^ { \\mathrm { t } }$ and $\\mathtt { e m b } _ { d } ^ { \\mathrm { t } }$ be the query and document embeddings produced by the \n174 query encoder $\\mathrm { E n c } _ { Q } ^ { \\mathrm { t } }$ and document encoder $\\mathrm { E n c } _ { D } ^ { \\mathrm { t } }$ of the teacher DE model, respectively. Similarly, \n175 let $\\mathsf { e m b } _ { q } ^ { \\mathrm { s } }$ and $\\mathsf { e m b } _ { d } ^ { \\mathrm { s } }$ denote the query and document embeddings produced by a student DE model \n176 with $( \\dot { \\mathrm { E n c } } _ { Q } ^ { \\mathrm { s } } , \\mathrm { E n c } _ { D } ^ { \\mathrm { s } } )$ as its query and document encoders. Now, EmbedDistill optimizes the following \n177 embedding alignment losses in addition to the score-matching loss from Sec. 2.2 to align query and \n178 document embeddings of the teacher and student: ",
536
+ "bbox": [
537
+ 140,
538
+ 218,
539
+ 826,
540
+ 306
541
+ ],
542
+ "page_idx": 4
543
+ },
544
+ {
545
+ "type": "equation",
546
+ "img_path": "images/fa0517b3cf27c5c9b88e11967a60c13165f0202460fe03e51a4511cf5365635a.jpg",
547
+ "text": "$$\n\\begin{array} { r l } & { R _ { \\mathrm { E m b } , Q } ( \\mathrm { t } , \\mathrm { s } ; \\mathbb { S } _ { n } ) = \\displaystyle \\frac { 1 } { n } \\sum _ { q \\in \\mathcal { S } _ { n } } \\| \\mathbf { e m b } _ { q } ^ { \\mathrm { t } } - \\mathrm { p r o j } \\big ( \\mathbf { e m b } _ { q } ^ { \\mathrm { s } } \\big ) \\| ; } \\\\ & { R _ { \\mathrm { E m b } , D } ( \\mathrm { t } , \\mathrm { s } ; \\mathbb { S } _ { n } ) = \\displaystyle \\frac { 1 } { n } \\sum _ { d \\in \\mathcal { S } _ { n } } \\| \\mathbf { e m b } _ { d } ^ { \\mathrm { t } } - \\mathrm { p r o j } \\big ( \\mathbf { e m b } _ { d } ^ { \\mathrm { s } } \\big ) \\| . } \\end{array}\n$$",
548
+ "text_format": "latex",
549
+ "bbox": [
550
+ 316,
551
+ 311,
552
+ 681,
553
+ 376
554
+ ],
555
+ "page_idx": 4
556
+ },
557
+ {
558
+ "type": "text",
559
+ "text": "179 Asymmetric DE. We also propose a novel student DE configuration where the student employs the \n180 teacher’s document encoder (i.e., $\\mathrm { E n c } _ { D } ^ { \\mathrm { s } } = \\mathrm { E n c } _ { D } ^ { \\mathrm { t } } ,$ ) and only train its query encoder, which is much \n181 smaller compared to the teacher’s query encoder. For such a setting, it is natural to only employ the \n182 embedding matching loss in Eq. 7 as the document embeddings are aligned by design (cf. Fig. 1a). \n183 Note that this asymmetric student DE does not incur an increase in latency despite the use of a \n184 large teacher document encoder. This is because the large document encoder is only needed to \n185 create a good quality document index offline, and only the query encoder is evaluated at inference \n186 time. Also, the similarity search cost is not increased as the projection layer ensures the same small \n187 embedding dimension as in the symmetric DE student. Thus, for DE to DE distillation, we prescribe \n188 the asymmetric DE configuration universally. Our theoretical analysis (cf. Sec. 3) and experimental \n189 results (cf. Sec. 5) suggest that the ability to inherit the document tower from the teacher DE model \n190 can drastically improve the final performance, especially when combined with query embedding \n191 matching task (cf. Eq. 7). ",
560
+ "bbox": [
561
+ 140,
562
+ 377,
563
+ 823,
564
+ 434
565
+ ],
566
+ "page_idx": 4
567
+ },
568
+ {
569
+ "type": "text",
570
+ "text": "",
571
+ "bbox": [
572
+ 142,
573
+ 439,
574
+ 825,
575
+ 565
576
+ ],
577
+ "page_idx": 4
578
+ },
579
+ {
580
+ "type": "text",
581
+ "text": "4.2 CE to DE distillation ",
582
+ "text_level": 1,
583
+ "bbox": [
584
+ 171,
585
+ 577,
586
+ 357,
587
+ 592
588
+ ],
589
+ "page_idx": 4
590
+ },
591
+ {
592
+ "type": "text",
593
+ "text": "193 Given that CE models jointly encode query-document pairs, individual query and document embed \n94 dings are not readily available to implement embedding matching losses as per Eq. 7 and 8. This \n95 makes it challenging to employ EmbedDistill for CE to DE distillation. ",
594
+ "bbox": [
595
+ 148,
596
+ 599,
597
+ 826,
598
+ 641
599
+ ],
600
+ "page_idx": 4
601
+ },
602
+ {
603
+ "type": "text",
604
+ "text": "As a naïve solution, for a $( q , d )$ pair, one can simply match a joint transformation of the student’s query embedding $\\mathsf { e m b } _ { q } ^ { \\mathrm { s } }$ and document embedding $\\mathsf { e m b } _ { d } ^ { \\mathrm { s } }$ to the teacher’s joint embedding $\\mathtt { e m b } _ { q , d } ^ { \\mathrm { t } }$ , produced by (single) teacher encoder $\\operatorname { E n c } ^ { t }$ . However, we observed that including such an embedding matching task often leads to severe over-fitting, and results in a poor student. Since $s ^ { \\mathrm { t } } ( q , d ) = \\langle \\bar { w } , \\mathtt { e m b } _ { q , d } ^ { \\mathrm { t } } \\rangle$ , during CE model training, the joint embeddings $\\mathtt { e m b } _ { q , d } ^ { \\mathrm { t } }$ for relevant and irrelevant $( q , d )$ pairs are encouraged to be aligned with $w$ and $- w$ , respectively. This produces degenerate embeddings that do not capture semantic query-to-document relationships. We notice that even the final query and document token embeddings lose such semantic structure (cf. Appendix G.2). Thus, a teacher CE model with $s ^ { \\mathrm { t } } ( q , d ) = \\langle w , \\mathsf { e m b } _ { q , d } ^ { \\mathrm { t } } \\rangle$ does not add value for distillation beyond score-matching; in fact, it hurts to include naïve embedding matching. Next, we propose a modified CE model training strategy that facilitates EmbedDistill. ",
605
+ "bbox": [
606
+ 173,
607
+ 647,
608
+ 825,
609
+ 806
610
+ ],
611
+ "page_idx": 4
612
+ },
613
+ {
614
+ "type": "text",
615
+ "text": "CE models with dual pooling. A dual pooling scheme is employed in the scoring layer to produce two embeddings $\\mathsf { e m b } _ { q \\gets ( q , d ) } ^ { \\mathrm { t } }$ and $\\mathsf { e m b } _ { d ( q , d ) } ^ { \\mathrm { t } }$ from a CE model that serve as the proxy query and document embeddings, respectively. Accordingly, we define the relevance score as $s ^ { \\mathrm { t } } ( q , d ) \\ =$ $\\langle \\mathbf { e m b } _ { q ( q , d ) } ^ { \\mathrm { t } } , \\mathbf { e m b } _ { d ( q , d ) } ^ { \\mathrm { t } } \\rangle$ . We explore two variants of dual pooling: (1) special token-based pooling that pools from [CLS] and [SEP]; and (2) segment-based weighted mean pooling that separately ",
616
+ "bbox": [
617
+ 174,
618
+ 811,
619
+ 825,
620
+ 888
621
+ ],
622
+ "page_idx": 4
623
+ },
624
+ {
625
+ "type": "table",
626
+ "img_path": "images/b1045098adf8c12d9d6c1333b26ad16540223ae449dad60161f12104334c670b.jpg",
627
+ "table_caption": [
628
+ "Table 1: Full recall performance of various student DE models on NQ dev set, including symmetric DE student model (67.5M or 11.3M transformer for both encoders), and asymmetric DE student model (67.5M or 11.3M transformer as query encoder and document embeddings inherited from the teacher). All distilled students used the same teacher (110.1M parameter BERT-base models as both encoders), with the full Recall $\\textcircled { \\omega } 5 = 7 2 . 3 $ , Recall $\\textcircled { \\omega } 2 0 = 8 6 . 1 $ , and Recall $\\textcircled { a } 1 0 0 = 9 3 . 6 $ . "
629
+ ],
630
+ "table_footnote": [],
631
+ "table_body": "<table><tr><td rowspan=\"2\">Method</td><td colspan=\"3\">6-Layer (67.5M)</td><td colspan=\"3\">4-Layer (11.3M)</td></tr><tr><td></td><td>R@5 R@20R@100</td><td></td><td></td><td>R@5 R@20R@100</td><td></td></tr><tr><td>Train student directly</td><td>36.2</td><td>59.7</td><td>80.0</td><td>24.8</td><td>44.7</td><td>67.5</td></tr><tr><td>+ Distill from teacher</td><td>65.3</td><td>81.6</td><td>91.2</td><td>44.3</td><td>64.9</td><td>81.0</td></tr><tr><td>+ Inherit doc embeddings</td><td>69.9</td><td>83.9</td><td>92.3</td><td>56.3</td><td>70.9</td><td>82.5</td></tr><tr><td>+ Query embedding matching</td><td>72.7</td><td>86.5</td><td>93.9</td><td>61.2</td><td>75.2</td><td>85.1</td></tr><tr><td>+ Query generation</td><td>73.4</td><td>86.3</td><td>93.8</td><td>64.3</td><td>77.8</td><td>87.9</td></tr><tr><td>Train student using only embedding matching and</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>inherit doc embeddings</td><td>71.4</td><td>84.9</td><td>92.6</td><td>64.6</td><td>50.2</td><td>76.8</td></tr><tr><td>+ Query generation</td><td>71.8</td><td>85.0</td><td>93.0</td><td>54.2</td><td>68.9</td><td>80.8</td></tr></table>",
632
+ "bbox": [
633
+ 171,
634
+ 188,
635
+ 553,
636
+ 318
637
+ ],
638
+ "page_idx": 5
639
+ },
640
+ {
641
+ "type": "table",
642
+ "img_path": "images/ce34bd4e6a04dde874c07b7ed383cfcd4a7589dc0a6be0d1a5b3fdbb64b38750.jpg",
643
+ "table_caption": [
644
+ "Table 2: Performance of EmbedDistill for DE to DE distillation on NQ test set. While prior works listed in the table rely on techniques such as negative mining and multistage training, we explore the orthogonal direction of embedding-matching that improves single-stage distillation, which can be combined with them. "
645
+ ],
646
+ "table_footnote": [],
647
+ "table_body": "<table><tr><td>Method</td><td>#Layers</td><td>R@20</td><td>R@100</td></tr><tr><td>DPR [20]</td><td>12</td><td>78.4</td><td>85.4</td></tr><tr><td>DPR + PAQ[47]</td><td>12</td><td>84.0</td><td>89.2</td></tr><tr><td>DPR + PAQ[47]</td><td>24</td><td>84.7</td><td>89.2</td></tr><tr><td>ACNE [60]</td><td>12</td><td>81.9</td><td>87.5</td></tr><tr><td>RocketQA [48]</td><td>12</td><td>82.7</td><td>88.5</td></tr><tr><td>MSS-DPR[53]</td><td>12</td><td>84.0</td><td>89.2</td></tr><tr><td>MSS-DPR[53]</td><td>24</td><td>84.8</td><td>89.8</td></tr><tr><td>Our teacher [63]</td><td>12 (220.2M)</td><td>85.4</td><td>90.0</td></tr><tr><td>EmbedDistill</td><td>6 (67.5M)</td><td>85.1</td><td>89.8</td></tr><tr><td>EmbedDistill</td><td>4 (11.3M)</td><td>81.2</td><td>87.4</td></tr></table>",
648
+ "bbox": [
649
+ 568,
650
+ 188,
651
+ 825,
652
+ 318
653
+ ],
654
+ "page_idx": 5
655
+ },
656
+ {
657
+ "type": "text",
658
+ "text": "12 performs weighted averaging on the query and document segments of the final token embeddings. \n13 See Appendix B for details. ",
659
+ "bbox": [
660
+ 151,
661
+ 332,
662
+ 823,
663
+ 359
664
+ ],
665
+ "page_idx": 5
666
+ },
667
+ {
668
+ "type": "text",
669
+ "text": "In addition to dual pooling, we also utilize a reconstruction loss during the CE training, which measures the likelihood of predicting each token of the original input from the final token embeddings. This loss encourages reconstruction of query and document tokens based on the final token embeddings and prevents the degeneration of the token embeddings during training. Given proxy embeddings from the teacher CE, we can perform EmbedDistill with the embedding matching loss defined in Eq. 7 and Eq. 8 (cf. Fig. 1b). ",
670
+ "bbox": [
671
+ 173,
672
+ 366,
673
+ 825,
674
+ 450
675
+ ],
676
+ "page_idx": 5
677
+ },
678
+ {
679
+ "type": "text",
680
+ "text": "4.3 Task-specific online data generation ",
681
+ "text_level": 1,
682
+ "bbox": [
683
+ 168,
684
+ 462,
685
+ 462,
686
+ 476
687
+ ],
688
+ "page_idx": 5
689
+ },
690
+ {
691
+ "type": "text",
692
+ "text": "Data augmentation as a general technique has been previously considered in the IR literature [see, e.g., 45, 47, 17], especially in data-limited, out-of-domain, or zero-shot settings. As EmbedDistill aims to align the embeddings spaces of the teacher and student, the ability to generate similar queries or documents can naturally help enforce such an alignment globally on the task-specific manifold. Given a set of unlabeled task-specific query and document pairs $\\mathbb { U } _ { m }$ , we can further add the embedding matching losses $R _ { \\mathrm { E m b , Q } } ( \\mathrm { t } , \\mathrm { s } ; \\mathcal { U } _ { m } )$ or $R _ { \\mathrm { E m b , D } } ( \\mathrm { t } , \\mathrm { s } ; \\mathcal { U } _ { m } )$ to our training objective. Interestingly, for DE to DE distillation setting, our approach can even benefit from a large collection of task-specific queries $\\Omega ^ { \\prime }$ or documents $\\mathrm { \\textmathcal { D } ^ { \\prime } }$ . Here, we can independently employ embedding matching losses $R _ { \\mathrm { E m b , Q } } ( \\mathrm { t } , \\mathrm { s } ; \\Omega ^ { \\prime } )$ or $R _ { \\mathrm { E m b , D } } ( \\mathrm { t } , \\mathrm { s } ; \\mathcal { D } ^ { \\prime } )$ that focus on queries and documents, respectively. Please refer to Appendix E describing how the task-specific data were generated. ",
693
+ "bbox": [
694
+ 173,
695
+ 483,
696
+ 825,
697
+ 621
698
+ ],
699
+ "page_idx": 5
700
+ },
701
+ {
702
+ "type": "text",
703
+ "text": "5 Experiments ",
704
+ "text_level": 1,
705
+ "bbox": [
706
+ 174,
707
+ 632,
708
+ 312,
709
+ 648
710
+ ],
711
+ "page_idx": 5
712
+ },
713
+ {
714
+ "type": "text",
715
+ "text": "We now conduct a comprehensive evaluation of the proposed distillation approach. Specifically, we highlight the utility of the approach for both DE to DE and CE to DE distillation. We also showcase the benefits of combining our distillation approach with query generation methods. ",
716
+ "bbox": [
717
+ 174,
718
+ 657,
719
+ 825,
720
+ 699
721
+ ],
722
+ "page_idx": 5
723
+ },
724
+ {
725
+ "type": "text",
726
+ "text": "5.1 Setup",
727
+ "text_level": 1,
728
+ "bbox": [
729
+ 174,
730
+ 710,
731
+ 253,
732
+ 724
733
+ ],
734
+ "page_idx": 5
735
+ },
736
+ {
737
+ "type": "text",
738
+ "text": "Benchmarks and evaluation metrics. We consider two popular IR benchmarks — Natural Questions (NQ) [24] and MSMARCO [40], which focus on finding the most relevant passage/document given a question and a search query, respectively. NQ provides both standard test and dev sets, whereas MSMARCO provides only the dev set that are widely used for common benchmarks. In what follows, we use the terms query (document) and question (passages) interchangeably. For NQ, we use the standard full recall (strict) as well as the relaxed recall metric [20] to evaluate the retrieval performance. For MSMARCO, we focus on the standard metrics Mean Reciprocal Rank $( \\mathbf { M } \\mathbf { R } \\mathbf { R } ) @ 1 0$ , and normalized Discounted Cumulative Gain $( \\mathrm { n D C G } ) @ 1 0$ to evaluate both re-ranking and retrieval performance. For the re-ranking, we restrict to re-ranking only the top 1000 candidate document provided as part of the dataset to be fair, while some works use stronger methods to find better top 1000 candidates for re-ranking (resulting in higher evaluation numbers) See Appendix D for a detailed discussion on these evaluation metrics. Finally, we also evaluate EmbedDistill on the BEIR benchmark [57] in terms of nDCG $@ 1 0$ and recall $@ 1 0 0$ metrics. ",
739
+ "bbox": [
740
+ 173,
741
+ 732,
742
+ 825,
743
+ 911
744
+ ],
745
+ "page_idx": 5
746
+ },
747
+ {
748
+ "type": "text",
749
+ "text": "9 Model architectures. We follow the standard Transformers-based IR model architectures similar to Karpukhin et al. [20], Qu et al. [48], Oguz et al. ˘ [47]. We utilized various sizes of DE models based on BERT-base [11] (12-layer, 768 dim, 110M parameters), DistilBERT [55] (6-layer, 768 dim, 67.5M parameters $- \\sim 2 / 3$ of base), or BERT-mini [58] (4-layer, 256 dim, 11.3M parameters $- \\sim 1 / 1 0$ of base). For query generation (cf. Sec. 4.3), we employ BART-base [27], an encoder-decoder model, to generate similar questions from each training example’s input question (query). We randomly mask $\\bar { 1 } 0 \\%$ of tokens and inject zero mean Gaussian noise with $\\sigma = \\{ 0 . 1 , 0 . 2 \\}$ between the encoder and decoder. See Appendix E for more details on query generation and Appendix F.1 for hyperparameters. ",
750
+ "bbox": [
751
+ 155,
752
+ 92,
753
+ 825,
754
+ 203
755
+ ],
756
+ "page_idx": 6
757
+ },
758
+ {
759
+ "type": "text",
760
+ "text": "5.2 DE to DE distillation ",
761
+ "text_level": 1,
762
+ "bbox": [
763
+ 173,
764
+ 219,
765
+ 357,
766
+ 234
767
+ ],
768
+ "page_idx": 6
769
+ },
770
+ {
771
+ "type": "text",
772
+ "text": "We employ AR2 $[ 6 3 ] ^ { 3 }$ and SentenceBERTv5 $[ 5 0 ]$ as teacher DE models for NQ and MSMARCO. Note that both models are based on BERT-base. For DE to DE distillation, we consider two kinds of configurations for the student DE model: (1) Symmetric: We use identical question and document encoders. We evaluate DistilBERT and BERT-mini on both datasets. (2) Asymmetric: The student inherits document embeddings from the teacher DE model and are not trained during the distillation. For query encoder, we use DistilBERT or BERT-mini which are smaller than document encoder. ",
773
+ "bbox": [
774
+ 174,
775
+ 243,
776
+ 452,
777
+ 450
778
+ ],
779
+ "page_idx": 6
780
+ },
781
+ {
782
+ "type": "text",
783
+ "text": "Student DE model training. We train student DE models using a combination of (i) one-hot loss (cf. Eq. 9 in Appendix A) on training data; (ii) distillation loss in (cf. Eq. 11 in Appendix A); and (iii) em",
784
+ "bbox": [
785
+ 173,
786
+ 458,
787
+ 452,
788
+ 526
789
+ ],
790
+ "page_idx": 6
791
+ },
792
+ {
793
+ "type": "text",
794
+ "text": "Table 3: Performance of various DE models on MSMARCO dev set for both $r e$ -ranking and retrieval tasks (full corpus). The teacher model (110.1M parameter BERT-base models as both encoders) for re-ranking achieves MRR $@ 1 0$ of 36.8 and that for retrieval get MRR $@ 1 0$ of 37.2. The table shows performance (in MRR $@ 1 0$ ) of the symmetric DE student model (67.5M or 11.3M transformer as both encoders), and asymmetric DE student model $( 6 7 . 5 \\mathrm { M }$ or $1 1 . 3 \\mathbf { M }$ transformer as query encoder and document embeddings inherited from the teacher). ",
795
+ "bbox": [
796
+ 465,
797
+ 242,
798
+ 825,
799
+ 368
800
+ ],
801
+ "page_idx": 6
802
+ },
803
+ {
804
+ "type": "table",
805
+ "img_path": "images/16a88743bfe4ef72976527ee6a01cd4e1a3e6139668f66d8888b1e36c08809db.jpg",
806
+ "table_caption": [],
807
+ "table_footnote": [],
808
+ "table_body": "<table><tr><td rowspan=\"2\">Method</td><td colspan=\"2\">Re-ranking</td><td colspan=\"2\">Retrieval</td></tr><tr><td>67.5M</td><td>11.3M</td><td>67.5M</td><td>11.3M</td></tr><tr><td>Train student directly</td><td>27.0</td><td>23.0</td><td>22.6</td><td>18.6</td></tr><tr><td>+ Distill from teacher</td><td>34.6</td><td>30.4</td><td>35.0</td><td>28.6</td></tr><tr><td>+ Inherit doc embeddings</td><td>35.2</td><td>32.1</td><td>35.7</td><td>30.3</td></tr><tr><td>+ Query embedding matching</td><td>36.2</td><td>35.0</td><td>35.4</td><td>40.8</td></tr><tr><td>+ Query generation</td><td>36.2</td><td>34.4</td><td>37.2</td><td>34.8</td></tr><tr><td>Train student using only embedding matching and</td><td></td><td></td><td></td><td></td></tr><tr><td>inherit doc embeddings</td><td>36.5</td><td>33.5</td><td>36.6</td><td>31.4</td></tr><tr><td>+ Query generation</td><td>36.4</td><td>34.1</td><td>36.7</td><td>32.8</td></tr></table>",
809
+ "bbox": [
810
+ 462,
811
+ 381,
812
+ 825,
813
+ 516
814
+ ],
815
+ "page_idx": 6
816
+ },
817
+ {
818
+ "type": "text",
819
+ "text": "bedding matching loss in Eq. 7. We used [CLS]-pooling for all student encoders. Unlike DPR [20] or AR2, we do not use hard negatives from BM25 or other models, which greatly simplifies our distillation procedure. ",
820
+ "bbox": [
821
+ 168,
822
+ 527,
823
+ 825,
824
+ 568
825
+ ],
826
+ "page_idx": 6
827
+ },
828
+ {
829
+ "type": "text",
830
+ "text": "Results and discussion. To understand the impact of various proposed configurations and losses, we train models by sequentially adding components and evaluate their retrieval performance on NQ and MSMARCO dev set as shown in Table 1 and Table 3 respectively. (See Table 6 in Appendix F.2 for performance on NQ in terms of the relaxed recall and Table 7 in Appendix F.3 for MSMARCO in terms of $\\mathrm { n D C G G } 1 0 .$ ) ",
831
+ "bbox": [
832
+ 173,
833
+ 574,
834
+ 825,
835
+ 643
836
+ ],
837
+ "page_idx": 6
838
+ },
839
+ {
840
+ "type": "text",
841
+ "text": "We begin by training a symmetric DE without distillation. As expected, moving to distillation brings in considerable gains. Next, we swap the student document encoder with document embeddings from the teacher (non-trainable), which leads to a good jump in the performance. Now we can introduce EmbedDistill with Eq. 7 for aligning query representations between student and teacher. The two losses are combined with weight of 1.0 (except for BERT-mini models in the presence of query generation with 5.0). This improves performance significantly, e.g.,it provides ${ \\sim } 3$ and ${ \\sim } 5 $ points increase in recall $\\textcircled { \\alpha } 5$ on NQ with students based on DistilBERT and BERT-mini, respectively (Table 1). We further explore the utility of EmbedDistill in aligning the teacher and student embedding spaces in Appendix G.1. ",
842
+ "bbox": [
843
+ 171,
844
+ 650,
845
+ 825,
846
+ 775
847
+ ],
848
+ "page_idx": 6
849
+ },
850
+ {
851
+ "type": "text",
852
+ "text": "On top of the two losses (standard distillation and embedding matching), we also use $R _ { \\mathrm { E m b , Q } } ( \\mathrm { t } , \\mathrm { s } ; \\Omega ^ { \\prime } )$ from Sec. 4.3 on 2 additional questions (per input question) generated from BART. We also try a variant where we eliminate the standard distillation loss and only employ the embedding matching loss in Eq. 7 along with inheriting teacher’s document embeddings. This configuration without the standard distillation loss leads to excellent performance (with query generation again providing additional gains in most cases.) ",
853
+ "bbox": [
854
+ 174,
855
+ 781,
856
+ 825,
857
+ 864
858
+ ],
859
+ "page_idx": 6
860
+ },
861
+ {
862
+ "type": "text",
863
+ "text": "It is worth highlighting that DE models trained with the proposed methods (e.g., asymmetric DE with embedding matching and generation) achieve $9 9 \\%$ of the performance in both NQ/MSMARCO tasks with a query encoder that is 2/3rd the size of that of the teacher. Furthermore, even with 1/10th size of the query encoder, our proposal can achieve $9 5 . 9 7 \\%$ of the performance. This is particularly useful for latency critical applications with minimal impact on the final performance. ",
864
+ "bbox": [
865
+ 140,
866
+ 90,
867
+ 516,
868
+ 229
869
+ ],
870
+ "page_idx": 7
871
+ },
872
+ {
873
+ "type": "text",
874
+ "text": "Finally, we take our best student models, i.e., one trained using with additional embedding matching loss and using data augmentation from query generation, and evaluate on test sets. We compare with various prior work and note that most prior work used considerably bigger models in terms of parameters, depth (12 or 24 layers), or width (upto 1024 dims). For NQ test set results are reported in Table 2, but as MSMARCO does not have any public test set, we instead present results for the BEIR benchmark in Table 4. Note we also provide evaluation of our SentenceBERT teacher achieving very high performance on the benchmark which can be of independent interest (please refer to Appendix F.4 for details). For both NQ and BEIR, our approach obtains competitive student model with fewer than $50 \\%$ of the parameters: even with 6 layers, our student model is very close $( 9 8 - 9 9 \\%$ ) to its teacher. ",
875
+ "bbox": [
876
+ 143,
877
+ 236,
878
+ 517,
879
+ 319
880
+ ],
881
+ "page_idx": 7
882
+ },
883
+ {
884
+ "type": "table",
885
+ "img_path": "images/5fde82a0ee97305b02cb3fe0f4c239670e7e2e552ca99de6c06fd24d7a59a070.jpg",
886
+ "table_caption": [
887
+ "Table 4: Average BEIR performance of our DE teacher and EmbedDistill student models and their numbers of trainable parameters. Both models are trained on MSMARCO and evaluated on 14 other datasets (the average does not include MSMARCO). The full table is at Appendix F.4. With EmbedDistill, student materializes most of the performance of the teacher on the unforeseen datasets. "
888
+ ],
889
+ "table_footnote": [],
890
+ "table_body": "<table><tr><td>Method</td><td>#Layers</td><td>nDCG@10</td><td>R@100</td></tr><tr><td>DPR [21]</td><td>12</td><td>22.5</td><td>47.7</td></tr><tr><td>ANCE [60]</td><td>12</td><td>40.5</td><td>60.0</td></tr><tr><td>TAS-B [15]</td><td>6</td><td>42.8</td><td>64.8</td></tr><tr><td>GenQ [57]</td><td>6</td><td>42.5</td><td>64.2</td></tr><tr><td>Our teacher [50]</td><td>12 (220.2M)</td><td>45.7</td><td>65.1</td></tr><tr><td>EmbedDistill</td><td>6 (67.5M)</td><td>44.0</td><td>63.5</td></tr></table>",
891
+ "bbox": [
892
+ 534,
893
+ 204,
894
+ 825,
895
+ 300
896
+ ],
897
+ "page_idx": 7
898
+ },
899
+ {
900
+ "type": "text",
901
+ "text": "",
902
+ "bbox": [
903
+ 173,
904
+ 319,
905
+ 825,
906
+ 401
907
+ ],
908
+ "page_idx": 7
909
+ },
910
+ {
911
+ "type": "text",
912
+ "text": "5.3 CE to DE distillation ",
913
+ "text_level": 1,
914
+ "bbox": [
915
+ 173,
916
+ 415,
917
+ 357,
918
+ 430
919
+ ],
920
+ "page_idx": 7
921
+ },
922
+ {
923
+ "type": "text",
924
+ "text": "We consider two CE teachers for MSMARCO reranking task5 : a standard [CLS]-pooled CE teacher, and the Dual-pooled CE teacher (cf. Sec. 4.2). Both teachers are based on RoBERTa-base and trained on triples in the training set for 300K steps with crossentropy loss. ",
925
+ "bbox": [
926
+ 174,
927
+ 438,
928
+ 517,
929
+ 521
930
+ ],
931
+ "page_idx": 7
932
+ },
933
+ {
934
+ "type": "text",
935
+ "text": "Student DE model training. We considered the following distillation variants: standard score-based distillation from the [CLS]-pooled teacher, and our novel Dual-pooled CE teacher (with and without embedding matching loss). For each variant, we initialize encoders of the student DE model with two RoBERTabase models and train for 500K steps on the training triples. We performed the naïve joint embedding matching for the [CLS]-pooled teacher (cf. Sec. 4.2) and employed the query embedding matching (cf. Eq.7) for the Dual-pooled CE teacher. In either case, embedding-matching loss is added on top of the standard cross entropy loss with the weight of 1.0 (when used). ",
936
+ "bbox": [
937
+ 174,
938
+ 527,
939
+ 517,
940
+ 637
941
+ ],
942
+ "page_idx": 7
943
+ },
944
+ {
945
+ "type": "table",
946
+ "img_path": "images/6ccd9539c20f7aea65fa42044b70efed0249277a8c8d0065af6582ea38258c5f.jpg",
947
+ "table_caption": [
948
+ "Table 5: Performance of DE models distilled from [CLS]-pooled and Dual-pooled CE models on MSMARCO re-ranking task (original top $1 0 0 0 \\ \\mathrm { d e v } )$ . While both teacher models perform similarly, embedding matching-based distillation only works with the Dual-pooled teacher. See Appendix F for $\\mathrm { n D C G } @ 1 0$ metric. "
949
+ ],
950
+ "table_footnote": [],
951
+ "table_body": "<table><tr><td>Method</td><td>MRR@10</td></tr><tr><td>[CLS]-pooled teacher</td><td>37.1</td></tr><tr><td>Dual-pooled teacher</td><td>37.0</td></tr><tr><td>Standard distillation from [CLs]-pooled teacher</td><td>33.0</td></tr><tr><td>+Joint matching</td><td>32.4</td></tr><tr><td>Standard distillation from Dual-pooled teacher</td><td>33.3</td></tr><tr><td>+Query matching</td><td>33.7</td></tr></table>",
952
+ "bbox": [
953
+ 532,
954
+ 536,
955
+ 823,
956
+ 627
957
+ ],
958
+ "page_idx": 7
959
+ },
960
+ {
961
+ "type": "text",
962
+ "text": "",
963
+ "bbox": [
964
+ 168,
965
+ 638,
966
+ 823,
967
+ 679
968
+ ],
969
+ "page_idx": 7
970
+ },
971
+ {
972
+ "type": "text",
973
+ "text": "Results and discussion. Table 5 evaluates the effectiveness of the dual pooling and the embedding matching for CE to DE distillation. As described in Sec. 4.2, the traditional [CLS]-pooled teacher did not provide any useful embedding for the embedding matching (see Appendix G.2 for the further analysis of the resulting embedding space). However, with the Dual-pooled teacher, embedding matching does boost student’s performance. ",
974
+ "bbox": [
975
+ 174,
976
+ 685,
977
+ 825,
978
+ 756
979
+ ],
980
+ "page_idx": 7
981
+ },
982
+ {
983
+ "type": "text",
984
+ "text": "6 Related work ",
985
+ "text_level": 1,
986
+ "bbox": [
987
+ 173,
988
+ 768,
989
+ 316,
990
+ 785
991
+ ],
992
+ "page_idx": 7
993
+ },
994
+ {
995
+ "type": "text",
996
+ "text": "Here, we position our EmbedDistill work with respect to prior work on distillation and data augmentation for Transformers-based IR models. We also cover prior efforts on aligning representations during distillation for non-IR settings. Unlike our problem setting where the DE student is factorized, these works mainly consider distilling a single large Transformer into a smaller one. ",
997
+ "bbox": [
998
+ 174,
999
+ 795,
1000
+ 825,
1001
+ 851
1002
+ ],
1003
+ "page_idx": 7
1004
+ },
1005
+ {
1006
+ "type": "text",
1007
+ "text": "Distillation for IR. Traditional distillation techniques have been widely applied in the IR literature, often to distill a teacher CE model to a student DE model [28, 8]. Recently, distillation from a DE ",
1008
+ "bbox": [
1009
+ 165,
1010
+ 857,
1011
+ 821,
1012
+ 886
1013
+ ],
1014
+ "page_idx": 7
1015
+ },
1016
+ {
1017
+ "type": "text",
1018
+ "text": "353 model (with complex late interaction) to another DE model (with inner-product scoring) has also been \n354 considered [29, 15]. As for distilling across different model architectures, Lu et al. [31], Izacard and \n355 Grave [16] consider distillation from a teacher CE model to a student DE model. Hofstätter et al. [14] \n356 conduct an extensive study of knowledge distillation across a wide-range of model architectures. Most \n357 existing distillation schemes for IR rely on only teacher scores; by contrast, we propose a geometric \n358 approach that also utilizes the teacher embeddings. Many recent efforts [48, 51, 56] show that iterative \n359 multi-stage (self-)distillation improves upon single-stage distillation [48, 51, 56]. These approaches \n360 use a model from the previous stage to obtain labels [56] as well as mine harder-negatives [60]. We \n361 only focus on the single-stage distillation in this paper. Multi-stage procedures are complementary to \n362 our work, as one can employ our proposed embedding-matching approach in various stages of such a \n363 procedure. Interestingly, we demonstrate in Sec. 5 that our proposed EmbedDistill can successfully \n364 benefit from high quality models trained with such complex procedures [50, 63]. In particular, our \n365 single-stage distillation method can transfer almost all of their performance gains to even smaller \n366 models. Also to showcase that our method brings gain orthogonal to how teacher was trained, we \n367 conduct experiments with single-stage trained teacher in Appendix F.5. \n368 Distillation with representation alignments. Outside of the IR context, a few prior works proposed \n369 to utilize alignment between hidden layers during distillation [52, 55, 18, 1, 64]. Chen et al. [7] utilize \n370 the representation alignment to re-use teacher’s classification layer for image classification. Unlike \n371 these works, our work is grounded in a rigorous theoretical understanding of the teacher-student \n372 (generalization) gap for IR models. Further, our work differs from these as it needs to address multiple \n373 challenges presented by an IR setting: 1) cross-architecture distillation such as CE to DE distillation; \n374 2) partial representation alignment of query or document representations as opposed to aligning for \n375 the entire input, i.e., a query-documents pair; and 3) catering representation alignment approach to \n376 novel IR setups such as asymmetric DE configuration. To the best of our knowledge, our work is first \n377 in the IR literature that goes beyond simply matching scores (or its proxies) for distillation. ",
1019
+ "bbox": [
1020
+ 138,
1021
+ 92,
1022
+ 825,
1023
+ 299
1024
+ ],
1025
+ "page_idx": 8
1026
+ },
1027
+ {
1028
+ "type": "text",
1029
+ "text": "",
1030
+ "bbox": [
1031
+ 148,
1032
+ 304,
1033
+ 825,
1034
+ 441
1035
+ ],
1036
+ "page_idx": 8
1037
+ },
1038
+ {
1039
+ "type": "text",
1040
+ "text": "Semi-supervised learning for IR. Data augmentation or semi-supervised learning has been previously used to ensure data efficiency in IR [see, e.g., 35, 66]. More interestingly, data augmentation have enabled performance improvements as well. Doc2query [45, 44] performs document expansion by generating queries that are relevant to the document and appending those queries to the document. Query expansion has also been considered, e.g., for document re-ranking [67]. Notably, generating synthetic (query, passage, answer) triples from a text corpus to augment existing training data for QA systems also leads to significant gains [2, 47]. Furthermore, even zero-shot approaches, where no labeled query-document pairs are used, can also perform competitively to supervised methods [26, 17, 33, 54]. Unlike these works, we utilize query-generation capability to ensure tighter alignment between the embedding spaces of the teacher and student. ",
1041
+ "bbox": [
1042
+ 173,
1043
+ 445,
1044
+ 825,
1045
+ 584
1046
+ ],
1047
+ "page_idx": 8
1048
+ },
1049
+ {
1050
+ "type": "text",
1051
+ "text": "Richer transformers-based architectures for IR. Besides DE and CE models (cf. Sec. 2), intermediate configurations [36, 22, 42, 32] have been proposed. Such models independently encode query and document before applying a more complex late interaction between the two. Nogueira et al. [46] explore generative encoder-decoder style model for re-ranking. In this paper, we focus on basic DE/CE models to showcase the benefits of our proposed geometric distillation approach. Exploring embedding matching for aforementioned architectures is an interesting avenue for future work. ",
1052
+ "bbox": [
1053
+ 174,
1054
+ 590,
1055
+ 825,
1056
+ 674
1057
+ ],
1058
+ "page_idx": 8
1059
+ },
1060
+ {
1061
+ "type": "text",
1062
+ "text": "394 7 Conclusion ",
1063
+ "text_level": 1,
1064
+ "bbox": [
1065
+ 151,
1066
+ 694,
1067
+ 299,
1068
+ 710
1069
+ ],
1070
+ "page_idx": 8
1071
+ },
1072
+ {
1073
+ "type": "text",
1074
+ "text": "We propose EmbedDistill — a novel distillation method for IR that goes beyond simple score matching. En route, we provide a theoretical understanding of the teacher-student generalization gap in an IR setting which not only motivated EmbedDistill but also inspired new design choices for the student DE models: (a) reusing the teacher’s document encoder in the student and (b) aligning query embeddings of the teacher and student. This simple approach delivers consistent quality and computational gains in practical deployments and we demonstrate them on MSMARCO, NQ, and BEIR benchmarks. Finally, we found EmbedDistill retains $9 5 . 9 7 \\%$ of the teacher performance to with 1/10th size students. ",
1075
+ "bbox": [
1076
+ 171,
1077
+ 724,
1078
+ 825,
1079
+ 821
1080
+ ],
1081
+ "page_idx": 8
1082
+ },
1083
+ {
1084
+ "type": "text",
1085
+ "text": "Limitations. As discussed in Sec. 4.2 and 5.3, EmbedDistill requires modifications in the CE scoring function to be effective. In terms of underlying IR model architectures, we only explore Transformerbased models in our experiments; primarily due to their widespread utilization. That said, we expect our results to extend to non-Transformer architectures such as MLPs. Finally, we note that our experiments only consider NLP domains, and exploring other modalities (e.g., vision) or multi-modal settings (e.g., image-to-text search) is left as an interesting avenue for future work. ",
1086
+ "bbox": [
1087
+ 173,
1088
+ 828,
1089
+ 823,
1090
+ 911
1091
+ ],
1092
+ "page_idx": 8
1093
+ },
1094
+ {
1095
+ "type": "text",
1096
+ "text": "408 References [1] Gustavo Aguilar, Yuan Ling, Yu Zhang, Benjamin Yao, Xing Fan, and Chenlei Guo. Knowledge distillation from internal representations. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 7350–7357, 2020. [2] Chris Alberti, Daniel Andor, Emily Pitler, Jacob Devlin, and Michael Collins. Synthetic QA corpora generation with roundtrip consistency. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 6168–6173, Florence, Italy, July 2019. Association for Computational Linguistics. doi: 10.18653/v1/P19-1620. URL https://aclanthology.org/P19-1620. [3] Yoshua Bengio and Jean-SÉbastien Senecal. Adaptive importance sampling to accelerate training of a neural probabilistic language model. IEEE Transactions on Neural Networks, 19 (4):713–722, 2008. doi: 10.1109/TNN.2007.912312. [4] Olivier Bousquet, Stéphane Boucheron, and Gábor Lugosi. Introduction to Statistical Learning Theory, pages 169–207. Springer Berlin Heidelberg, Berlin, Heidelberg, 2004. ISBN 978-3-540-28650-9. doi: 10.1007/978-3-540-28650-9_8. URL https://doi.org/10.1007/ 978-3-540-28650-9_8. [5] Cristian Bucila, Rich Caruana, and Alexandru Niculescu-Mizil. Model compression. In ˇ Proceedings of the 12th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’06, pages 535–541, New York, NY, USA, 2006. ACM. [6] Danqi Chen, Adam Fisch, Jason Weston, and Antoine Bordes. Reading Wikipedia to answer open-domain questions. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1870–1879, Vancouver, Canada, July 2017. Association for Computational Linguistics. doi: 10.18653/v1/P17-1171. URL https://aclanthology.org/P17-1171. [7] Defang Chen, Jian-Ping Mei, Hailin Zhang, Can Wang, Yan Feng, and Chun Chen. Knowledge distillation with the reused teacher classifier. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 11933–11942, 2022. [8] Xuanang Chen, Ben He, Kai Hui, Le Sun, and Yingfei Sun. Simplified tinybert: Knowledge distillation for document retrieval. In Djoerd Hiemstra, Marie-Francine Moens, Josiane Mothe, Raffaele Perego, Martin Potthast, and Fabrizio Sebastiani, editors, Advances in Information Retrieval, pages 241–248, Cham, 2021. Springer International Publishing. ISBN 978-3-030- 72240-1. [9] Zhuyun Dai and Jamie Callan. Deeper text understanding for IR with contextual neural language modeling. In Benjamin Piwowarski, Max Chevalier, Éric Gaussier, Yoelle Maarek, Jian-Yun Nie, and Falk Scholer, editors, Proceedings of the 42nd International ACM SIGIR Conference on Research and Development in Information Retrieval, SIGIR 2019, Paris, France, July 21-25, 2019, pages 985–988. ACM, 2019. [10] Zhuyun Dai and Jamie Callan. Context-aware sentence/passage term importance estimation for first stage retrieval. arXiv preprint arXiv:1910.10687, 2019. [11] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: pre-training of deep bidirectional transformers for language understanding. In Jill Burstein, Christy Doran, and Thamar Solorio, editors, Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACLHLT 2019, Minneapolis, MN, USA, June 2-7, 2019, Volume 1 (Long and Short Papers), pages 4171–4186. Association for Computational Linguistics, 2019. \n453 [12] Ruiqi Guo, Philip Sun, Erik Lindgren, Quan Geng, David Simcha, Felix Chern, and Sanjiv Kumar. Accelerating large-scale inference with anisotropic vector quantization. In International Conference on Machine Learning, 2020. URL https://arxiv.org/abs/1908.10396. [13] Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network, 2015. ",
1097
+ "bbox": [
1098
+ 147,
1099
+ 51,
1100
+ 828,
1101
+ 911
1102
+ ],
1103
+ "page_idx": 9
1104
+ },
1105
+ {
1106
+ "type": "text",
1107
+ "text": "458 [14] Sebastian Hofstätter, Sophia Althammer, Michael Schröder, Mete Sertkan, and Allan Hanbury. \n459 Improving efficient neural ranking models with cross-architecture knowledge distillation. CoRR, \n460 abs/2010.02666, 2020. URL https://arxiv.org/abs/2010.02666. \n61 [15] Sebastian Hofstätter, Sheng-Chieh Lin, Jheng-Hong Yang, Jimmy Lin, and Allan Hanbury. \n62 Efficiently teaching an effective dense retriever with balanced topic aware sampling. In Pro \n63 ceedings of the 44th International ACM SIGIR Conference on Research and Development in \n64 Information Retrieval, SIGIR ’21, page 113–122, New York, NY, USA, 2021. Association \n65 for Computing Machinery. ISBN 9781450380379. doi: 10.1145/3404835.3462891. URL \n66 https://doi.org/10.1145/3404835.3462891. \n[16] Gautier Izacard and Edouard Grave. Distilling knowledge from reader to retriever for question \n68 answering. In International Conference on Learning Representations, 2021. URL https: \n69 //openreview.net/forum?id=NTEz-6wysdb. \n70 [17] Gautier Izacard, Mathild Caron, Lucas Hosseini, Sebastian Riedel, Piotr Bojanowski, Armand \n71 Joulin, and Edouard Grave. Unsupervised dense information retrieval with contrastive learning. \n72 arXiv preprint arXiv:2112.09118, 2021. \n[18] Xiaoqi Jiao, Yichun Yin, Lifeng Shang, Xin Jiang, Xiao Chen, Linlin Li, Fang Wang, and \n74 Qun Liu. TinyBERT: Distilling BERT for natural language understanding. In Findings of the \n75 Association for Computational Linguistics: EMNLP 2020, pages 4163–4174, Online, November \n76 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.findings-emnlp.372. \n77 URL https://aclanthology.org/2020.findings-emnlp.372. \n78 [19] Jeff Johnson, Matthijs Douze, and Hervé Jégou. Billion-scale similarity search with gpus. IEEE \n79 Transactions on Big Data, 7(3):535–547, 2021. doi: 10.1109/TBDATA.2019.2921572. \n80 [20] Vladimir Karpukhin, Barlas Oguz, Sewon Min, Patrick Lewis, Ledell Wu, Sergey Edunov, \n81 Danqi Chen, and Wen-tau Yih. Dense passage retrieval for open-domain question answering. \n82 In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Process \n83 ing (EMNLP), pages 6769–6781, Online, November 2020. Association for Computational \n84 Linguistics. \n85 [21] Vladimir Karpukhin, Barlas Oguz, Sewon Min, Patrick Lewis, Ledell Wu, Sergey Edunov, ˘ \n86 Danqi Chen, and Wen-tau Yih. Dense passage retrieval for open-domain question answering. \n87 arXiv preprint arXiv:2004.04906, 2020. \n88 [22] Omar Khattab and Matei Zaharia. ColBERT: Efficient and Effective Passage Search via \n89 Contextualized Late Interaction over BERT, page 39–48. Association for Computing Machinery, \n90 New York, NY, USA, 2020. ISBN 9781450380164. \n[23] Tom Kwiatkowski, Jennimaria Palomaki, Olivia Redfield, Michael Collins, Ankur Parikh, Chris \n92 Alberti, Danielle Epstein, Illia Polosukhin, Jacob Devlin, Kenton Lee, Kristina Toutanova, Llion \n93 Jones, Matthew Kelcey, Ming-Wei Chang, Andrew M. Dai, Jakob Uszkoreit, Quoc Le, and Slav \n94 Petrov. Natural questions: A benchmark for question answering research. Transactions of the \n95 Association for Computational Linguistics, 7:452–466, 2019. doi: 10.1162/tacl_a_00276. URL \n96 https://aclanthology.org/Q19-1026. \n97 [24] Tom Kwiatkowski, Jennimaria Palomaki, Olivia Redfield, Michael Collins, Ankur Parikh, Chris \n98 Alberti, Danielle Epstein, Illia Polosukhin, Jacob Devlin, Kenton Lee, et al. Natural questions: a \n99 benchmark for question answering research. Transactions of the Association for Computational \n00 Linguistics, 7:453–466, 2019. \n01 [25] Michel Ledoux and Michel Talagrand. Probability in Banach spaces. Springer-Verlag, 1991. \n02 [26] Kenton Lee, Ming-Wei Chang, and Kristina Toutanova. Latent retrieval for weakly supervised \n03 open domain question answering. In Anna Korhonen, David R. Traum, and Lluís Màrquez, \n04 editors, Proceedings of the 57th Conference of the Association for Computational Linguistics, \n05 ACL 2019, Florence, Italy, July 28- August 2, 2019, Volume 1: Long Papers, pages 6086–6096. \n06 Association for Computational Linguistics, 2019. \n507 [27] Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer \n508 Levy, Veselin Stoyanov, and Luke Zettlemoyer. BART: Denoising sequence-to-sequence pre \n509 training for natural language generation, translation, and comprehension. In Proceedings of \n510 the 58th Annual Meeting of the Association for Computational Linguistics, pages 7871–7880, \n511 Online, July 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.acl-main. \n512 703. URL https://aclanthology.org/2020.acl-main.703. \n513 [28] Canjia Li, Andrew Yates, Sean MacAvaney, Ben He, and Yingfei Sun. Parade: Passage repre \n514 sentation aggregation for document reranking. arXiv preprint arXiv:2008.09093, 2020. \n515 [29] Sheng-Chieh Lin, Jheng-Hong Yang, and Jimmy Lin. In-batch negatives for knowledge dis \n516 tillation with tightly-coupled teachers for dense retrieval. In Proceedings of the 6th Work \n517 shop on Representation Learning for NLP (RepL4NLP-2021), pages 163–173, Online, August \n518 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.repl4nlp-1.17. URL \n519 https://aclanthology.org/2021.repl4nlp-1.17. \n520 [30] Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike \n521 Lewis, Luke Zettlemoyer, and Veselin Stoyanov. Roberta: A robustly optimized bert pretraining \n522 approach. arXiv preprint arXiv:1907.11692, 2019. \n523 [31] Wenhao Lu, Jian Jiao, and Ruofei Zhang. Twinbert: Distilling knowledge to twin-structured \n524 compressed bert models for large-scale retrieval. In Proceedings of the 29th ACM International \n525 Conference on Information & Knowledge Management, CIKM ’20, page 2645–2652, New \n526 York, NY, USA, 2020. Association for Computing Machinery. ISBN 9781450368599. doi: \n527 10.1145/3340531.3412747. URL https://doi.org/10.1145/3340531.3412747. \n528 [32] Yi Luan, Jacob Eisenstein, Kristina Toutanova, and Michael Collins. Sparse, dense, and \n529 attentional representations for text retrieval. Transactions of the Association for Computational \n530 Linguistics, 9:329–345, 2021. doi: 10.1162/tacl_a_00369. URL https://aclanthology.org/ \n531 2021.tacl-1.20. \n532 [33] Ji Ma, Ivan Korotkov, Yinfei Yang, Keith Hall, and Ryan McDonald. Zero-shot neural pas \n533 sage retrieval via domain-targeted synthetic question generation. In Proceedings of the 16th \n534 Conference of the European Chapter of the Association for Computational Linguistics: Main \n535 Volume, pages 1075–1088, Online, April 2021. Association for Computational Linguistics. doi: \n536 10.18653/v1/2021.eacl-main.92. URL https://aclanthology.org/2021.eacl-main.92. \n537 [34] Sean MacAvaney, Andrew Yates, Arman Cohan, and Nazli Goharian. CEDR: Contextualized \n538 embeddings for document ranking. In Proceedings of the 42nd International ACM SIGIR \n539 Conference on Research and Development in Information Retrieval, SIGIR’19, page 1101–1104, \n540 New York, NY, USA, 2019. Association for Computing Machinery. ISBN 9781450361729. doi: \n541 10.1145/3331184.3331317. URL https://doi.org/10.1145/3331184.3331317. \n542 [35] Sean MacAvaney, Andrew Yates, Kai Hui, and Ophir Frieder. Content-based weak supervision \n543 for ad-hoc re-ranking. In Proceedings of the 42nd International ACM SIGIR Conference on \n544 Research and Development in Information Retrieval, SIGIR’19, page 993–996, New York, NY, \n545 USA, 2019. Association for Computing Machinery. ISBN 9781450361729. doi: 10.1145/ \n546 3331184.3331316. URL https://doi.org/10.1145/3331184.3331316. \n547 [36] Sean MacAvaney, Franco Maria Nardini, Raffaele Perego, Nicola Tonellotto, Nazli Goharian, \n548 and Ophir Frieder. Efficient Document Re-Ranking for Transformers by Precomputing Term \n549 Representations, page 49–58. Association for Computing Machinery, New York, NY, USA, \n550 2020. ISBN 9781450380164. \n551 [37] Aditya Menon, Sadeep Jayasumana, Ankit Singh Rawat, Seungyeon Kim, Sashank Reddi, \n552 and Sanjiv Kumar. In defense of dual-encoders for neural ranking. In Kamalika Chaudhuri, \n553 Stefanie Jegelka, Le Song, Csaba Szepesvari, Gang Niu, and Sivan Sabato, editors, Proceedings \n554 of the 39th International Conference on Machine Learning, volume 162 of Proceedings of \n555 Machine Learning Research, pages 15376–15400. PMLR, 17–23 Jul 2022. URL https: \n556 //proceedings.mlr.press/v162/menon22a.html. ",
1108
+ "bbox": [
1109
+ 147,
1110
+ 92,
1111
+ 828,
1112
+ 133
1113
+ ],
1114
+ "page_idx": 10
1115
+ },
1116
+ {
1117
+ "type": "text",
1118
+ "text": "",
1119
+ "bbox": [
1120
+ 151,
1121
+ 107,
1122
+ 828,
1123
+ 917
1124
+ ],
1125
+ "page_idx": 10
1126
+ },
1127
+ {
1128
+ "type": "text",
1129
+ "text": "",
1130
+ "bbox": [
1131
+ 140,
1132
+ 92,
1133
+ 828,
1134
+ 922
1135
+ ],
1136
+ "page_idx": 11
1137
+ },
1138
+ {
1139
+ "type": "text",
1140
+ "text": "[38] Bhaskar Mitra and Nick Craswell. An introduction to neural information retrieval. Foundations and Trends® in Information Retrieval, 13(1):1–126, 2018. ISSN 1554-0669. doi: 10.1561/ 1500000061. URL http://dx.doi.org/10.1561/1500000061. 560 [39] Arvind Neelakantan, Tao Xu, Raul Puri, Alec Radford, Jesse Michael Han, Jerry Tworek, Qiming Yuan, Nikolas Tezak, Jong Wook Kim, Chris Hallacy, et al. Text and code embeddings by contrastive pre-training. arXiv preprint arXiv:2201.10005, 2022. [40] Tri Nguyen, Mir Rosenberg, Xia Song, Jianfeng Gao, Saurabh Tiwary, Rangan Majumder, and Li Deng. MS MARCO: A human generated machine reading comprehension dataset. In Tarek Richard Besold, Antoine Bordes, Artur S. d’Avila Garcez, and Greg Wayne, editors, Proceedings of the Workshop on Cognitive Computation: Integrating neural and symbolic approaches 2016, volume 1773 of CEUR Workshop Proceedings. CEUR-WS.org, 2016. [41] Jianmo Ni, Chen Qu, Jing Lu, Zhuyun Dai, Gustavo Hernandez Abrego, Ji Ma, Vincent Zhao, Yi Luan, Keith Hall, Ming-Wei Chang, and Yinfei Yang. Large dual encoders are generalizable retrievers. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pages 9844–9855, Abu Dhabi, United Arab Emirates, December 2022. Association for Computational Linguistics. URL https://aclanthology.org/2022.emnlp-main.669. [42] Ping Nie, Yuyu Zhang, Xiubo Geng, Arun Ramamurthy, Le Song, and Daxin Jiang. DC-BERT: decoupling question and document for efficient contextual encoding. In Jimmy Huang, Yi Chang, Xueqi Cheng, Jaap Kamps, Vanessa Murdock, Ji-Rong Wen, and Yiqun Liu, editors, Proceedings of the 43rd International ACM SIGIR conference on research and development in Information Retrieval, SIGIR 2020, Virtual Event, China, July 25-30, 2020, pages 1829–1832. ACM, 2020. doi: 10.1145/3397271.3401271. URL https://doi.org/10.1145/3397271.3401271. [43] Rodrigo Nogueira and Kyunghyun Cho. Passage re-ranking with BERT. CoRR, abs/1901.04085, 2019. URL http://arxiv.org/abs/1901.04085. [44] Rodrigo Nogueira, Jimmy Lin, and AI Epistemic. From doc2query to doctttttquery. Online preprint, 6, 2019. [45] Rodrigo Nogueira, Wei Yang, Jimmy Lin, and Kyunghyun Cho. Document expansion by query prediction. arXiv preprint arXiv:1904.08375, 2019. [46] Rodrigo Nogueira, Zhiying Jiang, Ronak Pradeep, and Jimmy Lin. Document ranking with a pretrained sequence-to-sequence model. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 708–718, Online, November 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.findings-emnlp.63. URL https: //aclanthology.org/2020.findings-emnlp.63. [47] Barlas Oguz, Kushal Lakhotia, Anchit Gupta, Patrick Lewis, Vladimir Karpukhin, Aleksandra ˘ Piktus, Xilun Chen, Sebastian Riedel, Wen-tau Yih, Sonal Gupta, et al. Domain-matched pre-training tasks for dense retrieval. arXiv preprint arXiv:2107.13602, 2021. [48] Yingqi Qu, Yuchen Ding, Jing Liu, Kai Liu, Ruiyang Ren, Wayne Xin Zhao, Daxiang Dong, Hua Wu, and Haifeng Wang. RocketQA: An optimized training approach to dense passage retrieval for open-domain question answering. In Kristina Toutanova, Anna Rumshisky, Luke Zettlemoyer, Dilek Hakkani-Tür, Iz Beltagy, Steven Bethard, Ryan Cotterell, Tanmoy Chakraborty, and Yichao Zhou, editors, Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL-HLT 2021, Online, June 6-11, 2021, pages 5835–5847. Association for Computational Linguistics, 2021. [49] Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J. Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. Journal of Machine Learning Research, 21(140):1–67, 2020. URL http://jmlr.org/papers/v21/20-074.html. [50] Nils Reimers, Iryna Gurevych, and Iryna Gurevych. Sentence-BERT: Sentence embeddings using siamese bert-networks. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing. Association for Computational Linguistics, 11 2019. URL http://arxiv.org/abs/1908.10084. ",
1141
+ "bbox": [
1142
+ 151,
1143
+ 80,
1144
+ 828,
1145
+ 919
1146
+ ],
1147
+ "page_idx": 12
1148
+ },
1149
+ {
1150
+ "type": "text",
1151
+ "text": "[51] Ruiyang Ren, Yingqi Qu, Jing Liu, Wayne Xin Zhao, Qiaoqiao She, Hua Wu, Haifeng Wang, and Ji-Rong Wen. Rocketqav2: A joint training method for dense passage retrieval and passage re-ranking. In Proceedings of EMNLP, 2021. \n[52] Adriana Romero, Nicolas Ballas, Samira Ebrahimi Kahou, Antoine Chassang, Carlo Gatta, and Yoshua Bengio. Fitnets: Hints for thin deep nets. arXiv preprint arXiv:1412.6550, 2014. \n[53] Devendra Sachan, Mostofa Patwary, Mohammad Shoeybi, Neel Kant, Wei Ping, William L. Hamilton, and Bryan Catanzaro. End-to-end training of neural retrievers for open-domain question answering. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 6648–6662, Online, August 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.acl-long.519. URL https: //aclanthology.org/2021.acl-long.519. \n[54] Devendra Singh Sachan, Mike Lewis, Mandar Joshi, Armen Aghajanyan, Wen-tau Yih, Joelle Pineau, and Luke Zettlemoyer. Improving passage retrieval with zero-shot question generation. arXiv preprint arXiv:2204.07496, 2022. \n[55] Victor Sanh, Lysandre Debut, Julien Chaumond, and Thomas Wolf. Distilbert, a distilled version of bert: smaller, faster, cheaper and lighter. arXiv preprint arXiv:1910.01108, 2019. \n[56] Keshav Santhanam, Omar Khattab, Jon Saad-Falcon, Christopher Potts, and Matei Zaharia. Colbertv2: Effective and efficient retrieval via lightweight late interaction. CoRR, abs/2112.01488, 2021. \n[57] Nandan Thakur, Nils Reimers, Andreas Rücklé, Abhishek Srivastava, and Iryna Gurevych. BEIR: A heterogeneous benchmark for zero-shot evaluation of information retrieval models. In Thirty-fifth Conference on Neural Information Processing Systems Datasets and Benchmarks Track (Round 2), 2021. URL https://openreview.net/forum?id=wCu6T5xFjeJ. \n[58] Iulia Turc, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Well-read students learn better: On the importance of pre-training compact models. arXiv preprint arXiv:1908.08962, 2019. \n[59] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Proceedings of the 31st International Conference on Neural Information Processing Systems, NIPS’17, page 6000–6010, Red Hook, NY, USA, 2017. Curran Associates Inc. ISBN 9781510860964. \n[60] Lee Xiong, Chenyan Xiong, Ye Li, Kwok-Fung Tang, Jialin Liu, Paul N. Bennett, Junaid Ahmed, and Arnold Overwijk. Approximate nearest neighbor negative contrastive learning for dense text retrieval. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id $=$ zeFrfgyZln. \n[61] Nishant Yadav, Nicholas Monath, Rico Angell, Manzil Zaheer, and Andrew McCallum. Efficient nearest neighbor search for cross-encoder models using matrix factorization. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pages 2171–2194, Abu Dhabi, United Arab Emirates, December 2022. Association for Computational Linguistics. URL https://aclanthology.org/2022.emnlp-main.140. \n[62] Zeynep Akkalyoncu Yilmaz, Wei Yang, Haotian Zhang, and Jimmy Lin. Cross-domain modeling of sentence-level evidence for document retrieval. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 3490–3496, Hong Kong, China, November 2019. Association for Computational Linguistics. \n[63] Hang Zhang, Yeyun Gong, Yelong Shen, Jiancheng Lv, Nan Duan, and Weizhu Chen. Adversarial retriever-ranker for dense text retrieval. In International Conference on Learning Representations, 2022. URL https://openreview.net/forum?id=MR7XubKUFB. \n[64] Linfeng Zhang and Kaisheng Ma. Improve object detection with feature-based knowledge distillation: Towards accurate and efficient detectors. In International Conference on Learning Representations, 2020. ",
1152
+ "bbox": [
1153
+ 153,
1154
+ 71,
1155
+ 826,
1156
+ 911
1157
+ ],
1158
+ "page_idx": 13
1159
+ },
1160
+ {
1161
+ "type": "text",
1162
+ "text": "660 [65] Shuai Zhang, Lina Yao, Aixin Sun, and Yi Tay. Deep learning based recommender system: \n661 A survey and new perspectives. ACM Comput. Surv., 52(1), feb 2019. ISSN 0360-0300. doi: \n662 10.1145/3285029. URL https://doi.org/10.1145/3285029. \n663 [66] Chen Zhao, Chenyan Xiong, Jordan Boyd-Graber, and Hal Daumé III. Distantly-supervised \n664 dense retrieval enables open-domain question answering without evidence annotation. In \n665 Proceedings of the 2021 Conference on Empirical Methods in Natural Language Process \n666 ing, pages 9612–9622, Online and Punta Cana, Dominican Republic, November 2021. As \n667 sociation for Computational Linguistics. doi: 10.18653/v1/2021.emnlp-main.756. URL \n668 https://aclanthology.org/2021.emnlp-main.756. \n669 [67] Zhi Zheng, Kai Hui, Ben He, Xianpei Han, Le Sun, and Andrew Yates. BERT-QE: Con \n670 textualized Query Expansion for Document Re-ranking. In Findings of the Association for \n671 Computational Linguistics: EMNLP 2020, pages 4718–4728, Online, November 2020. As \n672 sociation for Computational Linguistics. doi: 10.18653/v1/2020.findings-emnlp.424. URL \n673 https://aclanthology.org/2020.findings-emnlp.424. ",
1163
+ "bbox": [
1164
+ 130,
1165
+ 90,
1166
+ 828,
1167
+ 305
1168
+ ],
1169
+ "page_idx": 14
1170
+ }
1171
+ ]
parse/dev/BT03V9Re9a/BT03V9Re9a_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/BT03V9Re9a/BT03V9Re9a_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/D78Go4hVcxO/D78Go4hVcxO.md ADDED
@@ -0,0 +1,500 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # HOW DO VISION TRANSFORMERS WORK?
2
+
3
+ Namuk Park1,2, Songkuk $\mathbf { K i m ^ { 1 } }$ 1Yonsei University, 2NAVER AI Lab {namuk.park,songkuk}@yonsei.ac.kr
4
+
5
+ # ABSTRACT
6
+
7
+ The success of multi-head self-attentions (MSAs) for computer vision is now indisputable. However, little is known about how MSAs work. We present fundamental explanations to help better understand the nature of MSAs. In particular, we demonstrate the following properties of MSAs and Vision Transformers (ViTs): $\bullet$ MSAs improve not only accuracy but also generalization by flattening the loss landscapes. Such improvement is primarily attributable to their data specificity, not long-range dependency. On the other hand, ViTs suffer from non-convex losses. Large datasets and loss landscape smoothing methods alleviate this problem; $\textcircled { 2 }$ MSAs and Convs exhibit opposite behaviors. For example, MSAs are low-pass filters, but Convs are high-pass filters. Therefore, MSAs and Convs are complementary; $\bullet$ Multi-stage neural networks behave like a series connection of small individual models. In addition, MSAs at the end of a stage play a key role in prediction. Based on these insights, we propose AlterNet, a model in which Conv blocks at the end of a stage are replaced with MSA blocks. AlterNet outperforms CNNs not only in large data regimes but also in small data regimes.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ There is limited understanding of multi-head self-attentions (MSAs), although they are now ubiquitous in computer vision. The most widely accepted explanation for the success of MSAs is their weak inductive bias and capture of long-range dependencies (See, e.g., (Dosovitskiy et al., 2021; Naseer et al., 2021; Tuli et al., 2021; Yu et al., 2021a; Mao et al., 2021; Chu et al., 2021)). Yet because of their over-flexibility, Vision Transformers (ViTs)—neural networks (NNs) consisting of MSAs—have been known to have a tendency to overfit training datasets, consequently leading to poor predictive performance in small data regimes, e.g., image classification on CIFAR. However, we show that the explanation is poorly supported.
12
+
13
+ # 1.1 RELATED WORK
14
+
15
+ Self-attentions (Vaswani et al., 2017; Dosovitskiy et al., 2021) aggregate (spatial) tokens with normalized importances:
16
+
17
+ $$
18
+ z _ { j } = \sum _ { i } \mathrm { S o f t m a x } \left( \frac { Q K } { \sqrt { d } } \right) _ { i } V _ { i , j }
19
+ $$
20
+
21
+ where $Q , \kappa$ , and $V$ are query, key, and value, respectively. $d$ is the dimension of query and key, and $z _ { j }$ is the $j$ -th output token. From the perspective of convolutional neural networks (CNNs), MSAs are a transformation of all feature map points with large-sized and data-specific kernels. Therefore, MSAs are at least as expressive as convolutional layers (Convs) (Cordonnier et al., 2020), although this does not guarantee that MSAs will behave like Convs.
22
+
23
+ Is the weak inductive bias of MSA, such as modeling long-range dependencies, beneficial for the predictive performance? To the contrary, appropriate constraints may actually help a model learn strong representations. For example, local MSAs (Yang et al., 2019; Liu et al., 2021; Chu et al., 2021), which calculate self-attention only within small windows, achieve better performance than global MSAs not only on small datasets but also on large datasets, e.g., ImageNet-21K.
24
+
25
+ In addition, prior works observed that MSAs have the following intriguing properties: $\textcircled{1}$ MSAs improve the predictive performance of CNNs (Wang et al., 2018; Bello et al., 2019; Dai et al., 2021;
26
+
27
+ ![](images/6a7c10af21e7c231eebbb672587b5f2cdf840caba9cb495300f1e6ea9f2f1e2b.jpg)
28
+ Figure 1: Two different aspects consistently show that MSAs flatten loss landscapes. Left: Loss landscape visualizations show that ViT has a flatter loss $\small \mathrm { ( N L L + } \ell _ { 2 }$ regularization) than ResNet. Right: Hessian max eigenvalue spectra show that the magnitude of the Hessian eigenvalues of ViT is smaller than that of ResNet during training phases. We report the Hessian spectra at the end of the warmup phases, $1 0 0 ^ { \mathrm { t h } }$ , $2 0 0 ^ { \mathrm { t h } }$ , and $\mathrm { \bar { 3 0 0 } ^ { t h } }$ epochs. See Fig. 4 for a more detailed analysis.
29
+
30
+ Guo et al., 2021; Srinivas et al., 2021), and ViTs predict well-calibrated uncertainty (Minderer et al., 2021). $\textcircled{2}$ ViTs are robust against data corruptions, image occlusions (Naseer et al., 2021), and adversarial attacks (Shao et al., 2021; Bhojanapalli et al., 2021; Paul & Chen, 2022; Mao et al., 2021). They are particularly robust against high-frequency noises (Shao et al., 2021). $\textcircled{3}$ MSAs closer to the last layer significantly improve predictive performance (Graham et al., 2021; Dai et al., 2021).
31
+
32
+ These empirical observations raise immediate questions: $\bullet$ What properties of MSAs do we need to better optimize NNs? Do the long-range dependencies of MSAs help NNs learn? $\textcircled { \times }$ Do MSAs act like Convs? If not, how are they different? $\bullet$ How can we harmonize MSAs with Convs? Can we just leverage their advantages?
33
+
34
+ We provide an explanation of how MSAs work by addressing them as a trainable spatial smoothing of feature maps, because Eq. (1) also suggests that MSAs average feature map values with the positive importance-weights. Even non-trainable spatial smoothings, such as a small $2 \times 2$ box blur, help CNNs see better (Zhang, 2019; Park & Kim, 2021). These simple spatial smoothings not only improve accuracy but also robustness by spatially ensembling feature map points and flattening the loss landscapes (Park & Kim, 2021). Remarkably, spatial smoothings have the properties of MSAs $\textcircled{1} - \textcircled { 3 }$ . See Appendix B for detailed explanations of MSAs as a spatial smoothing.
35
+
36
+ # 1.2 CONTRIBUTION
37
+
38
+ We address the three key questions:
39
+
40
+ $\bullet$ What properties of MSAs do we need to improve optimization? We present various evidences to support that MSA is generalized spatial smoothing. It means that MSAs improve performance because their formulation—Eq. (1)—is an appropriate inductive bias. Their weak inductive bias disrupts NN training. In particular, a key feature of MSAs is their data specificity, not long-range dependency. As an extreme example, local MSAs with a $3 \times 3$ receptive field outperforms global MSA because they reduce unnecessary degrees of freedom.
41
+
42
+ How do MSAs improve performance? MSAs have their advantages and disadvantages. On the one hand, they flatten loss landscapes as shown in Fig. 1. The flatter the loss landscape, the better the performance and generalization (Li et al., 2018; Keskar et al., 2017; Santurkar et al., 2018; Foret et al., 2021; Chen et al., 2022). Thus, they improve not only accuracy but also robustness in large data regimes. On the other hand, MSAs allow negative Hessian eigenvalues in small data regimes. This means that the loss landscapes of MSAs are non-convex, and this non-convexity disturbs NN optimization (Dauphin et al., 2014). Large amounts of training data suppress negative eigenvalues and convexify losses.
43
+
44
+ ![](images/56be45fa0b2c8123606967a9d277b23dce2565d4cbe503f52a54d75f1147b242.jpg)
45
+ Figure 2: The Fourier analysis shows that MSAs do not act like Convs. Left: Relative log amplitudes of Fourier transformed feature map show that ViT tends to reduce high-frequency signals, while ResNet amplifies them. $\Delta$ Log amplitude is the difference between the log amplitude at normalized frequency $0 . 0 \pi$ (center) and at $1 . 0 \pi$ (boundary). See Fig. 8 for more detailed analysis. Right: We measure the decrease in accuracy against frequency-based random noise. ResNet is vulnerable to high-frequency noise, while ViT is robust against them. We use frequency window size of $0 . 1 \pi$ .
46
+
47
+ $\textcircled { 2 }$ Do MSAs act like Convs? We show that MSAs and Convs exhibit opposite behaviors. MSAs aggregate feature maps, but Convs diversify them. Moreover, as shown in Fig. 2a, the Fourier analysis of feature maps shows that MSAs reduce high-frequency signals, while Convs, conversely, amplifies high-frequency components. In other words, MSAs are low-pass filters, but Convs are high-pass filters. In addition, Fig. 2b indicates that Convs are vulnerable to high-frequency noise but that MSAs are not. Therefore, MSAs and Convs are complementary.
48
+
49
+ $\bullet$ How can we harmonize MSAs with Convs? We reveal that multi-stage NNs behave like a series connection of small individual models. Thus, applying spatial smoothing at the end of a stage improves accuracy by ensembling transformed feature map outputs from each stage (Park & Kim, 2021) as shown in Fig. 3a. Based on this finding, we propose an alternating pattern of Convs and MSAs. NN stages using this design pattern consists of a number of CNN blocks and one (or a few) MSA block as shown in Fig. 3c. The design pattern naturally derives the structure of canonical Transformer, which has one MSA block per MLP block as shown in Fig. 3b. It also provides an explanation of how adding Convs to Transformer’s MLP block improves accuracy and robustness (Yuan et al., 2021; Guo et al., 2021; Mao et al., 2021).
50
+
51
+ Surprisingly, models using this alternating pattern of Convs and MSAs outperform CNNs not only on large datasets but also on small datasets, such as CIFAR. This contrasts with canonical ViTs, models that perform poorly on small amount of data. It implies that MSAs are generalized spatial smoothings that complement Convs, not simply generalized Convs.
52
+
53
+ # 2 WHAT PROPERTIES OF MSAS DO WE NEED TO IMPROVE OPTIMIZATION?
54
+
55
+ To understand the underlying nature of MSAs, we investigate the properties of the ViT family: e.g., vanilla ViT (Dosovitskiy et al., 2021); PiT (Heo et al., 2021), which is “ViT $^ +$ multi-stage”; and Swin (Liu et al., 2021), which is $\mathrm { ^ { 6 6 } V i T + }$ multi-stage $^ +$ local MSA”. This section shows that these additional inductive biases enable ViTs to learn strong representations. We also use ResNet (He et al., 2016a) for comparison. NNs are trained from scratch with DeiT-style data augmentation (Touvron et al., 2021) for 300 epochs. The NN training begins with a gradual warmup (Goyal et al., 2017) for 5 epochs. Appendix A provides more detailed configurations and background information for experiments.
56
+
57
+ ![](images/f354d752997e0b3a823268a60ba0d34d9e7b1b88bfc59ffb63ac41d39cb70ed6.jpg)
58
+ Figure 3: Comparison of three different repeating patterns. Left: Spatial smoothings are located at the end of CNN stages. Middle: The stages of ViTs consist of repetitions of canonical Transformers. “D” is the hidden dimension and “H” is the number of heads. Right: The stages using alternating pattern consists of a number of CNN blocks and an MSA block. For more details, see Fig. 11.
59
+
60
+ The stronger the inductive biases, the stronger the representations (not regularizations). Do models with weak inductive biases overfit training datasets? To address this question, we provide two criteria on CIFAR-100: the error of the test dataset and the cross-entropy, or the negative log-likelihood, of the training dataset $\mathrm { { N L L } _ { \mathrm { { t r a i n } } } }$ , the lower the better). See Fig. 5a for the results.
61
+
62
+ Contrary to our expectations, experimental results show that the stronger the inductive bias, the lower both the test error and the training NLL. This indicates that ViT does not overfit training datasets. In addition, appropriate inductive biases, such as locality constraints for MSAs, helps NNs learn strong representations. We also observe these phenomena on CIFAR-10 and ImageNet as shown in Fig. C.1. Figure C.2 also supports that weak inductive biases disrupt NN training. In this experiment, extremely small patch sizes for the embedding hurt the predictive performance of ViT.
63
+
64
+ ViT does not overfit small training datasets. We observe that ViT does not overfit even on smaller datasets. Figure 5b shows the test error and the training NLL of ViT on subsampled datasets. In this experiment, as the size of the dataset decreases, the error increases as expected, but surprisingly, ${ \mathrm { N L L } } _ { \mathrm { t r a i n } }$ also increases. Thanks to the strong data augmentation, ViT does not overfit even on a dataset size of $2 \%$ . This suggests that ViT’s poor performance in small data regimes is not due to overfitting.
65
+
66
+ ViT’s non-convex losses lead to poor performance. How do weak inductive biases of MSAs disturb the optimization? A loss landscape perspective provides an explanation: the loss function of ViT is non-convex, while that of ResNet is strongly (near-)convex. This poor loss disrupts NN training (Dauphin et al., 2014), especially in the early phase of training (Jastrzebski et al., 2020; 2021). Figure 1b and Fig. 4 provide top-5 largest Hessian eigenvalue densities (Park & Kim, 2021) with a batch size of 16. The figures show that ViT has a number of negative Hessian eigenvalues, while ResNet only has a few.
67
+
68
+ Figure 4 also shows that large datasets suppress negative Hessian eigenvalues in the early phase of training. Therefore, large datasets tend to help ViT learn strong representations by convexifying the loss. ResNet enjoys little benefit from large datasets because its loss is convex even on small datasets.
69
+
70
+ ![](images/f5c7623c42c203631b88cf135e8afe8e18fd25c1bb76f22d4285060f9e06082b.jpg)
71
+ Figure 4: Hessian max eigenvalue spectra show that MSAs have their advantages and disadvantages. The dotted line is the spectrum of ViT using $6 \%$ dataset for training. Left: ViT has a number of negative Hessian eigenvalues, while ResNet only has a few. Right: The magnitude of ViT’s positive Hessian eigenvalues is small. See also Fig. 1b for more results.
72
+
73
+ ![](images/3cf0bbee17a8e6f763c065b1e7c18c0c559f816350fac0474a8609263da0b6d3.jpg)
74
+ Figure 5: ViT does not overfit training datasets. “R” is ResNet and “RX” is ResNeXt. Left: Weak inductive bias disturbs NN optimization. The lower the ${ \mathrm { N L L } } _ { \mathrm { t r a i n } }$ , the lower the error. Right: The lack of dataset also disturbs NN optimization.
75
+
76
+ Loss landscape smoothing methods aids in ViT training. Loss landscape smoothing methods can also help ViT learn strong representations. In classification tasks, global average pooling (GAP) smoothens the loss landscape by strongly ensembling feature map points (Park & Kim, 2021). We demonstrate how the loss smoothing method can help ViT improve performance by analyzing ViT with GAP classifier instead of CLS token on CIFAR-100.
77
+
78
+ Figure 6 shows the Hessian max eigenvalue spectrum of the ViT with GAP. As expected, the result shows that GAP classifier suppresses negative Hessian max eigenvalues, suggesting that GAP convexify the loss. Since negative eigenvalues disturb NN optimization, GAP classifier improve the accuracy by $+ 2 . 7$ percent point.
79
+
80
+ ![](images/62d6a66720e1da1e9ff9efaea1d60a8097ddab84b7ab83a6f328988fe5395220.jpg)
81
+ Figure 6: GAP classifier suppresses negative Hessian max eigenvalues in an early phase of training. We present Hessian max eigenvalue spectrum of ViT with GAP classifier instead of CLS token.
82
+
83
+ Likewise, Sharpness-Aware Minimization (SAM) (Foret et al., 2021), an optimizer that relies on the local smoothness of the loss function, also helps NNs seek out smooth minima. Chen et al. (2022) showed that SAM improves the predictive performance of ViT.
84
+
85
+ MSAs flatten the loss landscape. Another property of MSAs is that they reduces the magnitude of Hessian eigenvalues. Figure 1b and Fig. 4 shows that the eigenvalues of ViT are significantly smaller than that of CNNs. While large eigenvalues impede NN training (Ghorbani et al., 2019), MSAs can help NNs learn better representations by suppressing large Hessian eigenvalues. Figure 1a also support this claim. In Fig. 1a, we visualize the loss landscapes by using filter normalization (Li et al., 2018), and the loss landscape of ViT is flatter than that of ResNet. In large data regimes, the negative Hessian eigenvalues—the disadvantage of MSAs—disappears, and only their advantages remain. As a result, ViTs outperform CNNs on large datasets, such as ImageNet and JFT (Sun et al., 2017). PiT and Swin also flatten the loss landscapes. For more details, see Fig. C.4.
86
+
87
+ A key feature of MSAs is data specificity (not long-range dependency). The two distinguishing features of MSAs are long-range dependency and data specificity, also known as data dependency, as discussed in Section 1.1. Contrary to popular belief, the long-range dependency hinders NN optimization. To demonstrate this, we analyze convolutional ViT, which consists of two-dimensional convolutional MSAs (Yang et al., 2019) instead of global MSAs. Convolutional MSAs calculates self-attention only between feature map points in convolutional receptive fields after unfolding the feature maps in the same way as convolutions.
88
+
89
+ Figure 7a shows the error and ${ \mathrm { N L L } } _ { \mathrm { t r a i n } }$ of convolutional ViTs with kernel sizes of $3 \times 3 , 5 \times 5$ , and $8 \times 8$ (global MSA) on CIFAR-100. In this experiment, $5 \times 5$ kernel outperforms $8 \times 8$ kernel on both the training and the test datasets. ${ \mathrm { N L L } } _ { \mathrm { t r a i n } }$ of $3 \times 3$ kernel is worse than that of $5 \times 5$ kernel, but better than that of global MSA. Although the test accuracies of $3 \times 3$ and $5 \times 5$ kernels are comparable, the robustness of $5 \times 5$ kernel is significantly better than that of $3 \times 3$ kernel on CIFAR-100-C (Hendrycks & Dietterich, 2019).
90
+
91
+ ![](images/096854e93c3a0383c758e59378a6d8bfb67c71ab19dd2703eb7d8607eac0118f.jpg)
92
+ Figure 7: Locality constraint improves the performance of ViT. We analyze the ViT with convolutional MSAs. Convolutional MSA with $8 \times 8$ kernel is global MSA. Left: Local MSAs learn stronger representations than global MSA. Right: Locality inductive bias suppresses the negative Hessian eigenvalues, i.e., local MSAs have convex losses.
93
+
94
+ Figure 7b shows that the strong locality inductive bias not only reduce computational complexity as originally proposed (Liu et al., 2021), but also aid in optimization by convexifying the loss landscape. $5 \times 5$ kernel has fewer negative eigenvalues than global MSA because it restricts unnecessary degrees of freedom. $5 \times 5$ kernel also has fewer negative eigenvalues than $3 \times 3$ kernel because it ensembles a larger number of feature map points (See also Fig. 6). The amount of negative eigenvalues is minimized when these two effects are balanced.
95
+
96
+ It is clear that data specificity improves NNs. MLP-Mixer (Tolstikhin et al., 2021; Yu et al., 2021a), a model with an MLP kernel that does not depend on input data, underperforms compared to ViTs. Data specificity without self-attention (Bello, 2021) improves performance.
97
+
98
+ # 3 DO MSAS ACT LIKE CONVS?
99
+
100
+ Convs are data-agnostic and channel-specific. In contrast, MSAs are data-specific and channelagnostic. This section shows that these differences lead to large behavioral differences. It suggests that MSAs and Convs are complementary.
101
+
102
+ MSAs are low-pass filters, but Convs are highpass filters. As explained in Section 1.1, MSAs spatially smoothen feature maps with self-attention importances. Therefore, we expect that MSAs will tend to reduce high-frequency signals. See Appendix B for a more detailed discussion.
103
+
104
+ Figure 8 shows the relative log amplitude ( $\Delta$ log amplitude) of ViT’s Fourier transformed feature map at high-frequency $( 1 . 0 \pi )$ on ImageNet. In this figure, MSAs almost always decrease the high-frequency amplitude, and MLPs—corresponding to Convs— increase it. The only exception is in the early stages of the model. In these stages, MSAs behave like Convs, i.e., they increase the amplitude. This could serve as an evidence for a hybrid model that uses Convs in early stages and MSAs in late stages (Guo et al.,
105
+
106
+ ![](images/e36f09317cd9d1ea2b15310639f19e81ecb5ff8798236e2c950aa8351070791c.jpg)
107
+ Figure 8: MSAs (gray area) generally reduce the high-frequency component of feature map, and MLPs (white area) amplify it. This figure provides $\Delta$ log amplitude of ViT at high-frequency $( 1 . 0 \pi )$ . See also Fig. 2a and Fig. D.2 for more results.
108
+
109
+ 2021; Graham et al., 2021; Dai et al., 2021; Xiao et al., 2021; Srinivas et al., 2021).
110
+
111
+ Based on this, we can infer that low-frequency signals and high-frequency signals are informative to MSAs and Convs, respectively. In support of this argument, we report the robustness of ViT and ResNet against frequency-based random noise. Following Shao et al. (2021) and Park & Kim (2021), we measure the decrease in accuracy with respect to data with frequency-based random noise $\pmb { x } _ { \mathrm { n o i s e } } = \pmb { x } _ { 0 } + \mathcal { F } ^ { - 1 } \left( \mathcal { F } ( \delta ) \odot \mathbf { M } _ { f } \right)$ , where $\scriptstyle { \mathbf { { \mathit { x } } } } _ { 0 }$ is clean data, $\mathcal F ( \cdot )$ and $\mathcal { F } ^ { - 1 } ( \cdot )$ are Fourier transform and inverse Fourier transform, $\delta$ is Gaussian random noise, and ${ \mathbf { M } } _ { f }$ is frequency mask.
112
+
113
+ ![](images/812c340b7ae5d97b9e448ca1a7f009138c4c488370ada7b05e733593356431d4.jpg)
114
+ Figure 9: MSAs (gray area) reduce the variance of feature map points, but Convs (white area) increase the variance. The blue area is subsampling layer. This result implies that MSAs ensemble feature maps, but Convs do not.
115
+
116
+ As expected, the result in Fig. 2b reveals that ViT and ResNet are vulnerable to low-frequency noise and high-frequency noise, respectively. Low-frequency signals and the high-frequency signals each correspond to the shape and the texture of images. The results thus suggests that MSAs are shape-biased (Naseer et al., 2021), whereas Convs are texture-biased (Geirhos et al., 2019).
117
+
118
+ MSAs aggregate feature maps, but Convs do not. Since MSAs average feature maps, they will reduce variance of feature map points. This suggests that MSAs ensemble feature maps (Park & Kim, 2021). To demonstrate this claim, we measure the variance of feature maps from NN layers.
119
+
120
+ Figure 9 shows the experimental results of ResNet and ViT. This figure indicates that MSAs in ViT tend to reduce the variance; conversely, Convs in ResNet and MLPs in ViT increase it. In conclusion, MSAs ensemble feature map predictions, but Convs do not. As Park & Kim (2021) figured out, reducing the feature map uncertainty helps optimization by ensembling and stabilizing the transformed feature maps. See Fig. D.1 for more results on PiT and Swin.
121
+
122
+ We observe two additional patterns for feature map variance. First, the variance accumulates in every NN layer and tends to increase as the depth increases. Second, the feature map variance in ResNet peaks at the ends of each stage. Therefore, we can improve the predictive performance of ResNet by inserting MSAs at the end of each stage. Furthermore, we also can improve the performance by using MSAs with a large number of heads in late stages.
123
+
124
+ # 4 HOW CAN WE HARMONIZE MSAS WITH CONVS?
125
+
126
+ Since MSAs and Convs are complementary, this section seeks to design a model that leverages only the advantages of the two modules. To this end, we propose the design rules described in Fig. 3c, and demonstrate that the models using these rules outperforms CNNs, not only in the large data regimes but also in the small data regimes, such as CIFAR.
127
+
128
+ # 4.1 DESIGNING ARCHITECTURE
129
+
130
+ We first investigate the properties of multi-stage NN architectures. Based on this investigation, we come to propose an alternating pattern, i.e., a principle for stacking MSAs based on CNNs.
131
+
132
+ Multi-stage NNs behave like individual models. In Fig. 9, we observe that the pattern of feature map variance repeats itself at every stages. This behavior is also observed in feature map similarities and lesion studies.
133
+
134
+ Figure 10a shows the representational similarities of ResNet and Swin on CIFAR-100. In this experiment, we use mini-batch CKA (Nguyen et al., 2021) to measure the similarities. As Nguyen et al. (2021) figured out, the feature map similarities of CNNs have a block structure. Likewise, we observe that the feature map similarities of multi-stage ViTs, such as PiT and Swin, also have a block structure. Since vanilla ViT does not have this structure (Bhojanapalli et al., 2021; Raghu et al., 2021), the structure is an intrinsic characteristic of multi-stage architectures. See Fig. D.3 for more detailed results of ViT and PiT.
135
+
136
+ ![](images/5a440b8ae8d7079711f524fabf134967e530cc92d740404ea342d513a5a596e9.jpg)
137
+ Figure 10: Multi-stage CNNs and ViTs behave like a series connection of small individual models. Left: The feature map similarities show the block structure of ResNet and Swin. “E” stands for stem/embedding and “P” for pooling (subsampling) layer. Right: We measure decrease in accuracy after removing one unit from the trained model. Accuracy changes periodically, and this period is one stage. White, gray, and blue areas are Conv/MLP, MSA, and subsampling layers, respectively.
138
+
139
+ Figure 10b shows the results of lesion study (Bhojanapalli et al., 2021), where one NN unit is removed from already trained ResNet and Swin during the testing phase. In this experiment, we remove one $3 \times 3$ Conv layer from the bottleneck block of ResNet, and one MSA or MLP block from Swin. In ResNet, removing an early stage layers hurts accuracy more than removing a late stage layers. More importantly, removing a layer at the beginning of a stage impairs accuracy more than removing a layer at the end of a stage. The case of Swin is even more interesting. At the beginning of a stage, removing an MLP hurts accuracy. At the end of a stage, removing an MSA seriously impairs the accuracy. These results are consistent with Fig. 8. See Fig. D.4 for the results on ViT and PiT.
140
+
141
+ Based on these findings, we expect MSAs closer to the end of a stage to significantly improve the predictive performance. This is contrary to the popular belief that MSAs closer to the end of a model improve the performance (Srinivas et al., 2021; d’Ascoli et al., 2021; Graham et al., 2021; Dai et al., 2021).
142
+
143
+ Build-up rule. Considering all the insights, we propose the following design rules:
144
+
145
+ • Alternately replace Conv blocks with MSA blocks from the end of a baseline CNN model. • If the added MSA block does not improve predictive performance, replace a Conv block located at the end of an earlier stage with an MSA block . • Use more heads and higher hidden dimensions for MSA blocks in late stages.
146
+
147
+ We call the model that follows these rules AlterNet. AlterNet unifies ViTs and CNNs by adjusting the ratio of MSAs and Convs as shown in Fig. 3. Figure 11 shows AlterNet based on pre-activation ResNet-50 (He et al., 2016b) for CIFAR-100 as an example. Figure D.5 shows AlterNet for ImageNet.
148
+
149
+ Figure 12a reports the accuracy of Alter-ResNet-50, which replaces the Conv blocks in ResNet-50 with local MSAs (Liu et al., 2021) according to the aforementioned rules, on CIFAR-100. As expected, MSAs in the last stage (c4) significantly improve the accuracy. Surprisingly, an MSA in $2 ^ { \mathrm { n d } }$ stage (c2) improves the accuracy, while two or more MSAs in the $3 ^ { \mathrm { { \bar { r } d } } }$ stage (c3) reduce it. In conclusion, MSAs at the end of a stage play an important role in prediction.
150
+
151
+ Figure 12c demonstrates that MSAs suppress large eigenvalues while allowing only a few negative eigenvalues. As explained in Fig. 4, large datasets compensate for the shortcomings of MSAs. Therefore, more data allows more MSAs for a models.
152
+
153
+ ![](images/5d48db79864fdce5cd0499625b113c68ec1837fec3709a6c4bad43fdd6ec7006.jpg)
154
+ Figure 11: Detailed architecture of Alter-ResNet-50 for CIFAR-100. White, gray, and blue blocks mean Conv, MSA, and subsampling blocks. All stages (except stage 1) end with MSA blocks. This model is based on pre-activation ResNet-50. Following Swin, MSAs in stages 1 to 4 have 3, 6, 12, and 24 heads, respectively.
155
+
156
+ ![](images/8be26613a4590464286b5014a9586f6e03a11bce7cf972ed2fe2dede4a707464.jpg)
157
+ (a) Accuracy of AlterNet for MSA (b) Accuracy and robustness in a (c) Hessian max eigenvalue spectra number small data regime (CIFAR-100) in an early phase of training
158
+ Figure 12: AlterNet outperforms CNNs and ViTs. Left: MSAs in the late of the stages improve accuracy. We replace Convs of ResNet with MSAs one by one according to the build-up rules. c1 to ${ \tt c 4 }$ stands for the stages. Several MSAs in c3 harm the accuracy, but the MSA at the end of c2 improves it. Center: AlterNet outperforms CNNs even in a small data regime. Robustness is mean accuracy on CIFAR-100-C. “RX” is ResNeXt. Right: MSAs in AlterNet suppress the large eigenvalues; i.e., AlterNet has a flatter loss landscape than ResNet in the early phase of training.
159
+
160
+ # 4.2 PERFORMANCE
161
+
162
+ Figure 12b shows the accuracy and corruption robustness of Alter-ResNet-50 and other baselines on CIFAR-100 and CIFAR-100-C. Since CIFAR is a small dataset, CNNs outperforms canonical ViTs. Surprisingly, Alter-ResNet—a model with MSAs following the appropriate build-up rule— outperforms CNNs even in the small data regimes. This suggests that MSAs complement Convs. In the same manner, this simple modification shows competitive performance on larger datasets, such as ImageNet. See Fig. E.1 for more details.
163
+
164
+ # 5 DISCUSSION
165
+
166
+ Our present work demonstrates that MSAs are not merely generalized Convs, but rather generalized spatial smoothings that complement Convs. MSAs help NNs learn strong representations by ensembling feature map points and flattening the loss landscape.
167
+
168
+ Since the main objective of this work is to investigate the nature of MSA for computer vision, we preserve the architectures of Conv and MSA blocks in AlterNet. Thus, AlterNet has a strong potential for future improvements. In addition, AlterNet can conveniently replace the backbone for other vision tasks such as dense prediction (Carion et al., 2020). As Park & Kim (2021) pointed out, global average pooling (GAP) for simple classification tasks has a strong tendency to ensemble feature maps, but NNs for dense prediction do not use GAP. Therefore, we believe that MSA to be able to significantly improve the results in dense prediction tasks by ensembling feature maps. Lastly, strong data augmentation for MSA training harms uncertainty calibration as shown in Fig. F.1a. We leave a detailed investigation for future work.
169
+
170
+ # ACKNOWLEDGEMENT
171
+
172
+ We thank the reviewers, Taeoh Kim, and Pilhyeon Lee for valuable feedback. This work was supported by the Samsung Science and Technology Foundation under Project Number SSTF-BA1501-52.
173
+
174
+ # REPRODUCIBILITY STATEMENT
175
+
176
+ To ensure reproducibility, we provide comprehensive resources, such as code and experimental details. The code is available at https://github.com/xxxnell/how-do-vits-work. Appendix A.1 provides the specifications of all models used in this work. Detailed experimental setup including hyperparameters and the structure of AlterNet are also available in Appendix A.1 and Appendix E. De-facto image datasets are used for all experiments as described in Appendix A.1.
177
+
178
+ # REFERENCES
179
+
180
+ Irwan Bello. Lambdanetworks: Modeling long-range interactions without attention. In International Conference on Learning Representations, 2021.
181
+
182
+ Irwan Bello, Barret Zoph, Ashish Vaswani, Jonathon Shlens, and Quoc V Le. Attention augmented convolutional networks. In International Conference on Computer Vision, 2019.
183
+
184
+ Irwan Bello, William Fedus, Xianzhi Du, Ekin Dogus Cubuk, Aravind Srinivas, Tsung-Yi Lin, Jonathon Shlens, and Barret Zoph. Revisiting resnets: Improved training and scaling strategies. In Advances in Neural Information Processing Systems, 2021.
185
+
186
+ Srinadh Bhojanapalli, Ayan Chakrabarti, Daniel Glasner, Daliang Li, Thomas Unterthiner, and Andreas Veit. Understanding robustness of transformers for image classification. In International Conference on Computer Vision, 2021.
187
+
188
+ Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. In European Conference on Computer Vision, 2020.
189
+
190
+ Xiangning Chen, Cho-Jui Hsieh, and Boqing Gong. When vision transformers outperform resnets without pretraining or strong data augmentations. In International Conference on Learning Representations, 2022.
191
+
192
+ Xiangxiang Chu, Zhi Tian, Yuqing Wang, Bo Zhang, Haibing Ren, Xiaolin Wei, Huaxia Xia, and Chunhua Shen. Twins: Revisiting the design of spatial attention in vision transformers. In Advances in Neural Information Processing Systems, 2021.
193
+
194
+ Jean-Baptiste Cordonnier, Andreas Loukas, and Martin Jaggi. On the relationship between selfattention and convolutional layers. In International Conference on Learning Representations, 2020.
195
+
196
+ Ekin D Cubuk, Barret Zoph, Jonathon Shlens, and Quoc V Le. Randaugment: Practical automated data augmentation with a reduced search space. In Advances in Neural Information Processing Systems, 2020.
197
+
198
+ Zihang Dai, Hanxiao Liu, Quoc V Le, and Mingxing Tan. Coatnet: Marrying convolution and attention for all data sizes. In Advances in Neural Information Processing Systems, 2021.
199
+
200
+ Stéphane d’Ascoli, Hugo Touvron, Matthew Leavitt, Ari Morcos, Giulio Biroli, and Levent Sagun. Convit: Improving vision transformers with soft convolutional inductive biases. In International Conference on Machine Learning, 2021.
201
+
202
+ Yann N Dauphin, Razvan Pascanu, Caglar Gulcehre, Kyunghyun Cho, Surya Ganguli, and Yoshua Bengio. Identifying and attacking the saddle point problem in high-dimensional non-convex optimization. In Advances in Neural Information Processing Systems, 2014.
203
+
204
+ Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. In International Conference on Learning Representations, 2021.
205
+
206
+ Pierre Foret, Ariel Kleiner, Hossein Mobahi, and Behnam Neyshabur. Sharpness-aware minimization for efficiently improving generalization. In International Conference on Learning Representations, 2021.
207
+
208
+ Robert Geirhos, Patricia Rubisch, Claudio Michaelis, Matthias Bethge, Felix A Wichmann, and Wieland Brendel. Imagenet-trained cnns are biased towards texture; increasing shape bias improves accuracy and robustness. In International Conference on Learning Representations, 2019.
209
+
210
+ Behrooz Ghorbani, Shankar Krishnan, and Ying Xiao. An investigation into neural net optimization via hessian eigenvalue density. In International Conference on Machine Learning, 2019.
211
+
212
+ Priya Goyal, Piotr Dollár, Ross Girshick, Pieter Noordhuis, Lukasz Wesolowski, Aapo Kyrola, Andrew Tulloch, Yangqing Jia, and Kaiming He. Accurate, large minibatch sgd: Training imagenet in 1 hour. arXiv preprint arXiv:1706.02677, 2017.
213
+
214
+ Ben Graham, Alaaeldin El-Nouby, Hugo Touvron, Pierre Stock, Armand Joulin, Hervé Jégou, and Matthijs Douze. Levit: a vision transformer in convnet’s clothing for faster inference. In International Conference on Computer Vision, 2021.
215
+
216
+ Jianyuan Guo, Kai Han, Han Wu, Chang Xu, Yehui Tang, Chunjing Xu, and Yunhe Wang. Cmt: Convolutional neural networks meet vision transformers. arXiv preprint arXiv:2107.06263, 2021.
217
+
218
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2016a.
219
+
220
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. In European Conference on Computer Vision, 2016b.
221
+
222
+ Dan Hendrycks and Thomas Dietterich. Benchmarking neural network robustness to common corruptions and perturbations. In International Conference on Learning Representations, 2019.
223
+
224
+ Byeongho Heo, Sangdoo Yun, Dongyoon Han, Sanghyuk Chun, Junsuk Choe, and Seong Joon Oh. Rethinking spatial dimensions of vision transformers. In International Conference on Computer Vision, 2021.
225
+
226
+ Jiri Hron, Yasaman Bahri, Jascha Sohl-Dickstein, and Roman Novak. Infinite attention: Nngp and ntk for deep attention networks. In International Conference on Machine Learning, 2020.
227
+
228
+ Gao Huang, Yu Sun, Zhuang Liu, Daniel Sedra, and Kilian Q Weinberger. Deep networks with stochastic depth. In European Conference on Computer Vision, 2016.
229
+
230
+ Arthur Jacot, Franck Gabriel, and Clément Hongler. Neural tangent kernel: Convergence and generalization in neural networks. In Advances in Neural Information Processing Systems, 2018.
231
+
232
+ Stanislaw Jastrzebski, Maciej Szymczak, Stanislav Fort, Devansh Arpit, Jacek Tabor, Kyunghyun Cho, and Krzysztof Geras. The break-even point on optimization trajectories of deep neural networks. In International Conference on Learning Representations, 2020.
233
+
234
+ Stanislaw Jastrzebski, Devansh Arpit, Oliver Astrand, Giancarlo B Kerg, Huan Wang, Caiming Xiong, Richard Socher, Kyunghyun Cho, and Krzysztof J Geras. Catastrophic fisher explosion: Early phase fisher matrix impacts generalization. In International Conference on Machine Learning, 2021.
235
+
236
+ Nitish Shirish Keskar, Dheevatsa Mudigere, Jorge Nocedal, Mikhail Smelyanskiy, and Ping Tak Peter Tang. On large-batch training for deep learning: Generalization gap and sharp minima. In International Conference on Learning Representations, 2017.
237
+
238
+ Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009.
239
+
240
+ Hao Li, Zheng Xu, Gavin Taylor, Christoph Studer, and Tom Goldstein. Visualizing the loss landscape of neural nets. In Advances in Neural Information Processing Systems, 2018.
241
+
242
+ Chaoyue Liu, Libin Zhu, and Mikhail Belkin. On the linearity of large non-linear models: when and why the tangent kernel is constant. In Advances in Neural Information Processing Systems, 2020.
243
+
244
+ Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, and Baining Guo. Swin transformer: Hierarchical vision transformer using shifted windows. In International Conference on Computer Vision, 2021.
245
+
246
+ Ilya Loshchilov and Frank Hutter. Sgdr: Stochastic gradient descent with warm restarts. In International Conference on Learning Representations, 2017.
247
+
248
+ Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. In International Conference on Learning Representations, 2019.
249
+
250
+ Xiaofeng Mao, Gege Qi, Yuefeng Chen, Xiaodan Li, Ranjie Duan, Shaokai Ye, Yuan He, and Hui Xue. Towards robust vision transformer. arXiv preprint arXiv:2105.07926, 2021.
251
+
252
+ Paul Michel, Omer Levy, and Graham Neubig. Are sixteen heads really better than one? In Advances in Neural Information Processing Systems, 2019.
253
+
254
+ Matthias Minderer, Josip Djolonga, Rob Romijnders, Frances Hubis, Xiaohua Zhai, Neil Houlsby, Dustin Tran, and Mario Lucic. Revisiting the calibration of modern neural networks. In Advances in Neural Information Processing Systems, 2021.
255
+
256
+ Muzammal Naseer, Kanchana Ranasinghe, Salman Khan, Munawar Hayat, Fahad Shahbaz Khan, and Ming-Hsuan Yang. Intriguing properties of vision transformers. In Advances in Neural Information Processing Systems, 2021.
257
+
258
+ Thao Nguyen, Maithra Raghu, and Simon Kornblith. Do wide and deep networks learn the same things? uncovering how neural network representations vary with width and depth. In International Conference on Learning Representations, 2021.
259
+
260
+ Namuk Park and Songkuk Kim. Blurs behave like ensembles: Spatial smoothings to improve accuracy, uncertainty, and robustness. arXiv preprint arXiv:2105.12639, 2021.
261
+
262
+ Namuk Park, Taekyu Lee, and Songkuk Kim. Vector quantized bayesian neural network inference for data streams. In Proceedings of the AAAI Conference on Artificial Intelligence, 2021.
263
+
264
+ Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. Pytorch: An imperative style, high-performance deep learning library. In Advances in Neural Information Processing Systems, 2019.
265
+
266
+ Sayak Paul and Pin-Yu Chen. Vision transformers are robust learners. In Proceedings of the AAAI Conference on Artificial Intelligence, 2022.
267
+
268
+ Maithra Raghu, Thomas Unterthiner, Simon Kornblith, Chiyuan Zhang, and Alexey Dosovitskiy. Do vision transformers see like convolutional neural networks? In Advances in Neural Information Processing Systems, 2021.
269
+
270
+ Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, Alexander C. Berg, and Li Fei-Fei. ImageNet Large Scale Visual Recognition Challenge. International Journal of Computer Vision (IJCV), 2015.
271
+
272
+ Shibani Santurkar, Dimitris Tsipras, Andrew Ilyas, and Aleksander M ˛adry. How does batch normalization help optimization? In Advances in Neural Information Processing Systems, 2018.
273
+
274
+ Rulin Shao, Zhouxing Shi, Jinfeng Yi, Pin-Yu Chen, and Cho-Jui Hsieh. On the adversarial robustness of visual transformers. arXiv preprint arXiv:2103.15670, 2021.
275
+
276
+ Aravind Srinivas, Tsung-Yi Lin, Niki Parmar, Jonathon Shlens, Pieter Abbeel, and Ashish Vaswani. Bottleneck transformers for visual recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2021.
277
+
278
+ Andreas Steiner, Alexander Kolesnikov, Xiaohua Zhai, Ross Wightman, Jakob Uszkoreit, and Lucas Beyer. How to train your vit? data, augmentation, and regularization in vision transformers. arXiv preprint arXiv:2106.10270, 2021.
279
+
280
+ Chen Sun, Abhinav Shrivastava, Saurabh Singh, and Abhinav Gupta. Revisiting unreasonable effectiveness of data in deep learning era. In International Conference on Computer Vision, 2017.
281
+
282
+ Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2016.
283
+
284
+ Ilya Tolstikhin, Neil Houlsby, Alexander Kolesnikov, Lucas Beyer, Xiaohua Zhai, Thomas Unterthiner, Jessica Yung, Daniel Keysers, Jakob Uszkoreit, Mario Lucic, et al. Mlp-mixer: An all-mlp architecture for vision. In Advances in Neural Information Processing Systems, 2021.
285
+
286
+ Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, and Hervé Jégou. Training data-efficient image transformers & distillation through attention. In International Conference on Machine Learning, 2021.
287
+
288
+ Shikhar Tuli, Ishita Dasgupta, Erin Grant, and Thomas L Griffiths. Are convolutional neural networks or transformers more like human vision? In Proceedings of the Annual Meeting of the Cognitive Science Society, 2021.
289
+
290
+ Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in neural information processing systems, 2017.
291
+
292
+ Peihao Wang, Wenqing Zheng, Tianlong Chen, and Zhangyang Wang. Scaling the depth of vision transformers via the fourier domain analysis. In International Conference on Learning Representations, 2022.
293
+
294
+ Phil Wang. Implementation of vision transformer. https://github.com/lucidrains/ vit-pytorch, 2021.
295
+
296
+ Xiaolong Wang, Ross Girshick, Abhinav Gupta, and Kaiming He. Non-local neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2018.
297
+
298
+ Yeming Wen, Ghassen Jerfel, Rafael Muller, Michael W Dusenberry, Jasper Snoek, Balaji Lakshminarayanan, and Dustin Tran. Combining ensembles and data augmentation can harm your calibration. In International Conference on Learning Representations, 2021.
299
+
300
+ Ross Wightman. Pytorch image models. https://github.com/rwightman/ pytorch-image-models, 2019.
301
+
302
+ Tete Xiao, Mannat Singh, Eric Mintun, Trevor Darrell, Piotr Dollár, and Ross Girshick. Early convolutions help transformers see better. In Advances in Neural Information Processing Systems, 2021.
303
+
304
+ Saining Xie, Ross Girshick, Piotr Dollár, Zhuowen Tu, and Kaiming He. Aggregated residual transformations for deep neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2017.
305
+
306
+ Weijian Xu, Yifan Xu, Tyler Chang, and Zhuowen Tu. Co-scale conv-attentional image transformers. In International Conference on Computer Vision, 2021.
307
+
308
+ Baosong Yang, Longyue Wang, Derek F Wong, Lidia S Chao, and Zhaopeng Tu. Convolutional self-attention networks. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), 2019.
309
+
310
+ Zhewei Yao, Amir Gholami, Kurt Keutzer, and Michael W Mahoney. Pyhessian: Neural networks through the lens of the hessian. In 2020 IEEE International Conference on Big Data (Big Data), 2020.
311
+
312
+ Dong Yin, Raphael Gontijo Lopes, Jon Shlens, Ekin Dogus Cubuk, and Justin Gilmer. A fourier perspective on model robustness in computer vision. In Advances in Neural Information Processing Systems, 2019.
313
+
314
+ Tan Yu, Xu Li, Yunfeng Cai, Mingming Sun, and Ping Li. Rethinking token-mixing mlp for mlp-based vision backbone. In BMVC, 2021a.
315
+
316
+ Weihao Yu, Mi Luo, Pan Zhou, Chenyang Si, Yichen Zhou, Xinchao Wang, Jiashi Feng, and Shuicheng Yan. Metaformer is actually what you need for vision. arXiv preprint arXiv:2111.11418, 2021b.
317
+
318
+ Kun Yuan, Shaopeng Guo, Ziwei Liu, Aojun Zhou, Fengwei Yu, and Wei Wu. Incorporating convolution designs into visual transformers. In International Conference on Computer Vision, 2021.
319
+
320
+ Sangdoo Yun, Dongyoon Han, Seong Joon Oh, Sanghyuk Chun, Junsuk Choe, and Youngjoon Yoo. Cutmix: Regularization strategy to train strong classifiers with localizable features. In International Conference on Computer Vision, 2019.
321
+
322
+ Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. In International Conference on Learning Representations, 2018.
323
+
324
+ Richard Zhang. Making convolutional networks shift-invariant again. In International Conference on Machine Learning, 2019.
325
+
326
+ Zhun Zhong, Liang Zheng, Guoliang Kang, Shaozi Li, and Yi Yang. Random erasing data augmentation. In Proceedings of the AAAI Conference on Artificial Intelligence, 2020.
327
+
328
+ # A EXPERIMENTAL DETAILS
329
+
330
+ This section provides experimental details, e.g., setups and background information.
331
+
332
+ # A.1 SETUPS
333
+
334
+ We obtain the main experimental results from two sets of machines for CIFAR (Krizhevsky et al., 2009). The first set consists of an Intel Xeon W-2123 Processor, 32GB memory, and a single GeForce RTX 2080 Ti, and the other set of four Intel Intel Broadwell CPUs, 15GB memory, and a single NVIDIA T4. For ImageNet (Russakovsky et al., 2015), we use AMD Ryzen Threadripper 3960X 24-Core Processor, 256GB memory, and four GeForce RTX 2080 Ti. NN models are implemented in PyTorch (Paszke et al., 2019).
335
+
336
+ We train NNs using categorical cross-entropy (NLL) loss and AdamW optimizer (Loshchilov & Hutter, 2019) with initial learning rate of $\mathrm { { 1 . 2 5 \times 1 0 ^ { - 4 } } }$ and weight decay of $5 \times 1 0 ^ { - 2 }$ . We also use cosine annealing scheduler (Loshchilov & Hutter, 2017). NNs are trained for 300 epochs with a batch size of 96 on CIFAR, and a batch size of 128 on ImageNet. The learning rate is gradually increased (Goyal et al., 2017) for 5 epochs. Following Touvron et al. (2021), strong data augmentations—such as RandAugment (Cubuk et al., 2020), Random Erasing (Zhong et al., 2020), label smoothing (Szegedy et al., 2016), mixup (Zhang et al., 2018), and CutMix (Yun et al., 2019)—are used for training. Stochastic depth (Huang et al., 2016) is also used to regularize NNs. This DeiT-style configuration, which significantly improves the performance (Steiner et al., 2021; Bello et al., 2021), is the de facto standard in ViT training (See, e.g., (Heo et al., 2021; Liu et al., 2021)). Therefore, we believe the insights presented in this paper can be used widely. See source code (https://github.com/xxxnell/how-do-vits-work) for detailed configurations.
337
+
338
+ We mainly report the performances of ResNet-50, ViT-Ti, PiT-Ti, and Swin-Ti. Their training throughputs on CIFAR-100 are 320, 434, 364, and 469 image/sec, respectively, which are comparable to each other. Figures 5a and C.1a report the predictive performance of ResNeXt-50 (Xie et al., 2017), Twins-S (Chu et al., 2021), and MLP-Mixer-Ti (Tolstikhin et al., 2021). Figure E.1 additionally reports the performance of ConViT-Ti (d’Ascoli et al., 2021), LeViT-128S (Graham et al., 2021), and CoaT-Lite-Ti (Xu et al., 2021). We use a patch size of $2 \times 2$ for ViT and PiT on CIFAR; for Swin, a patch size of $1 \times 1$ and a window size of $4 \times 4$ . We use a patch size of $4 \times 4$ for ViT only in Fig. 7. We halve the depth of the ViT in Fig. C.5 and Fig. C.6 due to the memory limitation.
339
+
340
+ All models for CIFAR, and ResNet, ViT, and AlterNet for ImageNet are trained from scratch. We use pertained PiT and Swin from Wightman (2019) for ImageNet. The implementations of Vision Transformers are based on Wightman (2019) and Wang (2021).
341
+
342
+ For Hessian max eigenvalue spectrum (Park & Kim, 2021), $10 \%$ of the training dataset is used. We also use power iteration with a batch size of 16 to produce the top-5 largest eigenvalues. To this end, we use the implementation of Yao et al. (2020). We modify the algorithm to calculate the eigenvalues with respect to $\ell _ { 2 }$ regularized NLL on augmented training datasets. In the strict sense, the weight decay is not $\ell _ { 2 }$ regularization, but we neglect the difference.
343
+
344
+ For the Fourier analysis and the feature map variance experiment, the entire test dataset is used. We report the amplitudes and the variances averaged over the channels.
345
+
346
+ # A.2 BACKGROUND INFORMATION
347
+
348
+ Below are the preliminaries and terms of our experiments.
349
+
350
+ Test error and training NLL. We report test errors on clean test datasets and training NLLs on augmented training datasets in experiments, e.g., Fig. 5 and Fig. C.1. NLL is an appropriate metric for evaluating convergence on a training dataset because an NN optimizes NLL. In addition, it is the most widely used as a proper scoring rule indicating both accuracy and uncertainty. To represent predictive performance on a test dataset, we use a well-known metric: error. Although NLL can also serve the same purpose, results are consistent even when NLL is employed.
351
+
352
+ If an additional inductive bias or a learning technique improves the performance of an NN, this is either a method to help the NNs learn “strong representations”, or a method to “regularize” it.
353
+
354
+ An improved—i.e., lower—training NLL suggests that this bias or technique helps the NN learn strong representations. Conversely, a compromised training NLL indicates that the bias or technique regularizes the NN. Likewise, we say that “an NN overfits a training dataset” when a test error is compromised as the training NLL is improved.
355
+
356
+ Hessian max eigenvalue spectrum. Park & Kim (2021) proposed “Hessian max eigenvalue spectra”, a feasible method for visualizing Hessian eigenvalues of large-sized NNs for real-world problems. It calculates and gathers top- $k$ Hessian eigenvalues by using power iteration mini-batch wisely. Ghorbani et al. (2019) visualized the Hessian eigenvalue spectrum by using the Lanczos quadrature algorithm for full batch. However, this is not feasible for practical NNs because the algorithm requires a lot of memory and computing resources.
357
+
358
+ A good loss landscape is a flat and convex loss landscape. Hessian eigenvalues indicate the flatness and convexity of losses. The magnitude of Hessian eigenvalues shows sharpness, and the presence of negative Hessian eigenvalues shows non-convexity. Based on these insights, we introduce a negative max eigenvalue proportion (NEP, the lower the better) and an average of positive max eigenvalues (APE, the lower the better) to quantitatively measure the non-convexity and the sharpness, respectively. For a Hessian max eigenvalue spectrum $p ( \lambda )$ , NEP is the proportion of negative eigenvalues $\int _ { - \infty } ^ { 0 } p ( \lambda ) d \lambda$ , and APE is the expected value of positive eigenvalues $\textstyle { \int _ { 0 } ^ { \infty } \lambda p ( \lambda ) d \lambda } / { \int _ { 0 } ^ { \infty } p ( \lambda ) d \lambda }$ We use these metrics in Fig. C.5 and Fig. C.6.
359
+
360
+ Note that measuring loss landscapes and Hessian eigenvalues without considering a regularization on clean datasets would lead to incorrect results, since NN training optimizes $\ell _ { 2 }$ regularized NLL on augmented training datasets—not NLL on clean training datasets. We visualize loss landscapes and Hessian eigenvalues with respect to ${ } ^ { } \ell _ { 2 }$ regularized NLL loss” on “augmented training datasets”.
361
+
362
+ Fourier analysis of feature maps. We analyze feature maps in Fourier space to demonstrate that MSA is a low-pass filter as shown in Fig. 2, Fig. 8, and Fig. D.2. Fourier transform converts feature maps into frequency domain. We represent these converted feature maps on normalized frequency domain, so that the highest frequency components are at $f = \{ - \pi , + \pi \}$ , and the lowest frequency components are at $f = 0$ . We mainly report the amplitude ratio of high-frequency components and low-frequency components by using $\Delta$ log amplitude, the difference in log amplitude at $f = \pi$ and $f = 0$ . Yin et al. (2019) also analyzed the robustness of NNs from a Fourier perspective, but their research focused on input images—not feature maps—in Fourier spaces.
363
+
364
+ # B MSAS BEHAVE LIKE SPATIAL SMOOTHINGS
365
+
366
+ As mentioned in Section 1.1, spatial smoothings before subsampling layers help CNNs see better (Zhang, 2019; Park & Kim, 2021). Park & Kim (2021) showed that such improvement in performance is possible due to spatial ensembles of feature map points. To this end, they used the (Bayesian) ensemble average of predictions for proximate data points (Park et al., 2021), which exploits data uncertainty (i.e., a distribution of feature maps) as well as model uncertainty (i.e., a posterior probability distribution of NN weights):
367
+
368
+ $$
369
+ p ( z _ { j } | \pmb { x } _ { j } , \pmb { \mathcal { D } } ) \simeq \sum _ { i } \pi ( \pmb { x } _ { i } | \pmb { x } _ { j } ) p ( z _ { j } | \pmb { x } _ { i } , \pmb { w } _ { i } )
370
+ $$
371
+
372
+ where $\pi ( \pmb { x } _ { i } | \pmb { x } _ { j } )$ is the normalized importance weight of a feature map point $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ with respect to another feature map point $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { j } }$ , i.e., $\begin{array} { r } { \sum _ { i } \pi ( \pmb { x } _ { i } | \pmb { x } _ { j } ) = 1 } \end{array}$ . This importance is defined as the similarity between $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ and $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { j } }$ . $p ( \boldsymbol { z } _ { j } | \mathbf { x } _ { i } , \mathrm { \bar { { \boldsymbol { w } } } } _ { i } )$ and $p ( \boldsymbol { z } _ { j } | \mathbf { x } _ { j } , \mathcal { D } )$ stand for NN prediction and output predictive distribution, respectively. ${ \pmb w } _ { i }$ is the NN weight sample from the posterior $p ( \pmb { w } | \mathcal { D } )$ with respect to the training dataset $\mathcal { D }$ . Put shortly, Eq. (2) spatially complements a prediction with other predictions based on similarities between data points. For instance, a $2 \times 2$ box blur spatially ensembles four neighboring feature map points, each with $\%$ of the same importance.
373
+
374
+ We note that the formulations for self-attention and the ensemble averaging for proximate data points are identical. The Softmax term and $V$ in Eq. (1) exactly correspond to $\pi ( \pmb { x } _ { i } | \pmb { x } _ { j } )$ and $p ( \boldsymbol { z } _ { j } | \boldsymbol { x } _ { i } , \boldsymbol { w } _ { i } )$ in Eq. (2). The weight samples in Eq. (2) is correspond to the multi-heads of MSAs (See also (Hron et al., 2020)).
375
+
376
+ ![](images/93ffbf606beb389d8c7f5ff9f1eef2b93432ca79a752c145f31a0cab4d591e3d.jpg)
377
+ Figure C.1: The lower the training NLL, the lower the test error. “R” is ResNet and “RX” is ResNeXt. Left: In small data regimes, such as CIFAR-10 and CIFAR-100 (Fig. 5a), the cons of MSAs outweigh their pros; i.e., the non-convex losses disturb ViT optimization. Right: Large datasets convexify the loss functions. Therefore, the pros of MSAs outweigh their cons in large data regimes; i.e., MSAs help NNs learn strong representations by flattening the loss landscapes.
378
+
379
+ Likewise, the properties of spatial smoothing are the same as those of MSAs (Park & Kim, 2021): $\textcircled{1}$ Spatial smoothing improves the accuracy of CNNs. In addition, spatial smoothing predicts well-calibrated uncertainty. $\textcircled{2}$ Spatial smoothing is robust against MC dropout (which is equivalent to image occlusion), data corruption, and adversarial attacks, and particularly robust against highfrequency noise. $\textcircled{3}$ Spatial smoothing layers closer to the output layer significantly improves the predictive performance. In addition, concurrent works suggest that MSA blocks behave like a spatial smoothing. Wang et al. (2022) provided a proof that Softmax-normalized matrix is a low-pass filter, although this does not guarantee that MSA blocks will behave like low-pass filters. Yu et al. (2021b) demonstrated that the MSA layers of ViT can be replaced with average pooling layers.
380
+
381
+ Taking all these observations together, we provide an explanation of how MSAs work by addressing themselves as a general form of spatial smoothing or an implementation of ensemble averaging for proximate data points. Spatial smoothing improves performance in the following ways (Park & Kim, 2021): $\bullet$ Spatial smoothing helps in NN optimization by flattening the loss landscapes. Even a small $2 \times 2$ box blur filter significantly improves performance. $\textcircled { \times }$ Spatial smoothing is a low-pass filter. CNNs are vulnerable to high-frequency noises, but spatial smoothing improves the robustness against such noises by significantly reducing these noises. $\bullet$ Spatial smoothing is effective when applied at the end of a stage because it aggregates all transformed feature maps. This paper empirically shows that these mechanisms also apply to MSAs.
382
+
383
+ # C VITS FROM A LOSS LANDSCAPE PERSPECTIVE
384
+
385
+ This section provides further explanations of the analysis in Section 2.
386
+
387
+ The lower the NLL on the training dataset, the lower the error on the test dataset. Figure 5a demonstrates that low training NLLs result in low test errors on CIFAR-100. The same pattern can be observed on CIFAR-10 and ImageNet as shown in Fig. C.1.
388
+
389
+ In small data regimes, such as CIFAR-10 (Fig. C.1a) and CIFAR-100 (Fig. 5a), both the error and the ${ \mathrm { N L L } } _ { \mathrm { t r a i n } }$ of ViTs are inferior to those of CNNs. This suggests that the cons of MSAs outweigh their pros. As discussed in Fig. 4, ViTs suffers from the non-convex losses, and these non-convex losses disturb ViT optimization.
390
+
391
+ In large data regimes, such as ImageNet (Fig. C.1b), both the error and the ${ \mathrm { N L L } } _ { \mathrm { t r a i n } }$ of ViTs with local MSAs are superior to those of CNNs. Since large datasets convexify the loss functions as discussed in Fig. 4, the pros of MSAs outweigh their cons. Therefore, MSAs help NNs learn strong representations by flattening the loss landscapes.
392
+
393
+ Rigorous discussion on the regularization of CNN’s inductive bias. In Fig. 5a, we compare models of similar sizes, such as ResNet-50 and ViT-Ti. Through such comparison, we show that a weak inductive bias hinders NN training, and that inductive biases of CNNs—inductive bias of Convs and multi-stage architecture—help NNs learn strong representations. However, inductive biases of
394
+
395
+ ![](images/87ccf81fc7a522e4e2bd543ce48ae17a4f60e1b6551be8d5c8175b7b22c9f576.jpg)
396
+ Figure C.2: A small patch size does not guarantee better performance. We analyze ViTs with three embedded patch sizes: $2 \times 2$ , $4 \times 4$ , and $8 \times 8$ . Note that every MSA has a global receptive fields. Left: As expected, a large patch size harms the performance, but surprisingly, the same is observed from a small patch size. Right: A small patch size, or a weak inductive bias, produces negative eigenvalues. This is another evidence that a weak inductive bias hinders NN optimization. On the other hand, MSAs with a small patch size reduce the magnitude of eigenvalues because they ensemble a large number of feature map points. Performance is optimized when these two effects are balanced.
397
+
398
+ CNNs produce better test accuracy for the same training NLL, i.e., Convs somewhat regularize NNs. We analyze two comparable models in terms of ${ \mathrm { N L L } } _ { \mathrm { t r a i n } }$ on CIFAR-100. The ${ \mathrm { N L L } } _ { \mathrm { t r a i n } }$ of ResNet-18, a model smaller than ResNet-50, is 2.31 with an error of $2 2 . 0 \%$ . The ${ \mathrm { N L L } } _ { \mathrm { t r a i n } }$ of ViT-S, a model larger than ViT-Ti, is 2.17 with an error of $3 0 . 4 \%$ . In summary, the inductive biases of CNNs improve accuracy for similar training NLLs.
399
+
400
+ Most of the improvements come from the multi-stage architecture, not the inductive bias of Convs. The ${ \mathrm { N L L } } _ { \mathrm { t r a i n } }$ of the PiT-Ti, a multi-stage ViT-Ti, is 2.29 with an error of $2 4 . 1 \ \%$ . The accuracy of PiT is only 1.9 percent point lower than that of ResNet. In addition, the small receptive field also regularizes ViT. See Fig. 7.
401
+
402
+ ViT does not overfit a small training dataset even with a large number of epochs. Figure 5b shows that ViT does not overfit small training datasets, such as CIFAR. The same phenomenon can be observed in ViT training with a large number of epochs.
403
+
404
+ In Fig. C.3, we train ViT and ResNet for 75, 150, 300, 600, and 1200 epochs. Results show that both ${ \mathrm { N L L } } _ { \mathrm { t r a i n } }$ and error decrease as the number of epochs increases. The predictive performances of ViT are inferior to those of ResNet across all ranges of epochs.
405
+
406
+ A smaller patch size does not always imply better results. ViT splits image into multiple patches. The smaller the patch size, the greater the flexibility of expression and the weaker the inductive bias. By analyzing ViT with three patch sizes— $\cdot 2 \times 2$ , $4 \times 4$ , and $8 \times 8$ —we demonstrate once again that a weak inductive bias disturbs NN optimization.
407
+
408
+ ![](images/6cb7a1e5bc44a8945f1b63f798ffe3a294f5316dff8acee2593b8b3feacc70f3.jpg)
409
+ Figure C.3: A large number of epochs does not make ViT overfit the training dataset of CIFAR. Solid line is the predictive performance of ViT and dashed line is that of ResNet.
410
+
411
+ Figure C.2a shows the error on the test dataset and the NLL on the training dataset of CIFAR-100. As expected, a large patch size harms the performance on both datasets. Surprisingly, however, a small patch size also shows the same result. As such, appropriate patch sizes help ViT learn strong representations and do not regularize ViT.
412
+
413
+ The Hessian max eigenvalue spectra in Fig. C.2b explain this observation. Results reveal that a small patch size reduces the magnitude of Hessian eigenvalues but produces negative Hessian eigenvalues. In other words, the weak inductive bias makes loss landscapes flat yet non-convex. A large patch size suppresses negative eigenvalues. On the other hand, it not only limits the model expression but also sharpens loss landscapes. Performance is optimized when these two effects are balanced.
414
+
415
+ ![](images/82ffb7b1ecd72e21a3f1e178a4968a6210c2836b7728f64a9b02aab194a12e58.jpg)
416
+ (b) Negative and positive Hessian max eigenvalue spectra in early phase (left) and late phase (right) of training
417
+ Figure C.4: A multi-stage architecture (in PiT) and a local MSA (in Swin) also flatten the loss landscapes. Top: PiT has a flatter loss landscape than ViT near the optimum. Swin has an almost perfectly smooth parabolic loss landscape, which leads to better NN optimization. Bottom: A multistage architecture in PiT suppresses negative Hessian eigenvalues. A local MSA in Swin produces negative eigenvalues, but significantly reduces the magnitude of eigenvalues.
418
+
419
+ A multi-stage architecture in PiT and a local MSA in Swin also flatten loss landscapes. As explained in Fig. 1, an MSA smoothens loss landscapes. Similarly, a multi-stage architecture in PiT and local MSA in Swin also help NN learn strong representations by smoothing the loss landscapes.
420
+
421
+ Figure C.4 provides loss landscape visualizations and Hessian eigenvalue spectra of ResNet, ViT, PiT, and Swin. Figure C.4a visualizes the global geometry of the loss functions. The loss landscapes of PiT is flatter than that of ViT near the optimum. Since Swin has more parameters than ViT and PiT, $\ell _ { 2 }$ regularization determines the loss landscapes. All the loss surfaces of ViTs are smoother than that of ResNet. Figure C.4b shows the local geometry of the loss functions by using Hessian eigenvalues. In the early phase of training, a multi-stage architecture in PiT helps training by suppressing negative Hessian eigenvalues. A local MSA in Swin produces negative eigenvalues, but significantly reduces the magnitude of eigenvalues. Moreover, the magnitude of Swin’s Hessian eigenvalue does not significantly increases in the late phase of learning.
422
+
423
+ A lack of heads may lead to non-convex losses. Neural tangent kernel (NTK) (Jacot et al., 2018) theoretically implies that the loss landscape of a ViT is convex and flat when the number of heads or the number of embedding dimensions per head goes to infinity (Hron et al., 2020; Liu et al., 2020). In particular, Liu et al. (2020) suggests that $| | \bar { H } | | \simeq \mathcal { O } ( ^ { 1 / \sqrt { m } } )$ where $\left| \left| H \right| \right|$ is the Hessian spectral norm and $m$ is the number of heads or the number of embedding dimensions per head. Therefore, in practical situations, insufficient heads may cause non-convex and sharp losses.
424
+
425
+ Fig. C.5 empirically show that a lot of heads in MSA convexify and flatten the loss landscapes (cf. Michel et al. (2019)). In this experiment, we use NEP and APE to measure the non-convexity and the sharpness as introduced in Appendix A.2. Results show that both NEP and APE decrease as the number of heads increases. Likewise, Fig. C.6 shows that high embedding dimensions per head also convexify and flatten losses. The exponents of APE are $- 0 . 5 6 2$ for the number of heads and $- 0 . 7 9 6$ for the number of embedding dimensions, which are in close agreement with the value predicted by the theory of $- 1 / 2$ .
426
+
427
+ Large models have a flat loss in the early phase of training. Figure C.7 analyzes the loss landscapes of large models, such as ResNet-101 and ViT-S. As shown in Fig. C.7a, large models explore low NLLs. This can be a surprising because loss landscapes of large models are globally sharp as shown in Fig. C.7b.
428
+
429
+ ![](images/9732ac64f786ab7745d3818d082120d30095b8c5d27683e5738d941b50d92f1d.jpg)
430
+ Figure C.5: Multi-heads convexify and flatten loss landscapes. Left: We use negative max eigenvalue proportion (NEP) and average of positive max eigenvalues (APE) to quantify, respectively, the non-convexity and sharpness of loss landscapes. As the number of heads increases, loss landscapes become more convex and flatter. Right: Hessian max eigenvalue spectra also show that multi-head suppress negative eigenvalues and reduce the magnitude of eigenvalues.
431
+
432
+ ![](images/a3a69b33a3c9b21002fefa8d96a02ab12d13ff1ad829ad59ec902cb2f4185492.jpg)
433
+ Figure C.6: High embedding dimensions per head convexify and flatten the loss landscape. Left: As the number of embedding dimensions per head increases, loss landscapes become more convex and flat. Right: Hessian max eigenvalue spectra also show that high embedding dimensions suppress negative eigenvalues and reduce the magnitude of eigenvalues as shown in Fig. C.5.
434
+
435
+ The Hessian eigenvalue spectra in Fig. C.7c provide a solution to the problem: Hessian eigenvalues of large models are smaller than those of small models in the early phase of training. This indicates that large models have flat loss functions locally.
436
+
437
+ # D VITS FROM A FEATURE MAP PERSPECTIVE
438
+
439
+ This section provides further explanations of the analysis in Section 3 and Section 4.1.
440
+
441
+ MSAs in PiT and Swin also ensemble feature maps. In Fig. 9, we show that MSAs in ViT reduce feature map variances. The same pattern can be observed in PiT and Swin. Figure D.1 demonstrates that MSAs in PiT and Swin also reduce the feature map variances, suggesting that they also ensemble feature maps. One exception is the $3 ^ { \mathrm { r d } }$ stage of Swin. MSAs suppresses the increase in variance at the beginning of the stage, but not at the end of the stage.
442
+
443
+ MSAs in PiT and Swin are also low-pass filters. As discussed in Fig. 8, MSAs in ViTs are lowpass filters, while MLPs in ViT and Convs in ResNet are high-pass filters. Likewise, we demonstrate that MSAs in PiT and Swin are also low-pass filters.
444
+
445
+ ![](images/5902ccf65d72724f26ef90686c418acad3538f87a6e0b145c7ad9585ae5d6f37.jpg)
446
+ (c) Negative and positive Hessian max eigenvalue spectra in early phase (left) and late phase (right) of training
447
+ Figure C.7: Loss landscapes of large models. ResNet-50 and ResNet-101 are comparable to ViT-Ti and ViT-S, respectively. Top: Large models explore low NLLs. Middle: Loss landscape visualizations show that the global geometry of large models is sharp. Bottom: The Hessian eigenvalues of large models are smaller than those of small models. This suggests that large models have a flat local geometry in the early phase of training, and that this flat loss helps NNs learn strong representations. In the late phase of training, large ViTs have flat minima while large ResNet has a sharp minimum.
448
+
449
+ ![](images/d86c550ce0913f71d8a8154d05b9a07fd809bcf487023dee02ca30795ff9554a.jpg)
450
+ Figure D.1: MSAs in PiT and Swin also reduce feature map variance except in $3 ^ { \mathrm { r d } }$ stage of Swin. White, gray, and blue areas are Conv/MLP, MSA, and subsampling layers, respectively.
451
+
452
+ Figure D.2 shows the relative log amplitude of Fourier transformed feature maps. As in the case of ViT, MSAs in PiT and Swin generally decrease the amplitude of high-frequency signals; in contrast, MLPs increases the amplitude.
453
+
454
+ Multi-stage ViTs have a block structures. Feature map similarities of CNNs shows a block structure (Nguyen et al., 2021). As Raghu et al. (2021) pointed out, ViTs have a uniform representations across all layers. By investigating multi-stage ViTs, we demonstrate that subsampling layers create a characteristic block structure of the representation. See Fig. D.3.
455
+
456
+ Convs at the beginning of a stage and MSAs at the end of a stage play an important role. Figure D.4 shows the results of a lesion study for ResNet and ViTs. In this experiment, we remove one $3 \times 3$ Conv layer from the bottleneck block of a ResNet, and one MSA or MLP block from ViTs. Consistent results can be observed for all models: Removing Convs at the beginning of a stage and MSAs at the end of a stage significantly harm accuracy. As a result, the accuracy varies periodically.
457
+
458
+ # E EXTENDED INFORMATION OF ALTERNET
459
+
460
+ This section provides further informations on AlterNet.
461
+
462
+ Detailed architecture of AlterNet. Section 4 introduces AlterNet to harmonize Convs with MSAs. Since most MSAs take pre-activation arrangements, pre-activation ResNet is used as a baseline for consistency. We add one CNN block to the last stage of ResNet to make the number of blocks even. A local MSA with relative positional encoding from Swin is used for AlterNet. However, for simplicity of implementation, we do not implement detailed techniques, such as a cyclic shift and layer-specific initialization. For CIFAR, the patch size of the MSA is $1 \times 1$ and the window size is $4 \times 4$ . If all Conv blocks are alternately replaced with MSA, AlterNet becomes a Swin-like model.
463
+
464
+ In order to achieve better performance, NNs should strongly aggregate feature maps at the end of models as discussed in Section 3 and Section 4. To this end, AlterNet use 3, 6, 12, 24 heads for MSAs in each stage.
465
+
466
+ ![](images/64228730558ff934403c347829c23659307e449184eee46d3f4732e1fedd77b8.jpg)
467
+ Figure D.2: MSAs in PiT and Swin also reduce high-frequency signals. Left: $\Delta$ log amplitude of Fourier transformed feature map. We only provide the diagonal components. Right: The highfrequency $( 1 . 0 \pi ) \Delta$ log amplitude. White, gray, and blue areas are Conv/MLP, MSA, and subsampling layers, respectively.
468
+
469
+ ![](images/19c5b84e65812066b89f1e039ee1c68288ef975b1336b36db577be3a4b4dd919.jpg)
470
+ Figure D.3: Multi-stage ViTs have block structures in representational similarities. Block structures can be observed in all multi-stage NNs, namely, ResNet, PiT, and Swin. “E” is the stem/embedding and “P” is the pooling (subsampling) layer.
471
+
472
+ ![](images/9b725c23e2849279a552b75de075b4fb40c3a072f09bb055f3b8d90036309f2b.jpg)
473
+ Figure D.4: Lesion study shows that Convs at the beginning of a stage and MSAs at the end of a stage are important for prediction. We measure the decrease in accuracy after removing one unit from the trained model. In this experiment, we can observe that accuracy changes periodically. The white, gray, and blue areas are Convs/MLPs, MSAs, and subsampling layers, respectively.
474
+
475
+ ![](images/1ec915118c57a908eff1017a37f081e7827cbe58d3a358be887bf9741b9e38e9.jpg)
476
+ Figure D.5: Detailed architecture of Alter-ResNet-50 for ImageNet-1K. The white, gray, and blue blocks each represent Convs, MSAs, and subsampling blocks. This model alternately replaces Conv blocks with MSA blocks from the end of a stage. Following Swin, MSAs in stages 1 to 4 use 3, 6, 12, and 24 heads, respectively. We use 6 MSA blocks for ImageNet since large amounts of data alleviates the drawbacks of MSA. See Fig. 11 for comparison with the model for CIFAR-100, which uses 4 MSA blocks.
477
+
478
+ ![](images/ef46a16f7225e044360e6cbe12dfd0bd2fe992801d4553c1d8817ca6e27974e0.jpg)
479
+ Figure F.1: Distinctive properties of strong data augmentation. “Aug” stands for strong data augmentation. Left: Strong data augmentation makes predictions underconfident on CIFAR-100. The same phenomenon can be observed on ImageNet-1K. Right: Strong data augmentation significantly reduces the magnitude of Hessian max eigenvalues. This means that the data augmentation helps NNs converge to better optima by flattening the loss landscapes. On the other hand, strong data augmentation produces a lot of negative Hessian eigenvalues, i.e., it makes the losses non-convex.
480
+
481
+ The computational costs of Conv blocks and MSA blocks are almost identical. The training throughput of Alter-ResNet-50 is 473 image/sec on CIFAR-100, which is $20 \%$ faster than that of pre-activation ResNet-50.
482
+
483
+ The optimal number of MSAs depends on the model and dataset, so we empirically determine the number of MSAs as shown in Fig. 12a. A large dataset allows a large number of MSAs. For ImageNet, we use 6 MSAs as shown in Fig. D.5, because a large datasets alleviates the shortcomings of MSAs.
484
+
485
+ ![](images/0ea5cf8f47cb1c9c515ea256649c2bbd588e8513e33e24b935aa16b884c446b4.jpg)
486
+ Figure E.1: MSA with the appropriate build-up rules significantly improves ResNet on ImageNet. Robustness is mean accuracy on ImageNet-C. “RX” is ResNeXt.
487
+
488
+ MSAs improve the performance of CNNs on ImageNet. Since MSAs complement Convs, MSAs improve the predictive performance of CNNs when appropriate build-up rules are applied as shown in Section 4.1. Figure E.1 illustrates the accuracy and robustness—mean accuracy on ImageNet-C—of CNNs and ViTs on ImageNet-1K. Since ImageNet is a large dataset, a number of ViTs outperform CNNs. MSAs with the appropriate build-up rules significantly improves ResNet, and the predictive performance of AlterNet is on par with that of Swin in terms of accuracy without heavy modifications, e.g., the shifted windowing scheme (Liu et al., 2021). AlterNet is easy-to-implement and has a strong potential for future improvements. In addition, the build-up rules not only improve ResNet, but also other NNs, e.g., vanilla post-activation ResNet and ResNeXt; but we do not report this observation in order to keep the visualization simple.
489
+
490
+ # F DISTINCTIVE PROPERTIES OF DATA AUGMENTATION
491
+
492
+ This section empirically demonstrates that NN training with data augmentation is different from training on large datasets. We compare DeiT-style strong data augmentation with weak data augmentation, i.e., resize and crop. In this section, “a result without data augmentation” stands for “a result only with weak data augmentation”.
493
+
494
+ # F.1 DATA AUGMENTATION CAN HARM UNCERTAINTY CALIBRATION
495
+
496
+ Figure F.1a shows a reliability diagram of NNs with and without strong augmentation on CIFAR-100. Here, both ResNet and ViT without data augmentation (i.e., only with weak data augmentation) predict overconfident results. We show that strong data augmentation makes the predictive results underconfident (cf. Wen et al. (2021)). These are unexpected results because the predictions without data augmentation on large datasets, such as ImageNet, are not under-confident. A detailed investigation remains for future work.
497
+
498
+ F.2 DATA AUGMENTATION REDUCES THE MAGNITUDE OF HESSIAN EIGENVALUES
499
+
500
+ How does data augmentation help an MSA avoid overfitting on a training dataset and achieve better accuracy on a test dataset? Figure F.1b shows the Hessian max eigenvalue spectrum of NNs with and without strong data augmentation. First of all, strong data augmentation reduces the magnitude of Hessian eigenvalues, i.e., data augmentation flattens the loss landscapes in the early phase of training. These flat losses leads to better generalization. On the other hand, strong data augmentation produces a lot of negative Hessian eigenvalues, i.e., data augmentation makes the losses non-convex. This prevents NNs from converging to low losses on training datasets. It is clearly different from the effects of large datasets discussed in Fig. 4—large datasets convexify the loss landscapes. A detailed investigation remains for future work.
parse/dev/D78Go4hVcxO/D78Go4hVcxO_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/DHyHRBwJUTN/DHyHRBwJUTN.md ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/DHyHRBwJUTN/DHyHRBwJUTN_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/DHyHRBwJUTN/DHyHRBwJUTN_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/MkbcAHIYgyS/MkbcAHIYgyS_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/TCl7CbQ29hH/TCl7CbQ29hH.md ADDED
@@ -0,0 +1,375 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # CPT: COLORFUL PROMPT TUNING FOR PRE-TRAINED VISION-LANGUAGE MODELS
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ Pre-Trained Vision-Language Models (VL-PTMs) have shown promising capabilities in grounding natural language in image data, facilitating a broad variety of cross-modal tasks. However, we note that there exists a significant gap between the objective forms of model pre-training and fine-tuning, resulting in a need for large amounts of labeled data to stimulate the visual grounding capability of VLPTMs for downstream tasks. To address the challenge, we present Cross-modal Prompt Tuning (CPT, alternatively, Colorful Prompt Tuning), a novel paradigm for tuning VL-PTMs, which reformulates visual grounding into a fill-in-the-blank problem with color-based co-referential markers in image and text, maximally mitigating the gap. In this way, CPT enables strong few-shot and even zero-shot visual grounding capabilities of VL-PTMs. Comprehensive experimental results show that the prompt-tuned VL-PTMs outperform their fine-tuned counterparts by a large margin (e.g., $1 7 . 3 \%$ absolute accuracy improvement, and $7 3 . 8 \%$ relative standard deviation reduction on average with one shot in RefCOCO evaluation). All the data and codes will be available to facilitate future research.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Grounding natural language in fine-grained image regions is essential for a broad variety of visionlanguage tasks, such as robotic navigation (Tellex et al., 2011; Anderson et al., 2018b), visual question answering (Antol et al., 2015; Anderson et al., 2018a), visual dialogue (Das et al., 2017), and visual commonsense reasoning (Zellers et al., 2019). Recently Pre-Trained Vision-Language Models (VL-PTMs) have shown promising capabilities in visual grounding. Typically, generic cross-modal representations are first pre-trained on large-scale image-caption data in a self-supervised fashion, and then fine-tuned to adapt to downstream tasks (Lu et al., 2019; Su et al., 2019; Li et al., 2020; Radford et al., 2021). This pre-training-then-fine-tuning paradigm of VL-PTMs has greatly pushed forward the state-of-the-art of many cross-modal tasks.
12
+
13
+ Despite the success, we note that there exists a significant gap between the objective forms of pretraining and fine-tuning of VL-PTMs. As illustrated in Figure 1, during pre-training, most VL-PTMs are optimized based on the masked language modeling objective, trying to recover the masked token from the cross-modal context. However, during fine-tuning, downstream tasks are usually conducted by classifying unmasked token representations into semantic labels, where task-specific parameters are typically introduced. The gap hinders the effective adaptation of VL-PTMs to downstream tasks. As a result, a large amount of labeled data is typically required to stimulate the visual grounding capabilities of VL-PTMs for downstream tasks.
14
+
15
+ In this work, inspired by recent progress in pre-trained language models in natural language processing (Brown et al., 2020; Schick & Schutze, 2021a; Liu et al., 2021), we present Cross-modal ¨ Prompt Tuning (CPT, alternatively, Colorful Prompt Tuning), a novel paradigm for tuning VLPTMs. The key insight is that by adding color-based co-referential markers in both image and text, visual grounding can be reformulated into a fill-in-the-blank problem, maximally mitigating the gap between pre-training and fine-tuning. As shown in Figure 1, to ground natural language expressions in image data, CPT consists of two components: (1) a visual sub-prompt that uniquely marks image regions with colored blocks or segmentation masks, and (2) a textual sub-prompt that puts the query text into a color-based query template. Explicit grounding to the target image region can then be achieved by recovering the corresponding color text from the masked token in the query template. In addition, we present a principled method to search for high-quality cross-modal prompt configurations (i.e., visual appearances and texts of colors) for CPT.
16
+
17
+ ![](images/0c06701dc550421e7ed6cde9a9ceb8b8b45158d8ee3fa0a4623bc5c191b75dd5.jpg)
18
+ Figure 1: Illustration of (a) pre-training for VL-PTMs with masked language modeling (MLM) head, (b) vanilla fine-tuning with new classification (CLS) head, and (c) our colorful cross-modal prompt tuning (CPT) framework that reformulates visual grounding into a fill-in-the-blank problem with reused MLM head. Only square parts of relevant image regions are shown for illustration.
19
+
20
+ By mitigating the gap from pre-training, CPT enables strong few-shot and even zero-shot visual grounding capabilities of VL-PTMs. Experimental results show that the prompt-tuned VL-PTMs outperform their fine-tuned counterparts by a large margin. For example, using colored blocks as visual sub-prompts, CPT achieves $1 7 . 3 \%$ absolute accuracy improvement, and $7 3 . 8 \%$ relative standard deviation reduction on average with one shot in RefCOCO evaluation. In the same setting, when equipped with colored segmentation masks as visual sub-prompts, CPT can further achieve $2 0 . 0 \%$ absolute accuracy improvement, and $7 6 . 2 \%$ relative standard deviation reduction than the vanilla fine-tuning approach.
21
+
22
+ Our contributions are summarized as threefold: (1) We present a novel cross-modal prompt tuning paradigm for VL-PTMs. To the best of our knowledge, this is the first attempt in both cross-modal prompt tuning for VL-PTMs, and zero- and few-shot visual grounding independent of object types. (2) We present a principled approach to search for high-quality cross-modal prompt configurations for CPT. (3) We conduct comprehensive experiments which demonstrate the effectiveness of CPT.
23
+
24
+ # 2 PRELIMINARY
25
+
26
+ In the literature, visual grounding is typically formulated as a referring expression comprehension (REC) problem (Plummer et al., 2015; Mao et al., 2016). Given an image $I$ and a query text of referring expression $q$ , REC aims to locate the target region in $I$ that corresponds to $q$ . In this section, we introduce the vanilla fine-tuning approach for VL-PTMs.
27
+
28
+ A common practice for REC is to first detect a set of region proposals $\{ v _ { 1 } , v _ { 2 } , \ldots , v _ { n } \}$ via object detectors, and then classify or rank the proposals to select the target region (Lu et al., 2019; Chen et al., 2020). Specifically, visual and textual inputs are first transformed into a sequence of input tokens $\left\{ \left[ \mathrm { I M G } \right] , v _ { 1 } , v _ { 2 } , \ldots , v _ { n } \right.$ , [CLS], $w _ { 1 } , w _ { 2 } , \ldots , w _ { m } , [ \mathrm { S E P } ] \}$ , where $\{ w _ { 1 } , w _ { 2 } , \ldots , w _ { m } \}$ are textual tokens of $q$ , and $\big [ \mathrm { I M G } \big ]$ , [CLS] and [SEP] are special tokens. To obtain input representations, the feature of image regions is extracted by visual encoders, and the embeddings of textual and special tokens are obtained by a lookup table. Then input representations are fed into the pre-trained transformers to produce the hidden representations $\{ \mathbf { h } _ { \scriptscriptstyle { [ \mathbb { T } \mathrm { M G } ] } } , \mathbf { h } _ { v } ^ { 1 } , \mathbf { h } _ { v } ^ { 2 } , \dots , \mathbf { h } _ { v } ^ { n } , \mathbf { h } _ { \scriptscriptstyle { [ \mathbb { C } \mathrm { L S } ] } } , \mathbf { h } _ { w } ^ { \mathrm { f } } , \mathbf { h } _ { w } ^ { 2 } , \dots , \mathbf { h } _ { w } ^ { m } , \mathbf { h } _ { \scriptscriptstyle { [ \mathbb { S } \mathrm { E } \mathrm { P } ] } } \} .$ . Finally the hidden representation of the target region is optimized against negative ones via classification or ranking loss, where new task-specific parameters are introduced. As a result, fine-tuned VL-PTMs need a large mount of labeled instances to stimulate the visual grounding capability.
29
+
30
+ # 3 CROSS-MODAL PROMPT TUNING (CPT)
31
+
32
+ In this section, we introduce the framework of CPT, and how to apply CPT to zero-shot, few-shot and fully supervised visual grounding.
33
+
34
+ # 3.1 OVERVIEW
35
+
36
+ The key to visual grounding is to establish fine-grained connections between image regions and textual expressions. Therefore, a good cross-modal prompt tuning framework should take full advantage of co-referential signals from both image and text, and maximally mitigate the gap between pre-training and tuning. To this end, CPT reformulates visual grounding into a fill-in-the-blank problem, as shown in Figure 1. Specifically, the CPT framework consists of two components: (1) a visual sub-prompt that uniquely marks the image regions with colored blocks or segmentation masks, and (2) a textual sub-prompt that puts the query text into a color-based query template. Equipped with CPT, it is then straightforward for VL-PTMs to ground the query text by filling the masked token with the color text of the target image region, where the objective form is identical to pre-training.
37
+
38
+ # 3.2 VISUAL SUB-PROMPT
39
+
40
+ Given an image $I$ and its region proposals $\mathcal { R } = \{ v _ { 1 } , v _ { 2 } , . . . , v _ { n } \}$ , visual sub-prompt aims to uniquely mark the image regions with natural visual makers. Interestingly, we note that colored bounding boxes are widely used to uniquely mark objects in images for visualization in the literature. Inspired by this, we bridge the image regions and query text through a set of colors $\mathcal { C }$ , where each color $c _ { i } = ( c _ { v } ^ { i } , c _ { w } ^ { i } ) \in \mathsf { \bar { C } }$ is defined by its visual appearance $c _ { v } ^ { i }$ (e.g., RGB (255, 0, 0)) and color text $c _ { w } ^ { i }$ (e.g., red). Then we mark each region proposal $v _ { i }$ in the image with a unique color $c _ { v } ^ { i }$ for grounding, resulting in a set of colored image proposals $\Psi ( \mathcal { R } ; \mathcal { C } )$ , where $\Psi ( \cdot )$ denotes visual sub-prompt.
41
+
42
+ As for the shape of the visual sub-prompt, in principle, there are multiple plausible choices to mark the regions with colors, including colored bounding boxes, solid blocks, or solid object segmentation masks. In our experiments, we find that coloring the object with solid blocks and segmentation masks yields better results than bounding boxes, since solid colors that fit the outlines of objects are more common in real-world images (e.g., red shirt and blue car). Note that the addition of visual sub-prompt to the raw image does not change the architecture or parameters of VL-PTMs.
43
+
44
+ # 3.3 TEXTUAL SUB-PROMPT
45
+
46
+ Textual sub-prompt aims to prompt VL-PTMs to establish the connections between the query text and image regions marked by visual sub-prompt. Specifically, the query text $q$ (e.g., “the horse watched by the woman”) is transformed into a fill-in-the-blank query using a template $\mathcal { T } _ { g } ( \cdot )$ as:
47
+
48
+ $$
49
+ \mathcal { T } _ { g } ( q ) = \left[ \mathbb { C } \mathrm { { L S } } \right] q \mathrm { i s } \mathrm { i n } \left[ \mathrm { M } \mathrm { { A S K } } \right] \mathrm { c o l o r } \ \left[ \mathrm { { S E P } } \right]
50
+ $$
51
+
52
+ In this way, VL-PTMs are prompted to decide the color of which region is more appropriate to fill in the mask (e.g., red or blue) as follows:
53
+
54
+ $$
55
+ P ( v = v _ { i } | \mathcal { R } , q ) = P ( \mathrm { \tiny ~ I M A S K } ] = c _ { w } ^ { i } | \Psi ( \mathcal { R } ; \mathcal { C } ) , \mathcal { T } _ { g } ( q ) ) = \frac { \exp ( { \bf h } _ { \mathrm { \tiny ~ I M A S K } } ^ { \top } { \bf c } _ { w } ^ { i } ) } { \sum _ { c _ { j } \in \mathcal { C } } \exp ( { \bf h } _ { \mathrm { \tiny ~ I M A S K } } ^ { \top } { \bf c } _ { w } ^ { j } ) } ,
56
+ $$
57
+
58
+ where $v$ is the target region, $\mathbf { c } _ { w } ^ { i }$ is the embedding of $c _ { w } ^ { i }$ in the pre-trained MLM head. Note that the procedure does not introduce any new parameters, and also mitigates the gap between pre-training and tuning, and therefore improves the data efficiency for tuning VL-PTMs.
59
+
60
+ # 3.4 TRAINING AND INFERENCE
61
+
62
+ Equipped with CPT, VL-PTMs can readily perform zero-shot visual grounding without any labeled data, since the cross-modal representations of colors and their composition with other concepts (e.g., objects, attributes and relations) have been well learned by VL-PTMs during pre-training. When a few or full labeled instances are available, VL-PTMs can be further tuned by CPT using the entropybased objective: L = − P(R,q,v?)∈Dtrain $\begin{array} { r } { \mathcal { L } = - \sum _ { ( \mathcal { R } , q , v ^ { \star } ) \in \mathcal { D } _ { \operatorname { t r a i n } } } \log P ( v ^ { \star } | \mathcal { R } , q ) } \end{array}$ , where $\mathcal { D } _ { \mathrm { t r a i n } }$ is the training set.
63
+
64
+ ![](images/63263fe4ea028b14e86218e0b34963adfbf79c51a7c78d0afeb1fedf128513e9.jpg)
65
+ Figure 2: CPT framework for predicate classification by filling-in-the-blank with reused MLM head.
66
+
67
+ Although it is appealing to bridge the image and text through a color-based prompt, we identify two key challenges in its design: (1) how to determine the configurations of the color set $\mathcal { C }$ , and (2) how to deal with the large number of image regions with limited pre-trained colors.
68
+
69
+ Cross-Modal Prompt Search. Previous works in textual prompt tuning show that prompt configurations (e.g., textual templates) have a significant influence on the performance (Jiang et al., 2020). In this work, we make the first investigation in searching the cross-modal prompt configuration (i.e., the color set $\mathcal { C }$ ). Intuitively, $\mathcal { C }$ should consist of colors to which VL-PTMs are the most sensitive. To obtain a color $c _ { i } = ( \hat { c _ { v } ^ { i } } , c _ { w } ^ { i } )$ , a naive approach is to adopt the most frequent color text in the pre-training text as $c _ { w } ^ { i }$ , and its standard RGB as $c _ { v } ^ { i }$ (e.g., $c _ { i } \bar { = } \left( ( 2 5 5 , 0 , 0 ) \bar { , } r e d ) \right)$ . However, this solution is sub-optimal, since it determines the color text without considering its visual appearance, and the visual appearance of a color in real-world images often differs from its standard RGB.
70
+
71
+ To address the challenge, we present a principled cross-modal prompt search (CPS) algorithm for CPT, which jointly considers visual and textual semantics in real-world cross-modal data. Specifically, we first identify a candidate set of color texts $\hat { \mathcal { C } } _ { w }$ and visual appearances $\hat { \mathcal { C } } _ { v }$ . For each visual appearance candidate $\hat { c _ { v } } \in \hat { { \mathcal C } } _ { v }$ , we feed into VL-PTMs a pseudo-data instance consisting of a pure colored block of $\hat { c _ { v } }$ and a text: “[CLS] a photo in [MASK] color [SEP]”. Then we compute the decoding score $s ( \hat { c _ { v } } , \hat { c _ { w } } )$ for each color text candidate $\hat { c _ { w } } \in \hat { { \mathcal { C } } _ { w } }$ as in Equation 1, where a larger decoding score indicates higher correlation between $\hat { c _ { v } }$ and $\hat { c _ { w } }$ . To select the color texts that are sensitive by VL-PTMs, we retain the color texts that achieve the largest decoding scores for visual appearance candidates: $\mathcal { C } _ { w } = \{ c _ { w } | c _ { w } = \arg \operatorname* { m a x } _ { \hat { c } _ { w } ^ { j } \in \hat { \mathcal { C } } _ { w } } s ( \hat { c } _ { v } ^ { i } , \hat { c } _ { w } ^ { j } ) , \hat { c } _ { v } ^ { i } \in \hat { \mathcal { C } } _ { v } \}$ . Similarly, we can obtain the visual appearances according to the largest decoding score, resulting in the color set: $\begin{array} { r } { \mathcal { C } = \{ ( c _ { v } , c _ { w } ) | c _ { v } \stackrel { } { = } \operatorname * { a r g m a x } _ { \hat { c } _ { v } ^ { i } \in \hat { \mathcal { C } } _ { v } } s ( \hat { c } _ { v } ^ { i } , c _ { w } ^ { j } ) , c _ { w } ^ { j } \stackrel { } { \in } \mathcal { C } _ { w } \} . } \end{array}$ . We refer readers to Section B for the pseudo-code of the algorithm. In experiments, we find that the resultant colors yield better results than the naive ones. To make the raw content of the colored image regions available to VL-PTMs, a transparency hyperparameter $\alpha \in ( 0 , 1 )$ is further applied to color visual appearances in practice.
72
+
73
+ Image Region Batching. In visual grounding, the number of region proposals in an image usually exceeds the size of $\mathcal { C }$ $( \sim 1 0 )$ . Besides, we observe that heavily overlapped colored blocks can hinder visual grounding. Therefore, we divide the image regions into batches, where each batch contains a handful of moderately overlapping image regions, and mark each batch with a visual sub-prompt respectively. To handle the batches that do not contain the target region, we further introduce a new candidate text none in the decoding vocabulary, to indicate that there is no target region in the batch.
74
+
75
+ # 3.5 CPT FOR PREDICATE CLASSIFICATION
76
+
77
+ In the previous sections, we introduced CPT for visual grounding. In fact, CPT can also be easily adapted to other cross-modal tasks, such as predicate classification. Given an object pair (including the categories and bounding boxes) in an image, predicate classification aims to classify the relation into a relation set $\mathcal { P }$ , providing structured image representations that can facilitate many cross-modal tasks (Johnson et al., 2015; Hudson & Manning, 2019; Shi et al., 2019). In the literature, since the ground-truth relations cannot be exhaustively annotated during evaluation, to avoid false negatives, previous works typically score the triplets and evaluate the recall of top-N triplets (Xu et al., 2017; Zellers et al., 2018; Chen et al., 2019; Tang et al., 2019).
78
+
79
+ Visual and Textual Sub-prompts. As shown in Figure 2, to perform predicate classification, CPT first marks the image regions with visual sub-prompt as in Section 3.2, and puts the object pair in the query template as follows:
80
+
81
+ $$
82
+ \mathcal { T } _ { r } ( s , o ) = [ \mathrm { C L S } ] \ \mathrm { T h e } \ s _ { w } \ \mathrm { i n } \ c _ { w } ^ { i } \ \mathrm { c o l o r \ i s \Gamma [ \mathrm { M A S K } ] \ t h e } \ o _ { w } \ \mathrm { i n } \ c _ { w } ^ { j } \ \mathrm { c o l o r \ [ \mathrm { S B } \mathrm { T } ] \ . }
83
+ $$
84
+
85
+ where $s _ { w }$ is the subject text, $o _ { w }$ is the object text, and $c _ { w } ^ { i }$ and $c _ { w } ^ { j }$ are the corresponding color texts. Then VL-PTMs are prompted to recover the relation texts from masked tokens in the template. To accommodate the varied number of tokens in relation texts (e.g., wearing, walking on, typically $1 { \sim } 3$ tokens), we introduce a variable $l$ indicating the number of tokens in a relation text (e.g., $l = 2$ for walking on). The template $\tau ( \cdot ; l )$ will have $l$ consecutive masked tokens for relation prediction. For each template $\tau ( \cdot ; l )$ , we introduce a special NA relation consisting of $l$ tokens, which indicates that there is no relation between the entity pair under $\tau ( \cdot ; l )$ . Specifically, in our experiments, the NA relation is irrelevant, no relation, no relation with for $l = { 1 , 2 , 3 }$ respectively.
86
+
87
+ Training. Given a relational triplet $( s , r , o )$ , after decorating the input image regions and the object pair with visual and textual sub-prompts, VL-PTMs are optimized with the MLM loss to recover the relational tokens. Specifically, denote the number of tokens in $r$ as $| r |$ . (1) For templates where $l = | r |$ , models are asked to reconstruct the ith masked token in $\mathcal { T } ( s , o ; l )$ with the ith relational token $r _ { i }$ using the MLM head. (2) For templates where $l \neq | r |$ , since there is no relation between $( s , o )$ under $\mathcal { T } ( s , o ; l )$ , models are asked to reconstruct the NA relation. For $( s , o )$ that do not have any relation in the image, models are asked to reconstruct the NA relation for all $\dot { \mathcal { T } } ( s , o ; l )$ .
88
+
89
+ Inference. During inference, given an object pair $( s , o )$ , we score the relations based on their fitness to the prompt context. Specifically, the score of each relation $r ~ \in ~ \mathcal { P } ~ \cup ~ \{ \mathrm { N A } \}$ is obtained by the aggregated MLM scores of its composing tokens under the corresponding template: $\begin{array} { r } { s ( r ) = { \frac { 1 } { l } } \sum _ { i = 1 } ^ { l } \log P ( \mathrm { \mathop { M A S K } } ] _ { i } = r _ { i } | { \mathcal T } ( s , o ; l ) ) } \end{array}$ , where $l = | r |$ . Intuitively, larger $s ( r )$ indicates that the relation $r$ better fits the prompt context. Finally, the triplets $( s , r , o )$ are ranked according to the relation score $s ( r )$ , where $r \in \mathcal { P }$ .
90
+
91
+ Compared with visual grounding that aims to locate image regions for ungrounded texts, predicate classification represents a different series of cross-modal tasks that aim to perform semantic recognition based on grounded inputs, such as object classification (Zhao et al., 2017) and scene graph classification ( $\mathrm { { X u } }$ et al., 2017). In addition to better data efficiency, a crucial advantage of using CPT is that the semantic labels can be produced from open-world vocabularies, instead of fixed label sets.
92
+
93
+ # 4 EXPERIMENTS
94
+
95
+ In this section, we empirically evaluate CPT in prompting VL-PTMs for visual grounding in different settings, including zero-shot, few-shot and fully supervised settings. We refer readers to Section C for the implementation details.
96
+
97
+ # 4.1 EXPERIMENTAL SETTINGS
98
+
99
+ We first introduce the experimental settings of the visual grounding task, including datasets, training settings, evaluation protocols and baseline models in our experiments.
100
+
101
+ Datasets. Following previous works (Rohrbach et al., 2016; Zhang et al., 2018), we adopt three widely used visual grounding datasets collected from MSCOCO images (Lin et al., 2014), including RefCOCO (Yu et al., 2016), RefCOCO $^ +$ (Yu et al., 2016) and RefCOCOg (Mao et al., 2016). We refer readers to Section D.2 for more dataset details.
102
+
103
+ Training Settings. We report experimental results of different training settings, including (1) zeroshot setting, where no training data is available, (2) few-shot setting, where $K$ training instances are available $\begin{array} { r } { K = 1 , 2 , 4 , 8 , 1 6 , } \end{array}$ , and (3) fully supervised setting, where the full training set is available.
104
+
105
+ Evaluation Protocols. (1) Evaluation metrics. Following Zhang et al. (2018); Lu et al. (2019), we adopt accuracy of the grounding results as the evaluation metrics. An expression is considered correctly grounded if the IoU of the top predicted region and the ground truth is greater than 0.5. (2) Model validation. To better approximate the few-shot scenario where only a few labeled instances are available, inspired by Gao et al. (2021), we use a few-shot validation set (consisting of 16 instances) for few-shot and zero-shot experiments, and use full validation set for fully supervised experiments. (3) Robust evaluation. Previous works have shown that model training on limited data can suffer from instability (Dodge et al., 2020; Gao et al., 2021). For a robust and comprehensive evaluation, we report mean results over 5 random training set splits, as well as the standard deviation. For fair comparisons, the training and validation sets are identical for our baselines and CPT.
106
+
107
+ Baselines. We evaluate two variants of CPT, including CPT using colored blocks (CPT-Blk) and colored segmentation masks (CPT-Seg). We adopt the widely used VinVL (Zhang et al., 2021)
108
+
109
+ Table 1: Main results. Accuracies $( \% )$ of grounding referring expressions in zero-shot, few-shot and fully supervised settings. We report mean and standard deviation performance over 5 random splits. ZS: zero-shot. Blk: colored block, Seg: colored segmentation mask.
110
+
111
+ <table><tr><td rowspan="2"></td><td rowspan="2">Shot</td><td rowspan="2">Model</td><td colspan="3">RefCOCO</td><td colspan="3">RefCOCO+</td><td colspan="3">RefCOCOg</td></tr><tr><td>val</td><td>testA</td><td>testB</td><td>val</td><td>testA</td><td>testB</td><td>val</td><td>test</td><td></td></tr><tr><td>S</td><td>0</td><td>Random CPT-Blk CPT-Seg</td><td>15.9 ± 0.2 26.9 32.2</td><td>19.4 ±0.6 27.5 36.1</td><td>13.4± 0.4 27.4 30.3</td><td>16.1 ± 0.1 25.4 31.9</td><td>13.3±0.6 25.0 35.2</td><td>20.0±0.2 27.0 28.8</td><td>18.8± 0.4 32.1 36.7</td><td></td><td>19.2 ± 0.3 32.3 36.5</td></tr><tr><td></td><td>1</td><td>Fine-tuning CPT-Blk CPT-Seg</td><td>16.5 ± 4.9 34.1 ± 1.3 37.2 ± 0.9 22.5 ± 4.5</td><td>12.0±6.6 37.7 ± 1.7 41.5 ± 1.5 21.0 ± 7.2</td><td>23.5 ±5.7 32.2 ± 1.5 33.2 ±1.7</td><td>22.2±7.6 35.9 ± 4.1 37.9 ± 4.0</td><td>20.6±9.3 40.4±5.4 42.3± 5.9</td><td>25.7±5.2 32.2±2.6 33.9±2.4</td><td>26.9± 8.4 39.7± 3.4 43.1± 2.9</td><td></td><td>26.9± 8.1 39.9 ± 3.0 43.4 ± 3.1</td></tr><tr><td></td><td>2</td><td>Fine-tuning CPT-Blk CPT-Seg</td><td>35.3±3.2 39.8 ±1.7</td><td>25.9 ±4.7 39.6±3.0 30.9 ± 1.7 45.6±3.2 33.9 ±0.4</td><td>27.0 ±3.1 33.3±3.6 38.6±3.6</td><td>27.8±4.2 37.5±4.8 44.5± 4.5</td><td>27.0±2.6 30.3±2.5 32.8±3.8</td><td>28.4±12.0 40.1± 5.1 44.7 ± 5.1</td><td></td><td>28.1 ± 11.3 40.0± 4.7</td><td>44.3± 4.8</td></tr><tr><td>Jtpp-eg</td><td>4</td><td>Fine-tuning CPT-Blk CPT-Seg</td><td>29.1 ±5.0 38.3 ± 2.1 40.7 ± 3.2</td><td>29.9 ±7.8 43.6 ± 3.3 47.4 ± 4.1</td><td>29.8±5.3 34.0 ± 1.6 35.3 ±1.8</td><td>34.2 ± 4.2 37.7 ± 5.2 38.8±3.8 40.3 ± 2.0 46.5 ± 3.1</td><td>30.5±3.3 44.4± 6.4 33.5 ± 1.5 34.5 ±1.5</td><td></td><td>34.0 ± 13.1 40.6± 7.9 44.4 ± 6.9</td><td>40.9 ± 7.9</td><td>33.7 ±12.8 44.4 ± 6.9</td></tr><tr><td></td><td>8</td><td>Fine-tuning CPT-Blk CPT-Seg</td><td>34.6± 4.8 41.0 ± 1.5 41.3 ± 2.6</td><td>37.8± 5.5 43.9 ± 1.7 48.2 ± 4.6</td><td>31.4 ± 5.1 35.8±2.2 35.7±2.5</td><td>36.2±3.6 39.3 ± 1.5 42.6 ± 2.9</td><td>40.1 ± 4.6 46.1 ± 1.8 49.3 ± 4.7</td><td>32.7±2.3 33.2 ±1.3 35.4 ±1.0</td><td>40.6 ± 11.2 43.4± 6.5 47.4 ± 3.5</td><td></td><td>40.4 ± 11.7 43.6± 6.4 47.4 ± 3.5</td></tr><tr><td></td><td>16</td><td>Fine-tuning CPT-Blk CPT-Seg</td><td>39.8 ± 4.2 44.8± 3.3 45.3 ±1.8</td><td>45.5± 5.0 51.4 ± 4.1 53.3± 3.0</td><td>34.9 ±3.0 38.2 ± 2.3 37.5 ±1.3</td><td>41.8 ±3.0 41.5 ± 1.3 44.8 ± 0.9</td><td>47.3 ± 3.1 48.2 ± 2.1 52.5±1.2</td><td>36.2 ±2.3 34.7±0.9 36.6 ± 1.2</td><td>47.5± 4.1 47.8± 2.1 51.0± 2.6</td><td></td><td>47.8± 4.7 48.2± 2.8 51.4 ± 2.8</td></tr><tr><td>Psnnr</td><td>VL-T5</td><td>MAttNet</td><td>76.7 1</td><td>81.1 1</td><td>70.0 1</td><td>65.3 1</td><td>71.6 1 78.5</td><td>52.0 二 62.6</td><td>66.6 71.2</td><td></td><td>67.3 71.3</td></tr><tr><td></td><td>|Dtrainl</td><td>ViLBERT VLBERT ERNIE-ViL UNITER Fine-tuning</td><td>二 一 81.2</td><td>二 一 一 86.5</td><td>二 1</td><td>72.3 71.6 74.0</td><td>77.7 80.3</td><td>61.0 64.7</td><td>1 二</td><td></td><td>1 二</td></tr></table>
112
+
113
+ as the CPT backbone. We compare CPT with a series of strong baselines that utilize detected proposals, including vanilla fine-tuning of $\mathrm { V i n V L }$ and other VL-PTMs (see Section D.1 for more baseline details). For fair comparisons, we adopt the base size for all VL-PTMs. We refer readers to Section A.1 for the results of large size VL-PTMs.
114
+
115
+ # 4.2 MAIN RESULTS
116
+
117
+ The main results are reported in Table 1, from which we observe that: (1) CPT outperforms the random baseline and the strong fine-tuning baseline by a large margin in zero-shot and few-shot settings. For example, using colored blocks as visual sub-prompts, CPT achieves $1 7 . 3 \%$ absolute accuracy improvement on average with one shot in RefCOCO evaluation. This indicates that CPT can effectively improve sample efficiency in tuning VL-PTMs. (2) Coloring objects with segmentation masks in visual sub-prompts (CPT-Seg) achieves even better results than blocks (CPT-Blk). The reason is that solid colors that fit the outlines of objects are more common in real-world images, making CPT-Seg more natural visual sub-prompts (despite requiring stronger annotation to train the segmentation tools). (3) Notably, CPT achieves significantly smaller standard deviation than fine-tuning. For example, CPT-Blk achieves $7 3 . 8 \%$ relative standard deviation reduction on average with one shot in RefCOCO evaluation. This shows that a coherent tuning approach from pre-training can lead to substantially more stable few-shot training, which is a crucial factor for evaluating few-shot learning models (Gao et al., 2021). (4) We note that CPT-Blk slightly underperforms fine-tuning with 16 shots in $\operatorname { R e f C O C O + }$ evaluation. The reason is that $\operatorname { R e f C O C O + }$ has more colorbased expressions (e.g., the person in red shirt and blue hat), which can disturb our color-based CPT. However, this problem can be alleviated with more tuning instances in the fully supervised scenario, where models can learn to better distinguish colors in the query text and prompt template. (5) CPT models achieve comparable performance to strong fine-tuned VL-PTMs in the fully supervised settings. This shows that CPT is a competitive tuning approach for VL-PTMs even in the fully supervised scenario. We note that CPT-Blk slightly outperforms CPT-Seg in the fully supervised setting, and we refer readers to Section A.3 for a detailed analysis. In summary, compared to the vanilla fine-tuning approach, CPT achieves superior/comparable, and more stable performance in zero-shot, few-shot and fully supervised visual grounding.
118
+
119
+ # 4.3 INFLUENCE OF COLORS IN CPT’S VISUAL GROUNDING
120
+
121
+ In our analysis, we first investigate the influence of colors—the key ingredients—in the visual grounding performance of CPT. Specifically, we compare colors obtained from the frequency-based baseline (Freq) (See Section 3.4) and our cross-modal prompt search method CPS (Ours) in two dimensions, including an overall evaluation of top-N colors and a zoom-in study of individual colors. Unless otherwise specified, all the following experiments are conducted based on CPT-Blk on the validation set of RefCOCO in $0 , 2 , 8$ shot settings.
122
+
123
+ Table 2: Top-6 colors from the frequency-based baseline and our CPS. Visual appearances and color texts are reported. Best viewed in color.
124
+
125
+ <table><tr><td>Model</td><td>Color #1</td><td>Color #2</td><td>Color #3</td><td>Color #4</td><td>Color #5</td><td>Color #6</td></tr><tr><td>Freq</td><td>1(255,0,0),red</td><td>■(0.0.0),black</td><td>■(0,0,255),blue</td><td>■ (0,255,0), green</td><td>■ (255,255,0),yellow</td><td>1(165,42,42),brown</td></tr><tr><td>Ours</td><td>1(240,0,30),red</td><td>(155,50,210), purple</td><td>(255,255,25),yellow</td><td>(0,10,255), blue</td><td>■ (255,170,230),pink</td><td>(0,255,0), green</td></tr></table>
126
+
127
+ Overall Evaluation of Top-N Colors. We first show the top-6 colors recommended by each approach in Table 2. To evaluate the overall performance of the top colors from different models, we evaluate CPT equipped with each color from the top-6 colors respectively, and report the mean accuracy and standard deviation over different colors. From the experimental results in Figure 3a, we observe that the top colors produced by CPS achieve both higher mean accuracy and lower standard deviation than the baseline method in different shot-settings. The reason is that CPS jointly considers visual and textual semantics in searching cross-modal prompts, and therefore is able to effectively adjust and rank the colors for more accurate and stable visual grounding.
128
+
129
+ ![](images/00d1c1c073c5dff76871fcddd8e5865999c6dd4c29f4672edc6192658ea28752.jpg)
130
+ Figure 3: Results of utilizing different colors for visual grounding, including (a) an overall evaluation of top-6 colors from different models, and (b) a zoom-in study of aligned individual colors.
131
+
132
+ Zoom-In Study of Individual Colors. To investigate the fine-grained influence of specific colors in CPT’s visual grounding, we further perform a zoom-in study of individual colors. To align the colors for comparison, we merge the top-6 colors from the baseline and CPS, and remove the colors that are not included in the models’ complete color sets (e.g., black $\not \in { \mathcal { C } }$ in CPS). We report the accuracies in Figure 3b, from which we observe that: (1) The performance of different colors varies greatly in prompting VL-PTMs in the same shot-settings, and the optimal colors are different in different shotsettings. The results indicate the large influence of cross-modal prompt configurations, consistent with the findings from recent studies in textual prompt tuning (Jiang et al., 2020; Gao et al., 2021). (2) Colors produced by CPS achieve comparable or superior performance compared to the baseline in individual colors. The results show that given the color texts, CPS can properly adjust the color visual appearance (i.e., RGB) to improve the visual grounding performance. (3) We note that in some cases, colors produced by CPS slightly underperform the baseline. We hypothesize the reason is that, CPS uses a single textual template to compute the decoding scores for color adjustment, which can be biased. The problem can potentially be addressed by ensembling templates as in Qin & Eisner (2021), which we leave for future work.
133
+
134
+ # 4.4 CASE STUDY
135
+
136
+ To provide a more intuitive understanding of CPT, we conduct a case study on the validation set of RefCOCO in 8-shot setting. From the results in Figure 4, we have the following observations: (1) CPT enables VL-PTMs to distinguish target objects distracted by the same of type objects using only a few training instances, while the fine-tuning method struggles to succeed (Figure 4a). (2) CPT can be distracted by hard candidates (e.g., objects of the same type as the target that requires complex reasoning to identify), but will typically produce reasonable predictions. For example, in Figure 4b, CPT predicts a nearby apple while the fine-tuning baseline predicts a bowl. The reason is that CPT maximally reuses the pre-trained parameters of VL-PTMs, which can help prevent outrageous predictions that typically happen in few-shot fine-tuning. (3) However, we find that CPT can be disturbed by colors in raw image regions and text. For example, it can be difficult for the model to identify a red bowl when the candidate regions are colored by red blocks (Figure 4c).
137
+
138
+ ![](images/ffe57b334355fb54678de8ce343179c291890bdcd5ff6750cc4c1e33e65c9b69.jpg)
139
+ Figure 4: Case study. The bounding boxes given by image region proposals (olive), ground-truth annotation (pink), CPT (green), and fine-tuning baseline (yellow) are highlighted accordingly.
140
+
141
+ Table 3: Predicate classification results on Visual Genome. ZS: zero-shot, FS: fully supervised. We report the mean and standard deviation performance over 2 random splits.
142
+
143
+ <table><tr><td rowspan="2">Shot</td><td rowspan="2"></td><td rowspan="2">Model</td><td colspan="4">Val</td><td colspan="4">Test</td></tr><tr><td>R@50</td><td>R@100</td><td>mR@50</td><td>mR@100</td><td>R@50</td><td>R@100</td><td>mR@50</td><td>mR@100</td></tr><tr><td>S</td><td>0</td><td>Random CPT-Blk</td><td>1.6 ± 0.2 33.6</td><td>1.8±0.2 34.7</td><td>1.1±0.2 14.8</td><td>1.3±0.1 15.5</td><td>1.5±0.0 29.3</td><td>1.8±0.1 30.5</td><td>1.2 ±0.1 13.0</td><td>1.6 ± 0.1 14.5</td></tr><tr><td rowspan="4">Fs-etr</td><td>1</td><td>Fine-tuning CPT-Blk</td><td>3.8±0.1 16.3 ± 2.0</td><td>4.2 ±0.1 17.5 ± 2.3</td><td>7.8±0.9 25.2 ±0.7</td><td>8.7±1.0 27.4 ± 0.8</td><td>4.1 ± 0.1 18.0 ± 2.8</td><td>4.7±0.0 20.0±3.0</td><td>6.7±0.3 23.9±0.3</td><td>7.6±0.4 26.3±0.3</td></tr><tr><td>4</td><td>Fine-tuning CPT-Blk</td><td>7.1±1.9 14.4 ± 0.4</td><td>7.6±2.0 15.4 ± 0.4</td><td>10.3±0.8 30.4 ± 1.5</td><td>11.7±0.8 32.8 ±1.6</td><td>7.3 ± 1.5 17.7 ± 0.6</td><td>7.9 ± 1.7 19.3 ± 0.6</td><td>11.8 ± 1.0 28.5±1.5</td><td>13.2 ±0.9 32.1 ± 1.0</td></tr><tr><td>16</td><td>Fine-tuning CPT-Blk</td><td>8.4±0.3 15.0 ± 0.6</td><td>8.9±0.3 16.0 ± 0.8</td><td>20.7±0.6 33.0±0.2</td><td>21.7±0.6 35.4 ± 0.6</td><td>10.4±0.7 18.4 ± 1.0</td><td>11.2±0.8 20.0 ± 1.1</td><td>19.7 ±0.1 32.5±0.5</td><td>21.7±0.1 36.1 ± 0.6</td></tr><tr><td>32</td><td>Fine-tuning CPT-Blk</td><td>9.7± 1.1 17.2 ± 0.4</td><td>10.2 ± 1.1 18.2 ± 0.4</td><td>21.9±0.6</td><td>22.9±0.2</td><td>11.7±0.2</td><td>12.4±0.3</td><td>22.0±0.1</td><td>24.1±0.0 37.7 ± 0.3</td></tr><tr><td rowspan="4">S</td><td rowspan="4">|Dtrainl</td><td>Neural Motif</td><td></td><td></td><td>34.6±0.2</td><td>37.9 ± 0.1</td><td>20.8±0.1</td><td>22.3 ± 0.1</td><td>34.0 ± 0.1</td><td></td></tr><tr><td>BGNN</td><td>=</td><td>=</td><td>=</td><td></td><td>65.2</td><td>67.0</td><td>14.8</td><td>16.1</td></tr><tr><td>PCPL</td><td></td><td></td><td></td><td></td><td>59.2 50.8</td><td>61.3 52.6</td><td>30.4 35.2</td><td>32.9</td></tr><tr><td>DT2-ACBS</td><td></td><td></td><td>=</td><td></td><td>23.3</td><td>25.6</td><td>35.9</td><td>37.8 39.7</td></tr></table>
144
+
145
+ # 4.5 EXPERIMENTS ON PREDICATE CLASSIFICATION
146
+
147
+ To investigate the generalization capability of CPT, we evaluate CPT on predicate classification task.
148
+
149
+ Experimental Settings. (1) Datasets. We adopt the popular Visual Genome dataset (Krishna et al., 2017), which contains 50 visual relations. We refer readers to Section D.2 for the dataset details. (2) Evaluation protocols. Following previous works ( $\mathrm { { X u } }$ et al., 2017; Chen et al., 2019), we use recall $@ \mathbf { N }$ $( \mathsf { R } \ @ \mathsf { N } )$ and mean recall $\textstyle { \mathfrak { Q } } \mathbf { N }$ $( \mathrm { m } \mathrm { R @ { N } } )$ as the evaluation metrics. During training, K labeled instances are provided for each relation. (3) Baselines. We adopt fine-tuning of VinVL as our most direct baseline model. Specifically, we feed the image regions and their categories into the model, and concatenate the visual hidden representations of the subject and object. Then the object pair representation is fed into a softmax classifier. All VL-PTMs are in base size. We also report the results of strong baselines that are tailored for the task, and are fully supervised with 315, 642 labeled triplets, including Neural Motif (Zellers et al., 2018), BGNN (Li et al., 2021a), PCPL (Yan et al., 2020) and DT2-ACBS (Desai et al., 2021).
150
+
151
+ Results. From the results in Table 3, we observe that: (1) CPT significantly outperforms the random baseline and the strong fine-tuning baseline in zero-shot and few-shot settings. For example, using 32 shots, CPT achieves a strong $\operatorname { m } \mathbf { R } \ @ 1 0 0$ of $3 7 . 7 \%$ , outperforming fine-tuning by $1 3 . 6 \%$ absolute points, and closely approaching state-of-the-art fully supervised DT2-ACBS. This indicates that CPT can improve sample efficiency in tuning VL-PTMs. (2) We note that while the macro performance of CPT monotonically increases as the shot number grows, the micro performance drops first in 1- and 4-shot settings. This is due to the distribution gap between the balanced training set (i.e., K shot for each relation) and the long-tail test set. Since the relations in the pre-training corpora also follow a long-tail distribution, CPT can achieve a high starting point for micro performance.
152
+
153
+ # 5 RELATED WORK
154
+
155
+ Pre-trained Vision-language Models. Existing VL-PTMs can be roughly divided into three categories according to their pre-training objectives and architectures: (1) Masked language modeling based VL-PTMs are mainly pre-trained to recover the masked tokens (Lu et al., 2019; Su et al., 2019; Tan & Bansal, 2019; Li et al., 2020; Yu et al., 2021); (2) Auto-regressive language modeling based VL-PTMs model image and text tokens with Transformer decoders auto-regressively (Ramesh et al., 2021; Wang et al., 2021); (3) Contrastive learning based VL-PTMs are pre-trained to holistically match image-text pairs (Radford et al., 2021; Li et al., 2021b). Note that our Cross-modal Prompt Tuning (CPT) framework is orthogonal to VL-PTM design. In this work, without loss of generality, we focus on prompting masked language modeling based VL-PTMs due to their prevalence and superior performance, while applying CPT to other VL-PTMs is also applicable.
156
+
157
+ Prompt Tuning for NLP. Prompt tuning for pre-trained language models is a rapidly emerging field in NLP (Raffel et al., 2019; Brown et al., 2020; Liu et al., 2021). Originally designed for probing knowledge in pre-trained language models (Petroni et al., 2019), prompt tuning has now been extended to handle a variety of NLP tasks, including language understanding (Schick & Schutze, ¨ 2021a;b) and generation (Li & Liang, 2021). To facilitate prompt engineering, Shin et al. (2020) propose to automatically generate prompt templates via gradient-based search. Most related to our work are Tsimpoukelli et al. (2021); Zhou et al. (2021); Wang et al. (2021) that present textual prompt tuning for VL-PTMs, achieving promising results on some vision-language tasks. However, similar to existing works in NLP, they focus on prompt engineering in text, keeping images untouched, and therefore can only perform holistic implicit visual grounding. In comparison, to the best of our knowledge, CPT is the first cross-modal prompt tuning framework tailored for both image and text, and is capable of explicitly grounding natural language to fine-grained image regions.
158
+
159
+ Visual Grounding. There is a general consensus that visual grounding plays an essential role in solving vision-language tasks (Karpathy & Fei-Fei, 2015; Plummer et al., 2015; Goodfellow et al., 2016; Krishna et al., 2017; Lu et al., 2019). Mao et al. (2016) propose the referring expression comprehension task to explicitly evaluate the visual grounding capability. To address the task, most models learn to classify or rank image region candidates based on the expressions in a fully supervised fashion (Mao et al., 2016; Zhang et al., 2018; Lu et al., 2019; Chen et al., 2020), requiring large amounts of costly human-annotated data. To alleviate reliance on human annotation, some works have investigated zero-/few-shot grounding of new object types (Sadhu et al., 2019; Blukis et al., 2020), whereas amounts of training data are still needed for existing object types. In comparison, we prompt general VL-PTMs for zero- and few-shot visual grounding in a reformulated fill-in-the-blank paradigm independent of specific object types.
160
+
161
+ # 6 CONCLUSION AND FUTURE WORK
162
+
163
+ In this work, we present the first Cross-modal Prompt Tuning (CPT) framework for VL-PTMs. To facilitate prompt engineering, we present a principled approach to search for cross-modal prompt configurations. Comprehensive experimental results demonstrate the effectiveness of CPT on zeroshot, few-shot and fully supervised visual grounding. In future, we plan to address the color disturbance and improve the computation efficiency of CPT, and also investigate the effectiveness of CPT on other vision-language tasks. As the first attempt in cross-modal prompt tuning, we propose a color-based framework as one of the possible prompt tuning solutions. We leave exploring other plausible prompt tuning approaches of VL-PTMs for future work.
164
+
165
+ # 7 ETHICS STATEMENT
166
+
167
+ In this section, we discuss the main ethical considerations of CPT: (1) Intellectual property protection. The codes and data adopted from previous works are granted for research-purpose usage. (2) Privacy. The data adopted in this work (i.e., the pre-training data and tuning data) is created by human annotators for research purposes, and should not cause privacy issues. (3) Potential problems. VL-PTMs may be biased towards some objects and attributes. There are increasing efforts to address the problem in the community (Ross et al., 2021; Zhao et al., 2021).
168
+
169
+ # 8 REPRODUCIBILITY STATEMENT
170
+
171
+ To maximize the reproducibility, we provide a clear description of the methodology in Section 3, the pseudo-code of the model in Section B, implementation details in Section C, and detailed data characteristics and evaluation protocols in Section 4.1. All the data and codes will be available to facilitate future research.
172
+
173
+ # REFERENCES
174
+
175
+ Peter Anderson, Xiaodong He, Chris Buehler, Damien Teney, Mark Johnson, Stephen Gould, and Lei Zhang. Bottom-up and top-down attention for image captioning and visual question answering. In Proceedings of CVPR, pp. 6077–6086, 2018a.
176
+
177
+ Peter Anderson, Qi Wu, Damien Teney, Jake Bruce, Mark Johnson, Niko Sunderhauf, Ian Reid, ¨ Stephen Gould, and Anton van den Hengel. Vision-and-language navigation: Interpreting visually-grounded navigation instructions in real environments. In Proceedings of CVPR, June 2018b.
178
+
179
+ Stanislaw Antol, Aishwarya Agrawal, Jiasen Lu, Margaret Mitchell, Dhruv Batra, C Lawrence Zitnick, and Devi Parikh. VQA: Visual question answering. In Proceedings of ICCV, pp. 2425–2433, 2015.
180
+
181
+ Valts Blukis, Ross A Knepper, and Yoav Artzi. Few-shot object grounding and mapping for natural language robot instruction following. arXiv preprint arXiv:2011.07384, 2020.
182
+
183
+ Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020.
184
+
185
+ Tianshui Chen, Weihao Yu, Riquan Chen, and Liang Lin. Knowledge-embedded routing network for scene graph generation. In Proceedings of CVPR, pp. 6163–6171, 2019.
186
+
187
+ Yen-Chun Chen, Linjie Li, Licheng Yu, Ahmed El Kholy, Faisal Ahmed, Zhe Gan, Yu Cheng, and Jingjing Liu. UNITER: Universal image-text representation learning. In Proceedings of ECCV, pp. 104–120. Springer, 2020.
188
+
189
+ Jaemin Cho, Jie Lei, Hao Tan, and Mohit Bansal. Unifying vision-and-language tasks via text generation. In Proceedings of ICML, PMLR, pp. 1931–1942, 2021.
190
+
191
+ Abhishek Das, Satwik Kottur, Khushi Gupta, Avi Singh, Deshraj Yadav, Jose MF Moura, Devi ´ Parikh, and Dhruv Batra. Visual dialog. In Proceedings of CVPR, pp. 326–335, 2017.
192
+
193
+ Alakh Desai, Tz-Ying Wu, Subarna Tripathi, and Nuno Vasconcelos. Learning of visual relations: The devil is in the tails. In Proceedings of ICCV, pp. 15404–15413, 2021.
194
+
195
+ Jesse Dodge, Gabriel Ilharco, Roy Schwartz, Ali Farhadi, Hannaneh Hajishirzi, and Noah Smith. Fine-tuning pretrained language models: Weight initializations, data orders, and early stopping. arXiv preprint arXiv:2002.06305, 2020.
196
+
197
+ Tianyu Gao, Adam Fisch, and Danqi Chen. Making pre-trained language models better few-shot learners. In Proceedings of ACL, 2021.
198
+
199
+ Ian Goodfellow, Yoshua Bengio, and Aaron Courville. Deep learning. MIT press, 2016.
200
+
201
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of CVPR, pp. 770–778, 2016.
202
+
203
+ Kaiming He, Georgia Gkioxari, Piotr Dollar, and Ross Girshick. Mask R-CNN. In ´ Proceedings of the ICCV, pp. 2961–2969, 2017.
204
+
205
+ Drew A. Hudson and Christopher D. Manning. Learning by abstraction: The neural state machine. In Proceedings of NeurIPS, pp. 5901–5914, 2019.
206
+
207
+ Zhengbao Jiang, Frank F Xu, Jun Araki, and Graham Neubig. How can we know what language models know? TACL, 8:423–438, 2020.
208
+
209
+ Justin Johnson, Ranjay Krishna, Michael Stark, Li-Jia Li, David Shamma, Michael Bernstein, and Li Fei-Fei. Image retrieval using scene graphs. In Proceedings of CVPR, pp. 3668–3678, 2015.
210
+
211
+ Andrej Karpathy and Li Fei-Fei. Deep visual-semantic alignments for generating image descriptions. In Proceedings of CVPR, pp. 3128–3137, 2015.
212
+
213
+ Sahar Kazemzadeh, Vicente Ordonez, Mark Matten, and Tamara Berg. ReferitGame: Referring to objects in photographs of natural scenes. In Proceedings of EMNLP, pp. 787–798, 2014.
214
+
215
+ Ranjay Krishna, Yuke Zhu, Oliver Groth, Justin Johnson, Kenji Hata, Joshua Kravitz, Stephanie Chen, Yannis Kalantidis, Li-Jia Li, David A Shamma, et al. Visual genome: Connecting language and vision using crowdsourced dense image annotations. IJCV, 123(1):32–73, 2017.
216
+
217
+ Rongjie Li, Songyang Zhang, Bo Wan, and Xuming He. Bipartite graph network with adaptive message passing for unbiased scene graph generation. In Proceedings of CVPR, pp. 11109– 11119, 2021a.
218
+
219
+ Wei Li, Can Gao, Guocheng Niu, Xinyan Xiao, Hao Liu, Jiachen Liu, Hua Wu, and Haifeng Wang. UNIMO: Towards unified-modal understanding and generation via cross-modal contrastive learning. In Proceedings of ACL, pp. 2592–2607. Association for Computational Linguistics, 2021b.
220
+
221
+ Xiang Lisa Li and Percy Liang. Prefix-tuning: Optimizing continuous prompts for generation. arXiv preprint arXiv:2101.00190, 2021.
222
+
223
+ Xiujun Li, Xi Yin, Chunyuan Li, Pengchuan Zhang, Xiaowei Hu, Lei Zhang, Lijuan Wang, Houdong Hu, Li Dong, Furu Wei, et al. Oscar: Object-semantics aligned pre-training for vision-language tasks. In Proceedings of ECCV, pp. 121–137. Springer, 2020.
224
+
225
+ Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollar, and C Lawrence Zitnick. Microsoft COCO: Common objects in context. In ´ Proceedings of ECCV, pp. 740–755. Springer, 2014.
226
+
227
+ Pengfei Liu, Weizhe Yuan, Jinlan Fu, Zhengbao Jiang, Hiroaki Hayashi, and Graham Neubig. Pretrain, prompt, and predict: A systematic survey of prompting methods in natural language processing. arXiv preprint arXiv:2107.13586, 2021.
228
+
229
+ Jiasen Lu, Dhruv Batra, Devi Parikh, and Stefan Lee. ViLBERT: Pretraining task-agnostic visiolinguistic representations for vision-and-language tasks. Proceedings of NeurIPS, 32:13–23, 2019.
230
+
231
+ Junhua Mao, Jonathan Huang, Alexander Toshev, Oana Camburu, Alan L Yuille, and Kevin Murphy. Generation and comprehension of unambiguous object descriptions. In Proceedings of CVPR, pp. 11–20, 2016.
232
+
233
+ Fabio Petroni, Tim Rocktaschel, Sebastian Riedel, Patrick Lewis, Anton Bakhtin, Yuxiang Wu, and ¨ Alexander Miller. Language models as knowledge bases? In Proceedings of EMNLP-IJCNLP, pp. 2463–2473, 2019.
234
+
235
+ Bryan A Plummer, Liwei Wang, Chris M Cervantes, Juan C Caicedo, Julia Hockenmaier, and Svetlana Lazebnik. Flickr30k entities: Collecting region-to-phrase correspondences for richer imageto-sentence models. In Proceedings of ICCV, pp. 2641–2649, 2015.
236
+
237
+ Guanghui Qin and Jason Eisner. Learning how to ask: Querying LMs with mixtures of soft prompts. In Proceedings of NAACL, pp. 5203–5212, 2021.
238
+
239
+ Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. arXiv preprint arXiv:2103.00020, 2021.
240
+
241
+ Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. arXiv preprint arXiv:1910.10683, 2019.
242
+
243
+ Aditya Ramesh, Mikhail Pavlov, Gabriel Goh, Scott Gray, Chelsea Voss, Alec Radford, Mark Chen, and Ilya Sutskever. Zero-shot text-to-image generation. arXiv preprint arXiv:2102.12092, 2021.
244
+
245
+ Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster R-CNN: Towards real-time object detection with region proposal networks. Proceedings of NeurIPS, 28:91–99, 2015.
246
+
247
+ Anna Rohrbach, Marcus Rohrbach, Ronghang Hu, Trevor Darrell, and Bernt Schiele. Grounding of textual phrases in images by reconstruction. In Proceedings of ECCV, pp. 817–834. Springer, 2016.
248
+
249
+ Candace Ross, Boris Katz, and Andrei Barbu. Measuring social biases in grounded vision and language embeddings. In Proceedings of NAACL, pp. 998–1008, 2021.
250
+
251
+ Arka Sadhu, Kan Chen, and Ram Nevatia. Zero-shot grounding of objects from natural language queries. In Proceedings of ICCV, pp. 4694–4703, 2019.
252
+
253
+ Timo Schick and Hinrich Schutze. It’s not just size that matters: Small language models are also ¨ few-shot learners. In Proceedings of NAACL, pp. 2339–2352. Association for Computational Linguistics, 2021a.
254
+
255
+ Timo Schick and Hinrich Schutze. Exploiting cloze-questions for few-shot text classification and ¨ natural language inference. In Proceedings of EACL, pp. 255–269, 2021b.
256
+
257
+ Jiaxin Shi, Hanwang Zhang, and Juanzi Li. Explainable and explicit visual reasoning over scene graphs. In Proceedings of CVPR, pp. 8376–8384, 2019.
258
+
259
+ Taylor Shin, Yasaman Razeghi, Robert L Logan IV, Eric Wallace, and Sameer Singh. Eliciting knowledge from language models using automatically generated prompts. In Proceedings of EMNLP, pp. 4222–4235, 2020.
260
+
261
+ Weijie Su, Xizhou Zhu, Yue Cao, Bin Li, Lewei Lu, Furu Wei, and Jifeng Dai. VL-BERT: Pretraining of generic visual-linguistic representations. In Proceedings of ICLR, 2019.
262
+
263
+ Hao Tan and Mohit Bansal. LXMERT: Learning cross-modality encoder representations from transformers. In Proceedings of EMNLP-IJCNLP, pp. 5100–5111, 2019.
264
+
265
+ Kaihua Tang, Hanwang Zhang, Baoyuan Wu, Wenhan Luo, and Wei Liu. Learning to compose dynamic tree structures for visual contexts. In Proceedings of CVPR, pp. 6619–6628, 2019.
266
+
267
+ Stefanie Tellex, Thomas Kollar, Steven Dickerson, Matthew Walter, Ashis Banerjee, Seth Teller, and Nicholas Roy. Understanding natural language commands for robotic navigation and mobile manipulation. In Proceedings of AAAI, volume 25, 2011.
268
+
269
+ Maria Tsimpoukelli, Jacob Menick, Serkan Cabi, SM Eslami, Oriol Vinyals, and Felix Hill. Multimodal few-shot learning with frozen language models. arXiv preprint arXiv:2106.13884, 2021.
270
+
271
+ Zirui Wang, Jiahui Yu, Adams Wei Yu, Zihang Dai, Yulia Tsvetkov, and Yuan Cao. SimVLM: Simple visual language model pretraining with weak supervision. arXiv preprint arXiv:2108.10904, 2021.
272
+
273
+ Danfei Xu, Yuke Zhu, Christopher B Choy, and Li Fei-Fei. Scene graph generation by iterative message passing. In Proceedings of CVPR, pp. 5410–5419, 2017.
274
+
275
+ Shaotian Yan, Chen Shen, Zhongming Jin, Jianqiang Huang, Rongxin Jiang, Yaowu Chen, and XianSheng Hua. Pcpl: Predicate-correlation perception learning for unbiased scene graph generation. In Proceedings of ACM Multimedia, pp. 265–273, 2020.
276
+
277
+ Fei Yu, Jiji Tang, Weichong Yin, Yu Sun, Hao Tian, Hua Wu, and Haifeng Wang. ERNIE-ViL: Knowledge enhanced vision-language representations through scene graphs. In Proceedings of AAAI, volume 35, pp. 3208–3216, 2021.
278
+
279
+ Licheng Yu, Patrick Poirson, Shan Yang, Alexander C Berg, and Tamara L Berg. Modeling context in referring expressions. In Proceedings of ECCV, pp. 69–85. Springer, 2016.
280
+
281
+ Licheng Yu, Zhe Lin, Xiaohui Shen, Jimei Yang, Xin Lu, Mohit Bansal, and Tamara L Berg. MAttNet: Modular attention network for referring expression comprehension. In Proceedings of CVPR, pp. 1307–1315, 2018.
282
+
283
+ Rowan Zellers, Mark Yatskar, Sam Thomson, and Yejin Choi. Neural motifs: Scene graph parsing with global context. In Proceedings of CVPR, pp. 5831–5840, 2018.
284
+
285
+ Rowan Zellers, Yonatan Bisk, Ali Farhadi, and Yejin Choi. From recognition to cognition: Visual commonsense reasoning. In Proceedings of CVPR, pp. 6720–6731, 2019.
286
+
287
+ Hanwang Zhang, Yulei Niu, and Shih-Fu Chang. Grounding referring expressions in images by variational context. In Proceedings of CVPR, pp. 4158–4166, 2018.
288
+
289
+ Pengchuan Zhang, Xiujun Li, Xiaowei Hu, Jianwei Yang, Lei Zhang, Lijuan Wang, Yejin Choi, and Jianfeng Gao. VinVL: Revisiting visual representations in vision-language models. In Proceedings of CVPR, pp. 5579–5588, 2021.
290
+
291
+ Bo Zhao, Jiashi Feng, Xiao Wu, and Shuicheng Yan. A survey on deep learning-based fine-grained object classification and semantic segmentation. IJAC, 14(2):119–135, 2017.
292
+
293
+ Tony Z Zhao, Eric Wallace, Shi Feng, Dan Klein, and Sameer Singh. Calibrate before use: Improving few-shot performance of language models. In Proceedings of the ICML, 2021.
294
+
295
+ Kaiyang Zhou, Jingkang Yang, Chen Change Loy, and Ziwei Liu. Learning to prompt for visionlanguage models. arXiv preprint arXiv:2109.01134, 2021.
296
+
297
+ # A SUPPLEMENTARY EXPERIMENTS
298
+
299
+ # A.1 RESULTS OF LARGE SIZE VL-PTMS
300
+
301
+ In this section, we report the experimental results of large size VL-PTMs, including vanilla finetuning of baseline VL-PTMs, CPT-Blk and CPT-Seg with large size backbone (i.e., $1 , 0 2 4$ dimensional hidden representations and 24 layers). From the experimental results in Table 4, we observe that compared with vanilla fine-tuning, CPT achieves significantly better and more stable performance in zero-shot and few-shot settings, and comparable results in the fully supervised settings, which is consistent with the conclusions of main experiments in Section 4.2. In summary, the results show that CPT can generalize to VL-PTMs of different sizes.
302
+
303
+ Table 4: Results of large size VL-PTMs. Accuracies $( \% )$ of grounding referring expressions in zeroshot, few-shot and fully supervised settings. We report mean and standard deviation performance over 5 random splits. ZS: zero-shot. Blk: colored block, Seg: colored segmentation mask.
304
+
305
+ <table><tr><td rowspan="2"></td><td rowspan="2">Shot</td><td rowspan="2">Model</td><td colspan="3">RefCOCO</td><td colspan="3">RefCOCO+</td><td colspan="2">RefCOCOg</td></tr><tr><td>val</td><td>testA</td><td>testB</td><td>val</td><td>testA</td><td>testB</td><td>val</td><td>test</td></tr><tr><td>sS</td><td>0</td><td>Random CPT-Blk CPT-Seg</td><td>15.9 ± 0.2 25.7 29.5</td><td>19.4± 0.6 25.4 30.6</td><td>13.4± 0.4 27.0 28.7</td><td>16.1± 0.1 25.9 28.8</td><td>13.3±0.6 25.8 30.3</td><td>20.0±0.2 25.7 27.4</td><td>18.8± 0.4 32.9 34.6</td><td>19.2 ± 0.3 32.6 34.8</td></tr><tr><td></td><td>1</td><td>Fine-tuning CPT-Blk CPT-Seg</td><td>18.5± 3.4 36.4± 3.5 39.3 ± 4.2</td><td>13.7 ± 4.8 39.1± 4.3 43.2 ± 5.6</td><td>25.0±3.7 34.3± 2.7 35.5± 2.4</td><td>23.0±6.5 34.4±3.8 35.9 ± 3.8</td><td>22.8±8.2 38.7±5.4 41.0 ± 5.0</td><td>23.6 ± 4.5 31.2 ± 2.5 31.2 ±2.8</td><td>30.6±7.3 38.7± 4.8 40.9 ± 6.0</td><td>31.5 ± 7.4 38.7± 4.6 41.0 ± 6.1</td></tr><tr><td></td><td>2</td><td>Fine-tuning CPT-Blk CPT-Seg</td><td>23.4±3.5 38.3±2.9 41.4 ± 1.5 27.8±4.8</td><td>21.1 ± 5.2 40.5 ± 4.2 45.8 ± 3.6</td><td>26.7 ± 4.5 35.3 ± 1.2 36.6 ± 2.0</td><td>28.3±2.3 36.2 ± 5.5 38.7 ± 3.8</td><td>30.1± 5.3 41.1 ± 7.6 44.7 ± 5.2</td><td>26.4±2.8 31.9 ±3.3 33.5 ± 2.6</td><td>33.1±8.3 40.6±5.9 43.2 ± 5.9</td><td>33.4±8.2 41.3 ± 6.1 43.4 ± 5.8</td></tr><tr><td>Paretr</td><td>4</td><td>Fine-tuning CPT-Blk CPT-Seg</td><td>40.9 ± 1.8 41.3 ± 5.2</td><td>26.0± 7.8 45.0± 2.0 45.9 ± 7.1</td><td>30.1 ± 3.4 36.6 ± 1.6 36.5 ± 3.7</td><td>33.4±3.5 37.2±3.6 39.8 ± 3.8</td><td>36.8±5.1 42.4± 5.4 45.7 ± 5.7</td><td>28.3±2.1 33.6± 2.3 34.1 ± 1.8</td><td>36.9 ±8.9 42.2±6.5 45.7 ± 7.3</td><td>37.2± 8.7 42.7±6.9</td></tr><tr><td rowspan="2"></td><td rowspan="2">8</td><td rowspan="2">Fine-tuning CPT-Blk CPT-Seg</td><td>33.3±4.2</td><td>35.6 ± 7.4</td><td>31.2 ± 2.7</td><td>38.1±3.7</td><td>43.5±3.9</td><td>31.2±3.8</td><td>41.9 ± 8.0</td><td>45.8 ± 7.6 42.5 ± 7.9</td></tr><tr><td>42.7 ± 4.1 45.2 ± 3.6</td><td>48.4± 5.7 51.4 ± 4.9</td><td>37.3± 2.4 38.7 ± 2.4</td><td>39.9 ± 2.2 42.4 ± 3.8</td><td>45.8 ±3.0 49.0 ± 4.9</td><td>34.6 ± 2.1 35.7 ± 1.8</td><td>44.8 ± 4.1 48.1 ± 5.4</td><td>45.5± 4.6</td></tr><tr><td rowspan="5">Pnrarssrans</td><td rowspan="2">16</td><td>Fine-tuning</td><td>38.4± 2.4</td><td>42.8±4.2</td><td>33.4±2.5</td><td>40.7±3.2</td><td>45.6±3.5</td><td>34.7± 2.8</td><td>48.7±3.5</td><td>48.6 ± 5.8 49.4± 3.5</td></tr><tr><td>CPT-Blk</td><td>45.7± 2.5</td><td>53.0±3.2</td><td>37.9 ± 1.5</td><td>41.8 ± 2.0</td><td>48.8±2.6</td><td>35.7 ± 1.4</td><td>47.7 ± 2.4</td><td>48.6± 2.8</td></tr><tr><td rowspan="9"></td><td rowspan="9">CPT-Seg MAttNet</td><td></td><td>55.9 ± 3.5</td><td>40.3±2.0</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td>48.6 ± 3.1</td><td></td><td>43.8±2.0</td><td>50.9± 2.5</td><td>36.5 ± 1.3</td><td>50.8±3.6</td><td>51.6 ± 3.7</td></tr><tr><td>76.7</td><td>81.1</td><td>70.0</td><td>65.3</td><td>71.6</td><td>52.0</td><td>66.6</td><td>67.3</td></tr><tr><td>ViLBERT VLBERT</td><td>1</td><td>-</td><td>1</td><td>72.3</td><td>78.5</td><td>62.6</td><td>-</td></tr><tr><td>ERNIE-ViL |Dtrain]</td><td>1</td><td>-</td><td>-</td><td>72.6</td><td>78.6</td><td>62.3 66.9</td><td>1</td></tr><tr><td>UNITER</td><td>1</td><td>-</td><td>1</td><td>76.0</td><td>82.1</td><td>1 74.9</td><td>=</td></tr><tr><td>Fine-tuning</td><td>81.4</td><td>87.0</td><td>74.2</td><td>75.9</td><td>81.5</td><td>66.7</td><td>75.8</td></tr><tr><td>CPT-Blk</td><td>81.8</td><td>87.5</td><td>73.7 74.3</td><td>74.8 73.6</td><td>81.0 80.1</td><td>64.1 64.1</td><td>74.7 75.8 75.2</td></tr><tr><td>CPT-Seg</td><td>81.5 81.8</td><td>87.0 87.3</td><td>74.1</td><td>74.1</td><td>79.5</td><td>63.8</td><td>74.1 73.6</td></tr></table>
306
+
307
+ # A.2 EFFECT OF COLOR TRANSPARENCY
308
+
309
+ In practice, the color transparency is a crucial hyperparameter in CPT. Essentially, the choice of transparency is a trade-off between two factors: a small transparency can establish strong connections between color texts and visual appearances, but will undermine the visibility of the raw image region contents, and vice versa. To investigate the effect of color transparency, we evaluate CPT with different transparency of the default color (i.e., (240, 0, 30), red), with step size 0.1 in grid search. From the results in Figure 5, we observe that: (1) The performance peaks at moderate transparencies in different shot-settings, which is consistent with our analysis of the trade-off. (2) Interestingly, the optimal transparency increases as the number of training shots grows. The reason is that the bottleneck of visual grounding in low shot settings is to learn to utilize obvious colors in CPT to establish coarse-grained connections between images and text. In comparison, in many shot settings, with a better mastery of colors, fine-grained reading and understanding of image regions become more important to handle hard instances that require complex reasoning (e.g., composition of attributes and relations).
310
+
311
+ ![](images/1b06656849c0a2977287a873c254a28a0608ba06ffcdb6b6b136585e369e9b9a.jpg)
312
+ Figure 5: Experimental results with different color transparencies.
313
+
314
+ ![](images/f8764c4fe7f50af2d1ce9752342244a7a92e35d41941f8b4c90d8125b7f88431.jpg)
315
+ Figure 7: Visualization of grounding results. First row: zero-shot setting. Second row: fully supervised setting. FT: fine-tuning. The bounding boxes given by image region proposals (olive), ground-truth annotation (pink), CPT (green), and fine-tuning baseline (yellow) are highlighted accordingly. Some images are cropped for better visual effects.
316
+
317
+ # A.3 ANALYSIS OF VISUAL SUB-PROMPT SHAPE
318
+
319
+ In the main experimental results in Table 1, we note that although CPT-Seg significantly outperforms CPT-Blk in the zero-shot and few-shot settings, it slightly underperforms CPT-Blk in the fully supervised setting. To investigate the reason, we divide target objects in the validation set of RefCOCOg into disjoint bins according to the area of the bounding boxes, where each bin contains equal numbers of target objects (thus contributes equally to the overall result), and report the average performance of each bin in the fully supervised setting. From the results in Figure 6, we find that CPT-Seg outperforms CPTBlk on large objects, but is inferior in grounding small objects. We hypothesize the reason is that CPT-Seg changes the object outlines with imperfect colored segmentation masks, hindering the understanding and reasoning of objects to some extent. The problem is exacerbated in small objects, since compared with large objects, the segmentation error of small objects is essentially enlarged when the object feature maps are pooled into input features of the same size for Transformers.
320
+
321
+ ![](images/deec7c1b4877699d4d3a7a0fda01858a7a203b37c461f8883a433ddc70f75957.jpg)
322
+ Figure 6: Performance of CPT-Blk and CPT-Seg with base size in different box areas in the fully supervised setting.
323
+
324
+ # A.4 VISUALIZATION
325
+
326
+ The few-shot grounding results are visualized in Figure 4. In this section, we further visualize the grounding results in zero-shot and fully supervised settings, as shown in Figure 7. We find that
327
+
328
+ CPT can make reasonable zero-shot predictions. Moreover, we observe that the color disturbance problem is largely alleviated in the fully supervised setting, i.e., CPT is less disturbed by colors in raw image and text, as shown in Figure 7d. The reason is that a capable VL-PTM can learn to largely distinguish the colors of varying objects and pre-defined maker blocks.
329
+
330
+ # B PSEUDO-CODE OF CROSS-MODAL PROMPT SEARCH
331
+
332
+ Here we provide the pseudo-code of cross-modal prompt search. The algorithm aims to jointly consider visual and textual semantics in real-world cross-modal data to search for the color set $\mathcal { C }$ in CPT. The algorithm is simple in its design, and we leave exploring more advanced cross-modal prompt search methods for future work.
333
+
334
+ <table><tr><td>Algorithm1 Cross-modal Prompt Search</td></tr><tr><td>Require: P(·,·): VL-PTM with image regions R and query text q as input</td></tr><tr><td>Require: Cw: candidate color text set Require:Cy: candidate color RGB set</td></tr><tr><td>1: for c, in Cu do 2: R= {a pure color block ofc}</td></tr><tr><td>3: q=“[CLS] aphoto of[MASK] color[SEP]”</td></tr><tr><td>4: for c in Cw do 5: s(c,cw)=P([MASK]=Cu|R,q) 6: end for</td></tr></table>
335
+
336
+ # C IMPLEMENTATION DETAILS
337
+
338
+ In this section, we provide the implementation details about model training and inference, object detection and segmentation, as well as cross-modal prompt search.
339
+
340
+ Backbone. We adopt the widely used VinVL (Zhang et al., 2021) as the backbone, which achieves strong performance on many vision-language tasks. We use the $\mathrm { V i n V L _ { b a s e } }$ model in the main experiments, with 768 dimensional hidden representations and 12 encoding layers.
341
+
342
+ Object Detection and Segmentation. During training and inference, we use the region proposals predicted by the Faster-RCNN (Ren et al., 2015) and object segmentation masks predicted by the Mask-RCNN (He et al., 2017), which are provided by MAttNet (Yu et al., 2018). Both Faster-RCNN and Mask-RCNN are based on ResNet101 (He et al., 2016) with a region proposal network and a fully connected classifier for object detection. For Mask-RCNN, an additional mask branch is added to conduct multi-task learning. The Faster-RCNN and Mask-RCNN provided by MAttNet (Yu et al., 2018) achieve 34.1 and 30.7 average precision on the COCO test set respectively.
343
+
344
+ Visual Grounding. During training, an image region is considered as the target if its intersectionover-union (IoU) with the ground-truth region is greater than 0.5. During inference, we select the target region with the largest decoding score. All the hyperparameters and models are selected by grid search based on the performance on the few-shot/full validation set. The learning rate is 6e−5, and decreases linearly towards 0, which will be achieved at the end of the training (500 and 20, 000 steps for few-shot and fully supervised training respectively). The batch size is 32 and identical to shot size in fully supervised and few-shot settings respectively. The size of image region batch is 1.
345
+
346
+ Predicate Classification. The hyperparameters and models are selected by grid search on the validation set. The learning rate is 3e-5, and decreases linearly towards 0, which will be achieved at the end of the training (200 steps). The batch size is identical to shot size.
347
+
348
+ Table 5: Relations in Visual Genome dataset (Krishna et al., 2017). Some relations are renamed (shown in parentheses) to better fit the query template.
349
+
350
+ <table><tr><td>at</td><td>in</td><td>to</td><td>on</td><td>of</td><td>and</td><td>for</td><td>has (having)</td></tr><tr><td>says (saying)</td><td>over</td><td>from</td><td>with</td><td>near</td><td>wears (wearing)</td><td>under</td><td>above</td></tr><tr><td>using</td><td>along</td><td>behind</td><td>riding</td><td>across</td><td>eating</td><td>holding</td><td>wearing</td></tr><tr><td>between</td><td>against</td><td>playing</td><td>watching</td><td>carrying</td><td>covering</td><td>made of</td><td>part of</td></tr><tr><td>lying on</td><td>parked on</td><td>flying in</td><td>laying on</td><td>growing on</td><td>looking at</td><td>walking on</td><td>walking in</td></tr><tr><td>sitting on in front of</td><td>covered in on back of</td><td>mounted on</td><td>painted on</td><td>standing on</td><td>attached to</td><td>belonging to</td><td>hanging from</td></tr></table>
351
+
352
+ Cross-modal Prompt Search. The color text candidate set $\hat { \mathcal { C } } _ { w }$ is obtained from Wikipedia at en.wikipedia.org/wiki/Lists_of_colors. The color appearance candidate set $\hat { \mathcal { C } } _ { v }$ is obtained by grid searching RGB candidates around the standard RGBs of color texts in $\hat { \mathcal { C } } _ { w }$ . In grid searching RGB candidates, the range is $\pm 3 0$ around standard RGBs with step size 5 in each channel. Colors candidates are discarded if the decoding score is less than 0.8. The specific color choice from $\mathcal { C }$ is determined based on the performance on the few-shot/full validation set. The optimal color used in our experiments are $c = ( ( 2 4 0 , 0 , 3 0 ) , r e d )$ with transparency value 0.5 in zero-shot and few-shot settings, and $c = ( ( 2 5 5 , 1 7 0 , 2 3 0 ) , p i n k )$ with transparency value 0.45 in the fully supervised setting.
353
+
354
+ # D EXPERIMENT DETAILS
355
+
356
+ # D.1 BASELINE DETAILS
357
+
358
+ We provide baseline details for visual grounding. (1) Vanilla fine-tuning for VinVL (Zhang et al., 2021). This model adopts the same backbone as CPT, and serves as the most direct baseline in fewshot and fully supervised experiments. Following Chen et al. (2020), the logits for all regions are fed into a softmax layer, and the score of the target region is optimized using cross-entropy objective. (2) Vanilla fine-tuning for other VL-PTMs. For fully supervised experiments, we also report previous results of fine-tuning other VL-PTMs, including ViLBERT (Lu et al., 2019), VLBERT (Su et al., 2019), UNITER (Chen et al., 2020), ERNIE-ViL (Yu et al., 2021) and VL-T5 (Cho et al., 2021). (3) Visual grounding model. MAttNet (Yu et al., 2018) is a strong model tailored for visual grounding, and is compared in fully supervised setting. (4) Random baseline. For zero-shot experiments, we compare with a random baseline that randomly guesses the target region. For fair comparisons, we use the object proposals detected by MAttNet (Yu et al., 2018) for all baselines and CPT-Blk.
359
+
360
+ # D.2 DATASET DETAILS
361
+
362
+ Visual Grounding Datasets. (1) RefCOCO (Yu et al., 2016) is collected through a two-player referential game (Kazemzadeh et al., 2014), and contains 142,210 referential expressions for 50,000 object instances in 19,994 images. The dataset is split into train, validation, testA and testB sets, with 120,624, 10,834, 5,657 and 5,095 expression-object pairs respectively. TestA set only contains people as target objects, while testB set contains all other types of objects as targets. (2) RefCOCO $^ +$ (Yu et al., 2016) is also collected in an interactive way, and contains 141,564 referential expressions for 49,856 object instances in 19,992 images. The difference from RefCOCO is that RefCOCO $^ +$ focuses on distinguishing objects using appearance-based expressions, and excludes location-based expressions. The dataset is split into train, validation, testA and testB sets, with 120,191, 10,758, 5,726 and 4,889 expression-object pairs respectively. (3) RefCOCOg (Mao et al., 2016) is collected in a non-interactive way, and contains 95,010 referential expressions for 49,822 object instances in 25,799 images. The referential expressions in RefCOCOg are typically longer and more complex. The train, validation and test sets contain 80,512, 4,896 and 9,602 expression-object pairs.
363
+
364
+ Predicate Classification Datasets. We provide the relations of Visual Genome dataset in Table 5. The dataset contains 65, 651, 5, 000 and 32, 422 images in training, validation and test set respectively, where each image contains an average of 10.3 objects and 4.8 labeled relation instances. There are 150 distinct object categories and 50 relation categories in the dataset.
365
+
366
+ # E DISCUSSION AND OUTLOOK
367
+
368
+ In this section, we discuss the limitations of CPT and promising directions for future research.
369
+
370
+ Limitations. Despite its promising performance on visual grounding, we note that there are several limitations in CPT: (1) Color disturbance. CPT takes advantage of colors to bridge visual and textual semantics, by adding color-based sub-prompts in both images and text. As shown in Section 4.4, the color-based prompt can be disturbed by colors in raw images and text. (2) Computation efficiency. In our experiments, to maximally avoid color disturbance and account for the limited number of color candidates, we adopt small image region batch sizes. This means that a data instance needs to be fed into the model multiple times in order to obtain the result. We believe addressing these challenges are promising directions for improving CPT.
371
+
372
+ Outlook. In this work, we take visual grounding as a representative example to demonstrate the effectiveness of CPT. In fact, CPT can be easily adapted to other vision-language tasks. Here we discuss the promising directions, as illustrated in Figure 8. The visual and textual sub-prompts in CPT can well capture fine-grained object-level semantics for object-level tasks, such as: (1) Object classification. By coloring object proposals with visual sub-prompt, VL-PTMs can be prompted to produce object labels for object classification. (2) Scene graph classification. Moreover, by further decomposing textual sub-prompts, complex tasks involving different sub-tasks can be solved in a unified cross-modal prompt tuning framework. For example, VL-PTMs can be prompted to jointly produce object and predicate labels for challenging scene graph classification. In addition to data efficiency, a crucial advantage of using CPT is that the object/predicate labels can be produced from open-world vocabularies, instead of fixed label sets.
373
+
374
+ ![](images/bc891fe18e9936ad2a1d1bf0a54d0cbac4772e537ca0111143d607880d8b3695.jpg)
375
+ Figure 8: Outlook for adapting cross-modal prompt tuning (CPT) to other tasks.
parse/dev/TCl7CbQ29hH/TCl7CbQ29hH_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/TCl7CbQ29hH/TCl7CbQ29hH_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/XrGEkCOREX2/XrGEkCOREX2.md ADDED
@@ -0,0 +1,250 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # MEMO: Test Time Robustness via Adaptation and Augmentation
2
+
3
+ Marvin Zhang1, Sergey Levine1, Chelsea Finn2 1UC Berkeley 2Stanford University
4
+
5
+ # Abstract
6
+
7
+ While deep neural networks can attain good accuracy on in-distribution test points, many applications require robustness even in the face of unexpected perturbations in the input, changes in the domain, or other sources of distribution shift. We study the problem of test time robustification, i.e., using the test input to improve model robustness. Recent prior works have proposed methods for test time adaptation, however, they each introduce additional assumptions, such as access to multiple test points, that prevent widespread adoption. In this work, we aim to study and devise methods that make no assumptions about the model training process and are broadly applicable at test time. We propose a simple approach that can be used in any test setting where the model is probabilistic and adaptable: when presented with a test example, perform different data augmentations on the data point, and then adapt (all of) the model parameters by minimizing the entropy of the model’s average, or marginal, output distribution across the augmentations. Intuitively, this objective encourages the model to make the same prediction across different augmentations, thus enforcing the invariances encoded in these augmentations, while also maintaining confidence in its predictions. In our experiments, we evaluate two baseline ResNet models, two robust ResNet-50 models, and a robust vision transformer model, and we demonstrate that this approach achieves accuracy gains of $1 \%$ over standard model evaluation and also generally outperforms prior augmentation and adaptation strategies. For the setting in which only one test point is available, we achieve state-of-the-art results on the ImageNet-C, ImageNet-R, and, among ResNet-50 models, ImageNet-A distribution shift benchmarks.
8
+
9
+ # 1 Introduction
10
+
11
+ Deep neural network models have achieved excellent performance on many machine learning problems, such as image classification, but are often brittle and susceptible to issues stemming from distribution shift. For example, deep image classifiers may degrade precipitously in accuracy when encountering input perturbations, such as noise or changes in lighting $[ \hat { \left| 1 2 \right| } ]$ or domain shifts which occur naturally in real world applications $\mathbb { \left| \mathbb { Z } \right\| }$ . Therefore, robustification of deep models against these test shifts is an important and active area of study.
12
+
13
+ Most prior works in this area have focused on techniques for training time robustification, including utilizing larger models and datasets $\pmb { \mathbb { B 4 } }$ , various forms of adversarial training $\mathbb { B 9 } \mathbb { H 8 }$ , and aggressive data augmentation [51, 13, 24, 14]. Employing these techniques requires modifying the training process, which may not be feasible if, e.g., it involves heavy computation or non public data. Furthermore, these techniques do not rely on any information about the test points that the model must predict on, even though these test points may provide significant information for improving model robustness. Recently, several works have proposed methods for improving accuracy via adaptation after seeing the test data, typically by updating a subset of the model’s weights [44, 45, 18], normalization statistics [40], or both [46, 52]. Though effective at handling test shifts, these methods sometimes still require specialized training procedures, and they typically rely on extracting information via batches or even entire sets of test inputs, thus introducing additional assumptions.
14
+
15
+ ![](images/695fdc8d76523d7ae12f1252c94b960f4f9aeeee940045c10e43759d62a658f6.jpg)
16
+ Figure 1: Left: at test time, as detailed in $\mathsf { \overline { { S e c t i o n 3 } } } ,$ we have a single test input $\mathbf { x }$ , a set of data augmentation functions $\{ a _ { 1 } , \dotsc , a _ { M } \}$ , and a trained model that outputs a probabilistic predictive distribution and has adaptable parameters $\theta$ . We perform different augmentations on $\mathbf { x }$ and pass these augmented inputs to the model in order to estimate the marginal output distribution averaged over augmentations. Right: we perform a gradient update on the model to minimize the entropy of this marginal distribution, thus encouraging the model predictions to be invariant across different augmentations while maintaining confident predictions. The final prediction is then made on the original data point, i.e., the predictive distribution in the top right of the schematic.
17
+
18
+ In this work, we focus on methods for test time robustness, in which the specific test input may be leveraged in order to improve the model’s prediction on that point. We are interested in studying and devising methods for improving model robustness that are “plug and play”, i.e., they can be readily used with a wide variety of pretrained models and test settings. We also want methods that synergize with other robustification techniques, in order to achieve greater performance than using either in isolation. With these goals in mind, we devise a novel test time robustness method based on adaptation and augmentation. As illustrated in $\mathbb { F i g u r e 1 } ,$ when presented with a test point, we adapt the model by augmenting the test point in different ways while encouraging the model to make consistent predictions, thus respecting the invariances encoded in the data augmentations. We further encourage the model to make confident predictions, thus arriving at the proposed method: minimize the marginal entropy of the model’s predictions across the augmented versions of the test point.
19
+
20
+ We refer to the proposed method as marginal entropy minimization with one test point (MEMO), and this is the primary contribution of our work. MEMO makes direct use of pretrained models without any assumptions about their particular training procedure or architecture, while requiring only a single test input for adaptation. In Section 4, we demonstrate empirically that MEMO consistently improves the performance of ResNet [11] and vision transformer $\mathbb { \overline { { | \overline { { \mathbb { Z } } | } } } }$ models on several challenging ImageNet distribution shift benchmarks, achieving several new state-of-the-art results for these models in the setting in which only one test point is available. MEMO consistently outperforms non adaptive marginal distribution predictions (between $1 - 1 0 \%$ improvement) on the ImageNet-C [12] and ImageNet-R [14] test sets, indicating that adaptation plays a crucial role in improving predictive accuracy. MEMO encourages both invariance across augmentations and confident predictions, and an ablation study in Section 4 shows that both components are important for maximal performance gains. Also, MEMO is, to the best of our knowledge, the first adaptation method to improve performance (by $1 \%$ over standard model evaluation) on the ImageNet-A test set $\mathbb { \lVert 1 5 \rVert }$ .
21
+
22
+ # 2 Related work
23
+
24
+ Distribution shift has been studied under a number of frameworks $\pmb { \mathbb { B } } 6 \|$ , including domain adaptation [41, 6, 47], domain generalization [5, 32, 9], and distributionally robust optimization [4, 16, 39]. These frameworks typically leverage additional training or test assumptions in order to make the distribution shift problem more tractable. Largely separate from these frameworks, various empirical methods have also been proposed for dealing with shift, such as increasing the model and training dataset size or using heavy training augmentations [34, 51, 14]. The focus of this work is complementary to these efforts: MEMO is applicable to a wide range of pretrained models, including those trained via robustness methods, and can achieve further performance gains via test time adaptation.
25
+
26
+ Prior test time adaptation methods generally either make significant training or test time assumptions. Some methods update the model using batches or even entire datasets of test inputs, such as by computing batch normalization (BN) statistics on the test set [25, 19, 33, 40], computing class prototypes $\mathbb { \lVert \rVert }$ , or minimizing the (conditional) entropy of model predictions across a batch of test data $\lVert \overline { { 4 6 } } \rVert$ . The latter approach is closely related to MEMO. The differences are that MEMO minimizes marginal entropy using single test points and data augmentation and adapts all of the model parameters rather than just those associated with normalization layers, thus not requiring multiple test points or specific model architectures. Other test time adaptation methods can be applied to single test points but require specific training procedures or models [44, 17, 40, 1, 3]. Test time training (TTT) $\underline { { \lVert \varPsi \ 4 \rVert } }$ requires a specialized model with a rotation prediction head and a different procedure for training this model. Schneider et al. [40] show that BN adaptation can be effective even with only one test point. As we discuss in Section 3, MEMO synergizes well with this technique of “single point” BN adaptation. Mao et al. [29] propose a test time adaptation method based on input perturbations for robustness to adversarial attacks. Concurrently with our work, Sivaprasad and Fleuret $\mathbb { \lVert \rVert 3 \rVert }$ propose a similar method for test time adaptation by encouraging invariance to data augmentations, and they test their method on the corrupted CIFAR and VisDA [35] datasets.
27
+
28
+ A number of works have noted that varying forms of strong data augmentation on the training set can improve the resulting model’s robustness [51, 13, 24, 14]. Data augmentations are also sometimes used on the test data directly by averaging the model’s outputs across augmented copies of the test point $\mathbb { \left| \overline { { 2 3 } } \right| \overline { { \sharp 2 } } }$ , i.e., predicting according to the model’s marginal output distribution. When using cropping as the augmentation, this technique is often referred to as multicrop evaluation $\pmb { \mathbb { Z } } 2 \mathbf { l }$ . We instead use the term test time augmentation (TTA), as we use additional augmentations beyond cropping $\mathbb { \lVert \lambda \rVert }$ . TTA has been shown to be useful both for improving model accuracy and calibration $\pmb { \left. 2 \right. }$ as well as handling distribution shift [31]. We take this idea one step further by explicitly adapting the model such that its marginal output distribution has low entropy. This extracts an additional learning signal for improving the model, and furthermore, the adapted model can then make its final prediction on the clean test point rather than the augmented copies. We empirically show in Section 4 that these differences lead to improved performance over this non adaptive TTA baseline.
29
+
30
+ # 3 Augmenting and Adapting at Test Time
31
+
32
+ Data augmentations are typically used to train the model to respect certain invariances – e.g., changes in lighting or viewpoint do not change the underlying class label – but, especially when faced with distribution shift, the model is not guaranteed to obey the same invariances at test time. In this section, we introduce MEMO, a method for test time robustness that adapts the model such that it respects these invariances on the test input. We use “test time robustness” specifically to refer to techniques that operate directly on pretrained models and single test inputs – single point BN adaptation and TTA, as described in $\overline { { \mathsf { S e c t i o n 2 } } }$ are examples of prior test time robustness methods.
33
+
34
+ In the test time robustness setting, we are given a trained model $f _ { \theta }$ with parameters $\theta \in \Theta$ . We do not require any special training procedure and do not make any assumptions about the model, except that $\theta$ is adaptable and that $f _ { \theta }$ produces a conditional output distribution $p _ { \boldsymbol { \theta } } ( y | \mathbf { x } )$ that is differentiable with respect to $\theta . ^ { 1 }$ All standard deep neural network models satisfy these assumptions. A single point $\mathbf { x } \in \mathcal { X }$ is presented to $f _ { \theta }$ , for which it must predict a label $\hat { y } \in \mathcal { V }$ immediately. Note that this is precisely identical to the standard test time inference procedure for regular supervised learning models – in effect, we are simply modifying how inference is done, without any additional assumptions on the training process or on test time data availability. This makes test time robustness methods a simple “slot-in” replacement for the ubiquitous and standard test time inference process. We assume sampling access to a set of augmentation functions $\mathcal { A } \triangleq \{ a _ { 1 } , \ldots , a _ { M } \}$ that can be applied to the test point $\mathbf { x }$ . We use these augmentations and the self-supervised objective detailed below to adapt the model before it predicts on $\mathbf { x }$ . When given a set of test inputs, the model adapts and predicts on each test point independently. We do not assume access to any ground truth labels.
35
+
36
+ Require: trained model $f _ { \theta }$ , test point $\mathbf { x }$ , number of augmentations $B$ , learning rate $\eta$ , update rule $G$
37
+ 1: Sample $a _ { 1 } , \dots , a _ { B } \overset { \mathrm { i . i . d . } } { \sim } \mathcal { U } ( A )$ and produce augmented points $\tilde { \mathbf { x } } _ { i } = a _ { i } ( \mathbf { x } )$ for $i \in \{ 1 , \ldots , B \}$
38
+ 2: Compute estimate $\begin{array} { r } { \tilde { p } = \frac { 1 } { B } \sum _ { i = 1 } ^ { B } p _ { \theta } ( y | \tilde { \mathbf { x } } _ { i } ) \approx \bar { p } _ { \theta } ( y | \mathbf { x } ) } \end{array}$ and $\tilde { \ell } = H ( \tilde { p } ) \approx \ell ( \theta ; { \mathbf x } )$ , i.e., Eq. 2
39
+ 3: Adapt parameters via update rule $\theta ^ { \prime } G ( \theta , \eta , \tilde { \ell } )$
40
+ 4: Predict $\hat { y } \triangleq \arg \operatorname* { m a x } _ { y } p _ { \theta ^ { \prime } } ( y | \mathbf { x } )$
41
+
42
+ # 3.1 Marginal Entropy Minimization with One test point
43
+
44
+ Given a test point $\mathbf { x }$ and set of augmentation functions $\mathcal { A }$ , we sample $B$ augmentations from $\mathcal { A }$ and apply them to $\mathbf { x }$ in order to produce a batch of augmented data $\tilde { \mathbf { x } } _ { 1 } , \ldots , \tilde { \mathbf { x } } _ { B }$ . The model’s average, or marginal, output distribution with respect to the augmented points is given by
45
+
46
+ $$
47
+ \bar { p } _ { \theta } ( y | \mathbf { x } ) \triangleq \mathbb { E } _ { \mathcal { U } ( \mathcal { A } ) } \left[ p _ { \theta } ( y | a ( \mathbf { x } ) ) \right] \approx \frac { 1 } { B } \sum _ { i = 1 } ^ { B } p _ { \theta } ( y | \tilde { \mathbf { x } } _ { i } ) ,
48
+ $$
49
+
50
+ where the expectation is with respect to uniformly sampled augmentations $a \sim \mathcal { U } ( A )$ .
51
+
52
+ What properties do we desire from this marginal distribution? To answer this question, consider the role that data augmentation typically serves during training. For each training point $\left( { \bf x } ^ { \mathrm { t r a i n } } , y ^ { \mathrm { t r a i n } } \right)$ , the model $f _ { \theta }$ is trained using multiple augmented forms of the input $\tilde { \mathbf { x } } _ { 1 } ^ { \mathrm { t r a i n } } , \ldots , \tilde { \mathbf { x } } _ { E } ^ { \mathrm { t r a i n } }$ . $f$ is trained to obey the invariances between the augmentations and the label – no matter the augmentation on $\mathbf { x } ^ { \mathrm { t r a i n } }$ , $f$ should predict, with confidence, the same label $y ^ { \mathrm { t r a i n } }$ . We seek to devise a similar learning signal during test time, without any ground truth labels. That is, after adapting:
53
+
54
+ (1) the model $f _ { \theta }$ predictions should be invariant across augmented versions of the test point, and (2) the model $f _ { \theta }$ should be confident in its predictions, even for heavily augmented versions of the test point, since all versions have the same underlying label.
55
+
56
+ Optimizing the model for more confident predictions can be justified from the assumption that the true underlying decision boundaries between classes lie in low density regions of the data space $\textcircled { 8 }$ . With these two goals in mind, we propose to adapt the model using the entropy of its marginal output distribution over augmentations $\underline { { \operatorname { d } \dot { \operatorname { E q . } } \dot { 1 } ) } }$ , i.e.,
57
+
58
+ $$
59
+ \ell ( \theta ; \mathbf { x } ) \triangleq H \left( \bar { p } _ { \theta } ( \cdot | \mathbf { x } ) \right) = - \sum _ { y \in \mathcal { Y } } \bar { p } _ { \theta } ( y | \mathbf { x } ) \log \bar { p } _ { \theta } ( y | \mathbf { x } ) .
60
+ $$
61
+
62
+ Note that this objective is not the same as optimizing the average conditional entropy of the model’s predictive distributions across augmentations, i.e.,
63
+
64
+ $$
65
+ \ell _ { \mathrm { { C E } } } ( \boldsymbol { \theta } ; \mathbf { x } ) \triangleq \frac { 1 } { B } \sum _ { i = 1 } ^ { B } H ( p _ { \boldsymbol { \theta } } ( \cdot | \widetilde { \mathbf { x } } _ { i } ) ) .
66
+ $$
67
+
68
+ A model which predicts confidently but differently across augmentations would minimize $\operatorname { E q . 3 }$ but not $\boxed { \mathrm { E q . ~ } 2 }$ Optimizing $\operatorname { E q } . 2$ encourages both confidence and invariance, since the entropy of $\bar { p } _ { \theta } ( \cdot | \mathbf { x } )$ is minimized when the model outputs the same (confident) prediction regardless of the augmentation.
69
+
70
+ Algorithm 1 presents the overall method MEMO for test time adaptation. Though prior test time adaptation methods must carefully choose which parameters to adapt in order to avoid degenerate solutions $\lVert \overline { { 4 6 } } \rVert$ , our adaptation procedure simply adapts all of the model’s parameters $\theta$ (line 3). Given that $p _ { \boldsymbol { \theta } } ( \boldsymbol { y } | \mathbf { x } )$ is differentiable with respect to $\theta$ , we can directly use gradient based optimization to adapt $\theta$ according to $\mathbb { E } { \mathsf { q } } . 2 \mathbb { Z }$ We use only one gradient step per test point, because empirically we found this to be sufficient for improved performance while being more computationally efficient. After this step, we use the adapted model $f _ { \theta ^ { \prime } }$ to predict on the original test input $\mathbf { x }$ (line 4).
71
+
72
+ # 3.2 Composing MEMO with Prior Methods
73
+
74
+ An additional benefit of MEMO is that it synergizes with other approaches for handling distribution shift. In particular, MEMO can be composed with prior methods for training robust models and adapting model statistics, thus leveraging the performance improvements of each technique.
75
+
76
+ ![](images/6ecb312275c8b833a76347f6c7ba3d2b80f52b0b71a12da6610da54a844f0e30.jpg)
77
+ Figure 2: We visualize augmentations of a randomly chosen data point from the “Gaussian Noise level 3” ImageNet-C test set. Even for a robust model trained with heavy data augmentations [14], both its predictive accuracy and confidence (as shown in the top two rows) drop sharply when encountering test shift. As shown in the bottom two rows, these drops can be remedied via MEMO adaptation.
78
+
79
+ Pretrained robust models. Since MEMO makes no assumptions about, or modifications to, the model training procedure, performing adaptation on top of pretrained robust models, such as those trained with heavy data augmentations, is as simple as using any other pretrained model. Crucially, we find that, in practice, the set of test augmentations $\mathcal { A }$ does not have to match the augmentations that were used to train the model. For simplicity and efficiency, we use augmentations that can be easily sampled and are applied directly to the model input x. These properties do not hold for, e.g., data augmentation techniques based on image translation models, such as DeepAugment $\textcircled { 1 1 4 } \textcircled { 1 }$ , or feature mixing, such as moment exchange $\checkmark$ . However, we can still use models trained with these data augmentation techniques as our starting point for adaptation, thus allowing us to improve upon their state-of-the-art results. As noted above, using pretrained models is not as easily accomplished for adaptation methods which require complicated or specialized training procedures and model architectures, such as TTT $\mathbb { H } 4 4 \mathbb { I }$ or ARM $[ \bar { 1 } \bar { 5 } 2 ]$ . In our experiments, we use AugMix as our set of augmentations $\mathbb { \lVert \rVert 3 \rVert }$ , as it satisfies the above properties and still yields significant diversity when applied, as depicted in $\mathbb { F i g u r e 2 } $ Note that AugMix explicitly does not use augmentations that are similar to the corruptions in the CIFAR-10-C and ImageNet-C test sets [12, 13].
80
+
81
+ Adapting BN statistics. Schneider et al. $\mathbb { \left[ \left. 4 0 \right] \right. }$ showed that, even when presented with just a single test point, partially adapting the estimated mean and variance of the activations in each batch normalization (BN) layer of the model can still be effective in some cases for handling distribution shift. In this setting, to prevent overfitting to the test point, the channelwise mean and variance $[ \mu _ { \mathrm { t e s t } } , \sigma _ { \mathrm { t e s t } } ^ { 2 } ]$ estimated from this point are mixed with the the mean and variance $[ \mu _ { \mathrm { t r a i n } } , \sigma _ { \mathrm { t r a i n } } ^ { 2 } ]$ computed during training according to a prior strength $N$ . That is, for $\pmb { \nu } \in \{ \mu , \sigma ^ { 2 } \}$ ,
82
+
83
+ $$
84
+ \pmb { \nu } \triangleq \frac { N } { N + 1 } \pmb { \nu } _ { \mathrm { t r a i n } } + \frac { 1 } { N + 1 } \pmb { \nu } _ { \mathrm { t e s t } } .
85
+ $$
86
+
87
+ This technique is also straightforward to combine with MEMO: we simply use the adapted BN statistics whenever computing the model’s output distribution. We find in our experiments that this technique never degrades, and generally improves, the performance of test time adaptation, thus we combine MEMO with this technique by default whenever applicable. Following the suggestion in Schneider et al. $\mathbb { \left[ \left| 4 0 \right| \right] }$ , we set $N = 1 6$ for all of our experiments in the next section.
88
+
89
+ # 4 Experiments
90
+
91
+ Our experiments aim to answer the following questions:
92
+
93
+ (1) How does MEMO compare to prior methods for test time adaptation and test time robustness? (2) Can MEMO be combined with a wide range of model architectures and pretraining methods? (3) Which aspect of MEMO, the adaptation or augmentation, is the most important?
94
+
95
+ We evaluate MEMO on a total of five distribution shift benchmarks. We conduct CIFAR-10 [22] experiments on the CIFAR-10-C [12] and CIFAR-10.1 [37] test sets, and we conduct ImageNet [38] experiments on the ImageNet-C [12], ImageNet-R [14], and ImageNet-A [15] test sets.
96
+
97
+ To answer question (1), we compare to test time training (TTT) [44] in the CIFAR-10 experiments, for which we train ResNet-26 models following their protocol and specialized architecture. We do not compare to TTT for the ImageNet experiments due to the computational demands of training state-of-the-art models and because Sun et al. [44] do not report competitive ImageNet results. For the ImageNet experiments, we compare to Tent $[ \overline { { | 4 6 | } }$ and BN adaptation, which can be used with pretrained models but require multiple test inputs (or even the entire test set) for adaptation. We provide BN adaptation with 256 test inputs at a time and set the prior strength $N = 2 5 6$ [40].
98
+
99
+ For Tent, we use test batch sizes of 64 and, for ResNet-50 models, test both “online” adaptation – where the model adapts continually through the entire evaluation – and “episodic” adaptation – where the model is reset after each test batch $\overline { { \lVert \textcircled { 4 6 } \rVert } }$ . Note that the evaluation protocols are different for these two methods: whereas MEMO is tasked with predicting on each test point immediately after adaptation, BN adaptation predicts on a batch of 256 test points after computing BN statistics on the batch, and Tent predicts on a batch of 64 inputs after adaptation but also, in the online setting, continually adapts throughout evaluation. In all experiments, we further compare to single point BN adaptation $\mathbb { \left[ \left| 4 0 \right| \right] }$ and the TTA baseline that simply predicts according to $\bar { p } _ { \boldsymbol { \theta } } ( y | \mathbf { \bar { x } } )$ (Eq. 1) [23, 2]. Full details on our experimental protocol are provided in Appendix A.
100
+
101
+ To answer question (2), we apply MEMO on top of multiple pretrained models with different architectures, trained via several different procedures. For CIFAR-10, we train our own ResNet26 [11] models. For ImageNet, we use the best performing ResNet-50 robust models from prior work, which includes those trained with DeepAugment and AugMix augmentations $[ \textcircled { 1 4 } ]$ as well as those trained with moment exchange and CutMix $\pmb { \Vert 2 4 \Vert }$ . To evaluate the generality of prior test time robustness methods and MEMO, we also evaluate the small robust vision transformer $\mathrm { R V T ^ { * } }$ -small), which provides superior performance on all three ImageNet distribution shift benchmarks compared to the robust ResNet-50 models $\pmb { \mathbb { B } } \pmb { \mathrm { 0 } }$ . Finally, we evaluate ResNext-101 models [50, 28] on ImageNet-A, as these models previously achieved the strongest results for this test set [14].
102
+
103
+ Finally, to answer (3), we conduct ablative studies in subsection 4.2: first to determine the relative importance of maximizing confidence (via entropy minimization) versus enforcing invariant predictions across augmented copies of each test point, second to determine the importance of the particular augmentation functions used, and third to determine the required number of augmented samples per inference. The comparison to the non adaptive TTA baseline also helps determine whether simply augmenting the test point is sufficient or if adaptation is additionally helpful. In Appendix B, we provide further experiments ablating the augmentation component specifically.
104
+
105
+ # 4.1 Main Results
106
+
107
+ We summarize results for CIFAR-10, CIFAR-10.1, and CIFAR-10-C in Table 1, with full CIFAR-10- C results in Appendix C. We use indentations to indicate composition, e.g., TTT is performed at test time on top of their specialized joint training procedure. Across all corruption types in CIFAR-10-C, MEMO consistently improves test error compared to the baselines, non adaptive TTA, and TTT. MEMO also provides a larger performance gain on CIFAR-10.1 compared to TTT. We find that the non adaptive TTA baseline is competitive for these relatively simple test sets, though it is worse than MEMO for CIFAR-10-C. Of these three test sets, CIFAR-10-C is the only benchmark that explicitly introduces distribution shift, which suggests that adaptation is useful when the test shifts are more prominent. Both TTA and MEMO are also effective at improving performance for the original CIFAR-10 test set where there is no distribution shift, providing further support for the widespread use of augmentations in standard evaluation protocols [23, 2].
108
+
109
+ Table 1: Results for CIFAR-10, CIFAR-10.1, and CIFAR-10-C. ?Results from Sun et al. [44].
110
+
111
+ <table><tr><td></td><td>CIFAR-10 Error (%)</td><td>CIFAR-10.1 Error (%)</td><td>CIFAR-10-C Average Error (%)</td></tr><tr><td>ResNet-26 □</td><td>9.2</td><td>18.4</td><td>22.5</td></tr><tr><td>+TTA</td><td>7.3 (-1.9)</td><td>14.8 (-3.6)</td><td>19.9 (-2.6)</td></tr><tr><td>+ MEMO (ours)</td><td>7.3 (-1.9)</td><td>14.7 (-3.7)</td><td>19.6 (-2.9)</td></tr><tr><td>+ Joint training* 国</td><td>8.1</td><td>16.7</td><td>22.8</td></tr><tr><td>+ TTT* 因</td><td>7.9 (-0.2)</td><td>15.9 (-0.8)</td><td>21.5 (-1.3)</td></tr></table>
112
+
113
+ Table 2: Test results for the ImageNet test sets. MEMO achieves new state-of-the-art performance on each benchmark for ResNet-50 models for the single test point setting. For $\mathbf { R V T ^ { * } }$ -small, MEMO improves performance across all benchmarks and reaches a new state of the art for ImageNet-C and ImageNet-R. Compared to prior approaches, MEMO offers more consistent improvements.
114
+
115
+ <table><tr><td></td><td>ImageNet-C mCE↓</td><td>ImageNet-R Error (%)</td><td>ImageNet-A Error (%)</td></tr><tr><td>Baseline ResNet-50 自</td><td>76.7</td><td>63.9</td><td>100.0</td></tr><tr><td>+ TTA</td><td>77.9 (+1.2)</td><td>61.3 (-2.6)</td><td>98.4 (-1.6)</td></tr><tr><td>+ Single point BN</td><td>71.4 (-5.3)</td><td>61.1 (-2.8)</td><td>99.4 (-0.6)</td></tr><tr><td>+ MEMO (ours)</td><td>69.9 (-6.8)</td><td>58.8 (-5.1)</td><td>99.1 (-0.9)</td></tr><tr><td>+ BN (N = 256,n = 256)</td><td>61.6 (-15.1)</td><td>59.7 (-4.2)</td><td>99.8 3(-0.2)</td></tr><tr><td>+ Tent (online) [ 46</td><td>54.4 (−22.3)</td><td>57.7 (-6.2)</td><td>99.8 (-0.2)</td></tr><tr><td>+ Tent (episodic)</td><td>64.7 (−12.0)</td><td>61.0 (-2.9)</td><td>99.7 ( (-0.3)</td></tr><tr><td> + DeepAugment+AugMix [14]</td><td>53.6</td><td>53.2</td><td>96.1</td></tr><tr><td>+ TTA</td><td>55.2 (+1.6)</td><td>51.0 (-2.2)</td><td>93.5 (-2.6)</td></tr><tr><td>+ Single point BN</td><td>51.3 (-2.3)</td><td>51.2 (-2.0)</td><td>95.4 (-0.7)</td></tr><tr><td>+ MEMO (ours)</td><td>49.8 (-3.8)</td><td>49.2 (-4.0)</td><td>94.8 (-1.3)</td></tr><tr><td>+ BN(N = 256,n = 256)</td><td>45.4 (−8.2)</td><td>48.8 (-4.4)</td><td>96.8 (+0.7)</td></tr><tr><td>+ Tent (online)</td><td>43.5 (-10.1)</td><td>46.9 (-6.3)</td><td>96.7 (+0.6)</td></tr><tr><td> + Tent (episodic)</td><td>47.1 (-6.5)</td><td>50.1 (-3.1)</td><td>96.6 (+0.5)</td></tr><tr><td>+ MoEx+CutMix 2</td><td>74.8</td><td>64.5</td><td>91.9</td></tr><tr><td>+ TTA</td><td>75.7 (+0.9)</td><td>62.7 (-1.8)</td><td>89.5 (-2.4)</td></tr><tr><td>+ Single point BN</td><td>71.0 (-3.8)</td><td>62.6 (−1.9)</td><td>91.1 (-0.8)</td></tr><tr><td>+ MEMO (ours)</td><td>69.1 (-5.7)</td><td>59.4 (-3.3)</td><td>89.0 (-2.9)</td></tr><tr><td>+ BN (N = 256,n = 256)</td><td>60.9 (-13.9)</td><td>61.6 (-2.9)</td><td>93.9 (+2.0)</td></tr><tr><td>+ Tent (online)</td><td>54.0 (-20.8)</td><td>58.7 (-5.8)</td><td>94.4 (+2.5)</td></tr><tr><td>+ Tent (episodic)</td><td>66.2 (-8.6)</td><td>63.9 (-0.6)</td><td>94.7 (+2.8)</td></tr><tr><td>RVT*-small □</td><td>49.4</td><td>52.3</td><td>73.9</td></tr><tr><td>+ TTA</td><td>53.0 (+3.6)</td><td>49.0 (-3.3)</td><td>68.9 (-5.0)</td></tr><tr><td>+ Single point BN</td><td>48.0 (-1.4)</td><td>51.1 (-1.2)</td><td>74.4 (+0.5)</td></tr><tr><td>+ MEMO (ours)</td><td>40.6 (-8.8)</td><td>43.8 (-8.5)</td><td>69.8 (-4.1)</td></tr><tr><td>+ BN (N = 256,n = 256)</td><td>44.3 (-5.1)</td><td>51.0 ( (-1.3)</td><td>78.3 (+4.4)</td></tr><tr><td>+ Tent (online)</td><td>46.8 (-2.6)</td><td> 50.7 (-1.6)</td><td>82.1 (+8.2)</td></tr><tr><td>+ Tent (adapt all)</td><td>44.7 (-4.7)</td><td>74.1 (+21.8)</td><td>81.1 (+7.2)</td></tr></table>
116
+
117
+ We summarize results for ImageNet-C, ImageNet-R, and ImageNet-A in Table 2, with complete ImageNet-C results in $\boxed { \mathrm { A p p e n d i x ~ C } }$ We again use indentations to indicate composition, e.g., the best results on ImageNet-C for our setting are attained through a combination of starting from a model trained with DeepAugment and AugMix [14] and using MEMO on top. For both ImageNet-C and ImageNet-R, and for both the ResNet-50 and $\mathbf { R V T ^ { * } }$ -small models, combining MEMO with robust training techniques leads to new state-of-the-art performance among methods that observe only one test point at a time. We highlight in gray the methods that require multiple test points for adaptation, and we list in bold the best results from these methods which outperform the test time robustness methods. As Table 2 and prior work both show [40, 46], accessing multiple test points can be powerful for benchmarks such as ImageNet-C and ImageNet-R, in which inferred statistics from the test input distribution may aid in prediction. However, these methods do not help, and oftentimes even hurt, for ImageNet-A. Furthermore, we find that these methods are less effective with the $\mathrm { R V T ^ { * } }$ -small model, which may indicate their sensitivity to model architecture choices. Therefore, for this model, we also test a modification of Tent which adapts all parameters, and we find that this version of Tent works better for ImageNet-C but is significantly worse for ImageNet-R.
118
+
119
+ MEMO also results in substantial improvement for ImageNet-A. No prior test time adaptation methods have reported improvements on ImageNet-A, and some have reported explicit negative results $\mathbb { H O }$ . As discussed, it is reasonable for adaptation methods that rely on multiple test points to achieve greater success on other benchmarks such as ImageNet-C, in which a batch of inputs provides significant information about the specific corruption that must be dealt with. In contrast, ImageNet-A does not have such obvious characteristics associated with the input distribution, as it is simply a collection of images that are difficult to classify. As MEMO instead extracts a learning signal from single test points, it is, to the best of our knowledge, the first test time adaptation method to report successful results on this testbed. We view the consistency with which MEMO outperforms the best prior methods, which change across different test sets, as a major advantage of the proposed method.
120
+
121
+ TTA is the most competitive prior method for ImageNet-A, e.g., it results in larger improvements than MEMO for the $\mathbf { R V T ^ { * } }$ -small model. MEMO, however, achieves state-of-the-art performance among ResNet-50 models. To further compare MEMO to TTA, in Table 3, we evaluate whether MEMO can successfully adapt ResNext-101 models $ { \Vert 5 0 \Vert }$ and further improve performance on this challenging test set. We evaluate both a ResNext-101 (32x8d) baseline model pretrained on ImageNet, as well as the same model pretrained with weakly supervised learning (WSL) on billions of Instagram images $\bar { \left\| 2 8 \right\| }$ . For the
122
+
123
+ Table 3: ImageNet-A results for the ResNext-101s.
124
+
125
+ <table><tr><td colspan="2">ImageNet-A Error (%)</td></tr><tr><td>ResNext-101 ⑤0</td><td>90.0</td></tr><tr><td>+ TTA</td><td>83.2 (-6.8)</td></tr><tr><td>+ Single point BN</td><td>88.8 (-1.2)</td></tr><tr><td>+ MEMO (ours)</td><td>84.3 (-5.7)</td></tr><tr><td>+ WSL [28]</td><td>54.9</td></tr><tr><td>+ TTA</td><td>49.1 (-5.8)</td></tr><tr><td>+ Single point BN</td><td>58.9 (+4.0)</td></tr><tr><td>+ MEMO (ours)</td><td>43.2 (−11.7)</td></tr></table>
126
+
127
+ WSL model, we did not use single point BN adaptation for MEMO as we found this technique to be actually harmful to performance, and this corroborates previous findings $\mathbb { H O }$ . From the results, we can see that, although both TTA and MEMO significantly improve upon the baseline model evaluation, MEMO ultimately achieves the best accuracy by a significant margin as it is more successful at adapting the WSL model. This suggests that MEMO may synergize well with large scale pretraining, and further exploring this combination is an interesting direction for future work.
128
+
129
+ # 4.2 Ablative Study
130
+
131
+ MEMO uses both adaptation and augmentations. In this section, we ablate the adaptation procedure and the number of augmentations, and in Appendix B we ablate the choice of augmentations.
132
+
133
+ Adaptation procedure. From the results above, we conclude that adaptation generally provides additional benefits beyond simply using TTA to predict via the marginal output distribution $\bar { p } _ { \boldsymbol { \theta } } ( y | \mathbf { x } )$ . However, we can disentangle two distinct self-supervised learning signals that may be effective for adaptation: encouraging invariant predictions across different augmentations of the test point, and encouraging confidence via entropy minimization. The marginal entropy objective in $\operatorname { \bar { E } q } . 2$ encapsulates both of these learning signals, but it cannot easily be decomposed into these pieces. We instead use two ablative adaptation methods that each only make use of one of these learning signals.
134
+
135
+ First, we consider optimizing the pairwise cross entropy between each pair of augmented points, i.e.,
136
+
137
+ $$
138
+ \ell _ { \mathrm { P C E } } ( \boldsymbol { \theta } ; \mathbf { x } ) \triangleq \frac { 1 } { B \times ( B - 1 ) } \sum _ { i = 1 } ^ { B } \sum _ { j \neq i } H ( p _ { \boldsymbol { \theta } } ( \cdot | \widetilde { \mathbf { x } } _ { i } ) , p _ { \boldsymbol { \theta } } ( \cdot | \widetilde { \mathbf { x } } _ { j } ) ) ,
139
+ $$
140
+
141
+ Where $\tilde { \mathbf { x } } _ { i }$ again refers to the $i$ -th sampled augmentation applied to $\mathbf { x }$ . Intuitively, this loss function encourages the model to adapt such that it produces the same predictive distribution for all augmentations of the test point, but it does not encourage the model to produce confident predictions.
142
+
143
+ Table 4: Ablating the adaptation objective to test pairwise cross entropy and conditional entropy (CE) based adaptation. MEMO generally performs the best, indicating that both encouraging invariance across augmentations and confidence are helpful in adapting the model.
144
+
145
+ <table><tr><td></td><td>CIFAR-10 Error (%)</td><td>CIFAR-10.1 Error (%)</td><td>CIFAR-10-C Average Error (%)</td></tr><tr><td>ResNet-26 []</td><td>9.2</td><td>18.4</td><td>22.5</td></tr><tr><td>+ MEMO (ours)</td><td>7.3 (-1.9)</td><td>14.7 (-3.7)</td><td>19.6 (-2.9)</td></tr><tr><td>l (Eq. 2) )+lPCE 一</td><td>7.6 (-1.6)</td><td>15.3 (-3.1)</td><td>20.0 (-2.5)</td></tr><tr><td>Eq.2) + lcE</td><td>7.6 (-1.6)</td><td>14.7 (-3.7)</td><td>20.0 (-2.5)</td></tr><tr><td></td><td>ImageNet-C mCE↓</td><td>ImageNet-R Error (%)</td><td>ImageNet-A Error (%)</td></tr><tr><td>RVT*-small [30]</td><td>49.4</td><td>52.3</td><td>73.9</td></tr><tr><td>+ MEMO (ours)</td><td>40.6 (-8.8)</td><td>43.8 (-8.5)</td><td>69.8 (-4.1)</td></tr><tr><td>-l (Eq. 2) + lcE</td><td>41.2 (-8.2)</td><td>44.2 (−8.1)</td><td>69.7 (-4.2)</td></tr></table>
146
+
147
+ ![](images/5eaa7e18247da47c2425c9985f500a9780838964f166482db468111dd95d274c.jpg)
148
+ Figure 3: Plotting MEMO efficiency as seconds per evaluation $\mathbf { \dot { x } }$ axis) and $\%$ test error on ImageNet-R (y axis) for the ResNet-50 models (left) and $\mathrm { R V T ^ { * } }$ -small (right) while varying $B = \{ 1 , 2 , 4 , 8 , 1 6 , 3 2 , 6 4 , 1 2 8 \}$ . Note the log scale on the $\mathbf { X }$ axis.
149
+
150
+ Conversely, as an objective that encourages confidence but not invariance, we also consider optimizing the conditional entropy objective detailed in Eq. 3. This ablation is effectively a version of the episodic variant of Tent $[ \overline { { | 4 6 | } }$ that produces augmented copies of a single test point rather than assuming access to a test batch. We first evaluate these ablations on the CIFAR-10 test sets. We use the same adaptation procedure and hyperparameters, with $\ell$ replaced with the above objectives.
151
+
152
+ The results are presented in Table 4. We see that MEMO, i.e., marginal entropy minimization, generally performs better than adaptation with either of the alternative objectives. This supports the hypothesis that both invariance across, and confidence on, the augmentations are important learning signals for self-supervised adaptation. When faced with CIFAR-10.1, we see poor performance from the pairwise cross entropy based adaptation method. On the original CIFAR-10 test set and CIFAR-10- C, the ablations perform nearly identically and uniformly worse than MEMO. To further test the $\ell _ { \mathrm { C E } }$ ablation, which is the stronger of the two ablations, we also evaluate it on the ImageNet test sets for the $\mathrm { R V T ^ { * } }$ -small model. We find that, similarly, minimizing conditional entropy generally improves performance compared to the baseline evaluation. MEMO is more performant for ImageNet-C and ImageNet-R. Adaptation via $\ell _ { \mathrm { C E } }$ performs slightly better for ImageNet-A, though for this problem and model, TTA is still the best method. Thus, MEMO results in relatively small, but consistent, performance gains compared to only maximizing confidence on the augmentations.
153
+
154
+ Number of augmentations. In Figure 3, we analyze the $\%$ test error of MEMO adaptation on ImageNet-R as a function of the efficiency of adaptation, measured in seconds per evaluation. We achieve various tradeoffs by varying the number of augmented copies $B \ =$ $\{ 1 , 2 , 4 , 8 , 1 6 , 3 2 , 6 4 , 1 2 8 \}$ . We note that small values of $B$ such as 4 and 8 can already provide significant performance gains, thus a practical tradeoff between efficiency and accuracy is possible.
155
+
156
+ For large $B$ , the wall clock time is dominated by computing the augmentations. For the baseline ResNet-50 model, single point BN adaptation requires an average of 0.0252 seconds per test point. TTA and MEMO with $B = 6 4$ are much slower – 0.7742 and 0.9746 seconds, respectively, per test point – but can be made significantly more efficient by using $B = 4$ augmented samples – 0.0631 and 0.1037 seconds, respectively. In our implementation, we do not compute augmentations in parallel, though in principle this is possible for AugMix and should drastically improve efficiency overall. These experiments used four Intel Xeon Skylake 6130 CPUs and one NVIDIA TITAN RTX GPU.
157
+
158
+ # 5 Discussion
159
+
160
+ We presented MEMO, a method for test time robustification again distribution shift via adaptation and augmentation. MEMO does not require access or changes to the model training procedure and is thus broadly applicable for a wide range of model architectures pretrained in a number of different ways. Furthermore, MEMO adapts at test time using single test inputs, thus it does not assume access to multiple test points as in several recent methods for test time adaptation $\mathbb { H O } \mathbb { H } \mathbb { H }$ . On a range of CIFAR-10 and ImageNet distribution shift benchmarks, and for ResNet, vision transformer, and, to an extent, ResNext models, MEMO consistently improves performance at test time and achieves several new state-of-the-art results for these models in the single test point setting.
161
+
162
+ Inference via MEMO is more computationally expensive than standard model inference due to its augmentation and adaptation procedure – though, as the experiments above show, more favorable tradeoffs between efficiency and accuracy are possible with smaller values of $B$ , the number of augmentations per test point. One interesting direction for future work is to develop techniques for selectively determining when to adapt the model in order to achieve more efficient inference. For example, with well calibrated models $[ \mathbb { 1 0 } ]$ , we may run simple “feedforward” inference when the prediction confidence is over a certain threshold, thus achieving better efficiency. Additionally, it would be interesting to explore MEMO in the test setting where the model is allowed to continually adapt as more test data is observed. In our preliminary experiments in this setting, MEMO tended to lead to degenerate solutions, e.g., the model predicting a constant label with maximal confidence regardless of the input. This failure mode may potentially be rectified by carefully choosing which parameters to adapt, such as only adapting the parameters in BN layers $\boxed { \boxplus 6 }$ , or regularizing the model such that it does not change too drastically from the pretrained model [26].
163
+
164
+ # Acknowledgments and Disclosure of Funding
165
+
166
+ We thank members of the Robotic AI and Learning Lab and Berkeley AI Research for helpful discussions and feedback. MZ was supported in part by an NDSEG fellowship. CF is a CIFAR fellow. This research was partially supported by ARL DCIST CRA W911NF-17-2-0181 and ARO W911NF-21-1-0097.
167
+
168
+ # References
169
+
170
+ [1] F. Alet, M. Bauza, K. Kawaguchi, N. Kuru, T. Lozano-Pérez, and L. Kaelbling. Tailoring: Encoding inductive biases by optimizing unsupervised objectives at prediction time. In Advances in Neural Information Processing Systems (NeurIPS), 2021.
171
+ [2] A. Ashukha, A. Lyzhov, D. Molchanov, and D. Vetrov. Pitfalls of in-domain uncertainty estimation and ensembling in deep learning. In International Conference on Learning Representations (ICLR), 2020.
172
+ [3] A. Bartler, A. Bühler, F. Wiewel, M. Döbler, and B. Yang. MT3: Meta test-time training for self-supervised test-time adaption. In International Conference on Artificial Intelligence and Statistics (AISTATS), 2022.
173
+ [4] A. Ben-Tal, D. den Hertog, A. De Waegenaere, B. Melenberg, and G. Rennen. Robust solutions of optimization problems affected by uncertain probabilities. Management Science, 2013. [5] G. Blanchard, G. Lee, and C. Scott. Generalizing from several related classification tasks to a new unlabeled sample. In Advances in Neural Information Processing Systems (NIPS), 2011. [6] G. Csurka. Domain adaptation for visual applications: A comprehensive survey. arXiv preprint arXiv:1702.05374, 2017. [7] A. Dosovitskiy, L. Beyer, A. Kolesnikov, D. Weissenborn, X. Zhai, T. Unterthiner, M. Dehghani, M. Minderer, G. Heigold, S. Gelly, J. Uszkoreit, and N. Houlsby. An image is worth 16x16 words: Transformers for image recognition at scale. In International Conference on Learning Representations (ICLR), 2021. [8] Y. Grandvalet and Y. Bengio. Semi-supervised learning by entropy minimization. In Advances in Neural Information Processing Systems (NIPS), 2005. [9] I. Gulrajani and D. Lopez-Paz. In search of lost domain generalization. In International Conference on Learning Representations (ICLR), 2021.
174
+ [10] C. Guo, G. Pleiss, Y. Sun, and K. Weinberger. On calibration of modern neural networks. In International Conference on Machine Learning (ICML), 2017.
175
+ [11] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In Conference on Computer Vision and Pattern Recognition (CVPR), 2016.
176
+ [12] D. Hendrycks and T. Dietterich. Benchmarking neural network robustness to common corruptions and perturbations. In International Conference on Learning Representations (ICLR), 2019.
177
+ [13] D. Hendrycks, N. Mu, E. Cubuk, B. Zoph, J. Gilmer, and B. Lakshminarayanan. AugMix: A simple data processing method to improve robustness and uncertainty. In International Conference on Learning Representations (ICLR), 2020.
178
+ [14] D. Hendrycks, S. Basart, N. Mu, S. Kadavath, F. Wang, E. Dorundo, R. Desai, T. Zhu, S. Parajuli, M. Guo, D. Song, J. Steinhardt, and J. Gilmer. The many faces of robustness: A critical analysis of out-of-distribution generalization. In IEEE International Conference on Computer Vision (ICCV), 2021.
179
+ [15] D. Hendrycks, K. Zhao, S. Basart, J. Steinhardt, and D. Song. Natural adversarial examples. In Conference on Computer Vision and Pattern Recognition (CVPR), 2021.
180
+ [16] W. Hu, G. Niu, I. Sato, and M. Sugiyama. Does distributionally robust supervised learning give robust classifiers? In International Conference on Machine Learning (ICML), 2018.
181
+ [17] Y. Huang, J. Gornet, S. Dai, Z. Yu, T. Nguyen, D. Tsao, and A. Anandkumar. Neural networks with recurrent generative feedback. In Advances in Neural Information Processing Systems (NeurIPS), 2020.
182
+ [18] Y. Iwasawa and Y. Matsuo. Test-time classifier adjustment module for model-agnostic domain generalization. In Advances in Neural Information Processing Systems (NeurIPS), 2021.
183
+ [19] A. Kaku, S. Mohan, A. Parnandi, H. Schambra, and C. Fernandez-Granda. Be like water: Robustness to extraneous variables via adaptive feature normalization. arXiv preprint arXiv:2002.04019, 2020.
184
+ [20] D. Kingma and J. Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations (ICLR), 2015.
185
+ [21] P. Koh, S. Sagawa, H. Marklund, S. Xie, M. Zhang, A. Balsubramani, W. Hu, M. Yasunaga, R. Phillips, I. Gao, T. Lee, E. David, I. Stavness, W. Guo, B. Earnshaw, I. Haque, S. Beery, J. Leskovec, A. Kundaje, E. Pierson, S. Levine, C. Finn, and P. Liang. WILDS: A benchmark of in-the-wild distribution shifts. In International Conference on Machine Learning (ICML), 2021.
186
+ [22] A. Krizhevsky. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009.
187
+ [23] A. Krizhevsky, I. Sutskever, and G. Hinton. ImageNet classification with deep convolutional neural networks. In Advances in Neural Information Processing Systems (NIPS), 2012.
188
+ [24] B. Li, F. Wu, S. Lim, S. Belongie, and K. Weinberger. On feature normalization and data augmentation. In Conference on Computer Vision and Pattern Recognition (CVPR), 2021.
189
+ [25] Y. Li, N. Wang, J. Shi, J. Liu, and X. Hou. Revisiting batch normalization for practical domain adaptation. In International Conference on Learning Representations Workshop (ICLRW), 2017.
190
+ [26] Y. Liu, P. Kothari, B. van Delft, B. Bellot-Gurlet, T. Mordan, and A. Alahi. $\mathrm { T T T } { + } { + }$ : When does self-supervised test-time training fail or thrive? In Advances in Neural Information Processing Systems (NeurIPS), 2021.
191
+ [27] I. Loshchilov and F. Hutter. Decoupled weight decay regularization. In International Conference on Learning Representations (ICLR), 2019.
192
+ [28] D. Mahajan, R. Girshick, V. Ramanathan, K. He, M. Paluri, Y. Li, A. Bharambe, and L. van der Maaten. Exploring the limits of weakly supervised pretraining. In European Conference on Computer Vision (ECCV), 2018.
193
+ [29] C. Mao, M. Chiquier, H. Wang, J. Yang, and C. Vondrick. Adversarial attacks are reversible with natural supervision. In IEEE International Conference on Computer Vision (ICCV), 2021.
194
+ [30] X. Mao, G. Qi, Y. Chen, X. Li, R. Duan, S. Ye, Y. He, and H. Xue. Towards robust vision transformer. In Conference on Computer Vision and Pattern Recognition (CVPR), 2022.
195
+ [31] D. Molchanov, A. Lyzhov, Y. Molchanova, A. Ashukha, and D. Vetrov. Greedy policy search: A simple baseline for learnable test-time augmentation. In Conference on Uncertainty in Artificial Intelligence (UAI), 2020.
196
+ [32] K. Muandet, D. Balduzzi, and B. Schölkopf. Domain generalization via invariant feature representation. In International Conference on Machine Learning (ICML), 2013.
197
+ [33] Z. Nado, S. Padhy, D. Sculley, A. D’Amour, B. Lakshminarayanan, and J. Snoek. Evaluating prediction-time batch normalization for robustness under covariate shift. arXiv preprint arXiv:2006.10963, 2020.
198
+ [34] A. Orhan. Robustness properties of Facebook’s ResNeXt WSL models. arXiv preprint arXiv:1907.07640, 2019.
199
+ [35] X. Peng, B. Usman, N. Kaushik, J. Hoffman, D. Wang, and K. Saenko. VisDA: The visual domain adaptation challenge. arXiv preprint arXiv:1710.06924, 2017.
200
+ [36] J. Quiñonero Candela, M. Sugiyama, A. Schwaighofer, and N. Lawrence. Dataset Shift in Machine Learning. The MIT Press, 2009.
201
+ [37] B. Recht, R. Roelofs, L. Schmidt, and V. Shankar. Do CIFAR-10 classifiers generalize to CIFAR-10? arXiv preprint arXiv:1806.00451, 2018.
202
+ [38] O. Russakovsky, J. Deng, H. Su, J. Krause, S. Satheesh, S. Ma, Z. Huang, A. Karpathy, A. Khosla, M. Bernstein, A. Berg, and F. Li. Imagenet large scale visual recognition challenge. International Journal of Computer Vision (IJCV), 2015.
203
+ [39] S. Sagawa, P. Koh, T. Hashimoto, and P. Liang. Distributionally robust neural networks for group shifts: On the importance of regularization for worst-case generalization. In International Conference on Learning Representations (ICLR), 2020.
204
+ [40] S. Schneider, E. Rusak, L. Eck, O. Bringmann, W. Brendel, and M. Bethge. Improving robustness against common corruptions by covariate shift adaptation. In Advances in Neural Information Processing Systems (NeurIPS), 2020.
205
+ [41] H. Shimodaira. Improving predictive inference under covariate shift by weighting the loglikelihood function. Journal of Statistical Planning and Inference (JSPI), 2000.
206
+ [42] C. Shorten and T. Khoshgoftaar. A survey on image data augmentation for deep learning. Journal of Big Data, 2019.
207
+ [43] P. Sivaprasad and F. Fleuret. Test time adaptation through perturbation robustness. arXiv preprint arXiv:2110.10232, 2021.
208
+ [44] Y. Sun, X. Wang, Z. Liu, J. Miller, A. Efros, and M. Hardt. Test-time training with selfsupervision for generalization under distribution shifts. In International Conference on Machine Learning (ICML), 2020.
209
+ [45] T. Varsavsky, M. Orbes-Arteaga, C. Sudre, M. Graham, P. Nachev, and M. Cardoso. Test-time unsupervised domain adaptation. arXiv preprint arXiv:2010.01926, 2020.
210
+ [46] D. Wang, E. Shelhamer, S. Liu, B. Olshausen, and T. Darrell. Tent: Fully test-time adaptation by entropy minimization. In International Conference on Learning Representations (ICLR), 2021.
211
+ [47] G. Wilson and D. Cook. A survey of unsupervised deep domain adaptation. ACM Transactions on Intelligent Systems and Technology (TIST), 2020.
212
+ [48] E. Wong, L. Rice, and J. Kolter. Fast is better than free: Revisiting adversarial training. In International Conference on Learning Representations (ICLR), 2020.
213
+ [49] Y. Wu and K. He. Group normalization. In European Conference on Computer Vision (ECCV), 2018.
214
+ [50] S. Xie, R. Girshick, P. Dollár, Z. Tu, and K. He. Aggregated residual transformations for deep neural networks. In Conference on Computer Vision and Pattern Recognition (CVPR), 2017.
215
+ [51] D. Yin, R. Lopes, J. Shlens, E. Cubuk, and J. Gilmer. A Fourier perspective on model robustness in computer vision. In Advances in Neural Information Processing Systems (NeurIPS), 2019.
216
+ [52] M. Zhang, H. Marklund, A. Gupta, S. Levine, and C. Finn. Adaptive risk minimization: Learning to adapt to domain shift. In Advances in Neural Information Processing Systems (NeurIPS), 2021.
217
+
218
+ # Checklist
219
+
220
+ 1. For all authors...
221
+
222
+ (a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
223
+ (b) Did you describe the limitations of your work? [Yes] See Section 5.
224
+ (c) Did you discuss any potential negative societal impacts of your work? [No]
225
+ (d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
226
+
227
+ 2. If you are including theoretical results...
228
+
229
+ (a) Did you state the full set of assumptions of all theoretical results? [N/A] (b) Did you include complete proofs of all theoretical results? [N/A]
230
+
231
+ 3. If you ran experiments...
232
+
233
+ (a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] See supplementary material.
234
+ (b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Appendix A.
235
+ (c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [N/A]
236
+ (d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [No]
237
+
238
+ 4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
239
+
240
+ (a) If your work uses existing assets, did you cite the creators? [Yes]
241
+ (b) Did you mention the license of the assets? [No] All assets are publicly and freely available.
242
+ (c) Did you include any new assets either in the supplemental material or as a URL? [No]
243
+ (d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
244
+ (e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
245
+
246
+ 5. If you used crowdsourcing or conducted research with human subjects...
247
+
248
+ (a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
249
+ (b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
250
+ (c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
parse/dev/XrGEkCOREX2/XrGEkCOREX2_content_list.json ADDED
@@ -0,0 +1,1059 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "MEMO: Test Time Robustness via Adaptation and Augmentation ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 289,
8
+ 122,
9
+ 707,
10
+ 172
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Marvin Zhang1, Sergey Levine1, Chelsea Finn2 1UC Berkeley 2Stanford University ",
17
+ "bbox": [
18
+ 333,
19
+ 224,
20
+ 663,
21
+ 255
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "Abstract ",
28
+ "text_level": 1,
29
+ "bbox": [
30
+ 462,
31
+ 290,
32
+ 535,
33
+ 308
34
+ ],
35
+ "page_idx": 0
36
+ },
37
+ {
38
+ "type": "text",
39
+ "text": "While deep neural networks can attain good accuracy on in-distribution test points, many applications require robustness even in the face of unexpected perturbations in the input, changes in the domain, or other sources of distribution shift. We study the problem of test time robustification, i.e., using the test input to improve model robustness. Recent prior works have proposed methods for test time adaptation, however, they each introduce additional assumptions, such as access to multiple test points, that prevent widespread adoption. In this work, we aim to study and devise methods that make no assumptions about the model training process and are broadly applicable at test time. We propose a simple approach that can be used in any test setting where the model is probabilistic and adaptable: when presented with a test example, perform different data augmentations on the data point, and then adapt (all of) the model parameters by minimizing the entropy of the model’s average, or marginal, output distribution across the augmentations. Intuitively, this objective encourages the model to make the same prediction across different augmentations, thus enforcing the invariances encoded in these augmentations, while also maintaining confidence in its predictions. In our experiments, we evaluate two baseline ResNet models, two robust ResNet-50 models, and a robust vision transformer model, and we demonstrate that this approach achieves accuracy gains of $1 \\%$ over standard model evaluation and also generally outperforms prior augmentation and adaptation strategies. For the setting in which only one test point is available, we achieve state-of-the-art results on the ImageNet-C, ImageNet-R, and, among ResNet-50 models, ImageNet-A distribution shift benchmarks. ",
40
+ "bbox": [
41
+ 233,
42
+ 321,
43
+ 766,
44
+ 627
45
+ ],
46
+ "page_idx": 0
47
+ },
48
+ {
49
+ "type": "text",
50
+ "text": "1 Introduction ",
51
+ "text_level": 1,
52
+ "bbox": [
53
+ 174,
54
+ 654,
55
+ 310,
56
+ 670
57
+ ],
58
+ "page_idx": 0
59
+ },
60
+ {
61
+ "type": "text",
62
+ "text": "Deep neural network models have achieved excellent performance on many machine learning problems, such as image classification, but are often brittle and susceptible to issues stemming from distribution shift. For example, deep image classifiers may degrade precipitously in accuracy when encountering input perturbations, such as noise or changes in lighting $[ \\hat { \\left| 1 2 \\right| } ]$ or domain shifts which occur naturally in real world applications $\\mathbb { \\left| \\mathbb { Z } \\right\\| }$ . Therefore, robustification of deep models against these test shifts is an important and active area of study. ",
63
+ "bbox": [
64
+ 174,
65
+ 685,
66
+ 825,
67
+ 768
68
+ ],
69
+ "page_idx": 0
70
+ },
71
+ {
72
+ "type": "text",
73
+ "text": "Most prior works in this area have focused on techniques for training time robustification, including utilizing larger models and datasets $\\pmb { \\mathbb { B 4 } }$ , various forms of adversarial training $\\mathbb { B 9 } \\mathbb { H 8 }$ , and aggressive data augmentation [51, 13, 24, 14]. Employing these techniques requires modifying the training process, which may not be feasible if, e.g., it involves heavy computation or non public data. Furthermore, these techniques do not rely on any information about the test points that the model must predict on, even though these test points may provide significant information for improving model robustness. Recently, several works have proposed methods for improving accuracy via adaptation after seeing the test data, typically by updating a subset of the model’s weights [44, 45, 18], normalization statistics [40], or both [46, 52]. Though effective at handling test shifts, these methods sometimes still require specialized training procedures, and they typically rely on extracting information via batches or even entire sets of test inputs, thus introducing additional assumptions. ",
74
+ "bbox": [
75
+ 174,
76
+ 775,
77
+ 825,
78
+ 900
79
+ ],
80
+ "page_idx": 0
81
+ },
82
+ {
83
+ "type": "image",
84
+ "img_path": "images/695fdc8d76523d7ae12f1252c94b960f4f9aeeee940045c10e43759d62a658f6.jpg",
85
+ "image_caption": [
86
+ "Figure 1: Left: at test time, as detailed in $\\mathsf { \\overline { { S e c t i o n 3 } } } ,$ we have a single test input $\\mathbf { x }$ , a set of data augmentation functions $\\{ a _ { 1 } , \\dotsc , a _ { M } \\}$ , and a trained model that outputs a probabilistic predictive distribution and has adaptable parameters $\\theta$ . We perform different augmentations on $\\mathbf { x }$ and pass these augmented inputs to the model in order to estimate the marginal output distribution averaged over augmentations. Right: we perform a gradient update on the model to minimize the entropy of this marginal distribution, thus encouraging the model predictions to be invariant across different augmentations while maintaining confident predictions. The final prediction is then made on the original data point, i.e., the predictive distribution in the top right of the schematic. "
87
+ ],
88
+ "image_footnote": [],
89
+ "bbox": [
90
+ 191,
91
+ 87,
92
+ 808,
93
+ 299
94
+ ],
95
+ "page_idx": 1
96
+ },
97
+ {
98
+ "type": "text",
99
+ "text": "",
100
+ "bbox": [
101
+ 173,
102
+ 414,
103
+ 823,
104
+ 443
105
+ ],
106
+ "page_idx": 1
107
+ },
108
+ {
109
+ "type": "text",
110
+ "text": "In this work, we focus on methods for test time robustness, in which the specific test input may be leveraged in order to improve the model’s prediction on that point. We are interested in studying and devising methods for improving model robustness that are “plug and play”, i.e., they can be readily used with a wide variety of pretrained models and test settings. We also want methods that synergize with other robustification techniques, in order to achieve greater performance than using either in isolation. With these goals in mind, we devise a novel test time robustness method based on adaptation and augmentation. As illustrated in $\\mathbb { F i g u r e 1 } ,$ when presented with a test point, we adapt the model by augmenting the test point in different ways while encouraging the model to make consistent predictions, thus respecting the invariances encoded in the data augmentations. We further encourage the model to make confident predictions, thus arriving at the proposed method: minimize the marginal entropy of the model’s predictions across the augmented versions of the test point. ",
111
+ "bbox": [
112
+ 174,
113
+ 448,
114
+ 825,
115
+ 601
116
+ ],
117
+ "page_idx": 1
118
+ },
119
+ {
120
+ "type": "text",
121
+ "text": "We refer to the proposed method as marginal entropy minimization with one test point (MEMO), and this is the primary contribution of our work. MEMO makes direct use of pretrained models without any assumptions about their particular training procedure or architecture, while requiring only a single test input for adaptation. In Section 4, we demonstrate empirically that MEMO consistently improves the performance of ResNet [11] and vision transformer $\\mathbb { \\overline { { | \\overline { { \\mathbb { Z } } | } } } }$ models on several challenging ImageNet distribution shift benchmarks, achieving several new state-of-the-art results for these models in the setting in which only one test point is available. MEMO consistently outperforms non adaptive marginal distribution predictions (between $1 - 1 0 \\%$ improvement) on the ImageNet-C [12] and ImageNet-R [14] test sets, indicating that adaptation plays a crucial role in improving predictive accuracy. MEMO encourages both invariance across augmentations and confident predictions, and an ablation study in Section 4 shows that both components are important for maximal performance gains. Also, MEMO is, to the best of our knowledge, the first adaptation method to improve performance (by $1 \\%$ over standard model evaluation) on the ImageNet-A test set $\\mathbb { \\lVert 1 5 \\rVert }$ . ",
122
+ "bbox": [
123
+ 174,
124
+ 607,
125
+ 825,
126
+ 786
127
+ ],
128
+ "page_idx": 1
129
+ },
130
+ {
131
+ "type": "text",
132
+ "text": "2 Related work ",
133
+ "text_level": 1,
134
+ "bbox": [
135
+ 174,
136
+ 809,
137
+ 316,
138
+ 825
139
+ ],
140
+ "page_idx": 1
141
+ },
142
+ {
143
+ "type": "text",
144
+ "text": "Distribution shift has been studied under a number of frameworks $\\pmb { \\mathbb { B } } 6 \\|$ , including domain adaptation [41, 6, 47], domain generalization [5, 32, 9], and distributionally robust optimization [4, 16, 39]. These frameworks typically leverage additional training or test assumptions in order to make the distribution shift problem more tractable. Largely separate from these frameworks, various empirical methods have also been proposed for dealing with shift, such as increasing the model and training dataset size or using heavy training augmentations [34, 51, 14]. The focus of this work is complementary to these efforts: MEMO is applicable to a wide range of pretrained models, including those trained via robustness methods, and can achieve further performance gains via test time adaptation. ",
145
+ "bbox": [
146
+ 174,
147
+ 842,
148
+ 823,
149
+ 911
150
+ ],
151
+ "page_idx": 1
152
+ },
153
+ {
154
+ "type": "text",
155
+ "text": "",
156
+ "bbox": [
157
+ 176,
158
+ 90,
159
+ 823,
160
+ 133
161
+ ],
162
+ "page_idx": 2
163
+ },
164
+ {
165
+ "type": "text",
166
+ "text": "Prior test time adaptation methods generally either make significant training or test time assumptions. Some methods update the model using batches or even entire datasets of test inputs, such as by computing batch normalization (BN) statistics on the test set [25, 19, 33, 40], computing class prototypes $\\mathbb { \\lVert \\rVert }$ , or minimizing the (conditional) entropy of model predictions across a batch of test data $\\lVert \\overline { { 4 6 } } \\rVert$ . The latter approach is closely related to MEMO. The differences are that MEMO minimizes marginal entropy using single test points and data augmentation and adapts all of the model parameters rather than just those associated with normalization layers, thus not requiring multiple test points or specific model architectures. Other test time adaptation methods can be applied to single test points but require specific training procedures or models [44, 17, 40, 1, 3]. Test time training (TTT) $\\underline { { \\lVert \\varPsi \\ 4 \\rVert } }$ requires a specialized model with a rotation prediction head and a different procedure for training this model. Schneider et al. [40] show that BN adaptation can be effective even with only one test point. As we discuss in Section 3, MEMO synergizes well with this technique of “single point” BN adaptation. Mao et al. [29] propose a test time adaptation method based on input perturbations for robustness to adversarial attacks. Concurrently with our work, Sivaprasad and Fleuret $\\mathbb { \\lVert \\rVert 3 \\rVert }$ propose a similar method for test time adaptation by encouraging invariance to data augmentations, and they test their method on the corrupted CIFAR and VisDA [35] datasets. ",
167
+ "bbox": [
168
+ 174,
169
+ 140,
170
+ 825,
171
+ 361
172
+ ],
173
+ "page_idx": 2
174
+ },
175
+ {
176
+ "type": "text",
177
+ "text": "A number of works have noted that varying forms of strong data augmentation on the training set can improve the resulting model’s robustness [51, 13, 24, 14]. Data augmentations are also sometimes used on the test data directly by averaging the model’s outputs across augmented copies of the test point $\\mathbb { \\left| \\overline { { 2 3 } } \\right| \\overline { { \\sharp 2 } } }$ , i.e., predicting according to the model’s marginal output distribution. When using cropping as the augmentation, this technique is often referred to as multicrop evaluation $\\pmb { \\mathbb { Z } } 2 \\mathbf { l }$ . We instead use the term test time augmentation (TTA), as we use additional augmentations beyond cropping $\\mathbb { \\lVert \\lambda \\rVert }$ . TTA has been shown to be useful both for improving model accuracy and calibration $\\pmb { \\left. 2 \\right. }$ as well as handling distribution shift [31]. We take this idea one step further by explicitly adapting the model such that its marginal output distribution has low entropy. This extracts an additional learning signal for improving the model, and furthermore, the adapted model can then make its final prediction on the clean test point rather than the augmented copies. We empirically show in Section 4 that these differences lead to improved performance over this non adaptive TTA baseline. ",
178
+ "bbox": [
179
+ 173,
180
+ 367,
181
+ 825,
182
+ 532
183
+ ],
184
+ "page_idx": 2
185
+ },
186
+ {
187
+ "type": "text",
188
+ "text": "3 Augmenting and Adapting at Test Time ",
189
+ "text_level": 1,
190
+ "bbox": [
191
+ 174,
192
+ 554,
193
+ 534,
194
+ 571
195
+ ],
196
+ "page_idx": 2
197
+ },
198
+ {
199
+ "type": "text",
200
+ "text": "Data augmentations are typically used to train the model to respect certain invariances – e.g., changes in lighting or viewpoint do not change the underlying class label – but, especially when faced with distribution shift, the model is not guaranteed to obey the same invariances at test time. In this section, we introduce MEMO, a method for test time robustness that adapts the model such that it respects these invariances on the test input. We use “test time robustness” specifically to refer to techniques that operate directly on pretrained models and single test inputs – single point BN adaptation and TTA, as described in $\\overline { { \\mathsf { S e c t i o n 2 } } }$ are examples of prior test time robustness methods. ",
201
+ "bbox": [
202
+ 173,
203
+ 587,
204
+ 825,
205
+ 684
206
+ ],
207
+ "page_idx": 2
208
+ },
209
+ {
210
+ "type": "text",
211
+ "text": "In the test time robustness setting, we are given a trained model $f _ { \\theta }$ with parameters $\\theta \\in \\Theta$ . We do not require any special training procedure and do not make any assumptions about the model, except that $\\theta$ is adaptable and that $f _ { \\theta }$ produces a conditional output distribution $p _ { \\boldsymbol { \\theta } } ( y | \\mathbf { x } )$ that is differentiable with respect to $\\theta . ^ { 1 }$ All standard deep neural network models satisfy these assumptions. A single point $\\mathbf { x } \\in \\mathcal { X }$ is presented to $f _ { \\theta }$ , for which it must predict a label $\\hat { y } \\in \\mathcal { V }$ immediately. Note that this is precisely identical to the standard test time inference procedure for regular supervised learning models – in effect, we are simply modifying how inference is done, without any additional assumptions on the training process or on test time data availability. This makes test time robustness methods a simple “slot-in” replacement for the ubiquitous and standard test time inference process. We assume sampling access to a set of augmentation functions $\\mathcal { A } \\triangleq \\{ a _ { 1 } , \\ldots , a _ { M } \\}$ that can be applied to the test point $\\mathbf { x }$ . We use these augmentations and the self-supervised objective detailed below to adapt the model before it predicts on $\\mathbf { x }$ . When given a set of test inputs, the model adapts and predicts on each test point independently. We do not assume access to any ground truth labels. ",
212
+ "bbox": [
213
+ 173,
214
+ 689,
215
+ 825,
216
+ 871
217
+ ],
218
+ "page_idx": 2
219
+ },
220
+ {
221
+ "type": "text",
222
+ "text": "Require: trained model $f _ { \\theta }$ , test point $\\mathbf { x }$ , number of augmentations $B$ , learning rate $\\eta$ , update rule $G$ \n1: Sample $a _ { 1 } , \\dots , a _ { B } \\overset { \\mathrm { i . i . d . } } { \\sim } \\mathcal { U } ( A )$ and produce augmented points $\\tilde { \\mathbf { x } } _ { i } = a _ { i } ( \\mathbf { x } )$ for $i \\in \\{ 1 , \\ldots , B \\}$ \n2: Compute estimate $\\begin{array} { r } { \\tilde { p } = \\frac { 1 } { B } \\sum _ { i = 1 } ^ { B } p _ { \\theta } ( y | \\tilde { \\mathbf { x } } _ { i } ) \\approx \\bar { p } _ { \\theta } ( y | \\mathbf { x } ) } \\end{array}$ and $\\tilde { \\ell } = H ( \\tilde { p } ) \\approx \\ell ( \\theta ; { \\mathbf x } )$ , i.e., Eq. 2 \n3: Adapt parameters via update rule $\\theta ^ { \\prime } G ( \\theta , \\eta , \\tilde { \\ell } )$ \n4: Predict $\\hat { y } \\triangleq \\arg \\operatorname* { m a x } _ { y } p _ { \\theta ^ { \\prime } } ( y | \\mathbf { x } )$ ",
223
+ "bbox": [
224
+ 178,
225
+ 111,
226
+ 821,
227
+ 196
228
+ ],
229
+ "page_idx": 3
230
+ },
231
+ {
232
+ "type": "text",
233
+ "text": "3.1 Marginal Entropy Minimization with One test point ",
234
+ "text_level": 1,
235
+ "bbox": [
236
+ 173,
237
+ 222,
238
+ 575,
239
+ 238
240
+ ],
241
+ "page_idx": 3
242
+ },
243
+ {
244
+ "type": "text",
245
+ "text": "Given a test point $\\mathbf { x }$ and set of augmentation functions $\\mathcal { A }$ , we sample $B$ augmentations from $\\mathcal { A }$ and apply them to $\\mathbf { x }$ in order to produce a batch of augmented data $\\tilde { \\mathbf { x } } _ { 1 } , \\ldots , \\tilde { \\mathbf { x } } _ { B }$ . The model’s average, or marginal, output distribution with respect to the augmented points is given by ",
246
+ "bbox": [
247
+ 174,
248
+ 247,
249
+ 825,
250
+ 290
251
+ ],
252
+ "page_idx": 3
253
+ },
254
+ {
255
+ "type": "equation",
256
+ "img_path": "images/167b4ea9af7ac8b59f113a9ace265ae53c53372b280892f06b1650ed3db85e40.jpg",
257
+ "text": "$$\n\\bar { p } _ { \\theta } ( y | \\mathbf { x } ) \\triangleq \\mathbb { E } _ { \\mathcal { U } ( \\mathcal { A } ) } \\left[ p _ { \\theta } ( y | a ( \\mathbf { x } ) ) \\right] \\approx \\frac { 1 } { B } \\sum _ { i = 1 } ^ { B } p _ { \\theta } ( y | \\tilde { \\mathbf { x } } _ { i } ) ,\n$$",
258
+ "text_format": "latex",
259
+ "bbox": [
260
+ 330,
261
+ 292,
262
+ 665,
263
+ 337
264
+ ],
265
+ "page_idx": 3
266
+ },
267
+ {
268
+ "type": "text",
269
+ "text": "where the expectation is with respect to uniformly sampled augmentations $a \\sim \\mathcal { U } ( A )$ . ",
270
+ "bbox": [
271
+ 171,
272
+ 339,
273
+ 736,
274
+ 354
275
+ ],
276
+ "page_idx": 3
277
+ },
278
+ {
279
+ "type": "text",
280
+ "text": "What properties do we desire from this marginal distribution? To answer this question, consider the role that data augmentation typically serves during training. For each training point $\\left( { \\bf x } ^ { \\mathrm { t r a i n } } , y ^ { \\mathrm { t r a i n } } \\right)$ , the model $f _ { \\theta }$ is trained using multiple augmented forms of the input $\\tilde { \\mathbf { x } } _ { 1 } ^ { \\mathrm { t r a i n } } , \\ldots , \\tilde { \\mathbf { x } } _ { E } ^ { \\mathrm { t r a i n } }$ . $f$ is trained to obey the invariances between the augmentations and the label – no matter the augmentation on $\\mathbf { x } ^ { \\mathrm { t r a i n } }$ , $f$ should predict, with confidence, the same label $y ^ { \\mathrm { t r a i n } }$ . We seek to devise a similar learning signal during test time, without any ground truth labels. That is, after adapting: ",
281
+ "bbox": [
282
+ 173,
283
+ 359,
284
+ 825,
285
+ 446
286
+ ],
287
+ "page_idx": 3
288
+ },
289
+ {
290
+ "type": "text",
291
+ "text": "(1) the model $f _ { \\theta }$ predictions should be invariant across augmented versions of the test point, and (2) the model $f _ { \\theta }$ should be confident in its predictions, even for heavily augmented versions of the test point, since all versions have the same underlying label. ",
292
+ "bbox": [
293
+ 174,
294
+ 454,
295
+ 825,
296
+ 500
297
+ ],
298
+ "page_idx": 3
299
+ },
300
+ {
301
+ "type": "text",
302
+ "text": "Optimizing the model for more confident predictions can be justified from the assumption that the true underlying decision boundaries between classes lie in low density regions of the data space $\\textcircled { 8 }$ . With these two goals in mind, we propose to adapt the model using the entropy of its marginal output distribution over augmentations $\\underline { { \\operatorname { d } \\dot { \\operatorname { E q . } } \\dot { 1 } ) } }$ , i.e., ",
303
+ "bbox": [
304
+ 174,
305
+ 508,
306
+ 825,
307
+ 565
308
+ ],
309
+ "page_idx": 3
310
+ },
311
+ {
312
+ "type": "equation",
313
+ "img_path": "images/38f79de4ec6d2f88467dca608625ef272a52c1153d3c21d395cadf8ac6b9fefe.jpg",
314
+ "text": "$$\n\\ell ( \\theta ; \\mathbf { x } ) \\triangleq H \\left( \\bar { p } _ { \\theta } ( \\cdot | \\mathbf { x } ) \\right) = - \\sum _ { y \\in \\mathcal { Y } } \\bar { p } _ { \\theta } ( y | \\mathbf { x } ) \\log \\bar { p } _ { \\theta } ( y | \\mathbf { x } ) .\n$$",
315
+ "text_format": "latex",
316
+ "bbox": [
317
+ 323,
318
+ 568,
319
+ 673,
320
+ 603
321
+ ],
322
+ "page_idx": 3
323
+ },
324
+ {
325
+ "type": "text",
326
+ "text": "Note that this objective is not the same as optimizing the average conditional entropy of the model’s predictive distributions across augmentations, i.e., ",
327
+ "bbox": [
328
+ 174,
329
+ 606,
330
+ 821,
331
+ 635
332
+ ],
333
+ "page_idx": 3
334
+ },
335
+ {
336
+ "type": "equation",
337
+ "img_path": "images/0bc73768db961d265fc945815923b2331129333602064c177dfa5e006862b3f8.jpg",
338
+ "text": "$$\n\\ell _ { \\mathrm { { C E } } } ( \\boldsymbol { \\theta } ; \\mathbf { x } ) \\triangleq \\frac { 1 } { B } \\sum _ { i = 1 } ^ { B } H ( p _ { \\boldsymbol { \\theta } } ( \\cdot | \\widetilde { \\mathbf { x } } _ { i } ) ) .\n$$",
339
+ "text_format": "latex",
340
+ "bbox": [
341
+ 388,
342
+ 637,
343
+ 609,
344
+ 681
345
+ ],
346
+ "page_idx": 3
347
+ },
348
+ {
349
+ "type": "text",
350
+ "text": "A model which predicts confidently but differently across augmentations would minimize $\\operatorname { E q . 3 }$ but not $\\boxed { \\mathrm { E q . ~ } 2 }$ Optimizing $\\operatorname { E q } . 2$ encourages both confidence and invariance, since the entropy of $\\bar { p } _ { \\theta } ( \\cdot | \\mathbf { x } )$ is minimized when the model outputs the same (confident) prediction regardless of the augmentation. ",
351
+ "bbox": [
352
+ 173,
353
+ 683,
354
+ 825,
355
+ 724
356
+ ],
357
+ "page_idx": 3
358
+ },
359
+ {
360
+ "type": "text",
361
+ "text": "Algorithm 1 presents the overall method MEMO for test time adaptation. Though prior test time adaptation methods must carefully choose which parameters to adapt in order to avoid degenerate solutions $\\lVert \\overline { { 4 6 } } \\rVert$ , our adaptation procedure simply adapts all of the model’s parameters $\\theta$ (line 3). Given that $p _ { \\boldsymbol { \\theta } } ( \\boldsymbol { y } | \\mathbf { x } )$ is differentiable with respect to $\\theta$ , we can directly use gradient based optimization to adapt $\\theta$ according to $\\mathbb { E } { \\mathsf { q } } . 2 \\mathbb { Z }$ We use only one gradient step per test point, because empirically we found this to be sufficient for improved performance while being more computationally efficient. After this step, we use the adapted model $f _ { \\theta ^ { \\prime } }$ to predict on the original test input $\\mathbf { x }$ (line 4). ",
362
+ "bbox": [
363
+ 173,
364
+ 731,
365
+ 825,
366
+ 829
367
+ ],
368
+ "page_idx": 3
369
+ },
370
+ {
371
+ "type": "text",
372
+ "text": "3.2 Composing MEMO with Prior Methods ",
373
+ "text_level": 1,
374
+ "bbox": [
375
+ 174,
376
+ 843,
377
+ 491,
378
+ 859
379
+ ],
380
+ "page_idx": 3
381
+ },
382
+ {
383
+ "type": "text",
384
+ "text": "An additional benefit of MEMO is that it synergizes with other approaches for handling distribution shift. In particular, MEMO can be composed with prior methods for training robust models and adapting model statistics, thus leveraging the performance improvements of each technique. ",
385
+ "bbox": [
386
+ 174,
387
+ 868,
388
+ 825,
389
+ 911
390
+ ],
391
+ "page_idx": 3
392
+ },
393
+ {
394
+ "type": "image",
395
+ "img_path": "images/6ecb312275c8b833a76347f6c7ba3d2b80f52b0b71a12da6610da54a844f0e30.jpg",
396
+ "image_caption": [
397
+ "Figure 2: We visualize augmentations of a randomly chosen data point from the “Gaussian Noise level 3” ImageNet-C test set. Even for a robust model trained with heavy data augmentations [14], both its predictive accuracy and confidence (as shown in the top two rows) drop sharply when encountering test shift. As shown in the bottom two rows, these drops can be remedied via MEMO adaptation. "
398
+ ],
399
+ "image_footnote": [],
400
+ "bbox": [
401
+ 222,
402
+ 90,
403
+ 774,
404
+ 401
405
+ ],
406
+ "page_idx": 4
407
+ },
408
+ {
409
+ "type": "text",
410
+ "text": "Pretrained robust models. Since MEMO makes no assumptions about, or modifications to, the model training procedure, performing adaptation on top of pretrained robust models, such as those trained with heavy data augmentations, is as simple as using any other pretrained model. Crucially, we find that, in practice, the set of test augmentations $\\mathcal { A }$ does not have to match the augmentations that were used to train the model. For simplicity and efficiency, we use augmentations that can be easily sampled and are applied directly to the model input x. These properties do not hold for, e.g., data augmentation techniques based on image translation models, such as DeepAugment $\\textcircled { 1 1 4 } \\textcircled { 1 }$ , or feature mixing, such as moment exchange $\\checkmark$ . However, we can still use models trained with these data augmentation techniques as our starting point for adaptation, thus allowing us to improve upon their state-of-the-art results. As noted above, using pretrained models is not as easily accomplished for adaptation methods which require complicated or specialized training procedures and model architectures, such as TTT $\\mathbb { H } 4 4 \\mathbb { I }$ or ARM $[ \\bar { 1 } \\bar { 5 } 2 ]$ . In our experiments, we use AugMix as our set of augmentations $\\mathbb { \\lVert \\rVert 3 \\rVert }$ , as it satisfies the above properties and still yields significant diversity when applied, as depicted in $\\mathbb { F i g u r e 2 } $ Note that AugMix explicitly does not use augmentations that are similar to the corruptions in the CIFAR-10-C and ImageNet-C test sets [12, 13]. ",
411
+ "bbox": [
412
+ 174,
413
+ 489,
414
+ 825,
415
+ 698
416
+ ],
417
+ "page_idx": 4
418
+ },
419
+ {
420
+ "type": "text",
421
+ "text": "Adapting BN statistics. Schneider et al. $\\mathbb { \\left[ \\left. 4 0 \\right] \\right. }$ showed that, even when presented with just a single test point, partially adapting the estimated mean and variance of the activations in each batch normalization (BN) layer of the model can still be effective in some cases for handling distribution shift. In this setting, to prevent overfitting to the test point, the channelwise mean and variance $[ \\mu _ { \\mathrm { t e s t } } , \\sigma _ { \\mathrm { t e s t } } ^ { 2 } ]$ estimated from this point are mixed with the the mean and variance $[ \\mu _ { \\mathrm { t r a i n } } , \\sigma _ { \\mathrm { t r a i n } } ^ { 2 } ]$ computed during training according to a prior strength $N$ . That is, for $\\pmb { \\nu } \\in \\{ \\mu , \\sigma ^ { 2 } \\}$ , ",
422
+ "bbox": [
423
+ 173,
424
+ 712,
425
+ 825,
426
+ 796
427
+ ],
428
+ "page_idx": 4
429
+ },
430
+ {
431
+ "type": "equation",
432
+ "img_path": "images/cfb84e51768d4e96146e48039f127d2a083113d56b9205f05892affb31cf0c42.jpg",
433
+ "text": "$$\n\\pmb { \\nu } \\triangleq \\frac { N } { N + 1 } \\pmb { \\nu } _ { \\mathrm { t r a i n } } + \\frac { 1 } { N + 1 } \\pmb { \\nu } _ { \\mathrm { t e s t } } .\n$$",
434
+ "text_format": "latex",
435
+ "bbox": [
436
+ 392,
437
+ 803,
438
+ 606,
439
+ 835
440
+ ],
441
+ "page_idx": 4
442
+ },
443
+ {
444
+ "type": "text",
445
+ "text": "This technique is also straightforward to combine with MEMO: we simply use the adapted BN statistics whenever computing the model’s output distribution. We find in our experiments that this technique never degrades, and generally improves, the performance of test time adaptation, thus we combine MEMO with this technique by default whenever applicable. Following the suggestion in Schneider et al. $\\mathbb { \\left[ \\left| 4 0 \\right| \\right] }$ , we set $N = 1 6$ for all of our experiments in the next section. ",
446
+ "bbox": [
447
+ 174,
448
+ 842,
449
+ 825,
450
+ 911
451
+ ],
452
+ "page_idx": 4
453
+ },
454
+ {
455
+ "type": "text",
456
+ "text": "4 Experiments ",
457
+ "text_level": 1,
458
+ "bbox": [
459
+ 174,
460
+ 89,
461
+ 312,
462
+ 107
463
+ ],
464
+ "page_idx": 5
465
+ },
466
+ {
467
+ "type": "text",
468
+ "text": "Our experiments aim to answer the following questions: ",
469
+ "bbox": [
470
+ 173,
471
+ 121,
472
+ 542,
473
+ 136
474
+ ],
475
+ "page_idx": 5
476
+ },
477
+ {
478
+ "type": "text",
479
+ "text": "(1) How does MEMO compare to prior methods for test time adaptation and test time robustness? (2) Can MEMO be combined with a wide range of model architectures and pretraining methods? (3) Which aspect of MEMO, the adaptation or augmentation, is the most important? ",
480
+ "bbox": [
481
+ 173,
482
+ 146,
483
+ 818,
484
+ 195
485
+ ],
486
+ "page_idx": 5
487
+ },
488
+ {
489
+ "type": "text",
490
+ "text": "We evaluate MEMO on a total of five distribution shift benchmarks. We conduct CIFAR-10 [22] experiments on the CIFAR-10-C [12] and CIFAR-10.1 [37] test sets, and we conduct ImageNet [38] experiments on the ImageNet-C [12], ImageNet-R [14], and ImageNet-A [15] test sets. ",
491
+ "bbox": [
492
+ 173,
493
+ 205,
494
+ 823,
495
+ 248
496
+ ],
497
+ "page_idx": 5
498
+ },
499
+ {
500
+ "type": "text",
501
+ "text": "To answer question (1), we compare to test time training (TTT) [44] in the CIFAR-10 experiments, for which we train ResNet-26 models following their protocol and specialized architecture. We do not compare to TTT for the ImageNet experiments due to the computational demands of training state-of-the-art models and because Sun et al. [44] do not report competitive ImageNet results. For the ImageNet experiments, we compare to Tent $[ \\overline { { | 4 6 | } }$ and BN adaptation, which can be used with pretrained models but require multiple test inputs (or even the entire test set) for adaptation. We provide BN adaptation with 256 test inputs at a time and set the prior strength $N = 2 5 6$ [40]. ",
502
+ "bbox": [
503
+ 173,
504
+ 253,
505
+ 825,
506
+ 352
507
+ ],
508
+ "page_idx": 5
509
+ },
510
+ {
511
+ "type": "text",
512
+ "text": "For Tent, we use test batch sizes of 64 and, for ResNet-50 models, test both “online” adaptation – where the model adapts continually through the entire evaluation – and “episodic” adaptation – where the model is reset after each test batch $\\overline { { \\lVert \\textcircled { 4 6 } \\rVert } }$ . Note that the evaluation protocols are different for these two methods: whereas MEMO is tasked with predicting on each test point immediately after adaptation, BN adaptation predicts on a batch of 256 test points after computing BN statistics on the batch, and Tent predicts on a batch of 64 inputs after adaptation but also, in the online setting, continually adapts throughout evaluation. In all experiments, we further compare to single point BN adaptation $\\mathbb { \\left[ \\left| 4 0 \\right| \\right] }$ and the TTA baseline that simply predicts according to $\\bar { p } _ { \\boldsymbol { \\theta } } ( y | \\mathbf { \\bar { x } } )$ (Eq. 1) [23, 2]. Full details on our experimental protocol are provided in Appendix A. ",
513
+ "bbox": [
514
+ 173,
515
+ 357,
516
+ 826,
517
+ 483
518
+ ],
519
+ "page_idx": 5
520
+ },
521
+ {
522
+ "type": "text",
523
+ "text": "To answer question (2), we apply MEMO on top of multiple pretrained models with different architectures, trained via several different procedures. For CIFAR-10, we train our own ResNet26 [11] models. For ImageNet, we use the best performing ResNet-50 robust models from prior work, which includes those trained with DeepAugment and AugMix augmentations $[ \\textcircled { 1 4 } ]$ as well as those trained with moment exchange and CutMix $\\pmb { \\Vert 2 4 \\Vert }$ . To evaluate the generality of prior test time robustness methods and MEMO, we also evaluate the small robust vision transformer $\\mathrm { R V T ^ { * } }$ -small), which provides superior performance on all three ImageNet distribution shift benchmarks compared to the robust ResNet-50 models $\\pmb { \\mathbb { B } } \\pmb { \\mathrm { 0 } }$ . Finally, we evaluate ResNext-101 models [50, 28] on ImageNet-A, as these models previously achieved the strongest results for this test set [14]. ",
524
+ "bbox": [
525
+ 173,
526
+ 488,
527
+ 826,
528
+ 613
529
+ ],
530
+ "page_idx": 5
531
+ },
532
+ {
533
+ "type": "text",
534
+ "text": "Finally, to answer (3), we conduct ablative studies in subsection 4.2: first to determine the relative importance of maximizing confidence (via entropy minimization) versus enforcing invariant predictions across augmented copies of each test point, second to determine the importance of the particular augmentation functions used, and third to determine the required number of augmented samples per inference. The comparison to the non adaptive TTA baseline also helps determine whether simply augmenting the test point is sufficient or if adaptation is additionally helpful. In Appendix B, we provide further experiments ablating the augmentation component specifically. ",
535
+ "bbox": [
536
+ 174,
537
+ 619,
538
+ 825,
539
+ 717
540
+ ],
541
+ "page_idx": 5
542
+ },
543
+ {
544
+ "type": "text",
545
+ "text": "4.1 Main Results ",
546
+ "text_level": 1,
547
+ "bbox": [
548
+ 174,
549
+ 733,
550
+ 305,
551
+ 748
552
+ ],
553
+ "page_idx": 5
554
+ },
555
+ {
556
+ "type": "text",
557
+ "text": "We summarize results for CIFAR-10, CIFAR-10.1, and CIFAR-10-C in Table 1, with full CIFAR-10- C results in Appendix C. We use indentations to indicate composition, e.g., TTT is performed at test time on top of their specialized joint training procedure. Across all corruption types in CIFAR-10-C, MEMO consistently improves test error compared to the baselines, non adaptive TTA, and TTT. MEMO also provides a larger performance gain on CIFAR-10.1 compared to TTT. We find that the non adaptive TTA baseline is competitive for these relatively simple test sets, though it is worse than MEMO for CIFAR-10-C. Of these three test sets, CIFAR-10-C is the only benchmark that explicitly introduces distribution shift, which suggests that adaptation is useful when the test shifts are more prominent. Both TTA and MEMO are also effective at improving performance for the original CIFAR-10 test set where there is no distribution shift, providing further support for the widespread use of augmentations in standard evaluation protocols [23, 2]. ",
558
+ "bbox": [
559
+ 174,
560
+ 758,
561
+ 825,
562
+ 911
563
+ ],
564
+ "page_idx": 5
565
+ },
566
+ {
567
+ "type": "table",
568
+ "img_path": "images/99bfc676c738ea68f9e9adb000a8e2a91411abcf23411fafa5eed399df4a27ad.jpg",
569
+ "table_caption": [
570
+ "Table 1: Results for CIFAR-10, CIFAR-10.1, and CIFAR-10-C. ?Results from Sun et al. [44]. "
571
+ ],
572
+ "table_footnote": [],
573
+ "table_body": "<table><tr><td></td><td>CIFAR-10 Error (%)</td><td>CIFAR-10.1 Error (%)</td><td>CIFAR-10-C Average Error (%)</td></tr><tr><td>ResNet-26 □</td><td>9.2</td><td>18.4</td><td>22.5</td></tr><tr><td>+TTA</td><td>7.3 (-1.9)</td><td>14.8 (-3.6)</td><td>19.9 (-2.6)</td></tr><tr><td>+ MEMO (ours)</td><td>7.3 (-1.9)</td><td>14.7 (-3.7)</td><td>19.6 (-2.9)</td></tr><tr><td>+ Joint training* 国</td><td>8.1</td><td>16.7</td><td>22.8</td></tr><tr><td>+ TTT* 因</td><td>7.9 (-0.2)</td><td>15.9 (-0.8)</td><td>21.5 (-1.3)</td></tr></table>",
574
+ "bbox": [
575
+ 251,
576
+ 111,
577
+ 745,
578
+ 226
579
+ ],
580
+ "page_idx": 6
581
+ },
582
+ {
583
+ "type": "table",
584
+ "img_path": "images/e3fb13207ebb1acc9e6ea8271f8ca42c7bfd611354282adb61042ad553128b29.jpg",
585
+ "table_caption": [
586
+ "Table 2: Test results for the ImageNet test sets. MEMO achieves new state-of-the-art performance on each benchmark for ResNet-50 models for the single test point setting. For $\\mathbf { R V T ^ { * } }$ -small, MEMO improves performance across all benchmarks and reaches a new state of the art for ImageNet-C and ImageNet-R. Compared to prior approaches, MEMO offers more consistent improvements. "
587
+ ],
588
+ "table_footnote": [],
589
+ "table_body": "<table><tr><td></td><td>ImageNet-C mCE↓</td><td>ImageNet-R Error (%)</td><td>ImageNet-A Error (%)</td></tr><tr><td>Baseline ResNet-50 自</td><td>76.7</td><td>63.9</td><td>100.0</td></tr><tr><td>+ TTA</td><td>77.9 (+1.2)</td><td>61.3 (-2.6)</td><td>98.4 (-1.6)</td></tr><tr><td>+ Single point BN</td><td>71.4 (-5.3)</td><td>61.1 (-2.8)</td><td>99.4 (-0.6)</td></tr><tr><td>+ MEMO (ours)</td><td>69.9 (-6.8)</td><td>58.8 (-5.1)</td><td>99.1 (-0.9)</td></tr><tr><td>+ BN (N = 256,n = 256)</td><td>61.6 (-15.1)</td><td>59.7 (-4.2)</td><td>99.8 3(-0.2)</td></tr><tr><td>+ Tent (online) [ 46</td><td>54.4 (−22.3)</td><td>57.7 (-6.2)</td><td>99.8 (-0.2)</td></tr><tr><td>+ Tent (episodic)</td><td>64.7 (−12.0)</td><td>61.0 (-2.9)</td><td>99.7 ( (-0.3)</td></tr><tr><td> + DeepAugment+AugMix [14]</td><td>53.6</td><td>53.2</td><td>96.1</td></tr><tr><td>+ TTA</td><td>55.2 (+1.6)</td><td>51.0 (-2.2)</td><td>93.5 (-2.6)</td></tr><tr><td>+ Single point BN</td><td>51.3 (-2.3)</td><td>51.2 (-2.0)</td><td>95.4 (-0.7)</td></tr><tr><td>+ MEMO (ours)</td><td>49.8 (-3.8)</td><td>49.2 (-4.0)</td><td>94.8 (-1.3)</td></tr><tr><td>+ BN(N = 256,n = 256)</td><td>45.4 (−8.2)</td><td>48.8 (-4.4)</td><td>96.8 (+0.7)</td></tr><tr><td>+ Tent (online)</td><td>43.5 (-10.1)</td><td>46.9 (-6.3)</td><td>96.7 (+0.6)</td></tr><tr><td> + Tent (episodic)</td><td>47.1 (-6.5)</td><td>50.1 (-3.1)</td><td>96.6 (+0.5)</td></tr><tr><td>+ MoEx+CutMix 2</td><td>74.8</td><td>64.5</td><td>91.9</td></tr><tr><td>+ TTA</td><td>75.7 (+0.9)</td><td>62.7 (-1.8)</td><td>89.5 (-2.4)</td></tr><tr><td>+ Single point BN</td><td>71.0 (-3.8)</td><td>62.6 (−1.9)</td><td>91.1 (-0.8)</td></tr><tr><td>+ MEMO (ours)</td><td>69.1 (-5.7)</td><td>59.4 (-3.3)</td><td>89.0 (-2.9)</td></tr><tr><td>+ BN (N = 256,n = 256)</td><td>60.9 (-13.9)</td><td>61.6 (-2.9)</td><td>93.9 (+2.0)</td></tr><tr><td>+ Tent (online)</td><td>54.0 (-20.8)</td><td>58.7 (-5.8)</td><td>94.4 (+2.5)</td></tr><tr><td>+ Tent (episodic)</td><td>66.2 (-8.6)</td><td>63.9 (-0.6)</td><td>94.7 (+2.8)</td></tr><tr><td>RVT*-small □</td><td>49.4</td><td>52.3</td><td>73.9</td></tr><tr><td>+ TTA</td><td>53.0 (+3.6)</td><td>49.0 (-3.3)</td><td>68.9 (-5.0)</td></tr><tr><td>+ Single point BN</td><td>48.0 (-1.4)</td><td>51.1 (-1.2)</td><td>74.4 (+0.5)</td></tr><tr><td>+ MEMO (ours)</td><td>40.6 (-8.8)</td><td>43.8 (-8.5)</td><td>69.8 (-4.1)</td></tr><tr><td>+ BN (N = 256,n = 256)</td><td>44.3 (-5.1)</td><td>51.0 ( (-1.3)</td><td>78.3 (+4.4)</td></tr><tr><td>+ Tent (online)</td><td>46.8 (-2.6)</td><td> 50.7 (-1.6)</td><td>82.1 (+8.2)</td></tr><tr><td>+ Tent (adapt all)</td><td>44.7 (-4.7)</td><td>74.1 (+21.8)</td><td>81.1 (+7.2)</td></tr></table>",
590
+ "bbox": [
591
+ 232,
592
+ 305,
593
+ 766,
594
+ 743
595
+ ],
596
+ "page_idx": 6
597
+ },
598
+ {
599
+ "type": "text",
600
+ "text": "We summarize results for ImageNet-C, ImageNet-R, and ImageNet-A in Table 2, with complete ImageNet-C results in $\\boxed { \\mathrm { A p p e n d i x ~ C } }$ We again use indentations to indicate composition, e.g., the best results on ImageNet-C for our setting are attained through a combination of starting from a model trained with DeepAugment and AugMix [14] and using MEMO on top. For both ImageNet-C and ImageNet-R, and for both the ResNet-50 and $\\mathbf { R V T ^ { * } }$ -small models, combining MEMO with robust training techniques leads to new state-of-the-art performance among methods that observe only one test point at a time. We highlight in gray the methods that require multiple test points for adaptation, and we list in bold the best results from these methods which outperform the test time robustness methods. As Table 2 and prior work both show [40, 46], accessing multiple test points can be powerful for benchmarks such as ImageNet-C and ImageNet-R, in which inferred statistics from the test input distribution may aid in prediction. However, these methods do not help, and oftentimes even hurt, for ImageNet-A. Furthermore, we find that these methods are less effective with the $\\mathrm { R V T ^ { * } }$ -small model, which may indicate their sensitivity to model architecture choices. Therefore, for this model, we also test a modification of Tent which adapts all parameters, and we find that this version of Tent works better for ImageNet-C but is significantly worse for ImageNet-R. ",
601
+ "bbox": [
602
+ 173,
603
+ 772,
604
+ 825,
605
+ 911
606
+ ],
607
+ "page_idx": 6
608
+ },
609
+ {
610
+ "type": "text",
611
+ "text": "",
612
+ "bbox": [
613
+ 174,
614
+ 90,
615
+ 825,
616
+ 161
617
+ ],
618
+ "page_idx": 7
619
+ },
620
+ {
621
+ "type": "text",
622
+ "text": "MEMO also results in substantial improvement for ImageNet-A. No prior test time adaptation methods have reported improvements on ImageNet-A, and some have reported explicit negative results $\\mathbb { H O }$ . As discussed, it is reasonable for adaptation methods that rely on multiple test points to achieve greater success on other benchmarks such as ImageNet-C, in which a batch of inputs provides significant information about the specific corruption that must be dealt with. In contrast, ImageNet-A does not have such obvious characteristics associated with the input distribution, as it is simply a collection of images that are difficult to classify. As MEMO instead extracts a learning signal from single test points, it is, to the best of our knowledge, the first test time adaptation method to report successful results on this testbed. We view the consistency with which MEMO outperforms the best prior methods, which change across different test sets, as a major advantage of the proposed method. ",
623
+ "bbox": [
624
+ 173,
625
+ 166,
626
+ 825,
627
+ 305
628
+ ],
629
+ "page_idx": 7
630
+ },
631
+ {
632
+ "type": "text",
633
+ "text": "TTA is the most competitive prior method for ImageNet-A, e.g., it results in larger improvements than MEMO for the $\\mathbf { R V T ^ { * } }$ -small model. MEMO, however, achieves state-of-the-art performance among ResNet-50 models. To further compare MEMO to TTA, in Table 3, we evaluate whether MEMO can successfully adapt ResNext-101 models $ { \\Vert 5 0 \\Vert }$ and further improve performance on this challenging test set. We evaluate both a ResNext-101 (32x8d) baseline model pretrained on ImageNet, as well as the same model pretrained with weakly supervised learning (WSL) on billions of Instagram images $\\bar { \\left\\| 2 8 \\right\\| }$ . For the ",
634
+ "bbox": [
635
+ 174,
636
+ 313,
637
+ 452,
638
+ 518
639
+ ],
640
+ "page_idx": 7
641
+ },
642
+ {
643
+ "type": "table",
644
+ "img_path": "images/671d04f0f19b60ee1e6184c559481acaa2c5d29217b4118973764c1bb3859200.jpg",
645
+ "table_caption": [
646
+ "Table 3: ImageNet-A results for the ResNext-101s. "
647
+ ],
648
+ "table_footnote": [],
649
+ "table_body": "<table><tr><td colspan=\"2\">ImageNet-A Error (%)</td></tr><tr><td>ResNext-101 ⑤0</td><td>90.0</td></tr><tr><td>+ TTA</td><td>83.2 (-6.8)</td></tr><tr><td>+ Single point BN</td><td>88.8 (-1.2)</td></tr><tr><td>+ MEMO (ours)</td><td>84.3 (-5.7)</td></tr><tr><td>+ WSL [28]</td><td>54.9</td></tr><tr><td>+ TTA</td><td>49.1 (-5.8)</td></tr><tr><td>+ Single point BN</td><td>58.9 (+4.0)</td></tr><tr><td>+ MEMO (ours)</td><td>43.2 (−11.7)</td></tr></table>",
650
+ "bbox": [
651
+ 480,
652
+ 353,
653
+ 808,
654
+ 493
655
+ ],
656
+ "page_idx": 7
657
+ },
658
+ {
659
+ "type": "text",
660
+ "text": "WSL model, we did not use single point BN adaptation for MEMO as we found this technique to be actually harmful to performance, and this corroborates previous findings $\\mathbb { H O }$ . From the results, we can see that, although both TTA and MEMO significantly improve upon the baseline model evaluation, MEMO ultimately achieves the best accuracy by a significant margin as it is more successful at adapting the WSL model. This suggests that MEMO may synergize well with large scale pretraining, and further exploring this combination is an interesting direction for future work. ",
661
+ "bbox": [
662
+ 174,
663
+ 518,
664
+ 826,
665
+ 602
666
+ ],
667
+ "page_idx": 7
668
+ },
669
+ {
670
+ "type": "text",
671
+ "text": "4.2 Ablative Study ",
672
+ "text_level": 1,
673
+ "bbox": [
674
+ 174,
675
+ 619,
676
+ 315,
677
+ 633
678
+ ],
679
+ "page_idx": 7
680
+ },
681
+ {
682
+ "type": "text",
683
+ "text": "MEMO uses both adaptation and augmentations. In this section, we ablate the adaptation procedure and the number of augmentations, and in Appendix B we ablate the choice of augmentations. ",
684
+ "bbox": [
685
+ 174,
686
+ 645,
687
+ 823,
688
+ 675
689
+ ],
690
+ "page_idx": 7
691
+ },
692
+ {
693
+ "type": "text",
694
+ "text": "Adaptation procedure. From the results above, we conclude that adaptation generally provides additional benefits beyond simply using TTA to predict via the marginal output distribution $\\bar { p } _ { \\boldsymbol { \\theta } } ( y | \\mathbf { x } )$ . However, we can disentangle two distinct self-supervised learning signals that may be effective for adaptation: encouraging invariant predictions across different augmentations of the test point, and encouraging confidence via entropy minimization. The marginal entropy objective in $\\operatorname { \\bar { E } q } . 2$ encapsulates both of these learning signals, but it cannot easily be decomposed into these pieces. We instead use two ablative adaptation methods that each only make use of one of these learning signals. ",
695
+ "bbox": [
696
+ 174,
697
+ 690,
698
+ 826,
699
+ 787
700
+ ],
701
+ "page_idx": 7
702
+ },
703
+ {
704
+ "type": "text",
705
+ "text": "First, we consider optimizing the pairwise cross entropy between each pair of augmented points, i.e., ",
706
+ "bbox": [
707
+ 173,
708
+ 792,
709
+ 825,
710
+ 809
711
+ ],
712
+ "page_idx": 7
713
+ },
714
+ {
715
+ "type": "equation",
716
+ "img_path": "images/4e2f2d61b5960a73253a81a87246f66cccb9fcc83b8277866bf56c097a3590e3.jpg",
717
+ "text": "$$\n\\ell _ { \\mathrm { P C E } } ( \\boldsymbol { \\theta } ; \\mathbf { x } ) \\triangleq \\frac { 1 } { B \\times ( B - 1 ) } \\sum _ { i = 1 } ^ { B } \\sum _ { j \\neq i } H ( p _ { \\boldsymbol { \\theta } } ( \\cdot | \\widetilde { \\mathbf { x } } _ { i } ) , p _ { \\boldsymbol { \\theta } } ( \\cdot | \\widetilde { \\mathbf { x } } _ { j } ) ) ,\n$$",
718
+ "text_format": "latex",
719
+ "bbox": [
720
+ 305,
721
+ 815,
722
+ 691,
723
+ 862
724
+ ],
725
+ "page_idx": 7
726
+ },
727
+ {
728
+ "type": "text",
729
+ "text": "Where $\\tilde { \\mathbf { x } } _ { i }$ again refers to the $i$ -th sampled augmentation applied to $\\mathbf { x }$ . Intuitively, this loss function encourages the model to adapt such that it produces the same predictive distribution for all augmentations of the test point, but it does not encourage the model to produce confident predictions. ",
730
+ "bbox": [
731
+ 176,
732
+ 869,
733
+ 825,
734
+ 911
735
+ ],
736
+ "page_idx": 7
737
+ },
738
+ {
739
+ "type": "table",
740
+ "img_path": "images/42bf0790beea96abab2d0fb609dac6b3c3e1e406494824382177df686e95f8f7.jpg",
741
+ "table_caption": [
742
+ "Table 4: Ablating the adaptation objective to test pairwise cross entropy and conditional entropy (CE) based adaptation. MEMO generally performs the best, indicating that both encouraging invariance across augmentations and confidence are helpful in adapting the model. "
743
+ ],
744
+ "table_footnote": [],
745
+ "table_body": "<table><tr><td></td><td>CIFAR-10 Error (%)</td><td>CIFAR-10.1 Error (%)</td><td>CIFAR-10-C Average Error (%)</td></tr><tr><td>ResNet-26 []</td><td>9.2</td><td>18.4</td><td>22.5</td></tr><tr><td>+ MEMO (ours)</td><td>7.3 (-1.9)</td><td>14.7 (-3.7)</td><td>19.6 (-2.9)</td></tr><tr><td>l (Eq. 2) )+lPCE 一</td><td>7.6 (-1.6)</td><td>15.3 (-3.1)</td><td>20.0 (-2.5)</td></tr><tr><td>Eq.2) + lcE</td><td>7.6 (-1.6)</td><td>14.7 (-3.7)</td><td>20.0 (-2.5)</td></tr><tr><td></td><td>ImageNet-C mCE↓</td><td>ImageNet-R Error (%)</td><td>ImageNet-A Error (%)</td></tr><tr><td>RVT*-small [30]</td><td>49.4</td><td>52.3</td><td>73.9</td></tr><tr><td>+ MEMO (ours)</td><td>40.6 (-8.8)</td><td>43.8 (-8.5)</td><td>69.8 (-4.1)</td></tr><tr><td>-l (Eq. 2) + lcE</td><td>41.2 (-8.2)</td><td>44.2 (−8.1)</td><td>69.7 (-4.2)</td></tr></table>",
746
+ "bbox": [
747
+ 240,
748
+ 140,
749
+ 756,
750
+ 320
751
+ ],
752
+ "page_idx": 8
753
+ },
754
+ {
755
+ "type": "image",
756
+ "img_path": "images/5eaa7e18247da47c2425c9985f500a9780838964f166482db468111dd95d274c.jpg",
757
+ "image_caption": [
758
+ "Figure 3: Plotting MEMO efficiency as seconds per evaluation $\\mathbf { \\dot { x } }$ axis) and $\\%$ test error on ImageNet-R (y axis) for the ResNet-50 models (left) and $\\mathrm { R V T ^ { * } }$ -small (right) while varying $B = \\{ 1 , 2 , 4 , 8 , 1 6 , 3 2 , 6 4 , 1 2 8 \\}$ . Note the log scale on the $\\mathbf { X }$ axis. "
759
+ ],
760
+ "image_footnote": [],
761
+ "bbox": [
762
+ 176,
763
+ 338,
764
+ 820,
765
+ 523
766
+ ],
767
+ "page_idx": 8
768
+ },
769
+ {
770
+ "type": "text",
771
+ "text": "Conversely, as an objective that encourages confidence but not invariance, we also consider optimizing the conditional entropy objective detailed in Eq. 3. This ablation is effectively a version of the episodic variant of Tent $[ \\overline { { | 4 6 | } }$ that produces augmented copies of a single test point rather than assuming access to a test batch. We first evaluate these ablations on the CIFAR-10 test sets. We use the same adaptation procedure and hyperparameters, with $\\ell$ replaced with the above objectives. ",
772
+ "bbox": [
773
+ 174,
774
+ 607,
775
+ 825,
776
+ 676
777
+ ],
778
+ "page_idx": 8
779
+ },
780
+ {
781
+ "type": "text",
782
+ "text": "The results are presented in Table 4. We see that MEMO, i.e., marginal entropy minimization, generally performs better than adaptation with either of the alternative objectives. This supports the hypothesis that both invariance across, and confidence on, the augmentations are important learning signals for self-supervised adaptation. When faced with CIFAR-10.1, we see poor performance from the pairwise cross entropy based adaptation method. On the original CIFAR-10 test set and CIFAR-10- C, the ablations perform nearly identically and uniformly worse than MEMO. To further test the $\\ell _ { \\mathrm { C E } }$ ablation, which is the stronger of the two ablations, we also evaluate it on the ImageNet test sets for the $\\mathrm { R V T ^ { * } }$ -small model. We find that, similarly, minimizing conditional entropy generally improves performance compared to the baseline evaluation. MEMO is more performant for ImageNet-C and ImageNet-R. Adaptation via $\\ell _ { \\mathrm { C E } }$ performs slightly better for ImageNet-A, though for this problem and model, TTA is still the best method. Thus, MEMO results in relatively small, but consistent, performance gains compared to only maximizing confidence on the augmentations. ",
783
+ "bbox": [
784
+ 173,
785
+ 683,
786
+ 825,
787
+ 849
788
+ ],
789
+ "page_idx": 8
790
+ },
791
+ {
792
+ "type": "text",
793
+ "text": "Number of augmentations. In Figure 3, we analyze the $\\%$ test error of MEMO adaptation on ImageNet-R as a function of the efficiency of adaptation, measured in seconds per evaluation. We achieve various tradeoffs by varying the number of augmented copies $B \\ =$ $\\{ 1 , 2 , 4 , 8 , 1 6 , 3 2 , 6 4 , 1 2 8 \\}$ . We note that small values of $B$ such as 4 and 8 can already provide significant performance gains, thus a practical tradeoff between efficiency and accuracy is possible. ",
794
+ "bbox": [
795
+ 174,
796
+ 869,
797
+ 825,
798
+ 911
799
+ ],
800
+ "page_idx": 8
801
+ },
802
+ {
803
+ "type": "text",
804
+ "text": "",
805
+ "bbox": [
806
+ 173,
807
+ 90,
808
+ 823,
809
+ 119
810
+ ],
811
+ "page_idx": 9
812
+ },
813
+ {
814
+ "type": "text",
815
+ "text": "For large $B$ , the wall clock time is dominated by computing the augmentations. For the baseline ResNet-50 model, single point BN adaptation requires an average of 0.0252 seconds per test point. TTA and MEMO with $B = 6 4$ are much slower – 0.7742 and 0.9746 seconds, respectively, per test point – but can be made significantly more efficient by using $B = 4$ augmented samples – 0.0631 and 0.1037 seconds, respectively. In our implementation, we do not compute augmentations in parallel, though in principle this is possible for AugMix and should drastically improve efficiency overall. These experiments used four Intel Xeon Skylake 6130 CPUs and one NVIDIA TITAN RTX GPU. ",
816
+ "bbox": [
817
+ 174,
818
+ 126,
819
+ 825,
820
+ 223
821
+ ],
822
+ "page_idx": 9
823
+ },
824
+ {
825
+ "type": "text",
826
+ "text": "5 Discussion ",
827
+ "text_level": 1,
828
+ "bbox": [
829
+ 174,
830
+ 242,
831
+ 292,
832
+ 260
833
+ ],
834
+ "page_idx": 9
835
+ },
836
+ {
837
+ "type": "text",
838
+ "text": "We presented MEMO, a method for test time robustification again distribution shift via adaptation and augmentation. MEMO does not require access or changes to the model training procedure and is thus broadly applicable for a wide range of model architectures pretrained in a number of different ways. Furthermore, MEMO adapts at test time using single test inputs, thus it does not assume access to multiple test points as in several recent methods for test time adaptation $\\mathbb { H O } \\mathbb { H } \\mathbb { H }$ . On a range of CIFAR-10 and ImageNet distribution shift benchmarks, and for ResNet, vision transformer, and, to an extent, ResNext models, MEMO consistently improves performance at test time and achieves several new state-of-the-art results for these models in the single test point setting. ",
839
+ "bbox": [
840
+ 174,
841
+ 273,
842
+ 825,
843
+ 386
844
+ ],
845
+ "page_idx": 9
846
+ },
847
+ {
848
+ "type": "text",
849
+ "text": "Inference via MEMO is more computationally expensive than standard model inference due to its augmentation and adaptation procedure – though, as the experiments above show, more favorable tradeoffs between efficiency and accuracy are possible with smaller values of $B$ , the number of augmentations per test point. One interesting direction for future work is to develop techniques for selectively determining when to adapt the model in order to achieve more efficient inference. For example, with well calibrated models $[ \\mathbb { 1 0 } ]$ , we may run simple “feedforward” inference when the prediction confidence is over a certain threshold, thus achieving better efficiency. Additionally, it would be interesting to explore MEMO in the test setting where the model is allowed to continually adapt as more test data is observed. In our preliminary experiments in this setting, MEMO tended to lead to degenerate solutions, e.g., the model predicting a constant label with maximal confidence regardless of the input. This failure mode may potentially be rectified by carefully choosing which parameters to adapt, such as only adapting the parameters in BN layers $\\boxed { \\boxplus 6 }$ , or regularizing the model such that it does not change too drastically from the pretrained model [26]. ",
850
+ "bbox": [
851
+ 174,
852
+ 392,
853
+ 825,
854
+ 571
855
+ ],
856
+ "page_idx": 9
857
+ },
858
+ {
859
+ "type": "text",
860
+ "text": "Acknowledgments and Disclosure of Funding ",
861
+ "text_level": 1,
862
+ "bbox": [
863
+ 174,
864
+ 592,
865
+ 553,
866
+ 608
867
+ ],
868
+ "page_idx": 9
869
+ },
870
+ {
871
+ "type": "text",
872
+ "text": "We thank members of the Robotic AI and Learning Lab and Berkeley AI Research for helpful discussions and feedback. MZ was supported in part by an NDSEG fellowship. CF is a CIFAR fellow. This research was partially supported by ARL DCIST CRA W911NF-17-2-0181 and ARO W911NF-21-1-0097. ",
873
+ "bbox": [
874
+ 174,
875
+ 623,
876
+ 825,
877
+ 679
878
+ ],
879
+ "page_idx": 9
880
+ },
881
+ {
882
+ "type": "text",
883
+ "text": "References ",
884
+ "text_level": 1,
885
+ "bbox": [
886
+ 174,
887
+ 700,
888
+ 266,
889
+ 715
890
+ ],
891
+ "page_idx": 9
892
+ },
893
+ {
894
+ "type": "text",
895
+ "text": "[1] F. Alet, M. Bauza, K. Kawaguchi, N. Kuru, T. Lozano-Pérez, and L. Kaelbling. Tailoring: Encoding inductive biases by optimizing unsupervised objectives at prediction time. In Advances in Neural Information Processing Systems (NeurIPS), 2021. \n[2] A. Ashukha, A. Lyzhov, D. Molchanov, and D. Vetrov. Pitfalls of in-domain uncertainty estimation and ensembling in deep learning. In International Conference on Learning Representations (ICLR), 2020. \n[3] A. Bartler, A. Bühler, F. Wiewel, M. Döbler, and B. Yang. MT3: Meta test-time training for self-supervised test-time adaption. In International Conference on Artificial Intelligence and Statistics (AISTATS), 2022. \n[4] A. Ben-Tal, D. den Hertog, A. De Waegenaere, B. Melenberg, and G. Rennen. Robust solutions of optimization problems affected by uncertain probabilities. Management Science, 2013. [5] G. Blanchard, G. Lee, and C. Scott. Generalizing from several related classification tasks to a new unlabeled sample. In Advances in Neural Information Processing Systems (NIPS), 2011. [6] G. Csurka. Domain adaptation for visual applications: A comprehensive survey. arXiv preprint arXiv:1702.05374, 2017. [7] A. Dosovitskiy, L. Beyer, A. Kolesnikov, D. Weissenborn, X. Zhai, T. Unterthiner, M. Dehghani, M. Minderer, G. Heigold, S. Gelly, J. Uszkoreit, and N. Houlsby. An image is worth 16x16 words: Transformers for image recognition at scale. In International Conference on Learning Representations (ICLR), 2021. [8] Y. Grandvalet and Y. Bengio. Semi-supervised learning by entropy minimization. In Advances in Neural Information Processing Systems (NIPS), 2005. [9] I. Gulrajani and D. Lopez-Paz. In search of lost domain generalization. In International Conference on Learning Representations (ICLR), 2021. \n[10] C. Guo, G. Pleiss, Y. Sun, and K. Weinberger. On calibration of modern neural networks. In International Conference on Machine Learning (ICML), 2017. \n[11] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In Conference on Computer Vision and Pattern Recognition (CVPR), 2016. \n[12] D. Hendrycks and T. Dietterich. Benchmarking neural network robustness to common corruptions and perturbations. In International Conference on Learning Representations (ICLR), 2019. \n[13] D. Hendrycks, N. Mu, E. Cubuk, B. Zoph, J. Gilmer, and B. Lakshminarayanan. AugMix: A simple data processing method to improve robustness and uncertainty. In International Conference on Learning Representations (ICLR), 2020. \n[14] D. Hendrycks, S. Basart, N. Mu, S. Kadavath, F. Wang, E. Dorundo, R. Desai, T. Zhu, S. Parajuli, M. Guo, D. Song, J. Steinhardt, and J. Gilmer. The many faces of robustness: A critical analysis of out-of-distribution generalization. In IEEE International Conference on Computer Vision (ICCV), 2021. \n[15] D. Hendrycks, K. Zhao, S. Basart, J. Steinhardt, and D. Song. Natural adversarial examples. In Conference on Computer Vision and Pattern Recognition (CVPR), 2021. \n[16] W. Hu, G. Niu, I. Sato, and M. Sugiyama. Does distributionally robust supervised learning give robust classifiers? In International Conference on Machine Learning (ICML), 2018. \n[17] Y. Huang, J. Gornet, S. Dai, Z. Yu, T. Nguyen, D. Tsao, and A. Anandkumar. Neural networks with recurrent generative feedback. In Advances in Neural Information Processing Systems (NeurIPS), 2020. \n[18] Y. Iwasawa and Y. Matsuo. Test-time classifier adjustment module for model-agnostic domain generalization. In Advances in Neural Information Processing Systems (NeurIPS), 2021. \n[19] A. Kaku, S. Mohan, A. Parnandi, H. Schambra, and C. Fernandez-Granda. Be like water: Robustness to extraneous variables via adaptive feature normalization. arXiv preprint arXiv:2002.04019, 2020. \n[20] D. Kingma and J. Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations (ICLR), 2015. \n[21] P. Koh, S. Sagawa, H. Marklund, S. Xie, M. Zhang, A. Balsubramani, W. Hu, M. Yasunaga, R. Phillips, I. Gao, T. Lee, E. David, I. Stavness, W. Guo, B. Earnshaw, I. Haque, S. Beery, J. Leskovec, A. Kundaje, E. Pierson, S. Levine, C. Finn, and P. Liang. WILDS: A benchmark of in-the-wild distribution shifts. In International Conference on Machine Learning (ICML), 2021. \n[22] A. Krizhevsky. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009. \n[23] A. Krizhevsky, I. Sutskever, and G. Hinton. ImageNet classification with deep convolutional neural networks. In Advances in Neural Information Processing Systems (NIPS), 2012. \n[24] B. Li, F. Wu, S. Lim, S. Belongie, and K. Weinberger. On feature normalization and data augmentation. In Conference on Computer Vision and Pattern Recognition (CVPR), 2021. \n[25] Y. Li, N. Wang, J. Shi, J. Liu, and X. Hou. Revisiting batch normalization for practical domain adaptation. In International Conference on Learning Representations Workshop (ICLRW), 2017. \n[26] Y. Liu, P. Kothari, B. van Delft, B. Bellot-Gurlet, T. Mordan, and A. Alahi. $\\mathrm { T T T } { + } { + }$ : When does self-supervised test-time training fail or thrive? In Advances in Neural Information Processing Systems (NeurIPS), 2021. \n[27] I. Loshchilov and F. Hutter. Decoupled weight decay regularization. In International Conference on Learning Representations (ICLR), 2019. \n[28] D. Mahajan, R. Girshick, V. Ramanathan, K. He, M. Paluri, Y. Li, A. Bharambe, and L. van der Maaten. Exploring the limits of weakly supervised pretraining. In European Conference on Computer Vision (ECCV), 2018. \n[29] C. Mao, M. Chiquier, H. Wang, J. Yang, and C. Vondrick. Adversarial attacks are reversible with natural supervision. In IEEE International Conference on Computer Vision (ICCV), 2021. \n[30] X. Mao, G. Qi, Y. Chen, X. Li, R. Duan, S. Ye, Y. He, and H. Xue. Towards robust vision transformer. In Conference on Computer Vision and Pattern Recognition (CVPR), 2022. \n[31] D. Molchanov, A. Lyzhov, Y. Molchanova, A. Ashukha, and D. Vetrov. Greedy policy search: A simple baseline for learnable test-time augmentation. In Conference on Uncertainty in Artificial Intelligence (UAI), 2020. \n[32] K. Muandet, D. Balduzzi, and B. Schölkopf. Domain generalization via invariant feature representation. In International Conference on Machine Learning (ICML), 2013. \n[33] Z. Nado, S. Padhy, D. Sculley, A. D’Amour, B. Lakshminarayanan, and J. Snoek. Evaluating prediction-time batch normalization for robustness under covariate shift. arXiv preprint arXiv:2006.10963, 2020. \n[34] A. Orhan. Robustness properties of Facebook’s ResNeXt WSL models. arXiv preprint arXiv:1907.07640, 2019. \n[35] X. Peng, B. Usman, N. Kaushik, J. Hoffman, D. Wang, and K. Saenko. VisDA: The visual domain adaptation challenge. arXiv preprint arXiv:1710.06924, 2017. \n[36] J. Quiñonero Candela, M. Sugiyama, A. Schwaighofer, and N. Lawrence. Dataset Shift in Machine Learning. The MIT Press, 2009. \n[37] B. Recht, R. Roelofs, L. Schmidt, and V. Shankar. Do CIFAR-10 classifiers generalize to CIFAR-10? arXiv preprint arXiv:1806.00451, 2018. \n[38] O. Russakovsky, J. Deng, H. Su, J. Krause, S. Satheesh, S. Ma, Z. Huang, A. Karpathy, A. Khosla, M. Bernstein, A. Berg, and F. Li. Imagenet large scale visual recognition challenge. International Journal of Computer Vision (IJCV), 2015. \n[39] S. Sagawa, P. Koh, T. Hashimoto, and P. Liang. Distributionally robust neural networks for group shifts: On the importance of regularization for worst-case generalization. In International Conference on Learning Representations (ICLR), 2020. \n[40] S. Schneider, E. Rusak, L. Eck, O. Bringmann, W. Brendel, and M. Bethge. Improving robustness against common corruptions by covariate shift adaptation. In Advances in Neural Information Processing Systems (NeurIPS), 2020. \n[41] H. Shimodaira. Improving predictive inference under covariate shift by weighting the loglikelihood function. Journal of Statistical Planning and Inference (JSPI), 2000. \n[42] C. Shorten and T. Khoshgoftaar. A survey on image data augmentation for deep learning. Journal of Big Data, 2019. \n[43] P. Sivaprasad and F. Fleuret. Test time adaptation through perturbation robustness. arXiv preprint arXiv:2110.10232, 2021. \n[44] Y. Sun, X. Wang, Z. Liu, J. Miller, A. Efros, and M. Hardt. Test-time training with selfsupervision for generalization under distribution shifts. In International Conference on Machine Learning (ICML), 2020. \n[45] T. Varsavsky, M. Orbes-Arteaga, C. Sudre, M. Graham, P. Nachev, and M. Cardoso. Test-time unsupervised domain adaptation. arXiv preprint arXiv:2010.01926, 2020. \n[46] D. Wang, E. Shelhamer, S. Liu, B. Olshausen, and T. Darrell. Tent: Fully test-time adaptation by entropy minimization. In International Conference on Learning Representations (ICLR), 2021. \n[47] G. Wilson and D. Cook. A survey of unsupervised deep domain adaptation. ACM Transactions on Intelligent Systems and Technology (TIST), 2020. \n[48] E. Wong, L. Rice, and J. Kolter. Fast is better than free: Revisiting adversarial training. In International Conference on Learning Representations (ICLR), 2020. \n[49] Y. Wu and K. He. Group normalization. In European Conference on Computer Vision (ECCV), 2018. \n[50] S. Xie, R. Girshick, P. Dollár, Z. Tu, and K. He. Aggregated residual transformations for deep neural networks. In Conference on Computer Vision and Pattern Recognition (CVPR), 2017. \n[51] D. Yin, R. Lopes, J. Shlens, E. Cubuk, and J. Gilmer. A Fourier perspective on model robustness in computer vision. In Advances in Neural Information Processing Systems (NeurIPS), 2019. \n[52] M. Zhang, H. Marklund, A. Gupta, S. Levine, and C. Finn. Adaptive risk minimization: Learning to adapt to domain shift. In Advances in Neural Information Processing Systems (NeurIPS), 2021. ",
896
+ "bbox": [
897
+ 178,
898
+ 723,
899
+ 826,
900
+ 911
901
+ ],
902
+ "page_idx": 9
903
+ },
904
+ {
905
+ "type": "text",
906
+ "text": "",
907
+ "bbox": [
908
+ 171,
909
+ 64,
910
+ 828,
911
+ 919
912
+ ],
913
+ "page_idx": 10
914
+ },
915
+ {
916
+ "type": "text",
917
+ "text": "",
918
+ "bbox": [
919
+ 171,
920
+ 45,
921
+ 828,
922
+ 922
923
+ ],
924
+ "page_idx": 11
925
+ },
926
+ {
927
+ "type": "text",
928
+ "text": "",
929
+ "bbox": [
930
+ 169,
931
+ 89,
932
+ 828,
933
+ 541
934
+ ],
935
+ "page_idx": 12
936
+ },
937
+ {
938
+ "type": "text",
939
+ "text": "Checklist ",
940
+ "text_level": 1,
941
+ "bbox": [
942
+ 174,
943
+ 89,
944
+ 254,
945
+ 106
946
+ ],
947
+ "page_idx": 13
948
+ },
949
+ {
950
+ "type": "text",
951
+ "text": "1. For all authors... ",
952
+ "bbox": [
953
+ 214,
954
+ 116,
955
+ 339,
956
+ 131
957
+ ],
958
+ "page_idx": 13
959
+ },
960
+ {
961
+ "type": "text",
962
+ "text": "(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes] \n(b) Did you describe the limitations of your work? [Yes] See Section 5. \n(c) Did you discuss any potential negative societal impacts of your work? [No] \n(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes] ",
963
+ "bbox": [
964
+ 238,
965
+ 136,
966
+ 825,
967
+ 227
968
+ ],
969
+ "page_idx": 13
970
+ },
971
+ {
972
+ "type": "text",
973
+ "text": "2. If you are including theoretical results... ",
974
+ "bbox": [
975
+ 214,
976
+ 231,
977
+ 493,
978
+ 244
979
+ ],
980
+ "page_idx": 13
981
+ },
982
+ {
983
+ "type": "text",
984
+ "text": "(a) Did you state the full set of assumptions of all theoretical results? [N/A] (b) Did you include complete proofs of all theoretical results? [N/A] ",
985
+ "bbox": [
986
+ 238,
987
+ 248,
988
+ 738,
989
+ 280
990
+ ],
991
+ "page_idx": 13
992
+ },
993
+ {
994
+ "type": "text",
995
+ "text": "3. If you ran experiments... ",
996
+ "bbox": [
997
+ 212,
998
+ 285,
999
+ 393,
1000
+ 299
1001
+ ],
1002
+ "page_idx": 13
1003
+ },
1004
+ {
1005
+ "type": "text",
1006
+ "text": "(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] See supplementary material. \n(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Appendix A. \n(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [N/A] \n(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [No] ",
1007
+ "bbox": [
1008
+ 238,
1009
+ 303,
1010
+ 825,
1011
+ 435
1012
+ ],
1013
+ "page_idx": 13
1014
+ },
1015
+ {
1016
+ "type": "text",
1017
+ "text": "4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... ",
1018
+ "bbox": [
1019
+ 220,
1020
+ 439,
1021
+ 823,
1022
+ 454
1023
+ ],
1024
+ "page_idx": 13
1025
+ },
1026
+ {
1027
+ "type": "text",
1028
+ "text": "(a) If your work uses existing assets, did you cite the creators? [Yes] \n(b) Did you mention the license of the assets? [No] All assets are publicly and freely available. \n(c) Did you include any new assets either in the supplemental material or as a URL? [No] \n(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A] \n(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A] ",
1029
+ "bbox": [
1030
+ 238,
1031
+ 458,
1032
+ 825,
1033
+ 579
1034
+ ],
1035
+ "page_idx": 13
1036
+ },
1037
+ {
1038
+ "type": "text",
1039
+ "text": "5. If you used crowdsourcing or conducted research with human subjects... ",
1040
+ "bbox": [
1041
+ 214,
1042
+ 583,
1043
+ 705,
1044
+ 598
1045
+ ],
1046
+ "page_idx": 13
1047
+ },
1048
+ {
1049
+ "type": "text",
1050
+ "text": "(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A] \n(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A] \n(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A] ",
1051
+ "bbox": [
1052
+ 238,
1053
+ 602,
1054
+ 825,
1055
+ 691
1056
+ ],
1057
+ "page_idx": 13
1058
+ }
1059
+ ]
parse/dev/XrGEkCOREX2/XrGEkCOREX2_middle.json ADDED
The diff for this file is too large to render. See raw diff