Title: Tuning Multi-mode Token-level Prompt Alignment across Modalities
Venue: NeurIPS 2023
Accepted: yes
Keywords: Multi-modal prompt learning; Optimal transport
Abstract: Advancements in prompt tuning of vision-language models have underscored their potential in enhancing open-world visual concept comprehension. However, prior works only primarily focus on single-mode (only one prompt for each modality) and holistic level (image or sentence) semantic alignment, which fails to capture the sample diversity, leading to sub-optimal prompt discovery. To address the limitation, we propose a multi-mode token-level tuning framework that leverages the optimal transportation to learn and align a set of prompt tokens across modalities. Specifically, we rely on two essential factors: 1) multi-mode prompts discovery, which guarantees diverse semantic representations, and 2) token-level alignment, which helps explore fine-grained similarity. Consequently, the similarity can be calculated as a hierarchical transportation problem between the modality-specific sets. Extensive experiments on popular image recognition benchmarks show the superior generalization and few-shot abilities of our approach. The qualitative analysis demonstrates that the learned prompt tokens have the ability to capture diverse visual concepts.

Tuning Multi-mode Token-level Prompt Alignment across Modalities

Abstract

Advancements in prompt tuning of vision-language models have underscored their potential in enhancing open-world visual concept comprehension. However, prior works only primarily focus on single-mode (only one prompt for each modality) and holistic level (image or sentence) semantic alignment, which fails to capture the sample diversity, leading to sub-optimal prompt discovery. To address the limitation, we propose a multi-mode token-level tuning framework that leverages the optimal transportation to learn and align a set of prompt tokens across modalities. Specifically, we rely on two essential factors: 1) multi-mode prompts discovery, which guarantees diverse semantic representations, and 2) token-level alignment, which helps explore fine-grained similarity. Consequently, the similarity can be calculated as a hierarchical transportation problem between the modality-specific sets. Extensive experiments on popular image recognition benchmarks show the superior generalization and few-shot abilities of our approach. The qualitative analysis demonstrates that the learned prompt tokens have the ability to capture diverse visual concepts. The code is available at https://github.com/wds2014/ALIGN.

1 Introduction

Recently, prompt tuning has experienced significant advancements in adapting large pre-trained vision language models (PVLs) such as CLIP [1] and BLIP [2] to downstream tasks [3-6]. A typical PVL model consists of two branch networks: the text and image encoders. These networks are used to extract the corresponding modality features. PVLs are often contrastively pre-trained on Web-scale image-text pairs, which encourage the alignment of visual concepts with natural language in the shared semantic space. One of the core ideas behind prompt tuning is to formulate the downstream tasks into the original pre-training pipeline. For example, CLIP designs category descriptions with a manual prompt template ' a photo of a { class } ', which works well in generic image recognition. Unlike fine-tuning, where the entire model is tuned using task-specific objectives, demands prohibitive computing cost, and poses a risk of knowledge shift issues [7-9], prompt tuning fixes the model parameters instead and optimizes prompt vectors, which act as demonstrations to help extract task-related features. This significantly benefits the representations via PVLs, even in performing zero-shot inference without training samples.

However, identifying optimal prompts for PVLs is not a trivial task, which usually needs to solve the intricate semantic alignments between the textual and visual modalities. Inspired by the success

(e) ALIGN (ours)

<eos>

dog

• • •

<cls>

<eos>

a photo of a dog

• • •

<cls>

<eos>

• • •

<cls>

dog

<eos>

dog

• • •

<cls>

×

N

<eos>

• • •

<cls>

dog

×

M

×

N

(a) TPT

(b) VPT

(c) PLOT

(d) MPT

of prompt learning in neural language models (NLP) [10, 7, 11], approaches called textual prompt tuning (TPT) are proposed to learn continuous prompt embeddings for CLIP's text encoder, e.g. , ' X X X X { class } ', where 'X' denotes the learnable vectors [3, 4]. Optimized with a task-specific loss, the learned prompt embeddings distill the pre-trained knowledge encoded in the fixed parameters, achieving better flexibility and efficiency than hand-crafted methods [1]. To improve the generalization of TPT on unseen classes, many studies attempt to give the solutions from gradient flow [12, 13], prototype and composition prompt learning [14-16]. Moving beyond learning a single-mode prompt, which often fails to capture diverse concepts, various methods prefer to explore multiple prompts based on ensemble learning[1], optimal transport [17] and Bayesian inference [18-20], showing robust alignments and better performance.

In parallel with TPT, visual prompt tuning (VPT) focuses on the patch embedding space of the CLIP's image encoder [6]. VPT views images as a patch sequence and introduces visual prompts to enhance the image representations, e.g. , ' X X X X { image } ', where 'image' denotes the image patch sequence. VPT provides a simple and efficient idea to extract task-relevant visual features, which has been widely applied to many visual tasks, for example, video understanding [21], domain adaptation [22], transfer learning [23] and image segmentation [24-26]. More recently, there has been a research trend to combine TPT and VPT to learn multi-modal prompts together [27, 28]. However, they currently concentrate on single-mode prompt discovery, i.e. , only one prompt for one modality, which may be insufficient to represent a class [17]. This issue is even more acute in multi-modal prompt learning, where both visual and textual concepts and their alignments need to be inferred. Additionally, it is less sound to represent the image and label only with the global features [29, 30], which could lose local region features of the target object, resulting in sub-optimal classification.

To this end, this work develops a comprehensive prompt tuning framework, where multi-modal multi-mode prompts are learned by building the prompt and token-level optimal transport (OT). Formally, after feeding multiple prompt inputs into the modality-specific encoder, our prompt-level OT views each image as a discrete distribution P over the visual prompt space and views each label as a discrete distribution Q over the textual prompt space. With such formulation, the classification task becomes to measure the distance between P and Q . Moreover, along with the global prompt-level features, the patch (or token) embeddings capture the local region features of the target object (or category description). This motivates the token-level OT, where each prompt output is modeled as a discrete distribution over the token embedding space. The cost matrix is then calculated between the visual patches and textual tokens, enabling the token-level alignments. Crucially, the cost matrix in prompt-level OT that measures the transport cost between prompts from two domains is now converted to integrate the global features and the output of the token-level OT. This hierarchical connection makes it possible to predict the label with the detailed token and patch features, resulting in higher accuracy.

In summary, our method provides a novel prompt tuning framework that incorporates multiple modalities and token-level alignments via the hierarchical OT. The prompt-level OT learns the diverse semantics of a class from both image and language domains, and the token-level OT explores finegrained alignments between token embeddings. Notably, with different hyperparameter settings, the variants of the proposed model cover many previous works, offering flexibility for easy adaptation across diverse applications. The main contributions of the paper are as follows:

We propose a multi-mode token-level alignment framework for multi-modal prompts tuning, where multiple prompts are learned to improve the representation for both visual and textual modalities. With special settings, many previous works can be margined into our framework.

We formulate the prompt tuning task as the distribution matching problem, and develop the prompt and token-level OT to tackle the task with a principle and elegant solution.

We apply our method to few-shot classification, dataset transfer learning and domain generalization. Experiential results on widely used datasets show the superiority of the proposed model.

2 Background

2.1 Multi-modal Prompt Tuning

