SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2405.21070 · NeurIPS · 2024

What Makes CLIP More Robust to Long-Tailed Pre-Training Data? A Controlled Study for Transferable Insights

Xiaojuan Qi, Jiangmiao Pang, Xin Wen, Bingchen Zhao, Yilun Chen

arXiv · PDF · Open in the Atlas

Code that ran

5 of 12 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; 1 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 3 failures of our instrument; 7 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/2405.21070.json · badge: /api/ran/2405.21070.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
cvmi-lab/clip-beyond-tail canonical (classifier label)
classifier basis: census
3 ran · 6 no recorded run
CVMI-Lab/clip-beyond-tail canonical (classifier label)
classifier basis: classifier_2025
2 ran · 1 no recorded run
FunctionStatusWhere it lives
calc_frequency Ran
ran, honoured the contract we drafted
cvmi-lab/clip-beyond-tail/concept_freq_utils/calc_word_frequency.py
code served (permissive licence) · get_code("8d3bee52aa79681c")
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 int, ndim 0, dtype family int, shape () 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 torch

torch.manual_seed(0)

# all_tokens: list of collections where we check membership of words
# Each element should be a container (set, list, etc.) of tokens
all_tokens = [
    {'word1', 'word2', 'word3'},
    ['word2', 'word4', 'word5'],
    {'word1', 'word6'},
    ['word3', 'word4'],
]

# template: list of lists/tuples where each inner list is a sequence of words to match
# The function checks if ALL words in a template entry exist in a tokens container
template = [
    ['word1', 'word2'],
    ['word3', 'word4'],
    ['word7', 'word8'],
]

ARGS = {
    'all_tokens': all_tokens,
    'template': template,
}
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 int, ndim 0, dtype family int, shape () — shape () 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
join_caption Ran
ran; our contract draft was wrong, not the code
cvmi-lab/clip-beyond-tail/data_utils/create_incaps_caption_variants.py
code served (permissive licence) · get_code("c744c8b07a785dcd")
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 str. 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 random

# Global dictionaries needed by the function
wnid2synset = {
    'n02084442': ['golden_retriever', 'retriever'],
    'n02085620': ['Chihuahua', 'toy_dog'],
}

wnid2classname = {
    'n02084442': 'golden_retriever',
    'n02085620': 'Chihuahua',
}

# Sample dictionary matching the function's expected structure
sample_d = {
    'wnid': 'n02084442',
    'title': 'A beautiful dog',
    'tags': ['animal', 'pet', 'outdoor'],
    'description': 'This is a golden retriever playing in the park.\nIt loves to fetch.'
}

