SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2308.07686 · ICCV · 2023

Boosting Multi-modal Model Performance with Adaptive Gradient Modulation

Yi Zhou, Xingyu Li, Hong Li, Chunxiao Li, Pengbo Hu, Yinuo Lei

arXiv · PDF · Open in the Atlas

Code that ran

10 of 15 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 6 have no contract verdict; 4 failures of our instrument; 5 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/2308.07686.json · badge: /api/ran/2308.07686.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
lihong2303/agm_iccv2023 canonical (classifier label)
classifier basis: census
4 ran · 1 no recorded run
lihong2303/AGM_ICCV2023 community
Papers with Code archive
6 ran · 4 no recorded run
FunctionStatusWhere it lives
AVGA Ran
ran on a synthesized input
lihong2303/AGM_ICCV2023/model/AVE_net.py
code served (permissive licence) · get_code("aafb78dc73a6b848")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 3, dtype family float; no output shape is stated. The image it ran in was 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 torch.nn as nn

# Instantiate the AVGA module
INIT_ARGS = {
    'a_dim': 128,
    'v_dim': 512,
    'hidden_size': 256,
    'map_size': 49
}

# Create input tensors for forward pass
# audio shape: (batch, time, a_dim)
# video shape: (batch, time, spatial, v_dim)
batch_size = 2
time_steps = 3
spatial_dim = 7  # 7x7 = 49 spatial locations (map_size)
a_dim = 128
v_dim = 512

audio = torch.randn(batch_size, time_steps, a_dim)
video = torch.randn(batch_size, time_steps, spatial_dim * spatial_dim, v_dim)

