SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2204.10931 · NAACL · 2022

MCSE: Multimodal Contrastive Learning of Sentence Embeddings

David Adelani, Michael Hedderich, Dietrich Klakow, Marius Mosbach, Miaoran Zhang

arXiv · PDF · Open in the Atlas

Code that ran

2 of 2 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (2 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 0 failures of our instrument; 0 no recorded run), measured 2026-11-24; 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/2204.10931.json · badge: /api/ran/2204.10931.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
uds-lsv/mcse marked official in Papers with Code
Papers with Code archive
2 ran · 0 no recorded run
FunctionStatusWhere it lives
MCSE Ran
ran on a synthesized input · constructed an object; no result was computed
uds-lsv/mcse/src/model.py
code served (permissive licence) · get_code("3882409d4f53757d")
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, MCSE: 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

torch.manual_seed(0)

# Create a minimal language model that returns pooler_output and last_hidden_state
class MinimalLangModel(nn.Module):
    def __init__(self, hidden_size=4):
        super().__init__()
        self.hidden_size = hidden_size
        self.linear = nn.Linear(hidden_size, hidden_size)
    
    def forward(self, input_ids, attention_mask, token_type_ids=None, position_ids=None):
        batch_size = input_ids.size(0)
        num_sent = input_ids.size(1)
        
        # Create dummy last_hidden_state: (batch_size * num_sent, seq_len, hidden_size)
        seq_len = 8
        last_hidden_state = torch.randn(batch_size * num_sent, seq_len, self.hidden_size)
        last_hidden_state = last_hidden_state.view(batch_size, num_sent, seq_len, self.hidden_size)
        # Reshape to (batch_size * num_sent, seq_len, hidden_size) for processing
        last_hidden_state = last_hidden_state.view(batch_size * num_sent, seq_len, self.hidden_size)
        
        # Create dummy pooler_output: (batch_size * num_sent, hidden_size)
        pooler_output = torch.randn(batch_size * num_sent, self.hidden_size)
        
        class Output:
            pass
        
        output = Output()
        output.last_hidden_state = last_hidden_state
        output.pooler_output = pooler_output
        return output

# Create a minimal vision model
class MinimalVisnModel(nn.Module):
    def __init__(self, output_dim=4):
        super().__init__()
        self.output_dim = output_dim
        self.linear = nn.Linear(3, output_dim)
    
    def forward(self, img):
        # img shape: (batch_size, num_sent, 3, 32, 32) or similar
        # Output: (batch_size, output_dim)
        batch_size = img.size(0)
        return torch.randn(batch_size, self.output_dim)

# Create args object
class Args:
    def __init__(self):
        self.hidden_size = 4
        self.proj_dim = 3
        self.temp = 0.05
        self.temp_vl = 0.05
        self.device = 'cpu'

# Instantiate models and args
lang_model = MinimalLangModel(hidden_size=4)
visn_model = MinimalVisnModel(output_dim=4)
args = Args()

# Create batch
batch = {
    'input_ids': torch.randint(0, 100, (2, 2)),  # batch_size=2, num_sent=2
    'attention_mask': torch.ones(2, 2),
    'token_type_ids': torch.zeros(2, 2),
    'position_ids': torch.arange(2).unsqueeze(0).expand(2, 2),
    'img': torch.randn(2, 3, 32, 32)  # batch_size=2, 3 channels, 32x32
}

ARGS = {
    'lang_model': lang_model,
    'visn_model': visn_model,
    'args': args
}
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 MCSE — 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 MCSE 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
MLPLayer Ran
ran on a synthesized input · constructed an object; no result was computed
uds-lsv/mcse/src/model.py
code served (permissive licence) · get_code("d9c0e720e8c01537")
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, MLPLayer: 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

torch.manual_seed(0)

# Create a small feature tensor (batch_size=2, in_dim=4)
features = torch.randn(2, 4)

# Define parameters for MLPLayer
in_dim = 4
out_dim = 3

ARGS = {
    "in_dim": in_dim,
    "out_dim": out_dim,
}
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 MLPLayer — 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 MLPLayer 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

Also present in other papers' code

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

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

Repositories linked to this paper

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

Abstract

Learning semantically meaningful sentence embeddings is an open problem in natural language processing. In this work, we propose a sentence embedding learning approach that exploits both visual and textual information via a multimodal contrastive objective. Through experiments on a variety of semantic textual similarity tasks, we demonstrate that our approach consistently improves the performance across various datasets and pre-trained encoders. In particular, combining a small amount of multimodal data with a large text-only corpus, we improve the state-of-the-art average Spearman's correlation by 1.7%. By analyzing the properties of the textual embedding space, we show that our model excels in aligning semantically similar sentences, providing an explanation for its improved performance.

For agents

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

get_harvested_code_for_paper("2204.10931")
get_code_for_paper("2204.10931")
have("2204.10931")

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

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

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

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

Connect an agent — have() is free.