SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2205.03860 · 2022

CCMB: A Large-scale Chinese Cross-modal Benchmark

arXiv · PDF · Open in the Atlas

Code that ran

8 of 9 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 8 have no contract verdict; 0 failures of our instrument; 1 no recorded run), measured 2026-11-23; 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/2205.03860.json · badge: /api/ran/2205.03860.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
yuxie11/R2D2 canonical (classifier label)
classifier basis not recorded on the link
8 ran · 1 no recorded run
FunctionStatusWhere it lives
compute_image_features Ran
ran on a synthesized input
yuxie11/R2D2/train_r2d2_retrieval.py
code served (permissive licence) · get_code("7bf8bfbf255a9e9a")
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 3, 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

torch.manual_seed(0)

# Define a minimal model that implements encode_image
class SimpleImageEncoder(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def encode_image(self, image_input):
        # image_input shape: (batch, 4)
        # Return two tensors: image_feat and image_embed
        image_feat = self.linear(image_input)  # (batch, 3)
        image_embed = image_feat * 2  # (batch, 3) - different representation
        return image_feat, image_embed

# Create model instance
model = SimpleImageEncoder()

# Create a minimal data loader
# Each item is (image, img_id)
data_loader = [
    (torch.randn(2, 4), torch.tensor([0, 1])),
    (torch.randn(2, 4), torch.tensor([2, 3])),
]

# Set device to CPU
device = 'cpu'

ARGS = {
    'model': model,
    'data_loader': data_loader,
    'device': device,
}
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 tuple, ndim 3, 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
compute_text_features Ran
ran on a synthesized input
yuxie11/R2D2/train_r2d2_retrieval.py
code served (permissive licence) · get_code("4914409d106d9149")
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. 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)

class MockTextModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.embed_dim = 4
        self.feat_dim = 3
        
    def tokenize_text(self, texts):
        """Return a mock tokenized input with attention_mask attribute."""
        batch_size = len(texts)
        # Create a simple token tensor
        tokens = torch.randint(0, 100, (batch_size, 8))
        
        # Create a mock object with attention_mask
        class TokenizedInput:
            def __init__(self, tokens, attention_mask):
                self.tokens = tokens
                self.attention_mask = attention_mask
            
            def to(self, device):
                self.tokens = self.tokens.to(device)
                self.attention_mask = self.attention_mask.to(device)
                return self
        
        attention_mask = torch.ones(batch_size, 8)
        return TokenizedInput(tokens, attention_mask)
    
    def encode_text(self, text_input):
        """Return text_feat and text_embed."""
        batch_size = text_input.tokens.shape[0]
        text_feat = torch.randn(batch_size, self.feat_dim)
        text_embed = torch.randn(batch_size, self.embed_dim)
        return text_feat, text_embed

model = MockTextModel()
texts = ["hello world", "foo bar", "test text"]
device = "cpu"

ARGS = {
    "model": model,
    "texts": texts,
    "device": device
}
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 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
evaluation Ran
ran on a synthesized input
yuxie11/R2D2/r2d2_inference_demo.py
code served (permissive licence) · get_code("be3c5540222af5be")
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 ndarray, ndim 1, dtype family float, shape (2,) 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
import torch.nn as nn
from PIL import Image
import io

torch.manual_seed(0)

# Create a minimal mock model with all required methods and attributes
class MockModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.temp = 0.07
        self.text_joint_layer = MockTransformerLayer()
        self.img_joint_layer = MockTransformerLayer()
        self.img_joint_proj = nn.Linear(4, 4)
        self.itm_head = nn.Linear(4, 2)
        self.itm_head_i = nn.Linear(4, 2)
    
    def tokenize_text(self, texts):
        # Return mock tokenized text with attention_mask
        batch_size = len(texts)
        result = torch.randint(0, 100, (batch_size, 5))
        result.attention_mask = torch.ones(batch_size, 5, dtype=torch.long)
        return result
    
    def encode_text(self, text_input):
        # Return text_feats (batch, hidden_dim) and text_embeds (batch, hidden_dim)
        batch_size = text_input.shape[0]
        text_feats = torch.randn(batch_size, 4)
        text_embeds = torch.randn(batch_size, 4)
        return text_feats, text_embeds
    
    def encode_image(self, image_input):
        # Return image_feats (batch, seq_len, hidden_dim) and image_embeds (batch, hidden_dim)
        batch_size = image_input.shape[0]
        image_feats = torch.randn(batch_size, 3, 4)
        image_embeds = torch.randn(batch_size, 4)
        return image_feats, image_embeds

