SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2211.11427 · NeurIPS · 2022

Expectation-Maximization Contrastive Learning for Compact Video-and-Language Representations

Xian Wu, David Clifton, Jie Chen, Jin Peng, Fenglin Liu, Jinfa Huang, Shen Ge, Guoli Song

arXiv · PDF · Open in the Atlas

Code that ran

3 of 4 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 0 have no contract verdict; 3 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/2211.11427.json · badge: /api/ran/2211.11427.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
jpthu17/EMCL canonical (classifier label)
classifier basis: classifier_2025
1 ran · 1 no recorded run
jpthu17/HBI community
Papers with Code archive
2 ran · 0 no recorded run
FunctionStatusWhere it lives
cluster_dpc_knn Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
jpthu17/HBI/HBI/models/cluster.py
code served (permissive licence) · get_code("f09b191d136f2213")
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

torch.manual_seed(0)

# Create a small token_dict with 'x' key containing token embeddings
# Shape: [B, N, C] where B=batch, N=num_tokens, C=channels
token_dict = {
    'x': torch.randn(2, 5, 4)  # B=2, N=5 tokens, C=4 channels
}

# cluster_num: number of clusters to form
cluster_num = 3

# k: number of nearest neighbors for local density calculation
k = 2

# token_mask: optional mask for padded tokens
# Shape: [B, N] where non-zero means valid token
token_mask = torch.ones(2, 5)
token_mask[0, 4] = 0  # mark one token as padded in first batch

ARGS = {
    'token_dict': token_dict,
    'cluster_num': cluster_num,
    'k': k,
    'token_mask': token_mask
}
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
get_args Ran
ran; our contract draft was wrong, not the code
jpthu17/EMCL/video_retrieval/EMCL-Net/main_retrieval.py
code served (permissive licence) · get_code("eba8c64dc2ab559d")
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) and returned Namespace. 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 sys
from io import StringIO

# Mock sys.argv to provide command-line arguments
sys.argv = [
    'script.py',
    '--do_train', '1',
    '--do_eval', '1',
    '--datatype', 'msrvtt',
    '--anno_path', 'data/MSR-VTT/anns',
    '--video_path', 'data/MSR-VTT/videos',
    '--seed', '42',
    '--workers', '4',
    '--lr', '0.0001',
    '--coef_lr', '0.001',
    '--warmup_proportion', '0.1',
    '--weight_decay', '0.2',
    '--epochs', '5',
    '--batch_size', '128',
    '--batch_size_val', '128',
    '--max_words', '32',
    '--max_frames', '12',
    '--video_framerate', '1',
    '--device', 'cpu',
    '--world_size', '1',
    '--local_rank', '0',
    '--distributed', '0',
    '--n_display', '100',
    '--output_dir', '/tmp/output',
    '--base_encoder', 'ViT-B/32',
    '--agg_module', 'seqTransf',
    '--num_hidden_layers', '4',
    '--temp', '3.0',
    '--centerK', '32',
    '--stage_num', '9',
    '--momentum', '0.9',
    '--lamd', '1.0',
    '--beta', '3',
    '--t2v_temp', '0.01',
    '--v2t_temp', '0.01',
    '--init_model', None,
]

ARGS = {
    'description': 'Disentangled Representation Learning for Text-Video Retrieval'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Namespace — a Namespace output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Namespace 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
index_points Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
jpthu17/HBI/HBI/models/cluster.py
code served (permissive licence) · get_code("a1d91d4a1b5bbd6f")
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) and returned Tensor, ndim 3, dtype family float, shape (2, 4, 3) 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

torch.manual_seed(0)

# Create small tensors with distinct dimensions
# points: [B, N, C] where B=2 (batch), N=5 (num points), C=3 (channels)
points = torch.randn(2, 5, 3)

# idx: [B, S] where B=2 (batch), S=4 (num samples to index)
# Values should be valid indices into the N=5 dimension
idx = torch.tensor([[0, 2, 4, 1], [1, 3, 0, 2]], dtype=torch.long)

ARGS = {
    "points": points,
    "idx": idx,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 3, dtype family float, shape (2, 4, 3) — shape (2, 4, 3) 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
set_seed_logger Not yet run
unverified (harvested, no recorded run)
jpthu17/EMCL/video_retrieval/EMCL-Net/main_retrieval.py
code served (permissive licence) · get_code("8952edef143f2747")
How it ran

no invocation recorded.

Also present in other papers' code

Of 4 samples lifted from this paper's linked repositories, 4 carry a function identity and 0 do not. Of the 4 distinct functions with an identity, 3 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 3 later) and 1 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
index_points
brick of this paper's assembly: helper
42 other papers
15 dated earlier, 27 later · 6 only as an assembly brick
1706.02413 (2017-06)
PointNet++: Deep Hierarchical Feature Learning on Point Sets in a Metric Space
1811.07246 (2018-11)
PointConv: Deep Convolutional Networks on 3D Point Clouds
2003.13479 (2020-03)
RPM-Net: Robust Point Matching using Learned Features
and 39 more not named here
cluster_dpc_knn
brick of this paper's assembly: entry
1 other paper
1 later · 1 only as an assembly brick
2305.12218 (2023-05)
Text-Video Retrieval with Disentangled Conceptualization and Set-to-Set Alignment
set_seed_logger 1 other paper
1 later
2305.12218 (2023-05)
Text-Video Retrieval with Disentangled Conceptualization and Set-to-Set Alignment

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

Most video-and-language representation learning approaches employ contrastive learning, e.g., CLIP [53], to project the video and text features into a common latent space according to the semantic similarities of text-video pairs. However, such learned shared latent spaces are not often optimal, and the modality gap between visual and textual representation can not be fully eliminated. In this paper, we propose Expectation-Maximization Contrastive Learning (EMCL) to learn compact video-and-language representations. Specifically, we use the Expectation-Maximization algorithm to find a compact set of bases for the latent space, where the features could be concisely represented as the linear combinations of these bases. Such feature decomposition of video-and-language representations reduces the rank of the latent space, resulting in increased representing power for the semantics. Extensive experiments on three benchmark text-video retrieval datasets prove that our EMCL can learn more discriminative video-and-language representations than previous methods, and significantly outperform previous state-of-the-art methods across all metrics. More encouragingly, the proposed method can be applied to boost the performance of existing approaches either as a jointly training layer or an out-of-the-box inference module with no extra training, making it easy to be incorporated into any existing methods ‡ .

For agents

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

get_harvested_code_for_paper("2211.11427")
get_code_for_paper("2211.11427")
have("2211.11427")

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

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

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

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

Connect an agent — have() is free.