{"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/dual-risk-minimization-towards-next-level","title":"Dual Risk Minimization: Towards Next-Level Robustness in Fine-tuning Zero-Shot Models","arxiv_id":"2411.19757","date":"2024-11-29","proceeding":null,"authors":["Kaican Li","Weiyan Xie","Yongxiang Huang","Didan Deng","Lanqing Hong","Zhenguo Li","Ricardo Silva","Nevin L. Zhang"],"abstract":"Fine-tuning foundation models often compromises their robustness to distribution shifts. To remedy this, most robust fine-tuning methods aim to preserve the pre-trained features. However, not all pre-trained features are robust and those methods are largely indifferent to which ones to preserve. We propose dual risk minimization (DRM), which combines empirical risk minimization with worst-case risk minimization, to better preserve the core features of downstream tasks. In particular, we utilize core-feature descriptions generated by LLMs to induce core-based zero-shot predictions which then serve as proxies to estimate the worst-case risk. DRM balances two crucial aspects of model robustness: expected performance and worst-case performance, establishing a new state of the art on various real-world benchmarks. DRM significantly improves the out-of-distribution performance of CLIP ViT-L/14@336 on ImageNet (75.9 to 77.1), WILDS-iWildCam (47.1 to 51.8), and WILDS-FMoW (50.7 to 53.1); opening up new avenues for robust fine-tuning. Our code is available at https://github.com/vaynexie/DRM .","url_abs":"https://arxiv.org/abs/2411.19757v1","url_pdf":"https://arxiv.org/pdf/2411.19757v1.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":"dual-risk-minimization-towards-next-level","repo_url":"https://github.com/vaynexie/drm","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[],"methods":[{"method_slug":"clip","method_name":"CLIP"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2411.19757","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2411.19757"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+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":"deterministic:regex_extraction","url":"https://github.com/vaynexie/DRM","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/vaynexie/drm","reach":{"status":"ok"}}],"summary":{"ran":1,"ran_draft_wrong":3,"ran_fixture":1,"unverified":6},"by_repo_kind":{"official":{"samples":11,"ran":5,"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":11,"samples":[{"code_sha256_prefix":"f2d33de0c5046a5c","entry":"ClipLoss_c","repo":"vaynexie/drm","repo_kind":"official","path":"clip_m/loss.py","file_url":"https://github.com/vaynexie/drm/blob/HEAD/clip_m/loss.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"f2d33de0c5046a5c"}},{"code_sha256_prefix":"98f385d847636a3e","entry":"basic_clean","repo":"vaynexie/DRM","repo_kind":"official","path":"clip_m/tokenizer.py","file_url":"https://github.com/vaynexie/DRM/blob/HEAD/clip_m/tokenizer.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"98f385d847636a3e"}},{"code_sha256_prefix":"d919ae32e5e4e616","entry":"get_pairs","repo":"vaynexie/DRM","repo_kind":"official","path":"clip_m/tokenizer.py","file_url":"https://github.com/vaynexie/DRM/blob/HEAD/clip_m/tokenizer.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d919ae32e5e4e616"}},{"code_sha256_prefix":"9fbea808db47dc66","entry":"project_logits","repo":"vaynexie/DRM","repo_kind":"official","path":"src/datasets/imagenet.py","file_url":"https://github.com/vaynexie/DRM/blob/HEAD/src/datasets/imagenet.py","link_basis":"plan_row","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"9fbea808db47dc66"}},{"code_sha256_prefix":"9542161e9640b858","entry":"whitespace_clean","repo":"vaynexie/DRM","repo_kind":"official","path":"clip_m/tokenizer.py","file_url":"https://github.com/vaynexie/DRM/blob/HEAD/clip_m/tokenizer.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"9542161e9640b858"}},{"code_sha256_prefix":"b64f67bec6a093b9","entry":"build_model","repo":"vaynexie/DRM","repo_kind":"official","path":"clip_m/model.py","file_url":"https://github.com/vaynexie/DRM/blob/HEAD/clip_m/model.py","link_basis":"plan_row","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b64f67bec6a093b9"}},{"code_sha256_prefix":"ddcbd45e940484ee","entry":"gather_features","repo":"vaynexie/DRM","repo_kind":"official","path":"clip_m/loss.py","file_url":"https://github.com/vaynexie/DRM/blob/HEAD/clip_m/loss.py","link_basis":"plan_row","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ddcbd45e940484ee"}},{"code_sha256_prefix":"8d5ec0683c47758f","entry":"get_classnames","repo":"vaynexie/DRM","repo_kind":"official","path":"src/datasets/imagenet_classnames.py","file_url":"https://github.com/vaynexie/DRM/blob/HEAD/src/datasets/imagenet_classnames.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"8d5ec0683c47758f"}},{"code_sha256_prefix":"4b5474dbf23edd87","entry":"get_features","repo":"vaynexie/DRM","repo_kind":"official","path":"src/datasets/common.py","file_url":"https://github.com/vaynexie/DRM/blob/HEAD/src/datasets/common.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"4b5474dbf23edd87"}},{"code_sha256_prefix":"aeb196e862a2c0ca","entry":"get_features_helper","repo":"vaynexie/DRM","repo_kind":"official","path":"src/datasets/common.py","file_url":"https://github.com/vaynexie/DRM/blob/HEAD/src/datasets/common.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"aeb196e862a2c0ca"}},{"code_sha256_prefix":"c8c8c70c648c5698","entry":"maybe_dictionarize","repo":"vaynexie/DRM","repo_kind":"official","path":"src/datasets/common.py","file_url":"https://github.com/vaynexie/DRM/blob/HEAD/src/datasets/common.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c8c8c70c648c5698"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}