{"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/an-inverse-scaling-law-for-clip-training-1","title":"An Inverse Scaling Law for CLIP Training","arxiv_id":"2305.07017","date":"2023-05-11","proceeding":"NeurIPS 2023 11","authors":["Xianhang Li","Zeyu Wang","Cihang Xie"],"abstract":"CLIP, one of the pioneering foundation models that connect images and text, has enabled many recent breakthroughs in computer vision. However, its associated training cost is prohibitively high, imposing a significant barrier to its widespread exploration. In this paper, we present a surprising finding that there exists an inverse scaling law for CLIP training, whereby the larger the image/text encoders used, the shorter the sequence length of image/text tokens that can be applied in training. Moreover, we showcase that the strategy for reducing image/text token length plays a crucial role in determining the quality of this scaling law. As a result of this finding, we are able to successfully train CLIP even with limited computational resources. For example, using 8 A100 GPUs, our CLIP models achieve zero-shot top-1 ImageNet-1k accuracies of 63.2% in ~2 days, 67.8% in ~3 days, and 69.3% in ~4 days. Our method also works well when scaling up -- with G/14, we register a new record of 83.0% ImageNet-1k zero-shot accuracy, and meanwhile accelerate the training by ~33x compared to its OpenCLIP counterpart. By reducing the computation barrier associated with CLIP, we hope to inspire more research in this field, particularly from academics. Our code is available at https://github.com/UCSC-VLAA/CLIPA.","url_abs":"https://arxiv.org/abs/2305.07017v2","url_pdf":"https://arxiv.org/pdf/2305.07017v2.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":"an-inverse-scaling-law-for-clip-training-1","repo_url":"https://github.com/ucsc-vlaa/clipa","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"jax","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[],"methods":[{"method_slug":"clip","method_name":"CLIP"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2305.07017","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2305.07017"}},"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/UCSC-VLAA/CLIPA","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ucsc-vlaa/clipa","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"unverified":11},"by_repo_kind":{"official":{"samples":11,"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":0,"samples":[{"code_sha256_prefix":"687383b642d42364","entry":"bidirectional_contrastive_loss","repo":"ucsc-vlaa/clipa","repo_kind":"official","path":"clipa_jax/losses/common.py","file_url":"https://github.com/ucsc-vlaa/clipa/blob/HEAD/clipa_jax/losses/common.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"687383b642d42364"}},{"code_sha256_prefix":"92c6112113ef833f","entry":"decode_variant","repo":"UCSC-VLAA/CLIPA","repo_kind":"official","path":"clipa_jax/models/convnext.py","file_url":"https://github.com/UCSC-VLAA/CLIPA/blob/HEAD/clipa_jax/models/convnext.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"92c6112113ef833f"}},{"code_sha256_prefix":"da654725d3df8ece","entry":"get","repo":"UCSC-VLAA/CLIPA","repo_kind":"official","path":"clipa_jax/datasets/core.py","file_url":"https://github.com/UCSC-VLAA/CLIPA/blob/HEAD/clipa_jax/datasets/core.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"da654725d3df8ece"}},{"code_sha256_prefix":"1ededb122742f89c","entry":"get_posemb","repo":"UCSC-VLAA/CLIPA","repo_kind":"official","path":"clipa_jax/models/text_transformer.py","file_url":"https://github.com/UCSC-VLAA/CLIPA/blob/HEAD/clipa_jax/models/text_transformer.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"1ededb122742f89c"}},{"code_sha256_prefix":"ab73c5ea9b60c840","entry":"get_posemb","repo":"UCSC-VLAA/CLIPA","repo_kind":"official","path":"clipa_jax/models/vit.py","file_url":"https://github.com/UCSC-VLAA/CLIPA/blob/HEAD/clipa_jax/models/vit.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ab73c5ea9b60c840"}},{"code_sha256_prefix":"b2b574d0ba793b32","entry":"posemb_sincos_1d","repo":"UCSC-VLAA/CLIPA","repo_kind":"official","path":"clipa_jax/models/text_transformer.py","file_url":"https://github.com/UCSC-VLAA/CLIPA/blob/HEAD/clipa_jax/models/text_transformer.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"b2b574d0ba793b32"}},{"code_sha256_prefix":"3143c90644184650","entry":"posemb_sincos_2d","repo":"UCSC-VLAA/CLIPA","repo_kind":"official","path":"clipa_jax/models/common.py","file_url":"https://github.com/UCSC-VLAA/CLIPA/blob/HEAD/clipa_jax/models/common.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"3143c90644184650"}},{"code_sha256_prefix":"fb651d0a97fd4d3f","entry":"prepare_inputs_for_generation","repo":"UCSC-VLAA/CLIPA","repo_kind":"official","path":"clipa_torch/open_clip/coca_model.py","file_url":"https://github.com/UCSC-VLAA/CLIPA/blob/HEAD/clipa_torch/open_clip/coca_model.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"fb651d0a97fd4d3f"}},{"code_sha256_prefix":"2a377da4a76a2d44","entry":"register_pooler","repo":"UCSC-VLAA/CLIPA","repo_kind":"official","path":"clipa_torch/open_clip/hf_model.py","file_url":"https://github.com/UCSC-VLAA/CLIPA/blob/HEAD/clipa_torch/open_clip/hf_model.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"2a377da4a76a2d44"}},{"code_sha256_prefix":"99118ca7ebcca7e2","entry":"resample_posemb","repo":"UCSC-VLAA/CLIPA","repo_kind":"official","path":"clipa_jax/models/common.py","file_url":"https://github.com/UCSC-VLAA/CLIPA/blob/HEAD/clipa_jax/models/common.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"99118ca7ebcca7e2"}},{"code_sha256_prefix":"140a126a24e733d8","entry":"resample_posemb","repo":"UCSC-VLAA/CLIPA","repo_kind":"official","path":"clipa_jax/models/convnext.py","file_url":"https://github.com/UCSC-VLAA/CLIPA/blob/HEAD/clipa_jax/models/convnext.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"140a126a24e733d8"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}