SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2507.22264 · CVPR · 2025

SmartCLIP: Modular Vision-language Alignment with Identification Guarantees

Kun Zhang, Eric Xing, Yu Yao, Yujia Zheng, Guangyi Chen, Shaoan Xie, Zeyu Tang, Lingjing

arXiv · PDF · Open in the Atlas

Code that ran

6 of 8 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, 0 violated it and 0 have no contract verdict; 5 failures of our instrument; 2 no recorded run), measured 2026-11-23; 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/2507.22264.json · badge: /api/ran/2507.22264.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
LAION-AI/CLIP_benchmark canonical (classifier label)
classifier basis: census
6 ran · 2 no recorded run
FunctionStatusWhere it lives
PIL_to_bytes Ran
ran; our contract draft was wrong, not the code
LAION-AI/CLIP_benchmark/clip_benchmark/webdataset_builder.py
code served (permissive licence) · get_code("27180e9964b8cac8")
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 function. 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.

from PIL import Image
import io

# Create a simple PIL Image object
image = Image.new('RGB', (10, 10), color='red')

# Define ARGS with the required parameter
ARGS = {
    'image_format': 'png'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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_model_collection_from_file Ran
ran; our contract draft was wrong, not the code
LAION-AI/CLIP_benchmark/clip_benchmark/model_collection.py
code served (permissive licence) · get_code("e02503f545c31203")
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 list, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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 tempfile
import os

# Create a temporary file with CSV-like content
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt')
temp_file.write("model1,config1,weights1\n")
temp_file.write("model2,config2,weights2\n")
temp_file.write("model3,config3,weights3\n")
temp_file.close()

ARGS = {
    'path': temp_file.name
}
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 list, ndim 2, dtype family float — a list output has no array shape of its own; none is stated
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
identity_nodesplitter Ran
ran; our contract draft was wrong, not the code
LAION-AI/CLIP_benchmark/clip_benchmark/datasets/builder.py
code served (permissive licence) · get_code("ed2519ed9d7df540")
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 list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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)

# The function identity_nodesplitter simply returns its input unchanged
# It's designed to work with WebDataset shards in a multiprocessing context
# The parameter 'src' should be a WebDataset shard or iterable

# Create a simple stand-in for a WebDataset shard
# It can be any iterable, so we'll use a list of sample data
src = [
    {"image": torch.randn(2, 3, 4, 4), "label": torch.randint(0, 10, (2,))},
    {"image": torch.randn(2, 3, 4, 4), "label": torch.randint(0, 10, (2,))},
]

ARGS = {
    "src": src
}
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 list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
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
load_japanese_clip Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
LAION-AI/CLIP_benchmark/clip_benchmark/models/japanese_clip.py
code served (permissive licence) · get_code("f5190e9b44c5f641")
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 tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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
from typing import Dict

torch.manual_seed(0)

# Stand-in for ja_clip module
class MockJaClip:
    @staticmethod
    def load(pretrained, device='cpu', cache_dir=None):
        model = MockCLIPModel()
        transform = MockTransform()
        return model, transform
    
    @staticmethod
    def load_tokenizer():
        return MockTokenizer()
    
    @staticmethod
    def tokenize(texts, tokenizer=None, device='cpu'):
        batch_size = len(texts) if isinstance(texts, list) else 1
        return {
            'input_ids': torch.randint(0, 100, (batch_size, 8)),
            'attention_mask': torch.ones(batch_size, 8),
            'position_ids': torch.arange(8).unsqueeze(0).expand(batch_size, -1)
        }

class MockTokenizer:
    def __len__(self):
        return 1000

class MockCLIPModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.text_proj = nn.Linear(8, 512)
        self.image_proj = nn.Linear(3, 512)
    
    def get_text_features(self, input_ids, attention_mask, position_ids, **kwargs):
        # Simulate text encoding
        batch_size = input_ids.shape[0]
        return torch.randn(batch_size, 512)
    
    def get_image_features(self, image, **kwargs):
        # Simulate image encoding
        batch_size = image.shape[0] if image.dim() > 1 else 1
        return torch.randn(batch_size, 512)

class MockTransform:
    def __call__(self, x):
        return x

# Patch the japanese_clip import
import sys
sys.modules['japanese_clip'] = MockJaClip()

