{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/robust-fine-tuning-of-zero-shot-models","title":"Robust fine-tuning of zero-shot models","arxiv_id":"2109.01903","date":"2021-09-04","proceeding":"CVPR 2022 1","authors":["Mitchell Wortsman","Gabriel Ilharco","Jong Wook Kim","Mike Li","Simon Kornblith","Rebecca Roelofs","Raphael Gontijo-Lopes","Hannaneh Hajishirzi","Ali Farhadi","Hongseok Namkoong","Ludwig Schmidt"],"abstract":"Large pre-trained models such as CLIP or ALIGN offer consistent accuracy across a range of data distributions when performing zero-shot inference (i.e., without fine-tuning on a specific dataset). Although existing fine-tuning methods substantially improve accuracy on a given target distribution, they often reduce robustness to distribution shifts. We address this tension by introducing a simple and effective method for improving robustness while fine-tuning: ensembling the weights of the zero-shot and fine-tuned models (WiSE-FT). Compared to standard fine-tuning, WiSE-FT provides large accuracy improvements under distribution shift, while preserving high accuracy on the target distribution. On ImageNet and five derived distribution shifts, WiSE-FT improves accuracy under distribution shift by 4 to 6 percentage points (pp) over prior work while increasing ImageNet accuracy by 1.6 pp. WiSE-FT achieves similarly large robustness gains (2 to 23 pp) on a diverse set of six further distribution shifts, and accuracy gains of 0.8 to 3.3 pp compared to standard fine-tuning on seven commonly used transfer learning datasets. These improvements come at no additional computational cost during fine-tuning or inference.","url_abs":"https://arxiv.org/abs/2109.01903v3","url_pdf":"https://arxiv.org/pdf/2109.01903v3.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"robust-fine-tuning-of-zero-shot-models","repo_url":"https://github.com/mlfoundations/wise-ft","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"robust-fine-tuning-of-zero-shot-models","repo_url":"https://github.com/ivanaer/g-universal-clip","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"robust-fine-tuning-of-zero-shot-models","repo_url":"https://github.com/mlfoundations/model-soups","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"image-classification","task_name":"Image Classification"},{"task_slug":"transfer-learning","task_name":"Transfer Learning"}],"methods":[{"method_slug":"align","method_name":"ALIGN"},{"method_slug":"clip","method_name":"CLIP"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/image-classification-on-objectnet","task":"Image Classification","dataset":"ObjectNet","model":"WiSE-FT","rank_in_archive_order":12,"of":106,"metrics":{"Top-1 Accuracy":"72.1"},"uses_additional_data":true}],"syntology":{"syntology_url":"https://syntology.ai/paper/2109.01903","atlas_url":"https://app.syntology.ai/?focus=2109.01903","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2109.01903"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/mlfoundations/model-soups","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/mlfoundations/wise-ft","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ivanaer/g-universal-clip","reach":null}],"summary":{"ran_draft_wrong":1,"unverified":2},"by_repo_kind":{"official":{"samples":1,"ran":1,"repositories":1},"listed":{"samples":2,"ran":0,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":1,"samples":[{"code_sha256_prefix":"55033a7e690ca43b","entry":"_merge","repo":"mlfoundations/wise-ft","repo_kind":"official","path":"src/wise_ft.py","file_url":"https://github.com/mlfoundations/wise-ft/blob/HEAD/src/wise_ft.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"55033a7e690ca43b"}},{"code_sha256_prefix":"602d9712f9f7e7ee","entry":"AlphaWrapper","repo":"mlfoundations/model-soups","repo_kind":"listed","path":"learned_bylayer.py","file_url":"https://github.com/mlfoundations/model-soups/blob/HEAD/learned_bylayer.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"602d9712f9f7e7ee"}},{"code_sha256_prefix":"52e1473acbb0e1fb","entry":"load_weights","repo":"mlfoundations/model-soups","repo_kind":"listed","path":"learned_bylayer.py","file_url":"https://github.com/mlfoundations/model-soups/blob/HEAD/learned_bylayer.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"52e1473acbb0e1fb"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}