SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2309.10091 · ICCV · 2023

Unified Coarse-to-Fine Alignment for Video-Text Retrieval

Gedas Bertasius, Mohit Bansal, Yi-Lin Sung, Feng Cheng, Ziyang Wang

arXiv · PDF · Open in the Atlas

Code that ran

11 of 14 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, 1 violated it and 0 have no contract verdict; 9 failures of our instrument; 3 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/2309.10091.json · badge: /api/ran/2309.10091.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
Ziyang412/UCoFiA canonical (classifier label)
classifier basis: census
11 ran · 3 no recorded run
FunctionStatusWhere it lives
cached_path Ran
ran; our contract draft was wrong, not the code
Ziyang412/UCoFiA/eval_t2v/modules/file_utils.py
pointer only (licence: MIT); the stored copy get_code serves, from sejong-rcv/TAME, is pointer only (licence: NONE) · get_code("349d780dd4a89a37")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from sejong-rcv/TAME, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

check_attr Ran
ran, violated the contract we drafted
Ziyang412/UCoFiA/eval_t2v/modules/modeling.py
code served (permissive licence) · get_code("47c2715feba5fd6b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned bool, ndim 0, dtype family float, shape () 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.

class TaskConfig:
    def __init__(self):
        self.some_attribute = True
        self.another_attribute = "value"
        self.empty_attribute = None
        self.false_attribute = False

target_name = "some_attribute"
task_config = TaskConfig()

ARGS = {
    "target_name": target_name,
    "task_config": task_config
}
Setup block drafted by
a language model, Claude Sonnet 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 bool, ndim 0, dtype family float, shape () — shape () 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
compute_metrics Ran
ran; our contract draft was wrong, not the code
Ziyang412/UCoFiA/eval_t2v/metrics.py
code served (permissive licence) · get_code("f45b80d057798fed")
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 numpy as np

# The function compute_metrics takes a 2D numpy array x as input
# It performs sorting and ranking operations on this array
# to compute retrieval metrics (R1, R5, R10, MR, MeanR, MedianR)

# Create a small sample matrix for testing
# Using shape (4, 6) - 4 samples, 6 dimensional scores
np.random.seed(0)
x = np.random.randn(4, 6)

ARGS = {
    'x': x
}
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 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
filename_to_url Ran
ran; our contract draft was wrong, not the code
Ziyang412/UCoFiA/eval_t2v/modules/file_utils.py
pointer only (licence: MIT); the stored copy get_code serves, from sejong-rcv/TAME, is pointer only (licence: NONE) · get_code("db0ac56aaf6e35e6")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from sejong-rcv/TAME, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

init_device Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Ziyang412/UCoFiA/eval_t2v/main_ucofia.py
code served (permissive licence) · get_code("a0c23f10479a984e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 logging

# Set up a logger since the function uses a global logger
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
handler = logging.StreamHandler()
handler.setLevel(logging.INFO)
logger.addHandler(handler)

# Make logger available globally as the function expects
import sys
current_module = sys.modules[__name__]
setattr(current_module, 'logger', logger)

# Create a simple args object with the required attributes
class Args:
    def __init__(self):
        # Get the actual number of GPUs available (will be 0 on CPU-only systems)
        n_gpu = torch.cuda.device_count()
        if n_gpu == 0:
            n_gpu = 1  # Pretend we have 1 GPU for the batch size calculations
        
        # Set batch sizes that are divisible by n_gpu
        self.batch_size = n_gpu * 4  # e.g., 4 if n_gpu=1
        self.batch_size_val = n_gpu * 2  # e.g., 2 if n_gpu=1
        self.n_gpu = None  # Will be set by the function

args = Args()
local_rank = 0

ARGS = {
    'args': args,
    'local_rank': local_rank
}
Setup block drafted by
a language model, Claude Sonnet 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 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
sinkhorn_knopp Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Ziyang412/UCoFiA/eval_t2v/modules/modeling_ucofia.py
code served (permissive licence) · get_code("59bb972d444a2a94")
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 torch.nn.functional as F

torch.manual_seed(0)

# Create a small log similarity matrix
# Shape: (4, 3) - 4 rows, 3 columns for distinct dimensions
log_sim_matrix = torch.randn(4, 3, requires_grad=True)

ARGS = {
    "log_sim_matrix": log_sim_matrix,
    "n_iters": 4,
    "detach": False,
}
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
sinkhorn_knopp_video Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Ziyang412/UCoFiA/eval_t2v/modules/modeling_ucofia.py
code served (permissive licence) · get_code("e043fd83bad9c5f0")
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 torch.nn.functional as F

torch.manual_seed(0)

# Create a small similarity matrix (log scale)
# Shape: (batch_size, batch_size) - using 4x4 for small but non-trivial size
log_sim_matrix = torch.randn(4, 4, requires_grad=True)

ARGS = {
    "log_sim_matrix": log_sim_matrix,
    "n_iters": 4,
    "detach": False,
}
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
tensor_text_to_video_metrics Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Ziyang412/UCoFiA/eval_t2v/metrics.py
code served (permissive licence) · get_code("66bf2e9b33bd27dd")
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)

# Construct a valid sim_tensor for the function
# The function expects a 3D tensor with shape (num_texts, num_videos, num_videos)
# It uses permute(1, 0, 2), argsort operations, and diagonal extraction
# Let's create a small tensor: 2 texts, 3 videos, 3 videos
sim_tensor = torch.randn(2, 3, 3)

# Ensure the diagonal elements are valid (not inf or nan) for proper ranking
sim_tensor[0, 0, 0] = 0.5
sim_tensor[0, 1, 1] = 0.3
sim_tensor[0, 2, 2] = 0.8
sim_tensor[1, 0, 0] = 0.2
sim_tensor[1, 1, 1] = 0.9
sim_tensor[1, 2, 2] = 0.1

ARGS = {
    'sim_tensor': sim_tensor,
    'top_k': [1, 5, 10]
}
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_video_to_text_sim Ran
ran, honoured the contract we drafted
Ziyang412/UCoFiA/eval_t2v/metrics.py
pointer only (licence: MIT); the stored copy get_code serves, from sejong-rcv/TAME, is pointer only (licence: NONE) · get_code("b6f9f3930836fe3f")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from sejong-rcv/TAME, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

update_attr Ran
ran; our contract draft was wrong, not the code
Ziyang412/UCoFiA/eval_t2v/modules/modeling.py
code served (permissive licence) · get_code("d34a2226d2cf142e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned TargetConfig. 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 logging

logging.basicConfig(level=logging.WARNING)

class SourceConfig:
    def __init__(self):
        self.local_rank = 0
        self.some_attribute = 42
        self.another_attribute = "test_value"

class TargetConfig:
    def __init__(self):
        self.target_attr = None

target_name = "TargetConfig"
target_config = TargetConfig()
target_attr_name = "target_attr"
source_config = SourceConfig()
source_attr_name = "some_attribute"
default_value = None

ARGS = {
    "target_name": target_name,
    "target_config": target_config,
    "target_attr_name": target_attr_name,
    "source_config": source_config,
    "source_attr_name": source_attr_name,
    "default_value": default_value
}
Setup block drafted by
a language model, Claude Sonnet 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 TargetConfig — a TargetConfig output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a TargetConfig 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
url_to_filename Ran
ran; our contract draft was wrong, not the code
Ziyang412/UCoFiA/eval_t2v/modules/file_utils.py
pointer only (licence: MIT); the stored copy get_code serves, from lonePatient/ERNIE-text-classification-pytorch, is pointer only (licence: NONE) · get_code("af64ec220e8bcdbc")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from lonePatient/ERNIE-text-classification-pytorch, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_args Not yet run
unverified (harvested, no recorded run)
Ziyang412/UCoFiA/eval_t2v/main_clip4clip.py
code served (permissive licence) · get_code("5dad69c6b079e518")
How it ran

no invocation recorded.

get_args Not yet run
unverified (harvested, no recorded run)
Ziyang412/UCoFiA/eval_t2v/main_ucofia.py
code served (permissive licence) · get_code("318dd90e2fb0bff7")
How it ran

no invocation recorded.

video_bias_func Not yet run
unverified (harvested, no recorded run)
Ziyang412/UCoFiA/eval_t2v/modules/modeling_ucofia.py
code served (permissive licence) · get_code("6315d7e89c70a061")
How it ran

no invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 10 are also present in other papers whose code we hold (10 with at least one paper dated earlier, 9 the same month, 10 later) and 4 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
url_to_filename 20 other papers
17 dated earlier, 1 the same month, 2 later · 3 only as an assembly brick
1408.5882 (2014-08)
Convolutional Neural Networks for Sentence Classification
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1906.01698 (2019-06)
Open Sesame: Getting Inside BERT's Linguistic Knowledge
and 17 more not named here
cached_path 17 other papers
14 dated earlier, 1 the same month, 2 later · 3 only as an assembly brick
1408.5882 (2014-08)
Convolutional Neural Networks for Sentence Classification
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1906.01698 (2019-06)
Open Sesame: Getting Inside BERT's Linguistic Knowledge
and 14 more not named here
filename_to_url 13 other papers
10 dated earlier, 1 the same month, 2 later
1408.5882 (2014-08)
Convolutional Neural Networks for Sentence Classification
1906.01698 (2019-06)
Open Sesame: Getting Inside BERT's Linguistic Knowledge
1909.11059 (2019-09)
Unified Vision-Language Pre-Training for Image Captioning and VQA
and 10 more not named here
init_device 11 other papers
6 dated earlier, 1 the same month, 4 later
2002.06353 (2020-02)
UniVL: A Unified Video and Language Pre-Training Model for Multimodal Understanding and Generation
2104.08860 (2021-04)
CLIP4Clip: An Empirical Study of CLIP for End to End Video Clip Retrieval
2204.02874 (2022-04)
EclipSE: Efficient Long-range Video Retrieval using Sight and Sound
and 8 more not named here
check_attr 9 other papers
5 dated earlier, 1 the same month, 3 later
2104.08860 (2021-04)
CLIP4Clip: An Empirical Study of CLIP for End to End Video Clip Retrieval
2204.02874 (2022-04)
EclipSE: Efficient Long-range Video Retrieval using Sight and Sound
2211.09623 (2022-11)
Cross-Modal Adapter for Vision-Language Retrieval
and 6 more not named here
update_attr 9 other papers
5 dated earlier, 1 the same month, 3 later
2104.08860 (2021-04)
CLIP4Clip: An Empirical Study of CLIP for End to End Video Clip Retrieval
2204.02874 (2022-04)
EclipSE: Efficient Long-range Video Retrieval using Sight and Sound
2211.09623 (2022-11)
Cross-Modal Adapter for Vision-Language Retrieval
and 6 more not named here
tensor_video_to_text_sim 7 other papers
4 dated earlier, 1 the same month, 2 later
2204.02874 (2022-04)
EclipSE: Efficient Long-range Video Retrieval using Sight and Sound
2211.09623 (2022-11)
Cross-Modal Adapter for Vision-Language Retrieval
2301.00184 (2023-01)
Cap4Video: What Can Auxiliary Captions Do for Text-Video Retrieval?
and 4 more not named here
tensor_text_to_video_metrics 6 other papers
4 dated earlier, 1 the same month, 1 later
2204.02874 (2022-04)
EclipSE: Efficient Long-range Video Retrieval using Sight and Sound
2211.09623 (2022-11)
Cross-Modal Adapter for Vision-Language Retrieval
2301.00184 (2023-01)
Cap4Video: What Can Auxiliary Captions Do for Text-Video Retrieval?
and 3 more not named here
compute_metrics 4 other papers
2 dated earlier, 1 the same month, 1 later
2211.09623 (2022-11)
Cross-Modal Adapter for Vision-Language Retrieval
2301.00184 (2023-01)
Cap4Video: What Can Auxiliary Captions Do for Text-Video Retrieval?
2309.17093 (2023-09)
Prototype-based Aleatoric Uncertainty Quantification for Cross-modal Retrieval
and 1 more not named here
get_args 2 other papers
1 dated earlier, 1 later
2104.08860 (2021-04)
CLIP4Clip: An Empirical Study of CLIP for End to End Video Clip Retrieval
Diao_UniPT_Universal_Parallel_Tuning_for_Transfer_Learning_with_Efficient_Parameter_CVPR_2024_paper (2024 (year only))
UniPT: Universal Parallel Tuning for Transfer Learning with Efficient Parameter and Memory

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

The canonical approach to video-text retrieval leverages a coarse-grained or fine-grained alignment between visual and textual information. However, retrieving the correct video according to the text query is often challenging as it requires the ability to reason about both high-level (scene) and low-level (object) visual clues and how they relate to the text query. To this end, we propose a Unified Coarse-to-fine Alignment model, dubbed UCOFIA. Specifically, our model captures the cross-modal similarity information at different granularity levels. To alleviate the effect of irrelevant visual clues, we also apply an Interactive Similarity Aggregation module (ISA) to consider the importance of different visual features while aggregating the cross-modal similarity to obtain a similarity score for each granularity. Finally, we apply the Sinkhorn-Knopp algorithm to normalize the similarities of each level before summing them, alleviating over-and under-representation issues at different levels. By jointly considering the crossmodal similarity of different granularity, UCOFIA allows the effective unification of multi-grained alignments. Empirically, UCOFIA outperforms previous state-of-the-art CLIP-based methods on multiple video-text retrieval benchmarks, achieving 2.4%, 1.4% and 1.3% improvements in text-to-video retrieval R@1 on MSR-VTT, Activity-Net, and DiDeMo, respectively. Our code is publicly available at https://github.com/Ziyang412/UCoFiA.

For agents

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

get_harvested_code_for_paper("2309.10091")
get_code_for_paper("2309.10091")
have("2309.10091")

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

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

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

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

Connect an agent — have() is free.