SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2312.12155 · 2023

Towards Balanced Alignment: Modal-Enhanced Semantic Modeling for Video Moment Retrieval

arXiv · PDF · Open in the Atlas

Code that ran

6 of 7 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 0 have no contract verdict; 5 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/2312.12155.json · badge: /api/ran/2312.12155.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
lntzm/mesm canonical (classifier label)
classifier basis: census
6 ran · 1 no recorded run
FunctionStatusWhere it lives
build_vocab_from_pkl Ran
ran; our contract draft was wrong, not the code
lntzm/mesm/runner.py
code served (permissive licence) · get_code("7bf931c25a61f500")
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 os
import pickle
import tempfile

# Create a temporary directory and a mock vocab pickle file
temp_dir = tempfile.mkdtemp()
vocab_data = {'word1': 0, 'word2': 1, 'word3': 2}
vocab_file_path = os.path.join(temp_dir, 'glove.pkl')
with open(vocab_file_path, 'wb') as f:
    pickle.dump(vocab_data, f)

# Create a simple config object with ann_path attribute
class OptConfig:
    def __init__(self, ann_path):
        self.ann_path = ann_path

opt = OptConfig(ann_path=temp_dir)

ARGS = {
    'opt': opt
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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 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
count_parameters Ran
ran, honoured the contract we drafted
lntzm/mesm/utils/model_utils.py
pointer only (licence: MIT); the stored copy get_code serves, from Zhuo-Cao/QV-M2, is pointer only (licence: NONE) · get_code("edb929dece68582e")
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 Zhuo-Cao/QV-M2, 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.

gen_sineembed_for_position Ran
ran; our contract draft was wrong, not the code
lntzm/mesm/model/transformer.py
code served (permissive licence) · get_code("52a68aeae9ff7b91")
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 Tensor, ndim 3, dtype family float, shape (2, 3, 4) 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
import math

torch.manual_seed(0)

# Analyze the function:
# - pos_tensor: indexed with [:, :, 0] and [:, :, 1], so needs shape (batch, seq, 2)
# - dim: integer, used in arithmetic and indexing
# The function expects pos_tensor to have at least 3 dimensions with last dim >= 2

# Create a small pos_tensor with shape (batch=2, seq=3, features=2)
pos_tensor = torch.randn(2, 3, 2, dtype=torch.float32)

# dim should be even (used as each_dim = dim // 2)
dim = 4

ARGS = {
    "pos_tensor": pos_tensor,
    "dim": 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 Tensor, ndim 3, dtype family float, shape (2, 3, 4) — shape (2, 3, 4) 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
inverse_sigmoid Ran
ran; our contract draft was wrong, not the code
lntzm/mesm/model/transformer.py
pointer only (licence: MIT); the stored copy get_code serves, from wjun0830/qd-detr, is pointer only (licence: NOASSERTION) · get_code("6897880b6ce14c94")
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 wjun0830/qd-detr, and GitHub could not classify the licence of that repository (NOASSERTION). 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.

merge_state_dict_with_module Ran
ran; our contract draft was wrong, not the code
lntzm/mesm/utils/model_utils.py
code served (permissive licence) · get_code("7131e23bd6afa44e")
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 OrderedDict. 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 collections import OrderedDict

torch.manual_seed(0)

# Create a simple module to generate a state_dict
class SimpleModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
        self.conv = nn.Conv1d(2, 5, 3)

simple_module = SimpleModule()

# Get the module's state_dict
module_state_dict = simple_module.state_dict()

# Create an initial state_dict (could be empty or have other keys)
state_dict = OrderedDict()
state_dict['other_key'] = torch.randn(2, 4)

# Define the module name
module_name = 'encoder'

ARGS = {
    'state_dict': state_dict,
    'module_state_dict': module_state_dict,
    'module_name': module_name
}
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 OrderedDict — a OrderedDict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a OrderedDict 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
state_dict_without_module Ran
ran; our contract draft was wrong, not the code
lntzm/mesm/utils/model_utils.py
code served (permissive licence) · get_code("8a9ee3ed72e169c0")
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 OrderedDict. 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 collections import OrderedDict

torch.manual_seed(0)

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.layer1 = nn.Linear(4, 3)
        self.layer2 = nn.Linear(3, 2)
        self.module_to_skip = nn.Linear(2, 1)
    
    def forward(self, x):
        x = self.layer1(x)
        x = self.layer2(x)
        x = self.module_to_skip(x)
        return x

model = SimpleModel()

ARGS = {
    "model": model,
    "module_name": "module_to_skip"
}
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 OrderedDict — a OrderedDict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a OrderedDict 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
multi_head_attention_forward Not yet run
unverified (harvested, no recorded run)
lntzm/mesm/model/attention.py
pointer only (licence: MIT); the stored copy get_code serves, from wjj1wjj/Nodule-DETR, is pointer only (licence: NONE) · get_code("a82091666b9db8cf")
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 wjj1wjj/Nodule-DETR, 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. No invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 7 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 2 the same month, 7 later) and 0 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
inverse_sigmoid 28 other papers
11 dated earlier, 2 the same month, 14 later, 1 same year, order not determinable · 10 only as an assembly brick
2201.12329 (2022-01)
DAB-DETR: Dynamic Anchor Boxes are Better Queries for DETR
2203.01305 (2022-03)
DN-DETR: Accelerate DETR Training by Introducing Query DeNoising
2209.13306 (2022-09)
Embracing Consistency: A One-Stage Approach for Spatio-Temporal Video Grounding
and 25 more not named here
multi_head_attention_forward 24 other papers
10 dated earlier, 1 the same month, 13 later
2203.01305 (2022-03)
DN-DETR: Accelerate DETR Training by Introducing Query DeNoising
2203.03605 (2022-03)
DINO: DETR with Improved DeNoising Anchor Boxes for End-to-End Object Detection
2206.02777 (2022-06)
Mask DINO: Towards A Unified Transformer-based Framework for Object Detection and Segmentation
and 21 more not named here
count_parameters 11 other papers
6 dated earlier, 5 later
2001.09099 (2020-01)
TVR: A Large-Scale Dataset for Video-Subtitle Moment Retrieval
2105.06247 (2021-05)
Video Corpus Moment Retrieval with Contrastive Learning
2207.00383 (2022-07)
ReLER@ZJU-Alibaba Submission to the Ego4D Natural Language Queries Challenge 2022
and 8 more not named here
build_vocab_from_pkl 1 other paper
1 later
aaai_28177 (2024 (year only))
Towards Balanced Alignment: Modal-Enhanced Semantic Modeling for Video Moment Retrieval
gen_sineembed_for_position 1 other paper
1 later
aaai_28177 (2024 (year only))
Towards Balanced Alignment: Modal-Enhanced Semantic Modeling for Video Moment Retrieval
merge_state_dict_with_module 1 other paper
1 later
aaai_28177 (2024 (year only))
Towards Balanced Alignment: Modal-Enhanced Semantic Modeling for Video Moment Retrieval
state_dict_without_module 1 other paper
1 later
aaai_28177 (2024 (year only))
Towards Balanced Alignment: Modal-Enhanced Semantic Modeling for Video Moment Retrieval

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

Video Moment Retrieval (VMR) aims to retrieve temporal segments in untrimmed videos corresponding to a given language query by constructing cross-modal alignment strategies. However, these existing strategies are often sub-optimal since they ignore the modality imbalance problem, \textit{i.e.}, the semantic richness inherent in videos far exceeds that of a given limited-length sentence. Therefore, in pursuit of better alignment, a natural idea is enhancing the video modality to filter out query-irrelevant semantics, and enhancing the text modality to capture more segment-relevant knowledge. In this paper, we introduce Modal-Enhanced Semantic Modeling (MESM), a novel framework for more balanced alignment through enhancing features at two levels. First, we enhance the video modality at the frame-word level through word reconstruction. This strategy emphasizes the portions associated with query words in frame-level features while suppressing irrelevant parts. Therefore, the enhanced video contains less redundant semantics and is more balanced with the textual modality. Second, we enhance the textual modality at the segment-sentence level by learning complementary knowledge from context sentences and ground-truth segments. With the knowledge added to the query, the textual modality thus maintains more meaningful semantics and is more balanced with the video modality. By implementing two levels of MESM, the semantic information from both modalities is more balanced to align, thereby bridging the modality gap. Experiments on three widely used benchmarks, including the out-of-distribution settings, show that the proposed framework achieves a new start-of-the-art performance with notable generalization ability (e.g., 4.42% and 7.69% average gains of R1@0.7 on Charades-STA and Charades-CG). The code will be available at https://github.com/lntzm/MESM.

For agents

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

get_harvested_code_for_paper("2312.12155")
get_code_for_paper("2312.12155")
have("2312.12155")

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

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

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

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

Connect an agent — have() is free.