class MockTransformerLayer(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)
    
    def forward(self, encoder_embeds, attention_mask, encoder_hidden_states, encoder_attention_mask, return_dict=True):
        # Simulate transformer layer output
        output_hidden_state = torch.randn(encoder_embeds.shape[0], encoder_embeds.shape[1], 4)
        
        class Output:
            def __init__(self, hidden_state):
                self.last_hidden_state = hidden_state
        
        return Output(output_hidden_state)

# Create a simple RGB image as bytes
def create_mock_image():
    img = Image.new('RGB', (10, 10), color='red')
    img_bytes = io.BytesIO()
    img.save(img_bytes, format='PNG')
    img_bytes.seek(0)
    return img_bytes

# Setup arguments
model = MockModel()
texts = ["a photo of a dog", "a photo of a cat"]
image = create_mock_image()
image_size = 224
device = 'cpu'

ARGS = {
    'model': model,
    'texts': texts,
    'image': image,
    'image_size': image_size,
    'device': device
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (2,) — shape (2,) 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
gather_with_grad Ran
ran on a synthesized input
yuxie11/R2D2/models/r2d2_retrieval.py
code served (permissive licence) · get_code("ff0f588c0f5b23d9")
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 Tensor, 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 torch
import torch.distributed as dist
from unittest.mock import patch, MagicMock

torch.manual_seed(0)

# Mock distributed environment for single-process testing
class MockDistributed:
    def __init__(self):
        self.world_size = 1
        self.rank = 0
    
    def get_world_size(self):
        return self.world_size
    
    def get_rank(self):
        return self.rank
    
    def all_gather(self, output_list, input_tensor):
        # In single process, just copy the input to the first position
        output_list[0] = input_tensor.clone()
    
    def all_reduce(self, tensor):
        # In single process, no-op
        pass
    
    def is_available(self):
        return True

# Patch torch.distributed for testing
mock_dist = MockDistributed()

def mock_get_world_size():
    return mock_dist.get_world_size()

def mock_get_rank():
    return mock_dist.get_rank()

def mock_all_gather(output_list, input_tensor):
    mock_dist.all_gather(output_list, input_tensor)

def mock_all_reduce(tensor):
    mock_dist.all_reduce(tensor)

with patch.object(dist, 'get_world_size', mock_get_world_size):
    with patch.object(dist, 'get_rank', mock_get_rank):
        with patch.object(dist, 'all_gather', mock_all_gather):
            with patch.object(dist, 'all_reduce', mock_all_reduce):
                # Create a small test tensor: batch=2, dim=4
                test_tensor = torch.randn(2, 4)
                
                ARGS = {
                    "tensors": test_tensor
                }
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 Tensor, ndim 2, dtype family float — no output shape is stated: observe_signature.py could not observe it (call:ValueError)
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
gather_with_no_grad Ran
ran on a synthesized input
yuxie11/R2D2/models/r2d2_retrieval.py
code served (permissive licence) · get_code("d6695d6f18eb07ee")
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 Tensor, ndim 2, dtype family float, shape (4, 4) 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
import torch.nn as nn

torch.manual_seed(0)

# Mock distributed setup
class MockDistributed:
    _world_size = 2
    _rank = 0
    
    @staticmethod
    def get_world_size():
        return MockDistributed._world_size
    
    @staticmethod
    def get_rank():
        return MockDistributed._rank
    
    @staticmethod
    def all_gather(tensor_list, tensor, async_op=False):
        # Simple mock: fill the list with copies of the tensor
        for i in range(len(tensor_list)):
            tensor_list[i] = tensor.clone()

# Patch torch.distributed
torch.distributed.get_world_size = MockDistributed.get_world_size
torch.distributed.get_rank = MockDistributed.get_rank
torch.distributed.all_gather = MockDistributed.all_gather

# Create a small tensor (batch=2, dim=4)
tensor = torch.randn(2, 4)

ARGS = {
    "tensor": tensor,
    "sync_grad": False
}
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 Tensor, ndim 2, dtype family float, shape (4, 4) — shape (4, 4) 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
load_checkpoint Ran
ran on a synthesized input
yuxie11/R2D2/models/r2d2.py
code served (permissive licence) · get_code("619d3e0687ecaf67")
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. 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 os
import torch
import torch.nn as nn
import tempfile

torch.manual_seed(0)

# Create a simple model
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

# Create model instance
model = SimpleModel()

# Create a temporary checkpoint file
temp_dir = tempfile.gettempdir()
checkpoint_path = os.path.join(temp_dir, 'test_checkpoint.pt')

# Create a checkpoint with matching state dict
checkpoint = {
    'model': model.state_dict()
}
torch.save(checkpoint, checkpoint_path)

ARGS = {
    'model': model,
    'url_or_filename': checkpoint_path
}
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 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
make_optimizer Ran
ran on a synthesized input
yuxie11/R2D2/train_r2d2_matching.py
code served (permissive licence) · get_code("494b925526e287c1")
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 AdamW. 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)