Multi-modal prompt tuning (MPT) [28, 27] is a newly developed task that enables the joint learning of textual and visual prompts for PVLs. Instead of optimizing the unimodal prompts separately, the joint tuning paradigm not only leverages the two branch networks of PVLs, but also allows interactions between two modalities during training, resulting in dynamic alignments. Without loss of generality, we use a vision transformer (ViT) based CLIP for example, which consists of a ViT as an image encoder f and a transformer as a language encoder g . Given an input image X ∈ R H × W × 3 and K label names { class k } K k =1 . MPT first incorporates b learnable tokens as visual prompts { v i ∈ R d v } b i =1 , and another set of b learnable tokens as textual prompts { t i ∈ R d l } b i =1 . After concatenating them alongside the image patches and class names, one can obtain the output of CLIP as:

where < cls >,< eos > are virtual tokens, [ e 1 , ..., e O ] are O image patch embeddings, and [ w k, 1 , ..., w k,k l ] are token embeddings with length k l of k -th class. After the stacked self-attention layers of f and g , CLIP outputs the token embeddings and views z and h k as the prompt-level features of the image and label, respectively. Empirical findings suggest that it is more effective to obtain the vision prompt v by projecting the language prompt t through a vision-to-language mapping function, such as v = F ( t ) , rather than learning them independently [28, 6]. Finally, MPT estimates the label of x according to the cosine similarity score:

where τ is the fixed temperature parameter. MPT unifies the ideas of TPT and VPT by directly tuning the visual prompts v and textual prompt t at the same time. Eq. 1 indicates that the text encoder g takes the category prompts as input and outputs h , which serves as the corresponding classifier weights. Thanks to the pre-trained knowledge in CLIP, MPT retains the ability to perform open-set classification. Note that both the encoders f and g in CLIP are frozen and only the prompt sequences v and t are optimized during downstream training. This process can be seen as a bootstrapping step that helps guide the encoders to extract task-relevant features.

2.2 Optimal Transport Distance

Optimal transport (OT) is an efficient tool to measure the distance between two distributions, which is widely used in recent machine learning studies, such as text analysis [31-33], computer vision [3439] and generative model [40, 41]. Here we review the discrete OT matching and refer readers to [42] for details. Given two sets of data points X = { x i } i m =1 and Y = { y j } n j =1 , of which discrete distributions are formulated as p = ∑ m i =1 a i δ x i and q = ∑ n j =1 b j δ y j , respectively. a ∈ ∆ m and b ∈ ∆ n , where ∆ m denotes the probability simple of R m . We define the cost matrix between X and Y as C = ( C ij ) ∈ R m × n ≥ 0 , where C ij = c ( x i , y j ) is the transport cost from x i to y j , with c is the cost function. The goal of OT is to optimally transport p to q at the smallest cost:

where < · , · > denotes the Frobenius dot-product and T ∈ R m × n > 0 denotes the transport plan to be learned. OT distance is then minimized over all the joint probabilities of m × n space with two marginal constraints Π( p, q ) := { T : T 1 n = a , T T 1 m = b } , where 1 m denotes m-dimensional

all-one vector. As directly learning the optimal plan T in Eq. 2 can be time-consuming for large-scale problems, Sinkhorn distance from [42, 43] introduces the entropic constraint on the transport plan h ( T ) = ∑ m,n -T mn ln ( T mn ) and thus the resulting algorithm estimates T within a few iterations, showing better flexibility and scalability.

3 The Proposed Model

3.1 Overall Method

In this section, we introduce the technical details of our proposed model, named ALIGN , a holistic framework for multi-modal prompt tuning with optimal transport (shown in Fig. 2). Benefiting from the carefully designed multi-mode token-level alignment module, most existing works can be merged into our ALIGN with special settings. Intuitively, humans learn one class with various concepts, which provides sufficient semantic features, such as color, layout, and shape, to distinguish it from others [17]. Inspired by this, one of the goals of this work is to learn M visual prompt and N textual prompt simultaneously. Specifically, we first introduce our prompt-level OT, where each image and label are modeled as the discrete distributions P and Q over M -dimensional visual space and N -dimensional textual space. Moreover, instead of representing the prompt outputs as a single point, e.g. , the global features z and h , we distill the token-level knowledge implied in CLIP. Recalling that, the n -th textual prompt output of the k -th class contains b + k l token embeddings and the m -th visual prompt output of an image contains b + O patch embeddings, which capture the local-region features of corresponding modalities. This motivated us to develop the token-level OT that makes token-level comparisons for fine-grained alignments. As a result, m -th and n -th points in P and Q themselves are further modeled as discrete distributions over the shared token embedding space. Due to the compelling two-level OT connections, where the cost matrix in prompt-level OT is obtained by the output of token-level OT, the learned transport plan captures both the prompt and token-level features, which provides a principled and elegant way to estimate the distance between label and image sets.

3.2 Multi-mode Token-level Prompt Alignment

Moving beyond MPT which learns a single-mode prompt to describe the class and estimates the similarity based on prompt-level features, we aim to explore multi-mode representations in the textual and visual domains and make fine-grained alignment to improve the prediction accuracy. Now we have M groups of visual prompts { v m } M m =1 and N groups of textual prompts { t n } N n =1 , where each v m ∈ R d v × b and t n ∈ R d l × b are learnable prompt sequences with length b . Mathematically, we employ two empirical distributions P and Q to model the sets of two modalities:

where x m and y n denote the m -th visual output and n -th textual output in the d -dimensional latent space. They are further modeled as discrete distributions over token-level embeddings, which will be introduced later. Eq. 3 views each prompt equally and adopts the uniform distribution to model the weights. With those two semantic sets P and Q , the distance between images and labels is no longer calculated by first representing each image and label as a single point and then using the cosine similarity. ALIGN prefers to mine multi-mode features to describe various class concepts, resulting in better representations. The distance thus can be formulated as an entropy-regularized prompt-level OT problem [42]:

where λ > 0 is the weight of regularization, and C ∈ R M × N is the cost matrix between visual set x and textual set y . T ∈ R M × N is the to-be-learned transport plan with the marginal constraint, e.g. , T 1 N = 1 /M, T T 1 M = 1 /N . Note that, T mn measures the transported probability from m -th visual prompt to n -th textual prompt, and a large value means the high semantic connection between two prompts across modalities. Therefore, Eq. 4 estimates the expected transport cost between P and Q , which provides a principle solution to calculate the similarity between the images and labels.

Noticeably, the cost matrix C in Eq. 4 plays a critical role in the learning of T , and intuitively, the larger the transport costs between two points are, the lower the transport probabilities will be. A

g

𝑥𝑥

𝑦𝑦

Base 94.03

New 74.9

(a) Overview of the proposed ALIGN

(b) t-SNE on Eurosat

f

d

o

g

Token-level OT

• • •

•

2,3

C

Prompt-level OT

doa

doa

6op

Ntextualprompts

Mvisualprompts

natural choice is to specify C with the global features C mn = 1 -sim ( z m , h n ) , where z m and h n denote the prompt-level features of m -th visual prompt and n -th textual prompt. However, the above definition primarily emphasizes prompt-level representation and might have a limited capacity to capture the detailed token-level features, e.g. , different patches within an image may capture various local region features. Thus, the obtained transport plan may fail to reflect the true relations between P and Q . To this end, we further introduce the token-level OT that considers token-level alignments between two prompts. Specifically, we specify the visual output x and textual output y as two empirical distributions over token embeddings (here we omit the subscript m and n for clarity):

