OTTER: Effortless Label Distribution Adaptation of Zero-shot Models

Popular zero-shot models suffer due to artifacts inherited from pretraining. One particularly detrimental issue, caused by unbalanced web-scale pretraining data, is mismatched label distribution. Existing approaches that seek to repair the label distribution are not suitable in zero-shot settings, as they have mismatching requirements, such as needing access to labeled downstream task data or knowledge of the true label balance in the pretraining distribution. We sidestep these challenges and introduce a simple and lightweight approach to adjust pretrained model predictions via optimal transport. Our technique requires only an estimate of the label distribution of a downstream task. Theoretically, we characterize the improvement produced by our procedure under certain mild conditions and provide bounds on the error caused by misspecification. Empirically, we validate our method in a wide array of zero-shot image and text classification tasks, improving accuracy by 4.8% and 15.9% on average, and beating baselines like prior matching -- often by significant margins -- in 17 out of 21 datasets.

Paper

Similar papers

Peer review

Reviewer t22L7/10 · confidence 4/52024-07-01

Summary

This paper introduces a novel approach to address the issue of label distribution mismatch in zero-shot models, which is a common problem due to the imbalance in the pretraining datasets. The proposed method uses optimal transport to adjust the predictions of pretrained models based on an estimated downstream label distribution, without requiring additional training or access to labeled downstream data.

Strengths

1. The use of optimal transport to handle label distribution mismatch in zero-shot models is a novel and elegant solution. 2. The paper provides a solid theoretical foundation for the proposed method, including characterizations of the improvement under mild conditions and error bounds for misspecification. 3. Extensive empirical validation across a wide range of image and text classification tasks demonstrates the effectiveness of OTTER.

Weaknesses

1. dependence on estimated label distribution: the method relies on an accurate estimate of the downstream label distribution. In practice, obtaining a reliable estimate may be challenging, and errors in this estimate could impact the performance of OTTER. 2. evaluation on diverse datasets: while the paper includes a variety of datasets for validation, a more detailed analysis of performance across different types of datasets (e.g., varying in size, complexity, and imbalance levels) would provide a deeper understanding of the method's strengths and limitations. 3. comparison with recent methods: the paper compares OTTER with some existing baselines, but it could benefit from a more comprehensive comparison with the latest state-of-the-art methods in label distribution adaptation and zero-shot learning. There are many training-free or test-time adaption zero-shot baselines[a][b][c]. How does OTTER perform compared to these methods? 4. scalability: although described as lightweight, the paper does not thoroughly discuss the scalability of OTTER for very large-scale datasets. [a] Mirza, Muhammad Jehanzeb, et al. "Lafter: Label-free tuning of zero-shot classifier using language and unlabeled image collections." NIPS 2024. [b] Zhao, Shuai, et al. "Test-time adaptation with clip reward for zero-shot generalization in vision-language models." arXiv preprint arXiv:2305.18010. [c] Abdul Samadh, Jameel, et al. "Align your prompts: Test-time prompting with distribution alignment for zero-shot generalization." NIPS 2024.

Questions

The paper presents a compelling and well-validated approach to address label distribution mismatch in zero-shot models using optimal transport. Its innovative method, strong theoretical foundation, and significant empirical improvements make it a valuable contribution to the field. However, further exploration of its limitations, more comparisons with recent methods, and practical implementation details would enhance its impact and utility.

Rating

7

Confidence

4

Soundness

4

Presentation

3

Contribution

3

Limitations

The authors do not claim limitations.

Reviewer M3dD5/10 · confidence 4/52024-07-02

Summary

Zero shot classification suffers from label distribution mismatch. This paper suggest to adjust pretrained model prediction via optimal transport. By showing the optimal transport prediction is equivalent to the bayes optimal classifier's output theoretically and good model performances on various experimental settings empirically, the paper shows the validity of its proposed method.

Strengths

- The problem is well formulated - Various experiment

Weaknesses

- Novelty is limited. This paper suggests applying OT for managing label distribution shift. The class imbalance for pretrained network prediction is already well known, and OT has been already applied for various distribution shift cases. Therefore, naively applying OT for the biased pretrained model prediction is imaginable. - The proposal saying that Bayes optimal classifier can be derived through optimal transport is inadequate and too strong since it requires a true cost matrix. If $P_t(Y|X)$ is accessible, we don't even need to use the optimal transport. - Please link theorems of the main paper and proofs in the appendices for readability. - I don't think figure 2 shows OTTER remains unaffected. The acc is deteriorated from 90 to 7X, meaning about 15%p decrease.

