SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2504.20860 · ICCV · 2025

FedMVP: Federated Multimodal Visual Prompt Tuning for Vision-Language Models

Elisa Ricci, Biplab Banerjee, Subhankar Roy, Moloud Abdar, Mainak Singha, Ankit Jha, Sarthak Mehrotra

arXiv · PDF · Open in the Atlas

Code that ran

6 of 10 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 4 have no contract verdict; 2 failures of our instrument; 4 no recorded run), measured 2026-11-24; 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/2504.20860.json · badge: /api/ran/2504.20860.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
mainaksingha01/FedMVP community
Papers with Code archive
5 ran · 4 no recorded run
copy not recorded community
not in the paper's declared repositories
1 ran · 0 no recorded run
FunctionStatusWhere it lives
CrossAttention Ran
ran on a synthesized input
mainaksingha01/FedMVP/model/FedMVP.py
code served (permissive licence) · get_code("172f846498770187")
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, shape (2, 5, 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
from torch.nn import functional as F

def exists(val):
    return val is not None

class GEGLU(nn.Module):
    def forward(self, x):
        x, gates = x.chunk(2, dim=-1)
        return x * F.gelu(gates)

class FeedForward(nn.Module):
    def __init__(self, dim, mult=4):
        super().__init__()
        self.net = nn.Sequential(
            nn.LayerNorm(dim),
            nn.Linear(dim, dim * mult * 2),
            GEGLU(),
            nn.Linear(dim * mult, dim)
        )

    def forward(self, x):
        return self.net(x)

class PreNorm(nn.Module):
    def __init__(self, dim, fn, context_dim=None):
        super().__init__()
        self.fn = fn
        self.norm = nn.LayerNorm(dim)
        self.norm_context = nn.LayerNorm(context_dim) if exists(context_dim) else None

    def forward(self, x_q, x_k=None, x_v=None, **kwargs):
        x_q = self.norm(x_q)
        if exists(x_k):
            x_k = self.norm_context(x_k)
        else:
            x_k = x_q
        return self.fn(x_q, x_k, x_v, **kwargs)

class CrossAttention(nn.Module):
    def __init__(self, latent_dim, kv_dim, cross_heads=4, seq_dropout_prob=0.0):
        super().__init__()
        self.seq_dropout_prob = seq_dropout_prob
        self.cross_attend_blocks = nn.ModuleList([
            PreNorm(
                latent_dim,
                nn.MultiheadAttention(
                    latent_dim,
                    num_heads=cross_heads,
                    kdim=kv_dim,
                    vdim=kv_dim,
                    dropout=seq_dropout_prob,
                    batch_first=True
                ),
                context_dim=kv_dim
            ),
            FeedForward(latent_dim)
        ])

    def forward(self, query, key, value, mask=None):
        cross_attn, cross_ff = self.cross_attend_blocks
        x, _ = cross_attn(query, key, value, key_padding_mask=mask)
        x = cross_ff(x) + x
        return x

INIT_ARGS = {
    'latent_dim': 4,
    'kv_dim': 3,
    'cross_heads': 2,
    'seq_dropout_prob': 0.0
}

ARGS = {
    'query': torch.randn(2, 5, 4),
    'key': torch.randn(2, 6, 3),
    'value': torch.randn(2, 6, 3),
    'mask': None
}

if __name__ == '__main__':
    model = CrossAttention(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Expected shape: (2, 5, 4)")
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, shape (2, 5, 4) — shape (2, 5, 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)
CrossLoRAparams Ran
ran on a synthesized input
mainaksingha01/FedMVP/model/FedMVP.py
code served (permissive licence) · get_code("e99b2e23d1713a05")
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 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 as nn

class CrossLoRAparams(nn.Module):

    def __init__(self, dtype):
        super().__init__()
        self.cross_queryA = nn.Parameter(torch.randn(768, 8, dtype=dtype) * 0.02)
        self.cross_queryB = nn.Parameter(torch.randn(8, 768, dtype=dtype) * 0.02)
        self.cross_keyA = nn.Parameter(torch.randn(768, 8, dtype=dtype) * 0.02)
        self.cross_keyB = nn.Parameter(torch.randn(8, 768, dtype=dtype) * 0.02)
        self.cross_valueA = nn.Parameter(torch.randn(768, 8, dtype=dtype) * 0.02)
        self.cross_valueB = nn.Parameter(torch.randn(8, 768, dtype=dtype) * 0.02)

    def forward(self):
        return (self.cross_queryA, self.cross_queryB, self.cross_keyA, self.cross_keyB, self.cross_valueA, self.cross_valueB)


INIT_ARGS = {
    'dtype': torch.float32
}

ARGS = {}

model = CrossLoRAparams(**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 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
FeedForward Ran
ran on a synthesized input
mainaksingha01/FedMVP/model/FedMVP.py
code served (permissive licence) · get_code("0a53822227b596ff")
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, 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 torch.nn as nn
from torch.nn import functional as F

class GEGLU(nn.Module):

    def forward(self, x):
        x, gates = x.chunk(2, dim=-1)
        return x * F.gelu(gates)

class FeedForward(nn.Module):

    def __init__(self, dim, mult=4):
        super().__init__()
        self.net = nn.Sequential(nn.LayerNorm(dim), nn.Linear(dim, dim * mult * 2), GEGLU(), nn.Linear(dim * mult, dim))

    def forward(self, x):
        return self.net(x)


INIT_ARGS = {
    'dim': 4,
    'mult': 4,
}

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

if __name__ == '__main__':
    model = FeedForward(**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 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
GEGLU Ran
ran on a synthesized input
mainaksingha01/FedMVP/model/FedMVP.py
code served (permissive licence) · get_code("a23cbed08cdc0263")
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
from torch.nn import functional as F

class GEGLU(nn.Module):

    def forward(self, x):
        x, gates = x.chunk(2, dim=-1)
        return x * F.gelu(gates)


INIT_ARGS = {}

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

if __name__ == '__main__':
    model = GEGLU(**INIT_ARGS)
    output = model(**ARGS)
    print(output.shape)
    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)
aggregate_similarity Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
this paper's copy was not recorded; identical code first harvested from sachit-menon/classify_by_description_release
pointer only; the stored copy get_code serves, from sachit-menon/classify_by_description_release, is pointer only (licence: NONE) · get_code("3936ee935ec8fce1")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

truncate_text Ran
ran; our contract draft was wrong, not the code
mainaksingha01/FedMVP/model/FedMVP.py
code served (permissive licence) · get_code("d087afcbd5eb3bb4")
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 str. 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)

# The function truncate_text takes two parameters:
# - text: a string to be truncated
# - max_length: an integer specifying the maximum length

# The function simply returns text[:max_length], so we need:
# 1. A string for 'text'
# 2. An integer for 'max_length'

ARGS = {
    "text": "Hello, this is a sample text that will be truncated",
    "max_length": 15
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
FedMVP Not yet run
unverified (harvested, no recorded run)
mainaksingha01/FedMVP/model/FedMVP.py
code served (permissive licence) · get_code("36f62f5811cd81e9")
How it ran

no invocation recorded.

PreNorm Not yet run
unverified (harvested, no recorded run)
mainaksingha01/FedMVP/model/FedMVP.py
code served (permissive licence) · get_code("2a10953d1305213b")
How it ran

no invocation recorded.

PromptLearner Not yet run
unverified (harvested, no recorded run)
mainaksingha01/FedMVP/model/FedMVP.py
code served (permissive licence) · get_code("55833832ffbbb22b")
How it ran

no invocation recorded.

compute_description_encodings Not yet run
unverified (harvested, no recorded run)
mainaksingha01/FedMVP/model/FedMVP.py
code served (permissive licence) · get_code("c6d194bed3b55b54")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 1 later) and 8 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
GEGLU
brick of this paper's assembly: helper
11 other papers
10 dated earlier, 1 later · 5 only as an assembly brick
1706.03762 (2017-06)
Attention Is All You Need
2102.05095 (2021-02)
Is Space-Time Attention All You Need for Video Understanding?
2103.03206 (2021-03)
Perceiver: General Perception with Iterative Attention
and 8 more not named here
aggregate_similarity
brick of this paper's assembly: helper
2 other papers
2 dated earlier
2210.07183 (2022-10)
Visual Classification via Description from Large Language Models
2407.14412 (2024-07)
DEAL: Disentangle and Localize Concept-level Explanations for VLMs

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

In federated learning, textual prompt tuning adapts Vision-Language Models (e.g., CLIP) by tuning lightweight input tokens (or prompts) on local client data, while keeping network weights frozen. After training, only the prompts are shared by the clients with the central server for aggregation. However, textual prompt tuning suffers from overfitting to known concepts, limiting its generalizability to unseen concepts. To address this limitation, we propose Multimodal Visual Prompt Tuning (FedMVP) that conditions the prompts on multimodal contextual informationderived from the input image and textual attribute features of a class. At the core of FedMVP is a PromptFormer module that synergistically aligns textual and visual features through a cross-attention mechanism. The dynamically generated multimodal visual prompts are then input to the frozen vision encoder of CLIP, and trained with a combination of CLIP similarity loss and a consistency loss. Extensive evaluation on 20 datasets, spanning three generalization settings, demonstrates that FedMVP not only preserves performance on in-distribution classes and domains, but also displays higher generalizability to unseen classes and domains, surpassing state-of-the-art methods by a notable margin of +1.57% -2.26%. Code is available at https: //github.com/mainaksingha01/FedMVP.

For agents

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

get_harvested_code_for_paper("2504.20860")
get_code_for_paper("2504.20860")
have("2504.20860")

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

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

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

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

Connect an agent — have() is free.