where r = [ ˜ e 1 , ..., ˜ e O , ˜ v 1 , ..., ˜ v b ] is the output visual patches with length J = b + O , and s = [ ˜ t 1 , ..., ˜ t b , ˜ w k, 1 , ..., ˜ w k,k l ] is the output textual tokens with length b + k l . Unlike z and h that agent the prompt-level features, x and y collect the token-level features in the shared embedding space of CLIP. Naturally, the cost matrix ˆ C ∈ R J × L in the token-level OT is defined as ˆ C jl = 1 -sim ( r j , s l ) , which measures the transport cost between the visual patches and textual tokens. As a result, the distance between x and y is the total transport cost of the token-level OT:

where the transport plan ˆ T ∈ R J × L denotes how likely is that the j -th visual patch transports to the l -th token feature, providing a principle solution to align token-level features. This motivated us to develop a combined cost matrix that considers prompt and token-level features together:

where β is a trade-off parameter that controls the weight of token-level cost. The first two terms are the cosine distance between prompt-level features, and the last term is the OT distance between the token-level sets. In this way, Eq. 6 combines the pre-trained knowledge from two levels: the prompt-level features and the token-level embeddings. This enables the learned transport plan T in prompt-level OT to make fine-grained matching between M visual and N textual features, resulting in detailed alignments and better representations.

Once Eq. 4 is computed, we follow previous work [17] and predict the label of image X j as:

where C j,k denote the cost matrix of j -th image and k -th label. Note that the weight of the classifier Q k in our model can be viewed as a discrete uniform distribution over N textual prompts of label k , which contains multiple class-related semantics, improving the classification results. Thanks to the

differentiable Sinkhorn algorithm, all parameters of the proposed model can be optimized end-to-end by minimizing the following cross-entropy loss:

where y X is the one-hot label vector of image X Due to the OT formulation, our proposed ALIGN aims to learn M visual prompt sequences and N textual prompt sequences without introducing any neural networks. We describe our proposed model in the Appendix Algoritm. 1.

4 Related Work

Single-modal prompt tuning: There are two storylines of single-modal prompt tuning, TPT and VPT. The former focuses on the language branch of a PLV and is interested in prompt learning in continuous embedding space. As one of the representative works, CoOp [3] models a prompt's context using a set of learnable vectors and shows great improvement over intensively-tuned manual prompts. To solve the weak generalizability on unseen category, CoCoOp [4] extends CoOp by explicitly conditioning prompts on image instances, which shifts the concentrations away from a specific set of classes to each input instance, enabling a stronger generalization performance. Instead of single-mode prompt learning, PLOT [17] learns multiple textual prompts by adopting the OT distance between prompts and image patches, achieving diverse prompt tuning. ProDA [19] first maturely designs multiple prompts and then models the uncertainty of prompts by employing the Gaussian distribution to model prompt embeddings. Correspondingly, VPTs refer to prepending visual patches to the image input space, which also shows impressive results in adapting PVLs into downstream tasks. For example, Jia et al. [6] introduces trainable visual prompt vectors into the image patch sequence of each Transformer layer and learns them along with a linear head. Despite the promising performance on various visual tasks, those models are designed to learn single-modal prompts, which fails to make use of the pre-trained multi-modal knowledge.

Multi-modal prompt tuning: Moving beyond single-modal prompt tuning, MPT is a recently introduced task that learns textual prompts and visual prompts at the same time. This jointly tuning strategy not only distills the multi-modal knowledge but enables the dynamic alignments between prompts across modalities, showing better generalization. Zang et al. [27] propose a unified prompt tuning framework (UPT) [27] that shares an initial prompt across different modalities and designs a tiny network to generate the modality-specific prompts together. Almost parallel to UPT, Khattak et al. [28] proposed multi-modal prompt tuning (MaPLe) and adopted a projection matrix to condition vision prompts on their language counterparts explicitly allowing mutual propagation of gradients to promote synergy. In comparison, this work aims to learn multi-modal multi-mode prompts to better meet the requirement of diverse comprehensive representations. Besides, unlike measuring the similarity between images and labels by the global prompt-level features, we model each prompt as an empirical distribution over the token-level embedding space, and the similarity score is calculated by combining the prompt and token-level features under a hierarchical OT framework, which provides a novel and elegant tool to adapt PVLs into downstream tasks.

5 Experiments

5.1 Experimental Setup

Datasets To make a comprehensive evaluation, we performed extensive experiments on 4 task settings, such as few-shot image recognition, base-to-new generalization, cross-dataset transfer learning, and domain generalization. Those experiments are conducted on 15 widely used image datasets, varying in scale and domains, including ImageNet [44], Caltech101 [45], OxfordPets [46], StanfordCars [47], Flowers102 [48], Food101 [49], FGVCAircraft [50], EuroSAT [51], UCF101 [52], DTD [53], SUN397 [54], ImageNetV2 [55], ImageNet-Sketch [56], ImageNet-A [57], and ImageNetR [58]. The details of each dataset are provided in the Appendix Table. B. 1.

Baselines We compare ALIGN with the state-of-the-art methods, including: CLIP [1], which provides the base results without prompt tuning; the single-modal prompt tuning methods, e.g. ,

TPTs: CoOP [3], CoCoOp [4] and PLOT [17], and VPTs: VPT [6], and multi-modal prompt tuning methods: UPT [27] and MaPLe [28]. Note that we modified the official code of PLOT and changed the backbone to ViT-B/16 for a fair comparison.

Implementation Details Following previous MaPLe [28], we load the pre-trained Vit-B/16 CLIP model as our backbone, where d l = 512 , d v = 768 and d = 512 . We set the number of textual and visual prompts M = N = 4 , the length of prompt tokens b = 2 , the hyperparameter λ = 0 . 1 , and β = 1 . The maximum iteration number in the Sinkhorn algorithm is set as 100. For all tasks, we train our model with a batch-size of 4, a learning rate of 0.0035, and an optimizer as SGD. For each task, we optimize the number of epochs. Following MaPLe we run 2 epochs to train ImageNet as a source model with a learning rate of 0.0026. The reported results are the averaged value over 3 seeds. Please refer to the Appendix Sec. B for more details. For all baselines, we set the length of prompts as 4 and collect their results according to the original papers or previous works. Thus, some experimental results may be missing.

0 1 2

4

8

16

# Shots

60

65

70

75

80

Accuracy(%)

Zero-shot CLIP

Average over 11 datasets

CoOp

PLOT

VPT

UPT

MaPLe

ALIGN

0 1 2

4

8

16

# Shots

88

90

92

94

96

Accuracy(%)

Zero-shot CLIP

Caltech101

CoOp

PLOT

VPT

UPT

MaPLe

ALIGN

0 1 2

4

8

16

# Shots

82

84

86

88

90

92

94

Accuracy(%)

Zero-shot CLIP

OxfordPets

CoOp

PLOT

VPT

UPT

MaPLe

ALIGN

0 1 2

4

8

16

# Shots

50

60

70

80

Accuracy(%)

Zero-shot CLIP

StanfordCars

CoOp

PLOT

VPT

UPT

MaPLe

ALIGN

0 1 2

4

8

16

# Shots

67.5

70.0

72.5

75.0

77.5

80.0

82.5

85.0

87.5

Accuracy(%)

Zero-shot CLIP

Food101

CoOp

PLOT

VPT

UPT

MaPLe

ALIGN

0 1 2

4

8

16

# Shots

45

50

55

60

65

70

Accuracy(%)

Zero-shot CLIP

DTD

CoOp

PLOT

VPT

UPT

MaPLe

ALIGN

0 1 2

4

8

16

# Shots

50

60

70

80

90

Accuracy(%)

