SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2407.17331 · ECCV · 2024

Multi-label Cluster Discrimination for Visual Representation Learning

Jiankang Deng, Kaicheng Yang, Xiangzi Dai, Ziyong Feng, Xiang An

arXiv · PDF · Open in the Atlas

Code that ran

7 of 11 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (7 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 7 have no contract verdict; 0 failures of our instrument; 4 no recorded run), measured 2026-11-21; 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/2407.17331.json · badge: /api/ran/2407.17331.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
deepglint/unicom marked official in Papers with Code
Papers with Code archive
7 ran · 4 no recorded run
FunctionStatusWhere it lives
MLCDEncoder Ran
ran on a synthesized input · constructed an object; no result was computed
deepglint/unicom/mlcd/vit_rope2d_hf.py
code served (permissive licence) · get_code("7d1b1fa84c7948b6")
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 an instance of its own class, MLCDEncoder: the run constructed the object and did not call it, so no result was computed. 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
from transformers.models.clip.modeling_clip import CLIPVisionConfig

torch.manual_seed(0)

class MLCDVisionConfig(CLIPVisionConfig):
    model_type = 'mlcd_vision_model'

    def __init__(self, **kwargs):
        super().__init__(**kwargs)

# Create a minimal config
config = MLCDVisionConfig(
    hidden_size=8,
    num_attention_heads=2,
    num_hidden_layers=2,
    intermediate_size=16,
    hidden_act="quick_gelu",
    layer_norm_eps=1e-5,
    attention_dropout=0.0,
    initializer_range=0.02,
)