Questions

- Considering each cell of the cost matrix $C$, it is a loss (or the classifier score) calculated from the pretrained network. It means the cost matrix is biased to the source data distribution. In that sense, how the optimal transport can be considered as assigning true label? - How can the true label distribution of the target, $\nu*$, be accessible? - Can the author show more details for the equation of section 4.1? I cannot understand how to remove $P_s(X)$ and $P_t(X)$ - In table 1, what happened to Caltech256 Prior matching? Why the performance is far worse than zero-shot? - In figure 2, Why OTTER shows acc increase when the total variation distance between the source and the target increases from 0.4 to 0.8? With larger distribution shift, acc is supposed to deteriorate. If not, the synthetic experiment may be poorly modeled. - How long does it take to apply OTTER? I suppose it will take quadratically proportional to the dataset size.

Rating

5

Confidence

4

Soundness

3

Presentation

3

Contribution

1

Limitations

.

Authorsrebuttal2024-08-07

Reference

[1] Saerens, Marco, Patrice Latinne, and Christine Decaestecker. "Adjusting the outputs of a classifier to new a priori probabilities: a simple procedure." Neural computation 14.1 (2002): 21-41. [2] Lipton, Zachary, Yu-Xiang Wang, and Alexander Smola. "Detecting and correcting for label shift with black box predictors." ICML'18. [3] Azizzadenesheli, Kamyar, et al. "Regularized Learning for Domain Adaptation under Label Shifts." ICLR'18. [4] Alexandari, Amr, Anshul Kundaje, and Avanti Shrikumar. "Maximum likelihood with bias-corrected calibration is hard-to-beat at label shift adaptation." ICML'20. [5] Garg, Saurabh, et al. "A unified view of label shift estimation." NeurIPS'20. [6] Lee, Yin Tat, and Aaron Sidford. "Path finding methods for linear programming: Solving linear programs in $\tilde{O}(\sqrt{rank})$ iterations and faster algorithms for maximum flow." IEEE 55th Annual Symposium on Foundations of Computer Science. IEEE, 2014.

Area Chair 66Hy2024-08-12

Respond to author rebuttal

Dear reviewer, Thank you for your assistance in the review process. Could you please read the author rebuttal ASAP and let them / fellow reviewers know if it addressed your concerns?

Reviewer M3dD2024-08-13

I checked the authors' rebuttal, and appreciate their effort to relieve my concerns. Since my questions for the novelty claim has not been solved, and the authors have thoroughly answered my questions, I increase my score to 5.

Reviewer t3Bz8/10 · confidence 4/52024-07-08

Summary

Zero-shot models such as CLIP suffer from imbalanced predictions inherited from the uncurated pre-training data. This paper proposes adjusting the predictions of zero-shot models via optimal transport. This method requires only the downstream data and the label prior of the target distribution. Under the assumption that the conditional likelihood is unchanged between the pre-training data and the downstream data, the authors prove that the induced predictions are Bayes Optimal. The authors validate the effectiveness of the proposed method on several benchmark tests.

Strengths

The paper is well-organized and the presentation is clear. The idea of using optimal transport to adjust zero-shot predictions on downstream data is novel to me. Besides, the authors prove that the resulting predictions are Bayes optimal and justify the cost matrix using posteriors of zero-shot models. I have coarsely checked the proofs and find them convincing.

Weaknesses