Zero-shot CLIP

EuroSAT

CoOp

PLOT

VPT

UPT

MaPLe

ALIGN

0 1 2

4

8

16

# Shots

50

55

60

65

70

75

80

85

Accuracy(%)

Zero-shot CLIP

UCF101

CoOp

PLOT

VPT

UPT

MaPLe

ALIGN

5.2 Evaluation with the Standard Setting

Few-Shot Learning. We first evaluate our model on few-shot classification, where models are trained on 1,2,4,8, and 16 shots and then applied to the test sets. We report the accuracy scores of all models across 11 datasets at Fig. 3. Overall, our proposed ALIGN outperforms others in most cases and achieves consistent improvement over CoOp on all datasets. Among the multimodal prompt tuning methods, our method shows superior performance compared to UPV and MaPLe in general, except for the EuroSAT datasets. This demonstrates that ALIGN has the ability to distill the across-modalities knowledge and efficiently adapt PVLs into downstream tasks. Although there is a small margin between our model and those two models on some datasets, the competing models usually cannot achieve high performance over all datasets, e.g. , ALIGN exhibits 9.06/3.56/2.56/2.61/0.78(%) accuracy improvements compared with UPT on DTD datasets and achieves 6.56/8.75/7.63/6.64/4.47(%) improvements compared with MaPLe. In addition, we also find that our ALIGN performs better on 1/2/4 shots settings, showing the efficiency of our fine-grained alignments, which provide the token-level comparison during prediction. This capability contributes to more accurate classification, even with limited training samples.

Base-to-New Generalization. To assess the generalizability of our model, we follow CoCoOp [4] to equally split the classes into base and new sets, and models are only trained on the base classes while tested on the new sets. Table. 1 reports the results, and we have the following observations: First, our proposed ALIGN surpasses previous baselines by achieving the highest average scores,

thereby illustrating the superiority of the proposed framework. Second, ALIGN outperforms others in terms of H score across all datasets, except for the DTD dataset which indicates our method offers a more favorable trade-off between the base and new sets. We attribute this success to the token-level multi-mode prompt tuning strategy, where the multi-mode prompts enhance the ability to identify diverse visual concepts, which plays an essential role in unseen category prediction. Furthermore, for datasets that have small intra-class variances, such as Stanford Cars and FGVCAircraft, ALIGN achieves a noticeable improvement over MaPLe. The token-level alignment in ALIGN might account for this improvement, as it makes it more effective for fine-grained image classification.

Transfer Learning and Domain Generalization. To investigate the generalizability across-datasets or across-domains, we first train our model on ImageNet, utilizing all 1,000 classes, and subsequently apply it to 1) other 10 datasets and 2) other 4 domain shift datasets. We report those results at Table. 2 and 3, respectively. Based on those results, we find that our approach outperforms the baseline methods on 8/10 datasets with the best average accuracy score on dataset transfer learning task and 3/4 datasets on domain shift setting. These overall improvements highlight that ALIGN is less susceptible to the distribution shift between the source and target domains, thus revealing the robust generalizability of our model. Despite the marginal performance gain of ALIGN in contrast to MaPLe and UPT, our method outperforms them in most cases in terms of all four tasks and provides a novel multi-mode token-level alignment alternative for prompt tuning.

p_1

p_2

p_3

p_4

p_1

p_2

p_3

p_4

p_1_t_2

p_1_t_3

p_2_t_3

p_4_t_1

p_1_t_1

p_2_t_1

p_2_t_2

p_3_t_1

Qualitative Analysis Besides the extensive quantitative results, we are also interested in the learned visual concepts of the proposed token-level alignments. Fortunately, the transport plan learned in our token-level OT provides us with access to a convenient tool to visualize the most related visual patches. We report the qualitative analysis at Fig. 2(b) and Fig. 4. From Fig. 2(b), we find that our model prefers to learn separable representations in both base and new classes. Recalling that h n denotes the global feature of n -th prompts, to visualize the learned prompt and obtain the attention map over the patch space, we calculate the cosine similarity between h n and all patch embeddings ˆ e ∈ R d × O . We then view the normalized cosine similarity as the attention map and visualize the learned N = 4 prompts at the top row of Fig. 4. We observe that different prompts tend to align different patch regions, each of which contributes to the final prediction. This finding also meets with the motivation of the multi-mode prompt tuning, where each prompt aims to learn specific visual semantics.

Moving beyond the prompt-level visualization, we also visualize the token-level concepts. Specifically, for l -th column of the learned transport plan ˆ T l ∈ R J in token-level OT, it measures how likely the l -th token is transported to J = b + O patches. Here we focus on the O image patches and visualize the transport plan of an image sampled from the base set and new set at the second and third row in Fig. 4, respectively. We find that 1) different tokens within a prompt can capture various patches with similar visual concepts. For example, both p_1_t_2 and p_1_t_3 attend to the head of the cat; 2) Learning from the base set, the prompt tokens prefer to align the similar patches in the new set, which reveals that our token-level alignment module has the ability to transfer from the base set to the new set, rather than over-fitting to the base categories.

Complexity Analysis As discussed above, one of the key ideas of the proposed ALIGN is to learn multiple prompts for vision and language inputs and explore the token-level alignments under the hierarchical OT framework. To demonstrate the computation cost, we report the complexity analysis at Table. 4, where we focus on the number of trainable parameters (#Paras) and inference speed (fps). We find that 1) Overall, the multimodel prompts tuning methods (last three) require more trainable parameters and inference time than single-modal methods. 2) The proposed ALIGN requires

slightly more training parameters than UPT and MAPLE because of the multiple prompts. And it also requires more inference time than MAPLE, due to the hierarchical OT operations. 3) Thanks to the independent OT operations, which can be calculated parallelly with the GPU, ALIGN has a faster testing time than CoCoOp, and achieves 62 fps at the test stage.

6 Conclusion

This paper introduces a novel multi-mode token-level alignment framework for multi-modal prompt tuning under optimal transport. We first employ the prompt-level OT to model the multi-mode prompts across modalities, and then introduce the token-level OT by viewing each prompt itself as a set over token embedding space. By coupling those two-level OT via the cost matrix, the final prediction is obtained by combining the prompt-level features and the token-level embeddings, enabling fine-grained alignments. Extensive experiments have been conducted, showing that our proposed model achieves competing performance on four settings. In terms of the limitations , the users may still need large GPU memory to load the pre-trained weights of PVLs to apply the proposed model to the test process. One potential solution is to combine prompt tuning with knowledge distillation. We leave it as a future study. Thanks to the open-world visual concept understanding of PVLs, our model shows promising zero-shot/few-shot ability for image recognition, which has the potential to encourage researchers to derive new and better methods for prompt tuning. Our work may indirectly lead to a negative impacts if there is a sufficiently malicious or ill-informed choice of a few-shot classification task.

References

Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, Gretchen Krueger, and Ilya Sutskever. Learning transferable visual models from natural language supervision. In Proceedings of the 38th International Conference on Machine Learning, ICML 2021, 18-24 July 2021, Virtual Event , pages 8748-8763. PMLR, 2021.

Junnan Li, Dongxu Li, Caiming Xiong, and Steven C. H. Hoi. BLIP: bootstrapping languageimage pre-training for unified vision-language understanding and generation. In International Conference on Machine Learning, ICML 2022, 17-23 July 2022, Baltimore, Maryland, USA . PMLR, 2022.

