SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2109.07622 · 2021

Towards Zero-shot Cross-lingual Image Retrieval and Tagging

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; 0 honoured the contract we drafted, 0 violated it and 6 have no contract verdict; 0 failures of our instrument; 2 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/2109.07622.json · badge: /api/ran/2109.07622.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
FreddeFrallan/Multilingual-CLIP community (classifier label)
classifier basis not recorded on the link
6 ran · 2 no recorded run
FunctionStatusWhere it lives
createDataset Ran
ran on a synthesized input
FreddeFrallan/Multilingual-CLIP/multilingual_clip/TeacherLearning/Dataset.py
code served (permissive licence) · get_code("3fb74a0679cf6044")
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 _BatchDataset. 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 tensorflow as tf
import numpy as np

class SimpleTokenizer:
    def encode(self, text):
        # Return a simple fixed-length token sequence
        tokens = [1, 2, 3, 4, 5]
        return tokens[:5]

class SimpleEmbeddings:
    def __init__(self):
        self.data = [
            {'id': 'img_0', 'embedding': np.random.randn(1, 4).astype(np.float32)},
            {'id': 'img_1', 'embedding': np.random.randn(1, 4).astype(np.float32)},
        ]
        self.index = 0
    
    def shuffle(self):
        np.random.shuffle(self.data)
    
    def __iter__(self):
        self.index = 0
        return self
    
    def __next__(self):
        if self.index >= len(self.data):
            raise StopIteration
        result = self.data[self.index]
        self.index += 1
        return result

targetCaptions = {
    'img_0': {
        'caption_multi': 'a dog running in the park'
    },
    'img_1': {
        'caption_multi': 'a cat sleeping on the couch'
    }
}

embeddings = SimpleEmbeddings()

tokenizer = SimpleTokenizer()

