SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2305.07017 · NeurIPS · 2023

An Inverse Scaling Law for CLIP Training

Cihang Xie, Xianhang Li, Zeyu Wang, Santa Uc, Cruz

arXiv · PDF · Open in the Atlas

Code that ran

8 of 11 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 7 have no contract verdict; 1 failure of our instrument; 3 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2305.07017.json · badge: /api/ran/2305.07017.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
UCSC-VLAA/CLIPA canonical (classifier label)
classifier basis: census
8 ran · 2 no recorded run
ucsc-vlaa/clipa canonical (classifier label)
classifier basis: classifier_2025
0 ran · 1 no recorded run
FunctionStatusWhere it lives
decode_variant Ran
ran on a synthesized input
UCSC-VLAA/CLIPA/clipa_jax/models/convnext.py
code served (permissive licence) · get_code("92c6112113ef833f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

ARGS = {
    'variant': 'B'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_posemb Ran
ran on a synthesized input
UCSC-VLAA/CLIPA/clipa_jax/models/text_transformer.py
code served (permissive licence) · get_code("1ededb122742f89c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ArrayImpl, ndim 3, dtype family float, shape (1, 16, 8) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import flax.linen as nn
import jax.numpy as jnp
import numpy as np

class MockModel(nn.Module):
    """Mock Flax model that implements the param method."""
    
    def setup(self):
        pass
    
    def param(self, name, init_fn, shape, dtype):
        """Mock param method that returns initialized parameters."""
        key = jax.random.PRNGKey(0)
        return init_fn(key, shape, dtype)

import jax
import jax.random

# Create a mock self object that behaves like a Flax module
class MockSelf:
    def param(self, name, init_fn, shape, dtype):
        key = jax.random.PRNGKey(0)
        return init_fn(key, shape, dtype)

mock_self = MockSelf()

ARGS = {
    'self': mock_self,
    'typ': 'sincos1d',
    'max_len': 16,
    'width': 8,
    'name': 'posemb',
    'dtype': jnp.float32,
    'cls_token': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
flax, jax, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, ndim 3, dtype family float, shape (1, 16, 8) — shape (1, 16, 8) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_posemb Ran
ran on a synthesized input
UCSC-VLAA/CLIPA/clipa_jax/models/vit.py
code served (permissive licence) · get_code("ab73c5ea9b60c840")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ArrayImpl, ndim 3, dtype family float, shape (1, 12, 8) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import flax.linen as nn
import jax.numpy as jnp
import numpy as np

# Create a minimal Flax module that has the param method
class DummyModule(nn.Module):
    def setup(self):
        pass
    
    def __call__(self, x):
        return x

# Create an instance of the module
module_instance = DummyModule()

# Define all arguments for get_posemb
ARGS = {
    'self': module_instance,
    'typ': 'sincos2d',
    'seqshape': (4, 3),
    'width': 8,
    'name': 'posemb',
    'dtype': jnp.float32,
    'cls_token': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
flax, jax, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, ndim 3, dtype family float, shape (1, 12, 8) — shape (1, 12, 8) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
posemb_sincos_1d Ran
ran on a synthesized input
UCSC-VLAA/CLIPA/clipa_jax/models/text_transformer.py
code served (permissive licence) · get_code("b2b574d0ba793b32")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ArrayImpl, ndim 3, dtype family float, shape (1, 16, 8) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import jax.numpy as jnp
import numpy as np

ARGS = {
    "max_len": 16,
    "width": 8,
    "min_scale": 1.0,
    "max_scale": 10000.0,
    "dtype": jnp.float32,
    "cls_token": False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, ndim 3, dtype family float, shape (1, 16, 8) — shape (1, 16, 8) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
posemb_sincos_2d Ran
ran on a synthesized input
UCSC-VLAA/CLIPA/clipa_jax/models/common.py
code served (permissive licence) · get_code("3143c90644184650")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ArrayImpl, ndim 3, dtype family float, shape (1, 12, 8) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import jax.numpy as jnp

ARGS = {
    'h': 4,
    'w': 3,
    'width': 8,
    'temperature': 10000.0,
    'dtype': jnp.float32,
    'cls_token': False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, ndim 3, dtype family float, shape (1, 12, 8) — shape (1, 12, 8) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
prepare_inputs_for_generation Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
UCSC-VLAA/CLIPA/clipa_torch/open_clip/coca_model.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from WHU-USI3DV/TreeCLS, is pointer only (licence: NONE) · get_code("fb651d0a97fd4d3f")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from WHU-USI3DV/TreeCLS, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

register_pooler Ran
ran on a synthesized input
UCSC-VLAA/CLIPA/clipa_torch/open_clip/hf_model.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from WHU-USI3DV/TreeCLS, is pointer only (licence: NONE) · get_code("2a377da4a76a2d44")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from WHU-USI3DV/TreeCLS, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

resample_posemb Ran
ran on a synthesized input
UCSC-VLAA/CLIPA/clipa_jax/models/convnext.py
code served (permissive licence) · get_code("140a126a24e733d8")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ArrayImpl, ndim 3, dtype family float, shape (1, 64, 8) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import jax.numpy as jnp
import scipy.ndimage

# Create old and new position embeddings
# old shape: (1, 16, 8) - batch=1, seq_len=16 (4x4 grid), embed_dim=8
# new shape: (1, 64, 8) - batch=1, seq_len=64 (8x8 grid), embed_dim=8
old = np.random.randn(1, 16, 8).astype(np.float32)
new = np.random.randn(1, 64, 8).astype(np.float32)

ARGS = {
    "old": old,
    "new": new,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
absl, jax, numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, ndim 3, dtype family float, shape (1, 64, 8) — shape (1, 64, 8) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
bidirectional_contrastive_loss Not yet run
unverified (harvested, no recorded run)
ucsc-vlaa/clipa/clipa_jax/losses/common.py
code served (permissive licence) · get_code("687383b642d42364")
How it ran

no invocation recorded.

get Not yet run
unverified (harvested, no recorded run)
UCSC-VLAA/CLIPA/clipa_jax/datasets/core.py
code served (permissive licence) · get_code("da654725d3df8ece")
How it ran

no invocation recorded.

resample_posemb Not yet run
unverified (harvested, no recorded run)
UCSC-VLAA/CLIPA/clipa_jax/models/common.py
code served (permissive licence) · get_code("99118ca7ebcca7e2")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 2 the same month, 2 later) and 8 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
register_pooler 45 other papers
3 dated earlier, 1 the same month, 41 later
2301.07094 (2023-01)
Learning Customized Visual Models with Retrieval-Augmented Knowledge
2302.03668 (2023-02)
Hard Prompts Made Easy: Gradient-Based Discrete Optimization for Prompt Tuning and Discovery
2303.14814 (2023-03)
WinCLIP: Zero-/Few-Shot Anomaly Classification and Segmentation
and 42 more not named here
prepare_inputs_for_generation 43 other papers
2 dated earlier, 1 the same month, 40 later
2301.07094 (2023-01)
Learning Customized Visual Models with Retrieval-Augmented Knowledge
2303.14814 (2023-03)
WinCLIP: Zero-/Few-Shot Anomaly Classification and Segmentation
2305.17382 (2023-05)
APRIL-GAN: A Zero-/Few-Shot Anomaly Classification and Segmentation Method for CVPR 2023 VAND Workshop Challenge Tracks 1&2: 1st Place on Zero-shot AD and 4th Place on Few-shot AD
and 40 more not named here

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

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 upwith G/14, we register a new record of 83.0% ImageNet-1k zero-shot accuracy, and meanwhile accelerate the training by ∼33× 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. 37th Conference on Neural Information Processing Systems (NeurIPS 2023).

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2305.07017")
get_code_for_paper("2305.07017")
have("2305.07017")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2305.07017.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2305.07017.svg)](https://syntology.ai/paper/2305.07017)

Connect an agent — have() is free.