Kaiyang Zhou, Jingkang Yang, Chen Change Loy, and Ziwei Liu. Learning to prompt for vision-language models. International Journal of Computer Vision , 130(9):2337-2348, 2022.

Kaiyang Zhou, Jingkang Yang, Chen Change Loy, and Ziwei Liu. Conditional prompt learning for vision-language models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition , pages 16816-16825, 2022.

Zifeng Wang, Zizhao Zhang, Chen-Yu Lee, Han Zhang, Ruoxi Sun, Xiaoqi Ren, Guolong Su, Vincent Perot, Jennifer Dy, and Tomas Pfister. Learning to prompt for continual learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition , pages 139-149, 2022.

Menglin Jia, Luming Tang, Bor-Chun Chen, Claire Cardie, Serge J. Belongie, Bharath Hariharan, and Ser-Nam Lim. Visual prompt tuning. In Computer Vision - ECCV 2022 - 17th European Conference, Tel Aviv, Israel, October 23-27, 2022, Proceedings, Part XXXIII . Springer, 2022.

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. Advances in neural information processing systems , 33:1877-1901, 2020.

Florian Wenzel, Andrea Dittadi, Peter V. Gehler, Carl-Johann Simon-Gabriel, Max Horn, Dominik Zietlow, David Kernert, Chris Russell, Thomas Brox, Bernt Schiele, Bernhard Schölkopf, and Francesco Locatello. Assaying out-of-distribution generalization in transfer learning. In NeurIPS , 2022.

Korawat Tanwisuth, Shujian Zhang, Huangjie Zheng, Pengcheng He, and Mingyuan Zhou. POUF: Prompt-oriented unsupervised fine-tuning for large pre-trained models. In ICML 2023: International Conference on Machine Learning , July 2023.

Zhengbao Jiang, Frank F Xu, Jun Araki, and Graham Neubig. How can we know what language models know? Transactions of the Association for Computational Linguistics , 8:423-438, 2020.

Pengfei Liu, Weizhe Yuan, Jinlan Fu, Zhengbao Jiang, Hiroaki Hayashi, and Graham Neubig. Pre-train, prompt, and predict: A systematic survey of prompting methods in natural language processing. ACM Computing Surveys , 55(9):1-35, 2023.

Chengcheng Ma, Yang Liu, Jiankang Deng, Lingxi Xie, Weiming Dong, and Changsheng Xu. Understanding and mitigating overfitting in prompt tuning for vision-language models. IEEE Transactions on Circuits and Systems for Video Technology , pages 1-1, 2023. doi: 10.1109/TCSVT.2023.3245584.

Beier Zhu, Yulei Niu, Yucheng Han, Yue Wu, and Hanwang Zhang. Prompt-aligned gradient for prompt tuning. arXiv preprint arXiv:2205.14865 , 2022.

Yue Zhang, Hongliang Fei, Dingcheng Li, Tan Yu, and Ping Li. Prompting through prototype: A prototype-based prompt learning on pretrained vision-language models. arXiv preprint arXiv:2210.10841 , 2022.

Feng Wang, Manling Li, Xudong Lin, Hairong Lv, Alex Schwing, and Heng Ji. Learning to decompose visual features with latent textual prompts. In The Eleventh International Conference on Learning Representations , 2023. URL https://openreview.net/forum? id=wtcud6HroZr .

Nihal V. Nayak, Peilin Yu, and Stephen Bach. Learning to compose soft prompts for compositional zero-shot learning. In The Eleventh International Conference on Learning Representations , 2023. URL https://openreview.net/forum?id=S8-A2FXnIh .

Guangyi Chen, Weiran Yao, Xiangchen Song, Xinyue Li, Yongming Rao, and Kun Zhang. PLOT: Prompt learning with optimal transport for vision-language models. In The Eleventh International Conference on Learning Representations , 2023. URL https://openreview. net/forum?id=zqwryBoXYnh .

Xinyang Liu, Dongsheng Wang, Miaoge Li, Zhibin Duan, Yishi Xu, Bo Chen, and Mingyuan Zhou. Patch-token aligned bayesian prompt learning for vision-language models. arXiv preprint arXiv:2303.09100 , 2023.

Yuning Lu, Jianzhuang Liu, Yonggang Zhang, Yajing Liu, and Xinmei Tian. Prompt distribution learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition , pages 5206-5215, 2022.

Mohammad Mahdi Derakhshani, Enrique Sanchez, Adrian Bulat, Victor Guilherme Turrisi da Costa, Cees GM Snoek, Georgios Tzimiropoulos, and Brais Martinez. Variational prompt tuning improves generalization of vision-language models. arXiv preprint arXiv:2210.02390 , 2022.

Roei Herzig, Ofir Abramovich, Elad Ben-Avraham, Assaf Arbelle, Leonid Karlinsky, Ariel Shamir, Trevor Darrell, and Amir Globerson. Promptonomyvit: Multi-task prompt learning improves video transformers using synthetic scene data. arXiv preprint arXiv:2212.04821 , 2022.

Yunhe Gao, Xingjian Shi, Yi Zhu, Hao Wang, Zhiqiang Tang, Xiong Zhou, Mu Li, and Dimitris N Metaxas. Visual prompt tuning for test-time domain adaptation. arXiv preprint arXiv:2210.04831 , 2022.

Kihyuk Sohn, Yuan Hao, José Lezama, Luisa Polania, Huiwen Chang, Han Zhang, Irfan Essa, and Lu Jiang. Visual prompt tuning for generative transfer learning. arXiv preprint arXiv:2210.00990 , 2022.

Weihuang Liu, Xi Shen, Chi-Man Pun, and Xiaodong Cun. Explicit visual prompting for low-level structure segmentations. arXiv preprint arXiv:2303.10883 , 2023.

Lingbo Liu, Bruce XB Yu, Jianlong Chang, Qi Tian, and Chang-Wen Chen. Prompt-matched semantic segmentation. arXiv preprint arXiv:2208.10159 , 2022.

Senqiao Yang, Jiarui Wu, Jiaming Liu, Xiaoqi Li, Qizhe Zhang, Mingjie Pan, and Shanghang Zhang. Exploring sparse visual prompt for cross-domain semantic segmentation. arXiv preprint arXiv:2303.09792 , 2023.

Yuhang Zang, Wei Li, Kaiyang Zhou, Chen Huang, and Chen Change Loy. Unified vision and language prompt learning. CoRR , abs/2210.07225, 2022.

Muhammad Uzair Khattak, Hanoona Rasheed, Muhammad Maaz, Salman Khan, and Fahad Shahbaz Khan. Maple: Multi-modal prompt learning. arXiv preprint arXiv:2210.03117 , 2022.

Hyunjin Choi, Judong Kim, Seongho Joe, and Youngjune Gwon. Evaluation of bert and albert sentence embedding performance on downstream nlp tasks. In 2020 25th International conference on pattern recognition (ICPR) , pages 5482-5487. IEEE, 2021.

Nils Reimers and Iryna Gurevych. Sentence-bert: Sentence embeddings using siamese bertnetworks. 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 2019, Hong Kong, China, November 3-7, 2019 , pages 3980-3990. Association for Computational Linguistics, 2019.

Viet Huynh, He Zhao, and Dinh Phung. Otlda: A geometry-aware optimal transport approach for topic modeling. Advances in Neural Information Processing Systems , 33:18573-18582, 2020.

He Zhao, Dinh Phung, Viet Huynh, Trung Le, and Wray L. Buntine. Neural topic model via optimal transport. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021 , 2021.

