SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2401.17186 · AAAI · 2024

Embracing Language Inclusivity and Diversity in CLIP through Continual Language Learning

Yuexian Zou, Xuxin Cheng, Yong Dai, Yaowei Li, Bang Yang, Asif Raza

arXiv · PDF · Open in the Atlas

Code that ran

5 of 5 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 1 has no contract verdict; 3 failures of our instrument; 0 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/2401.17186.json · badge: /api/ran/2401.17186.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
yangbang18/CLFM canonical (classifier label)
classifier basis: census
5 ran · 0 no recorded run
FunctionStatusWhere it lives
construct_gts Ran
ran; our contract draft was wrong, not the code
yangbang18/CLFM/clfm/evaluation/RetrievalEvaluator.py
code served (permissive licence) · get_code("d1b2290a8db95c91")
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 numpy as np

torch.manual_seed(0)

# Construct valid arguments for construct_gts
# The function expects a list of dictionaries, each containing 'caption' key
# Captions can be either a single string or a list/tuple of strings

ARGS = {
    "annotation": [
        {
            "caption": "A cat sitting on a mat"
        },
        {
            "caption": ["A dog running", "A dog playing"]
        },
        {
            "caption": ("A bird flying", "A bird singing", "A bird resting")
        }
    ]
}
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 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
get_concat_dataset_and_loader Ran
ran on a synthesized input
yangbang18/CLFM/clfm/datasets/ConcatDataset.py
code served (permissive licence) · get_code("8fa0e8b2e219fd60")
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 numpy as np
from torch.utils.data import Dataset, DataLoader

torch.manual_seed(0)
np.random.seed(0)

class SimpleDataset(Dataset):
    def __init__(self, size=10):
        self.size = size
    
    def __len__(self):
        return self.size
    
    def __getitem__(self, idx):
        return torch.randn(4), torch.randint(0, 2, (1,)).item()

class MemoryDataset(Dataset):
    def __init__(self, size=5):
        self.size = size
        self.memory = []
    
    def __len__(self):
        return max(self.size, len(self.memory))
    
    def __getitem__(self, idx):
        if idx < len(self.memory):
            return self.memory[idx]
        return torch.randn(4), torch.randint(0, 2, (1,)).item()
    
    def reservoir_sampling(self, examples, labels):
        for ex, label in zip(examples, labels):
            self.memory.append((ex, label))

dataset1 = SimpleDataset(size=8)
dataset2 = SimpleDataset(size=6)

memory_dataset = MemoryDataset(size=5)

ARGS = {
    "datasets": [dataset1, dataset2],
    "weights": None,
    "batch_size": 2,
    "num_workers": 0,
    "is_train": True,
    "num_samples": None,
    "balanced_sampling": False,
    "experience_replay": False,
    "double_batch_size": False
}
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 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
retrieval_evaluation Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
yangbang18/CLFM/clfm/evaluation/RetrievalEvaluator.py
code served (permissive licence) · get_code("b4dae4f7179bbb2d")
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 numpy as np
from typing import Dict, List, Any

torch.manual_seed(0)
np.random.seed(0)

# Create minimal annotation list with caption key
# Each annotation item needs a 'caption' key with caption(s)
annotation = [
    {'caption': ['a cat sleeping on a mat', 'a feline resting']},
    {'caption': ['a dog running in the park']},
]

# Create score matrices
# scores_i2t: image-to-text scores, shape (num_images, num_texts)
# scores_t2i: text-to-image scores, shape (num_texts, num_images)
num_images = 2
num_texts = 3  # 2 captions for image 0, 1 caption for image 1

# Image-to-text scores: each image scored against all texts
scores_i2t = np.random.randn(num_images, num_texts).astype(np.float32)

# Text-to-image scores: each text scored against all images
scores_t2i = np.random.randn(num_texts, num_images).astype(np.float32)

ARGS = {
    'scores_i2t': scores_i2t,
    'scores_t2i': scores_t2i,
    'annotation': annotation,
    'topk': 2,
}
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 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
retrieval_evaluation_n_fold Ran
ran; our contract draft was wrong, not the code
yangbang18/CLFM/clfm/evaluation/RetrievalEvaluator.py
code served (permissive licence) · get_code("6abf632eb7201034")
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
import numpy as np

torch.manual_seed(0)
np.random.seed(0)

# Create a small annotation list with captions
# We need at least 10 items to split into 5 folds (2 items per fold)
annotation = [
    {'caption': f'caption_{i}'}
    for i in range(10)
]

# Create score matrices for image-to-text and text-to-image retrieval
# Total images: 10, Total texts: 10 (1 caption per image)
# scores_i2t: (n_images, n_texts) shape
# scores_t2i: (n_texts, n_images) shape

n_images = 10
n_texts = 10

# Create random scores with realistic values (higher scores = better match)
scores_i2t = np.random.rand(n_images, n_texts).astype(np.float32)
scores_t2i = np.random.rand(n_texts, n_images).astype(np.float32)

# Ensure diagonal elements are highest (images should match their own captions best)
for i in range(min(n_images, n_texts)):
    scores_i2t[i, i] += 10.0
    scores_t2i[i, i] += 10.0

ARGS = {
    'scores_i2t': scores_i2t,
    'scores_t2i': scores_t2i,
    'annotation': annotation,
    'n_fold': 5
}
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 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
tensor_prompt Ran
ran, honoured the contract we drafted
yangbang18/CLFM/clfm/adapters/prompt.py
code served (permissive licence) · get_code("580bf03d921b436f")
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 Parameter, 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)

ARGS = {
    "a": 2,
    "b": 4,
    "c": 3
}
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 Parameter, ndim 3, dtype family float — no output shape is stated: observe_signature.py recorded Tensor ndim 3, which disagrees with the fixture run
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

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 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 5 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

While vision-language pre-trained models (VL-PTMs) have advanced multimodal research in recent years, their mastery in a few languages like English restricts their applicability in broader communities. To this end, there is an increasing interest in developing multilingual VL models via a joint-learning setup, which, however, could be unrealistic due to expensive costs and data availability. In this work, we propose to extend VL-PTMs' language capacity by continual language learning (CLL), where a model needs to update its linguistic knowledge incrementally without suffering from catastrophic forgetting (CF). We begin our study by introducing a model dubbed CLL-CLIP, which builds upon CLIP, a prevailing VL-PTM that has acquired image-English text alignment. Specifically, CLL-CLIP contains an expandable token embedding layer to handle linguistic differences. It solely trains token embeddings to improve memory stability and is optimized under cross-modal and cross-lingual objectives to learn the alignment between images and multilingual texts. To alleviate CF raised by covariate shift and lexical overlap, we further propose a novel approach that ensures the identical distribution of all token embeddings during initialization and regularizes token embedding learning during training. We construct a CLL benchmark covering 36 languages based on MSCOCO and XM3600 datasets and then evaluate multilingual image-text retrieval performance. Extensive experiments verify the effectiveness of CLL-CLIP and show that our approach can boost CLL-CLIP, e.g., by 6.7% in text-to-image average Recall@1 on XM3600, and improve various state-ofthe-art methods consistently. Our code and data are available at https://github.com/yangbang18/CLFM.

For agents

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

get_harvested_code_for_paper("2401.17186")
get_code_for_paper("2401.17186")
have("2401.17186")

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

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

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

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

Connect an agent — have() is free.