ARGS = {
    'pretrained': 'ViT-B-32',
    'device': 'cpu',
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
japanese_clip, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
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
path_to_bytes Ran
ran; our contract draft was wrong, not the code
LAION-AI/CLIP_benchmark/clip_benchmark/webdataset_builder.py
code served (permissive licence) · get_code("eb9c4da61c3f9683")
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 bytes. 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 tempfile
import os

# Create a temporary file with some test content
temp_dir = tempfile.mkdtemp()
test_filepath = os.path.join(temp_dir, "test_file.bin")

# Write some binary content to the test file
test_content = b"This is test binary content for path_to_bytes function"
with open(test_filepath, 'wb') as f:
    f.write(test_content)

ARGS = {
    "filepath": test_filepath
}
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 bytes — a bytes output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a bytes 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
value_from_first_key_found Ran
ran, honoured the contract we drafted
LAION-AI/CLIP_benchmark/clip_benchmark/datasets/builder.py
code served (permissive licence) · get_code("9e8b17a3977b594e")
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)

# Construct a simple dictionary with some keys
dic = {
    'key1': 'value1',
    'key2': 42,
    'key3': [1, 2, 3],
    'key5': torch.tensor([1.0, 2.0, 3.0, 4.0])
}

# Construct a list of keys to search for
keys = ['key_not_found', 'key2', 'key1', 'key3']

ARGS = {
    'dic': dic,
    'keys': keys
}
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
build_dataset Not yet run
unverified (harvested, no recorded run)
LAION-AI/CLIP_benchmark/clip_benchmark/datasets/builder.py
code served (permissive licence) · get_code("33133229b84c5784")
How it ran

no invocation recorded.

get_metadata Not yet run
unverified (harvested, no recorded run)
LAION-AI/CLIP_benchmark/clip_benchmark/datasets/objectnet.py
code served (permissive licence) · get_code("f4eee6ad42516616")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 6 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 0 the same month, 0 later) and 2 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
get_model_collection_from_file 2 other papers
2 dated earlier
2309.01859 (2023-09)
NLLB-CLIP -- train performant multilingual image retrieval model on a budget
2411.00715 (2024-11)
B-cosification: Transforming Deep Neural Networks to be Inherently Interpretable
PIL_to_bytes 1 other paper
1 dated earlier
2309.01859 (2023-09)
NLLB-CLIP -- train performant multilingual image retrieval model on a budget
get_metadata 1 other paper
1 dated earlier
2309.01859 (2023-09)
NLLB-CLIP -- train performant multilingual image retrieval model on a budget
load_japanese_clip 1 other paper
1 dated earlier
2309.01859 (2023-09)
NLLB-CLIP -- train performant multilingual image retrieval model on a budget
path_to_bytes 1 other paper
1 dated earlier
2309.01859 (2023-09)
NLLB-CLIP -- train performant multilingual image retrieval model on a budget
value_from_first_key_found 1 other paper
1 dated earlier
2309.01859 (2023-09)
NLLB-CLIP -- train performant multilingual image retrieval model on a budget

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-23.

Repositories linked to this paper

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

Abstract

Contrastive Language-Image Pre-training (CLIP) [37] has emerged as a pivotal model in computer vision and multimodal learning, achieving state-of-the-art performance at aligning visual and textual representations through contrastive learning. However, CLIP struggles with potential information misalignment in many image-text datasets and suffers from entangled representation. On the one hand, short captions for a single image in datasets like MSCOCO may describe disjoint regions in the image, leaving the model uncertain about which visual features to retain or disregard. On the other hand, directly aligning long captions with images can lead to the retention of entangled details, preventing the model from learning disentangled, atomic concepts -ultimately limiting its generalization on certain downstream tasks involving short prompts. In this paper, we establish theoretical conditions that enable flexible alignment between textual and visual representations across varying levels of granularity. Specifically, our framework ensures that a model can not only preserve cross-modal semantic information in its entirety but also disentangle visual representations to capture finegrained textual concepts. Building on this foundation, we introduce SmartCLIP, a novel approach that identifies and aligns the most relevant visual and textual representations in a modular manner. Superior performance across various tasks demonstrates its capability to handle information misalignment and supports our identification theory.

For agents

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

get_harvested_code_for_paper("2507.22264")
get_code_for_paper("2507.22264")
have("2507.22264")

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

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

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

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

Connect an agent — have() is free.