Dongsheng Wang, Dandan Guo, He Zhao, Huangjie Zheng, Korawat Tanwisuth, Bo Chen, and Mingyuan Zhou. Representing mixtures of word embeddings with mixtures of topic embeddings. In The Tenth International Conference on Learning Representations, ICLR 2022, Virtual Event, April 25-29, 2022 .

Nicholas Kolkin, Jason Salavon, and Gregory Shakhnarovich. Style transfer by relaxed optimal transport and self-similarity. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition , pages 10051-10060, 2019.

Dandan Guo, Zhuo Li, He Zhao, Mingyuan Zhou, Hongyuan Zha, et al. Learning to re-weight examples with optimal transport for imbalanced classification. Advances in Neural Information Processing Systems , 35:25517-25530, 2022.

Tuan Nguyen, Trung Le, He Zhao, Quan Hung Tran, Truyen Nguyen, and Dinh Phung. Most: multi-source domain adaptation via optimal transport for student-teacher learning. In Proceedings of the Thirty-Seventh Conference on Uncertainty in Artificial Intelligence , volume 161 of Proceedings of Machine Learning Research , pages 225-235, 27-30 Jul 2021.

Dandan Guo, Long Tian, He Zhao, Mingyuan Zhou, and Hongyuan Zha. Adaptive distribution calibration for few-shot learning with hierarchical optimal transport. In Advances in Neural Information Processing Systems , pages 6996-7010, 2022.

Zheng Ge, Songtao Liu, Zeming Li, Osamu Yoshie, and Jian Sun. Ota: Optimal transport assignment for object detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition , pages 303-312, 2021.

Miaoge Li, Dongsheng Wang, Xinyang Liu, Zequn Zeng, Ruiying Lu, Bo Chen, and Mingyuan Zhou. Patchct: Aligning patch set and label set with conditional transport for multi-label image classification. In Proceedings of the IEEE/CVF International Conference on Computer Vision , 2023.

Long Tung Vuong, Trung Le, He Zhao, Chuanxia Zheng, Mehrtash Harandi, Jianfei Cai, and Dinh Q. Phung. Vector quantized wasserstein auto-encoder. In International Conference on Machine Learning, ICML 2023, 23-29 July 2023, Honolulu, Hawaii, USA , volume 202 of Proceedings of Machine Learning Research , pages 35223-35242. PMLR, 2023.

Viet Huynh, Dinh Q. Phung, and He Zhao. Optimal transport for deep generative models: State of the art and research challenges. In Proceedings of the Thirtieth International Joint Conference on Artificial Intelligence, IJCAI 2021, Virtual Event / Montreal, Canada, 19-27 August 2021 , pages 4450-4457, 2021.

Marco Cuturi. Sinkhorn distances: Lightspeed computation of optimal transport. Advances in neural information processing systems , 26, 2013.

Dan dan Guo, Long Tian, Minghe Zhang, Mingyuan Zhou, and Hongyuan Zha. Learning prototype-oriented set representations for meta-learning. In International Conference on Learning Representations , 2022.

Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A largescale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition , pages 248-255. Ieee, 2009.

Li Fei-Fei, Rob Fergus, and Pietro Perona. Learning generative visual models from few training examples: An incremental bayesian approach tested on 101 object categories. In 2004 conference on computer vision and pattern recognition workshop , pages 178-178. IEEE, 2004.

Omkar M Parkhi, Andrea Vedaldi, Andrew Zisserman, and CV Jawahar. Cats and dogs. In 2012 IEEE conference on computer vision and pattern recognition , pages 3498-3505. IEEE, 2012.

Jonathan Krause, Michael Stark, Jia Deng, and Li Fei-Fei. 3d object representations for finegrained categorization. In Proceedings of the IEEE international conference on computer vision workshops , pages 554-561, 2013.

Maria-Elena Nilsback and Andrew Zisserman. Automated flower classification over a large number of classes. In 2008 Sixth Indian Conference on Computer Vision, Graphics & Image Processing , pages 722-729. IEEE, 2008.

Lukas Bossard, Matthieu Guillaumin, and Luc Van Gool. Food-101-mining discriminative components with random forests. In Computer Vision-ECCV 2014: 13th European Conference, Zurich, Switzerland, September 6-12, 2014, Proceedings, Part VI 13 , pages 446-461. Springer, 2014.

Subhransu Maji, Esa Rahtu, Juho Kannala, Matthew Blaschko, and Andrea Vedaldi. Finegrained visual classification of aircraft. arXiv preprint arXiv:1306.5151 , 2013.

Patrick Helber, Benjamin Bischke, Andreas Dengel, and Damian Borth. Eurosat: A novel dataset and deep learning benchmark for land use and land cover classification. IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing , 12(7):2217-2226, 2019.

Khurram Soomro, Amir Roshan Zamir, and Mubarak Shah. Ucf101: A dataset of 101 human actions classes from videos in the wild. arXiv preprint arXiv:1212.0402 , 2012.

Mircea Cimpoi, Subhransu Maji, Iasonas Kokkinos, Sammy Mohamed, and Andrea Vedaldi. Describing textures in the wild. In Proceedings of the IEEE conference on computer vision and pattern recognition , pages 3606-3613, 2014.

Jianxiong Xiao, James Hays, Krista A Ehinger, Aude Oliva, and Antonio Torralba. Sun database: Large-scale scene recognition from abbey to zoo. In 2010 IEEE computer society conference on computer vision and pattern recognition , pages 3485-3492. IEEE, 2010.

Benjamin Recht, Rebecca Roelofs, Ludwig Schmidt, and Vaishaal Shankar. Do imagenet classifiers generalize to imagenet? In International Conference on Machine Learning , pages 5389-5400. PMLR, 2019.

Haohan Wang, Songwei Ge, Zachary Lipton, and Eric P Xing. Learning robust global representations by penalizing local predictive power. Advances in Neural Information Processing Systems , 32, 2019.

Dan Hendrycks, Kevin Zhao, Steven Basart, Jacob Steinhardt, and Dawn Song. Natural adversarial examples. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition , pages 15262-15271, 2021.

Dan Hendrycks, Steven Basart, Norman Mu, Saurav Kadavath, Frank Wang, Evan Dorundo, Rahul Desai, Tyler Zhu, Samyak Parajuli, Mike Guo, et al. The many faces of robustness: A critical analysis of out-of-distribution generalization. In Proceedings of the IEEE/CVF International Conference on Computer Vision , pages 8340-8349, 2021.

A Discussion

We in this paper propose ALIGN, a unified framework for multi-modal prompt tuning, where multimode modality-specific prompts are learned via the token-level alignment strategy. Moving beyond the single-model methods, which focus on textual prompt tuning or visual prompt tuning, ALIGN allows one to learn textual and visual prompts simultaneously, resulting in better representations in the shared vision-text embedding space. Compared to recent multi-modal methods, such as UPT [27] and MaPLe [28], ALIGN prefers to learn multi-mode prompts to capture diverse class attributes and develop the token-level alignment for fine-grained comparisons. This provides ALIGN with an efficient tool to calculate the similarity between prompts. We find that many previous works can be merged into our ALIGN framework with special hypermeter settings. We summarize this relationship at Table. 5. The N/A in Table. 5 means that PLOT calculates the similarity between the prompt-level label embeddings and the visual patch embeddings, which is not the case in ALIGN, where we calculate the similarity of prompt-level OT between textual label embeddings and visual image embeddings. and calculate the similarity of token-level OT between token embeddings and patch embeddings.