ARGS = {
    "config": config,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type MLCDEncoder — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a MLCDEncoder 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
MLCDEncoderLayer Ran
ran on a synthesized input · constructed an object; no result was computed
deepglint/unicom/mlcd/vit_rope2d_hf.py
code served (permissive licence) · get_code("1147651f76ba5063")
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 an instance of its own class, MLCDEncoderLayer: the run constructed the object and did not call it, so no result was computed. 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
from transformers.models.clip.modeling_clip import CLIPVisionConfig

torch.manual_seed(0)

class MLCDVisionConfig(CLIPVisionConfig):
    model_type = 'mlcd_vision_model'

    def __init__(self, **kwargs):
        super().__init__(**kwargs)

# Create a minimal config
config = MLCDVisionConfig(
    hidden_size=64,
    num_attention_heads=4,
    attention_dropout=0.0,
    layer_norm_eps=1e-5,
    intermediate_size=256,
    hidden_act="quick_gelu",
)

# Create input tensors
batch_size = 2
seq_len = 3
hidden_size = 64
num_heads = 4
head_dim = hidden_size // num_heads

# hidden_states: (batch, seq_len, hidden_size)
hidden_states = torch.randn(batch_size, seq_len, hidden_size)

# rotary_pos_emb: (seq_len, head_dim)
rotary_pos_emb = torch.randn(seq_len, head_dim)

ARGS = {
    "config": config,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type MLCDEncoderLayer — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a MLCDEncoderLayer 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
MLCDMLP Ran
ran on a synthesized input · constructed an object; no result was computed
deepglint/unicom/mlcd/vit_rope2d_hf.py
code served (permissive licence) · get_code("0744bf53c4214b05")
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 an instance of its own class, MLCDMLP: the run constructed the object and did not call it, so no result was computed. 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
from transformers.models.clip.modeling_clip import CLIPMLP, CLIPVisionConfig

torch.manual_seed(0)

class MLCDVisionConfig(CLIPVisionConfig):
    model_type = 'mlcd_vision_model'

    def __init__(self, **kwargs):
        super().__init__(**kwargs)

# Create a minimal MLCDVisionConfig
config = MLCDVisionConfig(
    hidden_size=256,
    intermediate_size=512,
    hidden_act="quick_gelu",
    hidden_dropout_prob=0.0,
    attention_probs_dropout_prob=0.0,
    initializer_range=0.02,
    initializer_factor=1.0,
    layer_norm_eps=1e-5,
    num_hidden_layers=2,
    num_attention_heads=4,
    image_size=224,
    patch_size=32,
)

ARGS = {
    'config': config
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type MLCDMLP — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a MLCDMLP 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
MLCDSdpaAttention Ran
ran on a synthesized input · constructed an object; no result was computed
deepglint/unicom/mlcd/vit_rope2d_hf.py
code served (permissive licence) · get_code("27eecf02ec652597")
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 an instance of its own class, MLCDSdpaAttention: the run constructed the object and did not call it, so no result was computed. 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
from transformers.models.clip.modeling_clip import CLIPVisionConfig

torch.manual_seed(0)

class MLCDVisionConfig(CLIPVisionConfig):
    model_type = 'mlcd_vision_model'

    def __init__(self, **kwargs):
        super().__init__(**kwargs)

config = MLCDVisionConfig(
    hidden_size=8,
    num_attention_heads=2,
    attention_dropout=0.1,
    image_size=224,
    patch_size=16,
    num_channels=3,
    num_hidden_layers=12,
    intermediate_size=32,
    hidden_act="quick_gelu",
    layer_norm_eps=1e-5,
    initializer_range=0.02,
    initializer_factor=1.0,
)

ARGS = {
    "config": config,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type MLCDSdpaAttention — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a MLCDSdpaAttention 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
MLCDVisionConfig Ran
ran on a synthesized input · constructed an object; no result was computed
deepglint/unicom/mlcd/vit_rope2d_hf.py
code served (permissive licence) · get_code("ff45de9afb241b5f")
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 an instance of its own class, MLCDVisionConfig: the run constructed the object and did not call it, so no result was computed. 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
from transformers.models.clip.modeling_clip import CLIPVisionConfig

torch.manual_seed(0)

class MLCDVisionConfig(CLIPVisionConfig):
    model_type = 'mlcd_vision_model'

    def __init__(self, **kwargs):
        super().__init__(**kwargs)

ARGS = {
    'hidden_size': 256,
    'intermediate_size': 512,
    'num_hidden_layers': 2,
    'num_attention_heads': 4,
    'image_size': 224,
    'patch_size': 16,
    'hidden_act': 'quick_gelu',
    'layer_norm_eps': 1e-5,
    'attention_dropout': 0.0,
    'initializer_range': 0.02,
    'initializer_factor': 1.0,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type MLCDVisionConfig — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a MLCDVisionConfig 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
MLCDVisionEmbeddings Ran
ran on a synthesized input · constructed an object; no result was computed
deepglint/unicom/mlcd/vit_rope2d_hf.py
code served (permissive licence) · get_code("47857c277feef274")
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 an instance of its own class, MLCDVisionEmbeddings: the run constructed the object and did not call it, so no result was computed. 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
from transformers.models.clip.modeling_clip import CLIPVisionConfig

torch.manual_seed(0)

class MLCDVisionConfig(CLIPVisionConfig):
    model_type = 'mlcd_vision_model'

    def __init__(self, **kwargs):
        super().__init__(**kwargs)

config = MLCDVisionConfig(
    hidden_size=4,
    image_size=8,
    patch_size=2,
    num_channels=3,
)

ARGS = {
    'config': config,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type MLCDVisionEmbeddings — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a MLCDVisionEmbeddings 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
VisionRotaryEmbedding Ran
ran on a synthesized input · constructed an object; no result was computed
deepglint/unicom/mlcd/vit_rope2d_hf.py
code served (permissive licence) · get_code("a12357d48c1c9ffa")
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 an instance of its own class, VisionRotaryEmbedding: the run constructed the object and did not call it, so no result was computed. 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
from torch import nn

torch.manual_seed(0)

class VisionRotaryEmbedding(nn.Module):

    def __init__(self, dim: int, theta: float=10000.0) -> None:
        super().__init__()
        inv_freq = 1.0 / theta ** (torch.arange(0, dim, 2, dtype=torch.float) / dim)
        self.register_buffer('inv_freq', inv_freq, persistent=False)

    def forward(self, seqlen: int) -> torch.Tensor:
        seq = torch.arange(seqlen, device=self.inv_freq.device, dtype=self.inv_freq.dtype)
        freqs = torch.outer(seq, self.inv_freq)
        return freqs


# Create an instance to test
embedding = VisionRotaryEmbedding(dim=4, theta=10000.0)

# Test the forward pass
output = embedding.forward(seqlen=2)

ARGS = {
    'dim': 4,
    'theta': 10000.0
}
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 VisionRotaryEmbedding — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a VisionRotaryEmbedding 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
MLCDPreTrainedModel Not yet run
unverified (harvested, no recorded run)
deepglint/unicom/mlcd/vit_rope2d_hf.py
code served (permissive licence) · get_code("47b28dd1d00a8546")
How it ran

no invocation recorded.

MLCDVisionModel Not yet run
unverified (harvested, no recorded run)
deepglint/unicom/mlcd/vit_rope2d_hf.py
code served (permissive licence) · get_code("b17ea9baa7a3c22c")
How it ran

no invocation recorded.

MLCDVisionTransformer Not yet run
unverified (harvested, no recorded run)
deepglint/unicom/mlcd/vit_rope2d_hf.py
code served (permissive licence) · get_code("453f2f4154c6fa96")
How it ran

no invocation recorded.

apply_rotary_pos_emb_vision Not yet run
unverified (harvested, no recorded run)
deepglint/unicom/mlcd/vit_rope2d_hf.py
code served (permissive licence) · get_code("9cbc76fa9f2e80cb")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 later) and 10 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
apply_rotary_pos_emb_vision
brick of this paper's assembly: helper
7 other papers
7 later
2410.06169 (2024-10)
Treat Visual Tokens as Text? But Your MLLM Only Needs Fewer Efforts to See
2411.17465 (2024-11)
ShowUI: One Vision-Language-Action Model for GUI Visual Agent
and 4 more not named here

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

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) has recently demonstrated success across various tasks due to superior feature representation empowered by image-text contrastive learning. However, the instance discrimination method used by CLIP can hardly encode the semantic structure of training data. To handle this limitation, cluster discrimination has been proposed through iterative cluster assignment and classification. Nevertheless, most cluster discrimination approaches only define a single pseudo-label for each image, neglecting multi-label signals in the image. In this paper, we propose a novel Multi-Label Cluster Discrimination method named MLCD to enhance representation learning. In the clustering step, we first cluster the large-scale LAION-400M dataset into one million centers based on off-the-shelf embedding features. Considering that natural images frequently contain multiple visual objects or attributes, we select the multiple closest centers as auxiliary class labels. In the discrimination step, we design a novel multi-label classification loss, which elegantly separates losses from positive classes and negative classes, and alleviates ambiguity on decision boundary. We validate the proposed multi-label cluster discrimination method with experiments on different scales of models and pre-training datasets. Experimental results show that our method achieves state-of-the-art performance on multiple downstream tasks including linear probe, zero-shot classification, and image-text retrieval.

For agents

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

get_harvested_code_for_paper("2407.17331")
get_code_for_paper("2407.17331")
have("2407.17331")

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

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

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

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

Connect an agent — have() is free.