Patching open-vocabulary models by interpolating weights
Gabriel Ilharco, Mitchell Wortsman, Samir Yitzhak Gadre, Shuran Song, Hannaneh Hajishirzi, Simon Kornblith, Ali Farhadi, Ludwig Schmidt
Abstract
Open-vocabulary models like CLIP achieve high accuracy across many image classification tasks. However, there are still settings where their zero-shot performance is far from optimal. We study model patching, where the goal is to improve accuracy on specific tasks without degrading accuracy on tasks where performance is already adequate. Towards this goal, we introduce PAINT, a patching method that uses interpolations between the weights of a model before fine-tuning and the weights after fine-tuning on a task to be patched. On nine tasks where zeroshot CLIP performs poorly, PAINT increases accuracy by 15 to 60 percentage points while preserving accuracy on ImageNet within one percentage point of the zero-shot model. PAINT also allows a single model to be patched on multiple tasks and improves with model scale. Furthermore, we identify cases of broad transfer, where patching on one task increases accuracy on other tasks even when the tasks have disjoint classes. Finally, we investigate applications beyond common benchmarks such as counting or reducing the impact of typographic attacks on CLIP. Our findings demonstrate that it is possible to expand the set of tasks on which open-vocabulary models achieve high accuracy without re-training them from scratch. Code available at https://github.com/mlfoundations/patching .
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
107 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- TIES-Merging: Resolving Interference When Merging Models cites Task Arithmetic in the Tangent Space: Improved Editing of Pre-Trained Models
- TIES-Merging: Resolving Interference When Merging Models cites Model soups: averaging weights of multiple fine-tuned models improves accuracy without increasing inference time
- TIES-Merging: Resolving Interference When Merging Models cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- TIES-Merging: Resolving Interference When Merging Models cites Learning Transferable Visual Models From Natural Language Supervision
- LIV: Language-Image Representations and Rewards for Robotic Control cites Model soups: averaging weights of multiple fine-tuned models improves accuracy without increasing inference time
- LIV: Language-Image Representations and Rewards for Robotic Control cites Scaling Up Visual and Vision-Language Representation Learning With Noisy Text Supervision
- LIV: Language-Image Representations and Rewards for Robotic Control cites Learning Transferable Visual Models From Natural Language Supervision
- Task Arithmetic in the Tangent Space: Improved Editing of Pre-Trained Models cites Model soups: averaging weights of multiple fine-tuned models improves accuracy without increasing inference time
- Task Arithmetic in the Tangent Space: Improved Editing of Pre-Trained Models cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Task Arithmetic in the Tangent Space: Improved Editing of Pre-Trained Models cites Learning Transferable Visual Models From Natural Language Supervision
- Model soups: averaging weights of multiple fine-tuned models improves accuracy without increasing inference time cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Model soups: averaging weights of multiple fine-tuned models improves accuracy without increasing inference time cites Scaling Up Visual and Vision-Language Representation Learning With Noisy Text Supervision
- Model soups: averaging weights of multiple fine-tuned models improves accuracy without increasing inference time cites Learning Transferable Visual Models From Natural Language Supervision
- Rewarded soups: towards Pareto-optimal alignment by interpolating weights fine-tuned on diverse rewards cites Model soups: averaging weights of multiple fine-tuned models improves accuracy without increasing inference time
- Rewarded soups: towards Pareto-optimal alignment by interpolating weights fine-tuned on diverse rewards cites Learning Transferable Visual Models From Natural Language Supervision
- Scaling Up Visual and Vision-Language Representation Learning With Noisy Text Supervision cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Scaling Up Visual and Vision-Language Representation Learning With Noisy Text Supervision cites Learning Transferable Visual Models From Natural Language Supervision
- Learning Transferable Visual Models From Natural Language Supervision cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Flamingo: a Visual Language Model for Few-Shot Learning cites Model soups: averaging weights of multiple fine-tuned models improves accuracy without increasing inference time
- Flamingo: a Visual Language Model for Few-Shot Learning cites Scaling Up Visual and Vision-Language Representation Learning With Noisy Text Supervision
- Flamingo: a Visual Language Model for Few-Shot Learning cites Learning Transferable Visual Models From Natural Language Supervision
- Self-regulating Prompts: Foundational Model Adaptation without Forgetting cites Scaling Up Visual and Vision-Language Representation Learning With Noisy Text Supervision
- Self-regulating Prompts: Foundational Model Adaptation without Forgetting cites Learning Transferable Visual Models From Natural Language Supervision
Cited by top-tier papers107
- TIES-Merging: Resolving Interference When Merging ModelsPrateek Yadav, Derek Tam, Leshem Choshen, Colin A. Raffel et al.NeurIPS 2023 · 999 citations
- Self-regulating Prompts: Foundational Model Adaptation without ForgettingMuhammad Uzair Khattak, Syed Talal Wasim, Muzammal Naseer, Salman Khan et al.ICCV 2023 · 365 citations
- Rewarded soups: towards Pareto-optimal alignment by interpolating weights fine-tuned on diverse rewardsAlexandre Ramé, Guillaume Couairon, Corentin Dancette, Jean-Baptiste Gaya et al.NeurIPS 2023 · 295 citations
- Task Arithmetic in the Tangent Space: Improved Editing of Pre-Trained ModelsGuillermo Ortiz-Jiménez, Alessandro Favero, Pascal FrossardNeurIPS 2023 · 272 citations
- LIV: Language-Image Representations and Rewards for Robotic ControlYecheng Jason Ma, Vikash Kumar, Amy Zhang, Osbert Bastani et al.ICML 2023 · 212 citations
Builds on32
- Learning Transferable Visual Models From Natural Language SupervisionAlec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh et al.ICML 2021 · 47,906 citations
- An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn et al.ICLR 2021 · 21,477 citations
- Flamingo: a Visual Language Model for Few-Shot LearningJean-Baptiste Alayrac, Jeff Donahue, Pauline Luc, Antoine Miech et al.NeurIPS 2022 · 6,707 citations
- Scaling Up Visual and Vision-Language Representation Learning With Noisy Text SupervisionChao Jia, Yinfei Yang, Ye Xia, Yi-Ting Chen et al.ICML 2021 · 5,401 citations
- Model soups: averaging weights of multiple fine-tuned models improves accuracy without increasing inference timeMitchell Wortsman, Gabriel Ilharco, Samir Yitzhak Gadre, Rebecca Roelofs et al.ICML 2022 · 1,464 citations
Related papers
- Open Vocabulary Semantic Segmentation with Patch Aligned Contrastive LearningJishnu Mukhoti, Tsung-Yu Lin, Omid Poursaeed, Rui Wang et al.CVPR 2023
- Robust fine-tuning of zero-shot modelsMitchell Wortsman, Gabriel Ilharco, Jong Wook Kim, Mike Li et al.CVPR 2022 · 364 citations
- LiFT: Transfer Learning in Vision-Language Models for Downstream Adaptation and GeneralizationJingzheng Li, Hailong SunACM MM 2023 · 5 citations
- Test-Time Visual In-Context TuningJiahao Xie, Alessio Tonioni, Nathalie Rauschmayr, Federico Tombari et al.CVPR 2025
- DeCoOp: Robust Prompt Tuning with Out-of-Distribution DetectionZhi Zhou, Ming Yang, Jiang-Xin Shi, Lan-Zhe Guo et al.ICML 2024 · 14 citations