B Data statistics and Hyperparameter setting

We thoroughly evaluate our proposed ALIGN framework across four distinct tasks: few-shot recognition, base-to-new generalization, cross-dataset transfer, and cross-domain generalization. These extensive experiments are conducted on a diverse set of fifty commonly used vision datasets, covering various contexts. These datasets include ImageNet [44] and Caltech101 [45] for generic image classification, OxfordPets [46], StanfordCars [47], Flowers102 [48], Food101 [49], and FGVCAircraft [50] for fine-grained image recognition, SUN397 [54] for scene recognition, UCF101 [52] for action recognition, DTD [53] for texture classification, and EuroSAT [51] for satellite imagery recognition. In the case of the cross-domain generalization task, our model is trained on ImageNet and subsequently tested on ImageNetV2 [55], ImageNet-Sketch [56], ImageNet-A [57], and ImageNet-R [58]. We summarize data statistics at Table. B. 1

The evaluation pipeline for each task follows the approach employed by previous works [3, 28]. The specific details of this pipeline are summarized below:

Few-shot Recognition. To evaluate the efficiency of the proposed ALIGN on the few-shot case, we follow CoOp [3], and first partition the dataset into base and novel sets. Those two sets share the same categories. Models are trained on the base set using a variety of shot settings, including 1, 2, 4, 8, and 16 shots per class, and then tested on the full novel set. The accuracy scores are reported to compare the performance. The training epoch is set as 10 for 1, 2, and 4 shots and 40 for 8 and 16 shots.

Base-to-New Generalization. To show the Generalizability of unseen categories, we first divide the dataset into two separate subsets: the base subset and the new subset. Importantly, these subsets do not share the same categories. The base subset contains a specific set of categories used for model training, while the new subset consists of previously unseen categories that the model has not

Appendix

been exposed to during training. Besides reporting the accuracy score on base and novel sets, we also calculate the harmonic mean H = (2 × Base × New ) / ( Base + New ) , which acts as a trade-off between Base and New, providing a comprehensive measure of overall model performance. The training epoch is set as 8.

Cross-Dataset Transfer. To determine the transferability of our model across different datasets, we first train our model on the source dataset (ImageNet) and then evaluate it on 10 different target datasets. The training epoch is set as 2 and the learning rate is set as 0.0026.

Cross-Domain Generalization. To determine the robustness of our model on the distribution-shift setting, we trained our model on the source dataset (ImageNet) and then assess it on 4 domain-shifted datasets, including ImageNetV2, ImageNet-Sketch, ImageNet-A, and ImageNet-R. The training epoch is set as 2 and the learning rate is set as 0.0026.

The other training hyperparameters in the previous experiments are set according to MaPLe [28], which are detailed listed at Table B. 2.

C Training Algorithm

Given the training datasets D = {X i , y X i } N D i =1 , our method aims to learn M visual and N textual prompts simultaneously. All parameters in ALIGN are optimized by minimizing the cross-entropy loss end-to-end. We summarize the training algorithm at Algorithm. 1.

Algorithm 1 Training algorithm of ALIGN.

Input : Training dataset D , a pre-trained vision-language model, class name set, number of visual prompts M , number of textual prompts N , and the training epoch.

Output : The learned ALIGN, which discovers multi-modal multi-mode prompts for downstream tasks.

Initialize : The M and N multi-modal prompt embeddings.

Preprocess : Built N × K textual token inputs according to Sec 2.1 in the manuscript.

for iter = 1,2,3,... do

1. Feed the textual input into the text encoder g and collect the outputs with the corresponding prompt-level representation { h n k } K,N k =1 ,n =1 and token embeddings { s n k } K,N k =1 ,n =1 , where each s n k is the output token embeddings of n -th prompt of k -th label with length b + k l .

2. Sample a batch of J images. Built N × B visual patch inputs according to Sec2.1 in the manuscript. Feed the visual input into the visual encoder f and collect the outputs with the corresponding prompt-level representation { z j m } J,M j =1 ,m =1 and patch embeddings { r j m } J,M j =1 ,m =1 , where each r j m denotes the output patch embeddings of m -th prompt of j -th image with length b + O .

# Two-level OT

3. Calculate the token-level OT distance between each image and each label in Eq.5 with the collected patch set and token set.

4. Calculate the cost matrix in prompt-level OT according to Eq.6, and then get the prompt-level OT distance in Eq.4.

Compute the cross-entropy loss L with the obtained prompt-level OT distance according to Eq.8 and update all learnable parameters by minimizing L with the stochastic gradient descent algorithm.

end for

D Additional Results

We in this section report additional results of other datasets on the few-shot task and conduct the ablation studies on the prompt and token-level OT.

D.1 Few-shot Results

We report the numerical results of various methods on 11 datasets at Table. D. 1.. From the results, we find that our method ALIGN outperforms baselines in most cases, which demonstrates the efficiency of the token-level prompt alignment module.

D.2 Ablation studies

Recall that the proposed model consists of the prompt-level and token-level OT, which align the textual and visual modalities from hierarchical semantics. In the previous experiment, we view the prompt-level and token-level OT equally and set the hyperparameter weight β = 1 in Eq.6 in the manuscript. Here want to analyze how those two OTs affect the model performance. To this end, we rewrite the cost matrix in Eq.6 in the manuscript as:

Note that β = 0 and β = 1 denote two of our variants, where the former denotes only prompt-OT works and the latter means we only focus on token-level similarity. We report the ablation results of ALIGN on Base-to-New tasks under various settings, e.g. , β = [0 , 0 . 2 , 0 . 5 , 0 . 7 , 1 . 0] at Fig. D1. We have the following interesting findings: 1) The combined ALIGN works better than each of them; 2) After finetuning β for each dataset, one can obtain better results than the reported values in our paper.

Peer reviews:
comments: SUMMARY:
The paper aims at improving few-shot classification based on CLIP-ViT-B/16 using prompt tuning. The authors introduced a multi-modal prompt tuning framework with token-level alignment and distribution matching. The prompts are tuned on ImageNet and then the model is benchmarked on 15 image datasets.

STRENGTHS:
+ The method achieves better results than baselines (e.g., CoOp, MaPLe) on a series of datasets, including both few-shot classification and transfer learning tasks.
+ The code is attached, making the method reproducible.
+ The introduced approach should be practical in real-world applications.

WEAKNESSES:
- The writing appears rushed and some sections are not easy to follow. There are also some typos and grammar issues, e.g., L135-136 "...CLIP. maximuming...".
- The central insight of this work is to introduce token-level alignment in a multimodal prompt-tuning framework. However, the fine-grained alignment with optimal transportation is not new (e.g., Hierarchical Optimal Transport for Multimodal Distribution Alignment, NeurIPS19) and the multimodal prompt-tuning framework is similar to existing works like MPT. It provides limited new knowledge to the community.
- In the experimental part, there are only comparisons based on base-size models. However, it is pretty essential to verify the scalability of the introduced method on larger models.

QUESTIONS:
Please see the Weaknesses.