# Create a minimal model with named parameters
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 2)
    
    def forward(self, x):
        return self.linear2(self.linear1(x))

model = SimpleModel()

# Create a config dict with required keys
cfg = {
    'base_lr': 0.001,
    'weight_decay': 0.0001
}

ARGS = {
    'cfg': cfg,
    'model': model
}
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 AdamW — a AdamW output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a AdamW 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
preprocess Ran
ran on a synthesized input
yuxie11/R2D2/r2d2_inference_demo.py
code served (permissive licence) · get_code("2ffab879ffc06bbe")
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 Tensor, ndim 3, dtype family float, shape (3, 224, 224) 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
from PIL import Image
import numpy as np

torch.manual_seed(0)

# Create a small PIL Image object to pass as the image parameter
# The function expects a PIL Image, so we'll create a tiny one
image_array = np.random.randint(0, 256, (32, 32, 3), dtype=np.uint8)
image = Image.fromarray(image_array, mode='RGB')

# image_size is an integer specifying the target size for resizing
image_size = 224

ARGS = {
    'image': image,
    'image_size': image_size,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (3, 224, 224) — shape (3, 224, 224) 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
prd2 Not yet run
unverified (harvested, no recorded run)
yuxie11/R2D2/models/prd2.py
code served (permissive licence) · get_code("6f7d7b0cd2149e78")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 9 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.

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

Vision-language pre-training (VLP) on large-scale datasets has shown premier performance on various downstream tasks. In contrast to plenty of available benchmarks with English corpus, large-scale pre-training datasets and downstream datasets with Chinese corpus remain largely unexplored. In this work, we build a large-scale high-quality Chinese Cross-Modal Benchmark named CCMB for the research community, which contains the currently largest public pre-training dataset Zero and five human-annotated fine-tuning datasets for downstream tasks. Zero contains 250 million images paired with 750 million text descriptions, plus two of the five fine-tuning datasets are also currently the largest ones for Chinese cross-modal downstream tasks. Along with the CCMB, we also develop a VLP framework named R2D2, applying a pre-Ranking + Ranking strategy to learn powerful vision-language representations and a two-way distillation method (i.e., target-guided Distillation and feature-guided Distillation) to further enhance the learning capability. With the Zero and the R2D2 VLP framework, we achieve state-of-the-art performance on twelve downstream datasets from five broad categories of tasks including image-text retrieval, image-text matching, image caption, text-to-image generation, and zero-shot image classification. The datasets, models, and codes are available at https://github.com/yuxie11/R2D2

For agents

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

get_harvested_code_for_paper("2205.03860")
get_code_for_paper("2205.03860")
have("2205.03860")

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

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

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

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

Connect an agent — have() is free.