ARGS = {
    'audio': audio,
    'video': video
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
AVSimilarity Ran
ran on a synthesized input
lihong2303/AGM_ICCV2023/model/AVE_net.py
code served (permissive licence) · get_code("c31fa6db2f989e02")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 1, dtype family float, shape (2,) 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 torch.nn as nn
import torch.nn.functional as F

class AVSimilarity(nn.Module):
    """
    function to compute audio-visual simility.
    """

    def __init__(self):
        super(AVSimilarity, self).__init__()

    def forward(self, v_fea, a_fea):
        v_fea = F.normalize(v_fea, dim=-1)
        a_fea = F.normalize(a_fea, dim=-1)
        cos_simm = torch.sum(torch.mul(v_fea, a_fea), dim=-1)
        return cos_simm


INIT_ARGS = {}

ARGS = {
    'v_fea': torch.randn(2, 4),
    'a_fea': torch.randn(2, 4),
}

if __name__ == '__main__':
    model = AVSimilarity(**INIT_ARGS)
    output = model(**ARGS)
    print("Output shape:", output.shape)
    print("Output:", output)
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 1, dtype family float, shape (2,) — shape (2,) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
Classify Ran
ran on a synthesized input
lihong2303/AGM_ICCV2023/model/AVE_net.py
code served (permissive licence) · get_code("a38cd2fd289e8d54")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 2, dtype family float, shape (2, 28) 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 torch.nn as nn

INIT_ARGS = {
    'hidden_dim': 256,
    'category_num': 28,
}

ARGS = {
    'feature': torch.randn(2, 256),
}

if __name__ == '__main__':
    from torch.nn import Module
    
    class Classify(nn.Module):

        def __init__(self, hidden_dim=256, category_num=28):
            super(Classify, self).__init__()
            self.L1 = nn.Linear(hidden_dim, 64, bias=False)
            self.L2 = nn.Linear(64, category_num, bias=False)
            nn.init.xavier_uniform_(self.L1.weight)
            nn.init.xavier_uniform_(self.L2.weight)

        def forward(self, feature):
            out = torch.nn.functional.relu(self.L1(feature))
            out = self.L2(out)
            return out

    model = Classify(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Output: {output}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 2, dtype family float, shape (2, 28) — shape (2, 28) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
Modality_Audio Ran
ran on a synthesized input
lihong2303/AGM_ICCV2023/model/AVE_net.py
code served (permissive licence) · get_code("e36f4b0eccf5a497")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 2, dtype family float; no output shape is stated. The image it ran in was 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 torch.nn as nn

class Modality_Audio(nn.Module):
    def __init__(self):
        super().__init__()

    def forward(self, total_out, pad_visual_out, pad_audio_out):
        return 0.5 * (total_out - pad_audio_out + pad_visual_out)

INIT_ARGS = {}

ARGS = {
    'total_out': torch.randn(2, 4),
    'pad_visual_out': torch.randn(2, 4),
    'pad_audio_out': torch.randn(2, 4)
}

# Call the class
model = Modality_Audio(**INIT_ARGS)
output = model(**ARGS)
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 2, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
Modality_Visual Ran
ran on a synthesized input
lihong2303/AGM_ICCV2023/model/AVE_net.py
code served (permissive licence) · get_code("430f6c316c7ba522")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 2, dtype family float; no output shape is stated. The image it ran in was 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 torch.nn as nn

class Modality_Visual(nn.Module):

    def __init__(self):
        super().__init__()

    def forward(self, total_out, pad_visual_out, pad_audio_out):
        return 0.5 * (total_out - pad_visual_out + pad_audio_out)


INIT_ARGS = {}

ARGS = {
    'total_out': torch.randn(2, 4),
    'pad_visual_out': torch.randn(2, 4),
    'pad_audio_out': torch.randn(2, 4),
}

if __name__ == '__main__':
    model = Modality_Visual(**INIT_ARGS)
    output = model(**ARGS)
    print("Output shape:", output.shape)
    print("Output:", output)
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 2, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
Modality_out Ran
ran on a synthesized input
lihong2303/AGM_ICCV2023/model/AVE_net.py
code served (permissive licence) · get_code("ab2703b195dbc96f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 2, dtype family float, shape (2, 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 torch.nn as nn

class Modality_out(nn.Module):

    def __init__(self):
        super().__init__()

    def forward(self, x):
        return x


INIT_ARGS = {}

ARGS = {
    'x': torch.randn(2, 4)
}

if __name__ == '__main__':
    model = Modality_out(**INIT_ARGS)
    output = model(**ARGS)
    print(output)
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 2, dtype family float, shape (2, 4) — shape (2, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
conv1x1 Ran
ran; our contract draft was wrong, not the code
lihong2303/agm_iccv2023/model/utils/resnet.py
code served (permissive licence) · get_code("d9def42110729a85")
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 Conv2d. 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)

# The function conv1x1 takes in_planes, out_planes, and stride as parameters
# It returns an nn.Conv2d layer configured for 1x1 convolution
# We need to provide valid integer arguments for these parameters

ARGS = {
    "in_planes": 3,
    "out_planes": 64,
    "stride": 1
}
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 Conv2d — a Conv2d output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Conv2d 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
conv3x3 Ran
ran; our contract draft was wrong, not the code
lihong2303/agm_iccv2023/model/utils/resnet.py
code served (permissive licence) · get_code("160bb14bd76201b4")
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 Conv2d. 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)

ARGS = {
    "in_planes": 3,
    "out_planes": 64,
    "stride": 1,
    "groups": 1,
    "dilation": 1,
}
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 Conv2d — a Conv2d output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Conv2d 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
drop_entry Ran
ran; our contract draft was wrong, not the code
lihong2303/agm_iccv2023/dataloader/URFunny_loader.py
code served (permissive licence) · get_code("b58de7ad57448696")
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

# Create a dataset dictionary with 'text' and other modalities
# The function iterates over dataset['text'], calls .sum() on each element,
# and uses np.delete on arrays in the dataset

# Create text data as numpy arrays where each row can be summed
text_data = np.array([
    np.array([1, 2, 3, 4]),      # row 0: sum != 0
    np.array([0, 0, 0, 0]),      # row 1: sum == 0 (will be dropped)
    np.array([1, 1, 1, 1]),      # row 2: sum != 0
    np.array([0, 0, 0, 0]),      # row 3: sum == 0 (will be dropped)
], dtype=object)

# Create other modalities with same number of rows (4 rows, 3 columns each for distinction)
modality_1 = np.random.rand(4, 3)
modality_2 = np.random.rand(4, 5)

dataset = {
    'text': text_data,
    'modality_1': modality_1,
    'modality_2': modality_2,
}

ARGS = {
    'dataset': dataset
}
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
make_mask Ran
ran; our contract draft was wrong, not the code
lihong2303/agm_iccv2023/model/MOSEI_net.py
pointer only (licence: MIT); the stored copy get_code serves, from MRUIL/WeakMCN, is pointer only (licence: NONE) · get_code("e766a0a3063c15d0")
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 MRUIL/WeakMCN, 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.

GradMod Not yet run
unverified (harvested, no recorded run)
lihong2303/AGM_ICCV2023/model/AVE_net.py
code served (permissive licence) · get_code("bec85adae7b780cd")
How it ran

no invocation recorded.

LSTM_A_V Not yet run
unverified (harvested, no recorded run)
lihong2303/AGM_ICCV2023/model/AVE_net.py
code served (permissive licence) · get_code("fb623012ed4c33ad")
How it ran

no invocation recorded.

PSP Not yet run
unverified (harvested, no recorded run)
lihong2303/AGM_ICCV2023/model/AVE_net.py
code served (permissive licence) · get_code("c4b3c64906d5d20e")
How it ran

no invocation recorded.

psp_net Not yet run
unverified (harvested, no recorded run)
lihong2303/AGM_ICCV2023/model/AVE_net.py
code served (permissive licence) · get_code("99749a0d159a5471")
How it ran

no invocation recorded.

resnet18 Not yet run
unverified (harvested, no recorded run)
lihong2303/agm_iccv2023/model/utils/resnet.py
code served (permissive licence) · get_code("9c84dee251170b5d")
How it ran

no invocation recorded.

Also present in other papers' code

Of 15 samples lifted from this paper's linked repositories, 15 carry a function identity and 0 do not. Of the 15 distinct functions with an identity, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 2 the same month, 4 later) and 11 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
conv1x1 431 other papers
274 dated earlier, 9 the same month, 139 later, 8 same year, order not determinable, 1 undated · 38 only as an assembly brick
1409.1556 (2014-09)
Very Deep Convolutional Networks for Large-Scale Image Recognition
1506.01186 (2015-06)
Cyclical Learning Rates for Training Neural Networks
1507.05717 (2015-07)
An End-to-End Trainable Neural Network for Image-based Sequence Recognition and Its Application to Scene Text Recognition
and 428 more not named here
conv3x3 312 other papers
177 dated earlier, 7 the same month, 120 later, 7 same year, order not determinable, 1 undated · 31 only as an assembly brick
1409.1556 (2014-09)
Very Deep Convolutional Networks for Large-Scale Image Recognition
1507.05717 (2015-07)
An End-to-End Trainable Neural Network for Image-based Sequence Recognition and Its Application to Scene Text Recognition
1512.03385 (2015-12)
Deep Residual Learning for Image Recognition
and 309 more not named here
make_mask 7 other papers
4 dated earlier, 3 later
2004.06165 (2020-04)
Oscar: Object-Semantics Aligned Pre-training for Vision-Language Tasks
2006.15955 (2020-06)
A Transformer-based joint-encoding for Emotion Recognition and Sentiment Analysis
2305.14836 (2023-05)
NuScenes-QA: A Multi-modal Visual Question Answering Benchmark for Autonomous Driving Scenario
and 4 more not named here
resnet18 7 other papers
2 dated earlier, 5 later
2203.15332 (2022-03)
Balanced Multimodal Learning via On-the-fly Gradient Modulation
2302.10912 (2023-02)
Balanced Audiovisual Dataset for Imbalance Analysis
2405.09321 (2024-05)
ReconBoost: Boosting Can Achieve Modality Reconcilement
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-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

While the field of multi-modal learning keeps growing fast, the deficiency of the standard joint training paradigm has become clear through recent studies. They attribute the sub-optimal performance of the jointly trained model to the modality competition phenomenon. Existing works attempt to improve the jointly trained model by modulating the training process. Despite their effectiveness, those methods can only apply to late fusion models. More importantly, the mechanism of the modality competition remains unexplored. In this paper, we first propose an adaptive gradient modulation method that can boost the performance of multimodal models with various fusion strategies. Extensive experiments show that our method surpasses all existing modulation methods. Furthermore, to have a quantitative understanding of the modality competition and the mechanism behind the effectiveness of our modulation method, we introduce a novel metric to measure the competition strength. This metric is built on the mono-modal concept, a function that is designed to represent the competition-less state of a modality. Through systematic investigation, our results confirm the intuition that the modulation encourages the model to rely on the more informative modality. In addition, we find that the jointly trained model typically has a preferred modality on which the competition is weaker than other modalities. However, this preferred modality need not dominate others. Our code will be available at https: //github.com/lihong2303/AGM_ICCV2023.

For agents

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

get_harvested_code_for_paper("2308.07686")
get_code_for_paper("2308.07686")
have("2308.07686")

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

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

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

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

Connect an agent — have() is free.