ARGS = {
    'd': sample_d,
    'use_title': True,
    'use_tags': True,
    'use_description': True,
    'append_cname': False,
    'use_synset': False,
    'template': '{}',
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
log_and_continue Ran
ran, violated the contract we drafted
cvmi-lab/clip-beyond-tail/data_utils/arrange_laionet.py
pointer only (licence: MIT); the stored copy get_code serves, from CSIPlab/SLUG, is pointer only (licence: NONE) · get_code("be4e00be50540042")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from CSIPlab/SLUG, 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.

parse_cmd Ran
ran; our contract draft was wrong, not the code
CVMI-Lab/clip-beyond-tail/exps_clip/run_pretrained_openclip.py
code served (permissive licence) · get_code("b1022da5ff456771")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned str. 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
import torch.nn as nn

torch.manual_seed(0)

# The function parse_cmd takes two string parameters: model and pretrained
# It checks if certain substrings are in the pretrained parameter to determine the dataset
# Then it constructs a command string

# We need to provide valid string arguments that will trigger one of the dataset branches
# Let's use 'cc12m' in pretrained to trigger the first branch

model = "ViT-B-32"
pretrained = "cc12m_epoch32"

ARGS = {
    "model": model,
    "pretrained": pretrained
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
sample_class_inds Ran
ran; our contract draft was wrong, not the code
CVMI-Lab/clip-beyond-tail/exps_sup/train_sup.py
code served (permissive licence) · get_code("dcc0f8a3d856ad1f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned tuple. 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)

# gt_classes: tensor of ground truth class indices
# num_to_sample: number of classes to sample
# C: total number of classes
# weight: optional weight tensor for sampling

# Create a small example where we have 10 total classes (C=10)
# and gt_classes contains some class indices
C = 10
gt_classes = torch.tensor([2, 5, 2, 7, 5])  # 5 samples with classes 2, 5, 7 appearing
num_to_sample = 6  # We want to sample 6 classes total (more than the 3 unique in gt_classes)

# Optional weight tensor for sampling probabilities
weight = torch.tensor([0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0])

ARGS = {
    'gt_classes': gt_classes,
    'num_to_sample': num_to_sample,
    'C': C,
    'weight': weight
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is 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
calc_frequency Not yet run
unverified (harvested, no recorded run)
CVMI-Lab/clip-beyond-tail/concept_freq_utils/calc_class_frequency.py
code served (permissive licence) · get_code("083dd12611928e3f")
How it ran

no invocation recorded.

calc_frequency Not yet run
unverified (harvested, no recorded run)
cvmi-lab/clip-beyond-tail/concept_freq_utils/calc_class_frequency_metaclip.py
code served (permissive licence) · get_code("1f8b5c15c1b07e8c")
How it ran

no invocation recorded.

get_synset Not yet run
unverified (harvested, no recorded run)
cvmi-lab/clip-beyond-tail/data_utils/create_incaps_caption_variants.py
code served (permissive licence) · get_code("7327f0f3714b44d0")
How it ran

no invocation recorded.

preprocess_template Not yet run
unverified (harvested, no recorded run)
cvmi-lab/clip-beyond-tail/concept_freq_utils/calc_class_frequency.py
code served (permissive licence) · get_code("478bab57fe97f4fd")
How it ran

no invocation recorded.

preprocess_template Not yet run
unverified (harvested, no recorded run)
cvmi-lab/clip-beyond-tail/concept_freq_utils/calc_word_frequency.py
code served (permissive licence) · get_code("9928091c045bd498")
How it ran

no invocation recorded.

preprocess_text Not yet run
unverified (harvested, no recorded run)
cvmi-lab/clip-beyond-tail/concept_freq_utils/calc_class_frequency.py
code served (permissive licence) · get_code("18545f8c98643da8")
How it ran

no invocation recorded.

rn50 Not yet run
unverified (harvested, no recorded run)
cvmi-lab/clip-beyond-tail/exps_sup/model.py
code served (permissive licence) · get_code("bd6c9c789d1ef16d")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 1 later) and 11 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
log_and_continue 3 other papers
1 dated earlier, 2 later
2403.16005 (2024-03)
Knowledge-Enhanced Dual-stream Zero-shot Composed Image Retrieval
2407.11867 (2024-07)
Targeted Unlearning with Single Layer Unlearning Gradient
2502.07972 (2025-02)
Training Sparse Mixture Of Experts Text Embedding Models

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

Severe data imbalance naturally exists among web-scale vision-language datasets. Despite this, we find CLIP pre-trained thereupon exhibits notable robustness to the data imbalance compared to supervised learning, and demonstrates significant effectiveness in learning generalizable representations. With an aim to investigate the reasons behind this finding, we conduct controlled experiments to study various underlying factors, and reveal that CLIP's pretext task forms a dynamic classification problem wherein only a subset of classes is present in training. This isolates the bias from dominant classes and implicitly balances the learning signal. Furthermore, the robustness and discriminability of CLIP improve with more descriptive language supervision, larger data scale, and broader open-world concepts, which are inaccessible to supervised learning. Our study not only uncovers the mechanisms behind CLIP's generalizability beyond data imbalance but also provides transferable insights for the research community. The findings are validated in both supervised and self-supervised learning, enabling models trained on imbalanced data to achieve CLIP-level performance on diverse recognition tasks. Code and data are available at: https://github.com/CVMI-Lab/clip-beyond-tail.

For agents

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

get_harvested_code_for_paper("2405.21070")
get_code_for_paper("2405.21070")
have("2405.21070")

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

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

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

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

Connect an agent — have() is free.