LIMITATIONS:
The authors have discussed their limitations on the GPU memory during test. It may also be important to discuss their training cost.
TITLE: Official Review
SOUNDNESS_CORRECTNESS: 2
DATE: 2023-07-04

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis work aims to overcome the limitations of previous works in prompt tuning for vision-language models. Unlike prior approaches that focus on single modality or holistic prompt alignment, the paper proposes a multi-mode token-level tuning framework that leverages optimal transportation to align prompt tokens across different modalities. The framework introduced in the paper relies on two crucial elements: multi-mode prompt discovery and token-level alignment. By enabling diverse semantic representations, multi-mode prompt discovery ensures a broader range of prompts. On the other hand, token-level alignment allows for a more detailed exploration of similarity between modalities. Extensive experiments demonstrate the effectiveness of the new method ALIGN.\n\nSTRENGTHS:\n1. Overall, this work is well-motivated, and the paper is well-written. It focuses on a practical problem in prompt learning and proposes a novel method called ALIGN.\n2. This work first leverages Optimal Transportation to address the limitations of prompt tuning. Intuitively, the new method can succeed in finding out token level vision-language prompts. Compared with the single-mode or holistic level prompt tuning approaches, this method can better reveal the connection between visual and textual prompts, which would be a very valuable insight for the study of vision-language alignment.\n3. The authors conduct extensive experiments to evaluate their method, and the results demonstrate non-trivial improvements over the existing baseline models. The comparison is clear, and their method ALIGN achieves SoTA performance in most scenarios.\n\nWEAKNESSES:\n1. The paper lacks discussion of computing cost. It seems that your ALIGN requires more self-attention computation compared to the baselines such as VPT and TPT. Your improvements might be challenged if the difference in training/inference cost is not provided or is too big.\n2. While the paper demonstrates its merits in token-level prompt learning, more empirical results in fine-grained tasks such as semantic segmentation should be included. However, the paper only gives classification results. I understand that implementing prompts into segmentation tasks is not easy and it merely appears in your baselines, but it would be a very strong support to your ALIGN’s effectiveness and significance.\n3. Some expressions are confusing. For example, in line 249-250, there is “For each task, we optimize the number of epochs”. Do you mean “the same number of epochs”?\n\nQUESTIONS:\n1. How about the comparison of computing cost between your method and the baselines?\n2. Is there any experimental results in inference tasks other than classification?\n\nLIMITATIONS:\nSee \"Weaknesses\".", "TITLE": "Official Review", "RECOMMENDATION": 6, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2023-07-04"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis paper introduces a multi-mode token-level alignment framework for multi-modal prompt tuning, which improves the representation of visual and textual modalities and can be used to improve existing methods. The task is formulated as a distribution matching problem, addressed using prompt and token-level optimal transportation (OT), providing a principled and elegant solution. The method is applied to few-shot classification, dataset transfer learning, and domain generalization, showing superior results on widely used datasets.\n\nSTRENGTHS:\n• The learning of multi-modal, multi-mode prompts is facilitated by establishing optimal transport (OT) at the prompt and token level.\n• The structure of the manuscript is solid and it's well-written overall.\n• The efficiency of the proposed ALIGN method for both few-shot classification and generalization has been confirmed through a series of diverse experiments.\n\nWEAKNESSES:\n• The proposed model might be memory-intensive, however, an analysis of the additional time and memory costs has not been provided.\n• The omission of specific details, particularly regarding the ablation analysis, somewhat undermines the impressive results.\n  - The study does not examine the influence of prompt length and quantity on the experimental outcomes.\n  - It remains unclear whether token-level alignment provides any enhancements compared to prompt-level alignment.\n\n• Miscellaneous issue\n- Figure 1 is not mentioned in the body text.\n- It seems that line 135 is missing a period, and the expression \"maximuming\" appears to be awkward.\n- In Table 1, CoOp shows the best result in 'Stanford Cars'-Base, so it should be highlighted instead of ALIGN\n\nQUESTIONS:\nSee the comments in weakness.\n\nLIMITATIONS:\n• As pointed out in the conclusion section, this paper's method still demands substantial GPU memory.\n• The method suggested does not appear to be well-suited for a fully zero-shot scenario where there is no training samples. This scenario is little bit different from the Base-to-New Generalization scenario.", "TITLE": "Official Review", "RECOMMENDATION": 6, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 2, "DATE": "2023-07-07"}

comments: SUMMARY:
The paper proposes a prompt-learning method for adapting CLIP to few-shot classification. The proposed prompt is multimodal, i.e., both vision and language encoder is adaptable, and multimode, i.e., each modality is assigned with several prompts for diverse representation. Experiments are conducted on few-shot and base-to-new transfer settings, showing the method's superiority over previous state-of-the-art.

STRENGTHS:
* Promising results are achieved, both in the few-shot setting and base-to-new transfer setting. 
* The presentation is mostly clear and easy to understand.

WEAKNESSES:
* Incremental novelty of the paper. Visual-language prompt learning with multimode prompts and optimal transport (OT) is explored in PLOT [17]. Also, multimodal prompts are explored in works like [27][28]. This proposed multimode multimodal prompts with OT multimode seems to combine the two types of previous methods and reveals limited insights. 
* Missing comparison on computation complexity. As multimode prompts require quite large parameters and computations compared to a single prompt, I want to see the comparison of parameter efficiency and time efficiency.
* It is strange that there is no ablation study of each component of the models. It is important to see the individual contribution of the multi-mode prompts and the token-level alignment.

QUESTIONS:
* In Fig. 3, ALIGN performance on UCF is much superior to previous methods, but the superiority on UCF is not obvious in the Base-to-New setting, especially on the base classes.  Why is that case? 
* In Page 3 Line 97, "Empirical findings" needs to specify the source of information or citing papers.

LIMITATIONS:
Yes
TITLE: Official Review
SOUNDNESS_CORRECTNESS: 2
DATE: 2023-07-10

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis paper argues that existing prompt turning fails to caption the sample diversity, learning to sub-optimal prompt discovery. To this end, they propose a multi-mode token-level alignment for multi-modal prompt tuning. Specifically, they formulate the prompt turning as the hierarchical optimal transportation problem (distribution matching problem). As a result, the extensive experiments on few-shot image classification, transfer learning, and domain generalization, show the superiority of the ALIGN.\n\nSTRENGTHS:\n1. **The proposed method is effective and comprehensive**. Learning and aligning a set of prompt tokens across modalities by hierarchical optimal transportation is effective and simple.\n2. **The result is strong and the evaluation is comprehensive**. The extensive experiments on 15 widely used image datasets under the setting of four task settings show the superiority of the proposed method.\n\nWEAKNESSES:\n1. **Time Complexity Analysis.** Since this method introduces hierarchical optimal transmission, I would like to ask whether there is more time overhead in the inference phase than in other methods. Can you provide relevant experimental comparisons in detail?\n\n2. **More Cases for Visualization.** In order to prove that learned prompt tokens have the ability to capture diverse visual concepts, it seems that Fig. 4 cannot explain the above claim well. I am more curious whether there are multiple prompts that will pay attention to the same visual concepts. Can you provide more cases for analysis?\n\n3. **The different with PLOT[1] and MAPLE[2].**  Can you provide a more thorough comparison to illustrate the novelty of your work?\n\n4. **The writing is need to be improved**. It is hard to understand the core idea from the messy introduction. What's more, Sec.2 Background and Sec.4 Related work have a large number of duplicates that exist and can be merged.\n\n\n[1] PLOT: Prompt Learning with Optimal Transport for Vision-Language Models. ICLR 2023.\n\n[2] MaPLe: Multi-modal Prompt Learning. CVPR 2023.\n\nQUESTIONS:\nAs shown in weaknesses.\n\nLIMITATIONS:\nN/A", "TITLE": "Official Review", "RECOMMENDATION": 5, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 2, "DATE": "2023-07-10"}