ARGS = {
    'targetCaptions': targetCaptions,
    'embeddings': embeddings,
    'batchSize': 2,
    'tokenizer': tokenizer,
    'maxSeqLen': 32,
    'loopForever': True,
    'shuffleSize': None,
    'encoderDims': (1, 4)
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type _BatchDataset — a _BatchDataset output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a _BatchDataset 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
createTrainingAndValidationDataset Ran
ran on a synthesized input
FreddeFrallan/Multilingual-CLIP/multilingual_clip/TeacherLearning/Dataset.py
code served (permissive licence) · get_code("0388a1f07bdd8902")
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 tensorflow as tf
import numpy as np

class SimpleTokenizer:
    def encode(self, text):
        # Simple tokenizer that returns small token ids
        tokens = text.split()
        return [hash(t) % 100 for t in tokens][:10]

class EmbeddingsList:
    def __init__(self, size=2):
        self.data = [
            {'id': f'img_{i}', 'embedding': np.random.randn(1, 768).astype(np.float32)}
            for i in range(size)
        ]
        self.idx = 0
    
    def shuffle(self):
        np.random.shuffle(self.data)
    
    def __iter__(self):
        return iter(self.data)

# Build target captions dict
targetCaptions = {
    f'img_{i}': {
        'caption_multi': 'a cat sitting on a mat' if i % 2 == 0 else 'a dog running in field'
    }
    for i in range(4)
}

# Build embeddings
trainEmbeddings = EmbeddingsList(size=2)
valEmbeddings = EmbeddingsList(size=2)

# Build tokenizer
tokenizer = SimpleTokenizer()

# Parameters
batchSize = 2
maxSeqLen = 32
encoderDims = (1, 768)

ARGS = {
    'trainEmbeddings': trainEmbeddings,
    'valEmbeddings': valEmbeddings,
    'batchSize': batchSize,
    'tokenizer': tokenizer,
    'targetCaptions': targetCaptions,
    'maxSeqLen': maxSeqLen,
    'encoderDims': encoderDims,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — 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
custom_collate_fn Ran
ran on a synthesized input
FreddeFrallan/Multilingual-CLIP/translation/02_translate_multilingual.py
code served (permissive licence) · get_code("cb1ad92bf1aa4cce")
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)

# Create sample data that matches what custom_collate_fn expects
# The function expects a list of dicts, each with 'input_ids' and 'attention_mask'
# where each value is a list/tensor containing token sequences

data = [
    {
        'input_ids': [torch.tensor([1, 2, 3, 4])],
        'attention_mask': [torch.tensor([1, 1, 1, 1])]
    },
    {
        'input_ids': [torch.tensor([5, 6])],
        'attention_mask': [torch.tensor([1, 1])]
    }
]

ARGS = {
    'data': data
}
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
loadTargetEmbeddings Ran
ran on a synthesized input
FreddeFrallan/Multilingual-CLIP/multilingual_clip/TeacherLearning/Training.py
code served (permissive licence) · get_code("fa54a724efeb2987")
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 tensorflow as tf
import numpy as np
from unittest.mock import Mock, patch

# Create mock dataset objects that mimic the structure returned by datasets.load_dataset
class MockDataset:
    def __init__(self, num_samples=10, embedding_dim=512):
        self.num_samples = num_samples
        self.embedding_dim = embedding_dim
        self.data = [
            {'embedding': np.random.randn(embedding_dim).astype(np.float32)}
            for _ in range(num_samples)
        ]
    
    def __getitem__(self, idx):
        if isinstance(idx, slice):
            return MockDataset(len(range(*idx.indices(self.num_samples))), self.embedding_dim)
        return self.data[idx]
    
    def __len__(self):
        return self.num_samples

# Mock the datasets.load_dataset function
def mock_load_dataset(dataset_name, config, split):
    return MockDataset(num_samples=100, embedding_dim=512)

# Patch datasets.load_dataset before importing/calling the function
import datasets
original_load_dataset = datasets.load_dataset
datasets.load_dataset = mock_load_dataset

# Now define ARGS with valid parameters
ARGS = {
    'imageBase': 'Vit-B-32',
    'validationSize': 5000
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
datasets, numpy, tensorflow — 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
splitIntoValueChunks Ran
ran on a synthesized input
FreddeFrallan/Multilingual-CLIP/multilingual_clip/TeacherLearning/Utils.py
code served (permissive licence) · get_code("d55e6ea8e1bff0dd")
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. 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 numpy as np

# Create sample data objects with a numeric value attribute
class DataPoint:
    def __init__(self, value, name):
        self.value = value
        self.name = name
    
    def __repr__(self):
        return f"DataPoint({self.value}, {self.name})"

# Create sample data
data = [
    DataPoint(10, "a"),
    DataPoint(25, "b"),
    DataPoint(15, "c"),
    DataPoint(30, "d"),
    DataPoint(5, "e"),
    DataPoint(35, "f"),
]

# Define the value extraction function
def getValueFunc(d):
    return d.value

# Define arguments
ARGS = {
    "data": data,
    "numChunks": 3,
    "getValueFunc": getValueFunc
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list — a list 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
splitListIntoChunks Ran
ran on a synthesized input
FreddeFrallan/Multilingual-CLIP/multilingual_clip/TeacherLearning/Utils.py
code served (permissive licence) · get_code("7c8aa0fb63b4ea23")
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 int; 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 numpy as np

torch.manual_seed(0)

# The function splitListIntoChunks takes:
# - data: a list-like object that supports len() and slicing
# - numChunks: an integer specifying how many chunks to split into

# Create a simple list of integers as test data
data = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]

# Number of chunks to split into
numChunks = 3

ARGS = {
    "data": data,
    "numChunks": numChunks
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — 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 int — 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
loadTokenizer Not yet run
unverified (harvested, no recorded run)
FreddeFrallan/Multilingual-CLIP/multilingual_clip/TeacherLearning/Utils.py
code served (permissive licence) · get_code("8ff441d03da0ffed")
How it ran

no invocation recorded.

load_model Not yet run
unverified (harvested, no recorded run)
FreddeFrallan/Multilingual-CLIP/multilingual_clip/legacy_multilingual_clip.py
code served (permissive licence) · get_code("325e7d8398013efd")
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, 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 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.

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

There has been a recent spike in interest in multi-modal Language and Vision problems. On the language side, most of these models primarily focus on English since most multi-modal datasets are monolingual. We try to bridge this gap with a zero-shot approach for learning multi-modal representations using cross-lingual pre-training on the text side. We present a simple yet practical approach for building a cross-lingual image retrieval model which trains on a monolingual training dataset but can be used in a zero-shot cross-lingual fashion during inference. We also introduce a new objective function which tightens the text embedding clusters by pushing dissimilar texts away from each other. For evaluation, we introduce a new 1K multi-lingual MSCOCO2014 caption test dataset (XTD10) in 7 languages that we collected using a crowdsourcing platform. We use this as the test set for zero-shot model performance across languages. We also demonstrate how a cross-lingual model can be used for downstream tasks like multi-lingual image tagging in a zero shot manner. XTD10 dataset is made publicly available here: https://github.com/adobe-research/Cross-lingual-Test-Dataset-XTD10.

For agents

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

get_harvested_code_for_paper("2109.07622")
get_code_for_paper("2109.07622")
have("2109.07622")

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

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

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

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

Connect an agent — have() is free.