TL;DR
OTTER (Optimal TransporT adaptER) is a lightweight, training-free method that fixes label distribution bias in zero-shot models like CLIP. By using optimal transport at inference time to align model predictions with a target distribution, it boosts accuracy by an average of 4.8% on image tasks and 15.9% on text tasks without any fine-tuning.
What Problem Does This Paper Address?
Zero-shot models are incredibly powerful because they can classify data they’ve never explicitly been trained on. However, they carry "baggage" from their massive pretraining datasets. If a model like CLIP saw many more pictures of Abyssinians than Persians during its web-scale training, it develops a "prior bias"—it will naturally want to predict "Abyssinian" more often, even when looking at a balanced dataset.
This is known as mismatched label distribution. As illustrated above, standard zero-shot models (like RN50 and ViT-B/16) often exhibit skewed prediction proportions that fail to match the uniform ground truth of a target dataset. Most existing fixes for this problem are "expensive": they require labeled data for fine-tuning or require the researcher to know the exact distribution of the original (often proprietary) pretraining data. The authors of OTTER set out to find a way to rebalance these models at inference time using only a rough estimate of the target task's distribution.
Methods
The core of the paper is OTTER (Optimal TransporT adaptER). Instead of traditional classification (where each image is classified independently), OTTER treats classification as an Optimal Transport (OT) problem.
- The Cost Matrix: The model takes the raw prediction scores from a zero-shot model and converts them into a "cost matrix" using negative log-probabilities. Essentially, if the model thinks an image is unlikely to be a "Pug," the "cost" of assigning it to that class is high.
- The Constraints: The user provides a target label distribution (e.g., "I expect my classes to be roughly uniform").
- The Optimization: OTTER solves for a "transport plan" that assigns images to classes in a way that minimizes the total cost while strictly satisfying the target distribution.
The authors also introduced R-OTTER (Reweighting OTTER) for online scenarios where you can't process a whole batch of data at once, and H-OTTER, which leverages class hierarchies (like knowing that a "Husky" is a type of "Dog") to improve results.
Datasets
The researchers validated OTTER across a massive battery of 21 datasets:
- Image Classification (17 datasets): Including classics like CIFAR-10/100, ImageNet (and its variants -r and -Sketch), Caltech101/256, Oxford-IIIT Pet, and specialized sets like EuroSAT (satellite imagery) and DTD (textures).
- Text Classification (4 datasets): Amazon reviews, GenderBias, CivilComments, and HateXplain.
- LLM Benchmarks: MMLU, ARC-Challenge, and CommonsenseQA were used to test OTTER's ability to mitigate selection bias in Large Language Models.
Key Insights and Ideas
- Label Shift Invariance: The authors prove theoretically that if the model is well-calibrated and the features don't change (only the class frequencies do), OTTER can actually recover the Bayes-optimal classifier. This means it can theoretically reach the best possible performance for that model architecture.
- Tuning-Free Performance: Unlike the baseline "Prior Matching," which requires careful hyperparameter tuning (like learning rates and temperatures) for every new dataset, OTTER is "plug-and-play." It works out of the box as long as you have a batch of data and a distribution estimate.
- Fixing LLM "Position Bias": LLMs often have a "selection bias" where they prefer certain multiple-choice letters (like 'A') regardless of content. The authors showed that by enforcing a uniform distribution constraint via OTTER, they could significantly neutralize this bias.
Key Results
- Accuracy Boosts: OTTER outperformed the standard zero-shot approach in almost every category. It provided an average lift of 4.8% in image classification and a staggering 15.9% in text classification.
- Beating the Baseline: It beat "Prior Matching" in 17 out of 21 datasets, often by significant margins. For example, on the Caltech256 dataset, OTTER achieved 87.0% accuracy compared to Prior Matching's 9.5% (which failed due to hyperparameter sensitivity).
- Efficiency: OTTER is computationally "light." In many tests, it achieved a 90%+ reduction in inference time compared to the iterative Prior Matching baseline.
- Robustness: Even when the estimate of the label distribution was slightly noisy or "misspecified," OTTER still generally outperformed the naive zero-shot model.
Limitations and Future Work
- The Batching Requirement: Standard OTTER requires a batch of inference data to work (it needs to see a group of images to know how to distribute them). While R-OTTER attempts to solve this for streaming data, it is slightly less accurate than the batch version.
- Dependency on Estimates: OTTER relies on the user providing an estimate of the downstream label distribution. While often easy (e.g., assuming a uniform distribution for a balanced test set), it becomes harder in "wild" scenarios where the distribution is completely unknown.
- Calibration Sensitivity: The theoretical guarantees rely on the model being "well-calibrated." If a model is wildly overconfident or underconfident in its raw scores, the "cost matrix" might be less effective.
Future work could involve developing better ways to automatically estimate the target distribution in a completely unsupervised manner, further removing the need for human input.
Summary updated