Major: (1) Related works are missing. Some papers have addresses the issue of removing the label bias in zero-shot models. For instance, [1][2] use a subset of the pre-training data to mitigate the bias. [3] focuses on only using the labeled downstream data to address imbalanced predictions and proposes two methods. The authors should consider including these prior works. [1] A simple zero-shot prompt weighting technique to improve prompt ensembling in text-image models. [2] The neglected tails of vision-language models. [3] Generalized Logit Adjustment: Improved Fine-tuning by Mitigating Label Bias in Foundation Models. (2) The proposed method is transductive and requires the entire test dataset to perform optimal transport. I am wondering if OTTER can estimate the label distribution of pre-training data $\pi$ from unlabeled downstream training data and then the debiasing procedure can be performed by subtracting the logarithm $\ln \pi$ from the zero-shot predictions, as described in [3] (https://arxiv.org/pdf/2310.08106), without needing to operate on the entire test dataset Minor: (1) Duplicate citations: [29] and [30]. (2) Line 120: should reference Algorithm 1.

Questions

Please refer to the weaknesses, and I am willing to raise the score if the major weaknesses are addressed. Additionally, I have a question to discuss with the authors. Both [3] and OTTER use downstream data to generate Bayes optimal predictions based on the assumption that $P(x|y)$ remains unchanged between the pre-training distribution and the downstream distribution. In practice, this assumption might not hold. For instance, the pre-training data might mostly consist of real photos, while some test benchmarks might be sketches, e.g., ImageNet-Sketch. Under this situation, is your method theoretically sound in mitigating the pre-training bias?

Rating

8

Confidence

4

Soundness

3

Presentation

3

Contribution

3

Limitations

Limitations have been discussed and no negative societal impact has been identified.

Reviewer t3Bz2024-08-08

Thank you for your response. Regarding your reply to W2, if I understand correctly, the authors suggest that the proposed OTTER method at least requires a batch of test samples to produce an unbiased prediction. My question is, if we are given a set of i.i.d. validation data with zero-shot predictions $y_{zs}$ and debiased predictions $y_{otter}$, is it possible to use these terms to derive $(\log\frac{P_t(y)}{P_s(y)}$such that the requirement of using all test data or a batch of test samples can be avoided?

Authorsrebuttal2024-08-11

Thank you for the interesting idea! Yes, combining two methods in the way you suggest could eliminate the need for the entire dataset or large data subsets in optimal transport. We appreciate the suggestion and will add the combination to our draft.

Reviewer t3Bz2024-08-11

Thank you for your updates. In my opinion, combining OTTER with [3] to avoid transductive zero-shot predictions would make the proposed method more practical. As a result, I am strongly considering increasing my score for the paper if the revised version incorporates this suggested combination. If you agree with the suggestion, could you provide concrete details on what changes you plan to make and where they will be implemented?

Authorsrebuttal2024-08-12

Thank you! We appreciate it. Following your suggestion, we have updated our paper to introduce a variant of our approach called R-OTTER (Reweighting OTTER). We added the R-OTTER formulation to Section 3, a set of theoretical results (which we sketch here) to Section 4, and empirical results (highlighted below, including both synthetic and real data settings) to Section 5. This approach helps reduce the reliance on large data subsets or the entire dataset for prediction. R-OTTER involves learning a reweighting factor (an estimate of $P_t(Y)/P_s(Y)$) using OTTER's predictions $y_{otter}$ as pseudolabels in validation set. This reweighting can then be applied to adjust probability scores or logits without relying on the entire test dataset. * R-OTTER formulation: For simplicity, we use a reweighting formulation equivalent to logit adjustment in [3]. The reweighted probability scores of $P_\theta$ with a reweighting parameter vector $r \in R^{K}$ defined as $P_{\theta, r}(Y=j|X=x) = \cfrac{r_j P_\theta(Y=j|X=x)}{\sum_{j'=1}^K r_{j'} P_\theta(Y=j'|X=x)}$. We learn $r$ with $y_{otter}$ using a cross entropy loss. We expect R-OTTER to perform comparably to OTTER (but with the desired benefit of not requiring running OTTER over the entire dataset) by learning the reweighting factor accurately. We provide a theoretical result showing that $r^*=P_t(Y)/P_s(Y)$ is optimal in this formulation. * **Theorem**. Under the same assumption of Theorem 4.2., $r^*=P_t(Y)/P_s(Y)$ is an optimal parameter when learning with $y_{otter}$. **Proof (Sketch)**. By assumption $P_\theta(Y|X)=P_s(Y|X)$. Using the result of Theorem 4.2, $y_{otter}$ samples are generated by $\arg\max_{j}P_t(Y=j|X=x)$. Suppose $r^*=P_t(Y)/P_s(Y)$. Then, $P_{\theta, r^*}(Y=j|X=x)$ $= \cfrac{r_j^* P_\theta(Y=j|X=x)}{\sum_{j'=1}^K r^*_{j'} P_\theta(Y=j'|X=x)}$ $=\cfrac{r_j^* P_s(Y=j|X=x)}{\sum_{j'=1}^K r_{j'}^* P_s(Y=j'|X=x)}$ $=\cfrac{\frac{P_t(Y=j)}{P_s(Y=j)}\frac{P_s(X=x|Y=j)P_s(Y=j)}{P_s(X=x)}}{\sum_{j'=1}^K\frac{P_t(Y=j')}{P_s(Y=j')}\frac{P_s(X=x|Y=j')P_s(Y=j')}{P_s(X=x)}}$ $=\cfrac{P_t(Y=j)P_s(X=x|Y=j)}{\sum_{j'=1}^KP_t(Y=j')P_s(X=x|Y=j')}$ $=\cfrac{P_t(Y=j)P_t(X=x|Y=j)}{\sum_{j'=1}^KP_t(Y=j')P_t(X=x|Y=j')}$ $=\cfrac{\frac{P_t(Y=j)P_t(Y=j|X=x)P_t(X=x)}{P_t(Y=j)}}{\sum_{j'=1}^K\frac{P_t(Y=j')P_t(Y=j'|X=x)P_t(X=x)}{P_t(Y=j')}}$ $=\cfrac{P_t(Y=j|X=x)}{\sum_{j'=1}^K P_t(Y=j'|X=x)}$ Thus, $y_{r\text{-}otter} = \arg\max_{j}P_{\theta, r^*}(Y=j|X=x)$ $=\arg\max_{j}\cfrac{P_t(Y=j|X=x)}{\sum_{j'=1}^K P_t(Y=j'|X=x)}$ $=\arg\max_{j}P_t(Y=j|X=x)$ $=y_{otter}$. Our synthetic experiment validates the above theorem. * **Synthetic experiment results**: We use our synthetic experiment setup with perturbation noise $\delta=0$ and label distribution $\alpha=0$. Additionally, we generated a validation set that follows the same distribution as the test set. After learning the reweighting parameter $r$ in the validation set using $y_{otter}$ as pseudolabels, we evaluated R-OTTER on the test set, comparing the results to those of zero-shot and OTTER. We expect that, if successful, R-OTTER will similarly gain improvement over zero-shot when the source and target distributions increasingly differ. We observe this: | TV (P_t(Y), P_s(Y)) | ZS | OTTER | R-OTTER | Bayes Optimal | |-----------------|--------|--------|---------|---------------| | 0 | 0.9306 | 0.9238 | **0.9179** | 0.9305 | | 0.05 | 0.9041 | 0.9001 | **0.8944** | 0.9065 | | 0.1 | 0.8783 | 0.8830 | **0.8768** | 0.8870 | | 0.15 | 0.8516 | 0.8687 | **0.8628** | 0.8732 | | 0.2 | 0.8261 | 0.8598 | **0.8492** | 0.8618 | | 0.25 | 0.8003 | 0.8507 | **0.8407** | 0.8516 | | 0.3 | 0.7731 | 0.8443 | **0.8331** | 0.8449 | | 0.35 | 0.7483 | 0.8428 | **0.8334** | 0.8430 | | 0.4 | 0.7218 | 0.8392 | **0.8317** | 0.8393 | | 0.45 | 0.6978 | 0.8432 | **0.8355** | 0.8434 | | 0.5 | 0.6709 | 0.8433 | **0.8371** | 0.8444 | Overall, we observe comparable accuracy to OTTER, where the difference is controlled by the parameter estimation error. We anticipate similar findings in our real-world experiments: * **Real experiment results**: We conducted a mini real-world experiment by splitting the original dataset into validation and test sets, following the same procedure as in the synthetic experiment. | | ZS | OTTER | R-OTTER | |------------|--------|--------|---------| | CIFAR100 | 0.6381 | 0.6759 | **0.6532** | | Caltech101 | 0.7964 | 0.8541 | **0.8427** | | DTD | 0.3893 | 0.4381 | **0.4156** | | EUROSAT | 0.3286 | 0.4185 | **0.3453** | | Flowers102 | 0.6382 | 0.6894 | **0.6836** | As expected, R-OTTER, indeed performs better than zero-shot across all datasets and often comparably to OTTER. We will include the full results in the revised manuscript.

Reviewer t3Bz2024-08-12

The theory and experiments sound good to me. I am happy to increase my score to 8.

Reviewer t22L2024-08-10

Thanks for the authors' answer. Regarding Q2, can you explain why the accuracy increases with the increase of imbalance? This is counterintuitive.

Authorsrebuttal2024-08-10

Thank you for your follow-up question. The reason OTTER shows greater accuracy gains with increased class imbalance is that there's more room for improvement in these scenarios. When the downstream class distribution is imbalanced, it often deviates more significantly from the concept distribution in the pretraining data, leading to a larger label distribution shift. This greater discrepancy allows OTTER to make more impactful corrections, resulting in the observed accuracy increase.

Program Chairsdecision2024-09-25

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC