{"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/modeling-caption-diversity-in-contrastive","title":"Modeling Caption Diversity in Contrastive Vision-Language Pretraining","arxiv_id":"2405.00740","date":"2024-04-30","proceeding":null,"authors":["Samuel Lavoie","Polina Kirichenko","Mark Ibrahim","Mahmoud Assran","Andrew Gordon Wilson","Aaron Courville","Nicolas Ballas"],"abstract":"There are a thousand ways to caption an image. Contrastive Language Pretraining (CLIP) on the other hand, works by mapping an image and its caption to a single vector -- limiting how well CLIP-like models can represent the diverse ways to describe an image. In this work, we introduce Llip, Latent Language Image Pretraining, which models the diversity of captions that could match an image. Llip's vision encoder outputs a set of visual features that are mixed into a final representation by conditioning on information derived from the text. We show that Llip outperforms non-contextualized baselines like CLIP and SigLIP on a variety of tasks even with large-scale encoders. Llip improves zero-shot classification by an average of 2.9% zero-shot classification benchmarks with a ViT-G/14 encoder. Specifically, Llip attains a zero-shot top-1 accuracy of 83.5% on ImageNet outperforming a similarly sized CLIP by 1.4%. We also demonstrate improvement on zero-shot retrieval on MS-COCO by 6.0%. We provide a comprehensive analysis of the components introduced by the method and demonstrate that Llip leads to richer visual representations.","url_abs":"https://arxiv.org/abs/2405.00740v4","url_pdf":"https://arxiv.org/pdf/2405.00740v4.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":"modeling-caption-diversity-in-contrastive","repo_url":"https://github.com/facebookresearch/llip","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"NOASSERTION"}}],"tasks":[{"task_slug":"diversity","task_name":"Diversity"},{"task_slug":"zero-shot-learning","task_name":"Zero-Shot Learning"},{"task_slug":null,"task_name":"zero-shot-classification"}],"methods":[{"method_slug":"clip","method_name":"CLIP"},{"method_slug":"set","method_name":"SET"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2405.00740","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2405.00740"}},"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":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/facebookresearch/llip","reach":{"status":"ok","spdx":"NOASSERTION"}}],"summary":{"ran_draft_wrong":4,"ran":9,"ran_honours":1,"unverified":8},"by_repo_kind":{"official":{"samples":22,"ran":14,"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":22,"samples":[{"code_sha256_prefix":"98f385d847636a3e","entry":"basic_clean","repo":"facebookresearch/llip","repo_kind":"official","path":"llip/open_clip/tokenizer.py","file_url":"https://github.com/facebookresearch/llip/blob/HEAD/llip/open_clip/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":"42af9a757bc1b69d","entry":"build_text_features","repo":"facebookresearch/llip","repo_kind":"official","path":"llip/clipeval/eval_zeroshot.py","file_url":"https://github.com/facebookresearch/llip/blob/HEAD/llip/clipeval/eval_zeroshot.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"42af9a757bc1b69d"}},{"code_sha256_prefix":"db0d3e0c5b2adeb5","entry":"clevr_t_transform","repo":"facebookresearch/llip","repo_kind":"official","path":"llip/clipeval/datasets.py","file_url":"https://github.com/facebookresearch/llip/blob/HEAD/llip/clipeval/datasets.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"db0d3e0c5b2adeb5"}},{"code_sha256_prefix":"d919ae32e5e4e616","entry":"get_pairs","repo":"facebookresearch/llip","repo_kind":"official","path":"llip/open_clip/tokenizer.py","file_url":"https://github.com/facebookresearch/llip/blob/HEAD/llip/open_clip/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":"8b0612f3e9492f95","entry":"list_pretrained","repo":"facebookresearch/llip","repo_kind":"official","path":"llip/open_clip/pretrained.py","file_url":"https://github.com/facebookresearch/llip/blob/HEAD/llip/open_clip/pretrained.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"8b0612f3e9492f95"}},{"code_sha256_prefix":"9471c2ed1b6fced5","entry":"list_pretrained_model_tags","repo":"facebookresearch/llip","repo_kind":"official","path":"llip/open_clip/pretrained.py","file_url":"https://github.com/facebookresearch/llip/blob/HEAD/llip/open_clip/pretrained.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"9471c2ed1b6fced5"}},{"code_sha256_prefix":"4ce83ee6f7ee1d23","entry":"list_pretrained_tag_models","repo":"facebookresearch/llip","repo_kind":"official","path":"llip/open_clip/pretrained.py","file_url":"https://github.com/facebookresearch/llip/blob/HEAD/llip/open_clip/pretrained.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"4ce83ee6f7ee1d23"}},{"code_sha256_prefix":"ad4accadc0057d93","entry":"load_checkpoint","repo":"facebookresearch/llip","repo_kind":"official","path":"llip/open_clip/factory.py","file_url":"https://github.com/facebookresearch/llip/blob/HEAD/llip/open_clip/factory.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"ad4accadc0057d93"}},{"code_sha256_prefix":"520cc1220abd0e5f","entry":"load_metadata","repo":"facebookresearch/llip","repo_kind":"official","path":"llip/clipeval/eval_zeroshot.py","file_url":"https://github.com/facebookresearch/llip/blob/HEAD/llip/clipeval/eval_zeroshot.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"520cc1220abd0e5f"}},{"code_sha256_prefix":"4b3a4d17e1df3140","entry":"load_state_dict","repo":"facebookresearch/llip","repo_kind":"official","path":"llip/open_clip/factory.py","file_url":"https://github.com/facebookresearch/llip/blob/HEAD/llip/open_clip/factory.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"4b3a4d17e1df3140"}},{"code_sha256_prefix":"0695ee477b98b602","entry":"parse_start_end","repo":"facebookresearch/llip","repo_kind":"official","path":"llip/configs.py","file_url":"https://github.com/facebookresearch/llip/blob/HEAD/llip/configs.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"0695ee477b98b602"}},{"code_sha256_prefix":"f321f54723433661","entry":"pil_loader","repo":"facebookresearch/llip","repo_kind":"official","path":"llip/clipeval/datasets.py","file_url":"https://github.com/facebookresearch/llip/blob/HEAD/llip/clipeval/datasets.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"f321f54723433661"}},{"code_sha256_prefix":"8e95157106d1df8c","entry":"trace_model","repo":"facebookresearch/llip","repo_kind":"official","path":"llip/open_clip/model.py","file_url":"https://github.com/facebookresearch/llip/blob/HEAD/llip/open_clip/model.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":"8e95157106d1df8c"}},{"code_sha256_prefix":"9542161e9640b858","entry":"whitespace_clean","repo":"facebookresearch/llip","repo_kind":"official","path":"llip/open_clip/tokenizer.py","file_url":"https://github.com/facebookresearch/llip/blob/HEAD/llip/open_clip/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":"546ba17b219740cb","entry":"build_model_from_openai_state_dict","repo":"facebookresearch/llip","repo_kind":"official","path":"llip/open_clip/model.py","file_url":"https://github.com/facebookresearch/llip/blob/HEAD/llip/open_clip/model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"546ba17b219740cb"}},{"code_sha256_prefix":"0baf8b3de60cf8ff","entry":"create_model","repo":"facebookresearch/llip","repo_kind":"official","path":"llip/open_clip/factory.py","file_url":"https://github.com/facebookresearch/llip/blob/HEAD/llip/open_clip/factory.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"0baf8b3de60cf8ff"}},{"code_sha256_prefix":"e2c5a40d6b301ed0","entry":"evaluate","repo":"facebookresearch/llip","repo_kind":"official","path":"llip/clipeval/eval_zeroshot.py","file_url":"https://github.com/facebookresearch/llip/blob/HEAD/llip/clipeval/eval_zeroshot.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"e2c5a40d6b301ed0"}},{"code_sha256_prefix":"ddcbd45e940484ee","entry":"gather_features","repo":"facebookresearch/llip","repo_kind":"official","path":"llip/open_clip/loss.py","file_url":"https://github.com/facebookresearch/llip/blob/HEAD/llip/open_clip/loss.py","link_basis":"harvester_set","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":"c188f5b72375b4e2","entry":"load_openai_model","repo":"facebookresearch/llip","repo_kind":"official","path":"llip/open_clip/openai.py","file_url":"https://github.com/facebookresearch/llip/blob/HEAD/llip/open_clip/openai.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"c188f5b72375b4e2"}},{"code_sha256_prefix":"e332856e3c2fc814","entry":"neighbour_exchange","repo":"facebookresearch/llip","repo_kind":"official","path":"llip/open_clip/loss.py","file_url":"https://github.com/facebookresearch/llip/blob/HEAD/llip/open_clip/loss.py","link_basis":"harvester_set","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":"e332856e3c2fc814"}},{"code_sha256_prefix":"5b1fd364afcf3c05","entry":"neighbour_exchange_bidir","repo":"facebookresearch/llip","repo_kind":"official","path":"llip/open_clip/loss.py","file_url":"https://github.com/facebookresearch/llip/blob/HEAD/llip/open_clip/loss.py","link_basis":"harvester_set","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":"5b1fd364afcf3c05"}},{"code_sha256_prefix":"88fb1afdb534319f","entry":"search_config","repo":"facebookresearch/llip","repo_kind":"official","path":"llip/configs.py","file_url":"https://github.com/facebookresearch/llip/blob/HEAD/llip/configs.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"88fb1afdb534319f"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}