SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2303.08138 · CVPR · 2023

Diversity-Aware Meta Visual Prompting

Xiaoyi Dong, Dongdong Chen, Weiming Zhang, Nenghai Yu, Feifei Wang, Gang Hua, Qidong Huang

arXiv · PDF · Open in the Atlas

Code that ran

7 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; 0 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 4 failures of our instrument; 0 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/2303.08138.json · badge: /api/ran/2303.08138.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
shikiw/DAM-VP canonical (classifier label)
classifier basis not recorded on the link
7 ran · 0 no recorded run
FunctionStatusWhere it lives
fixed_patch Ran
ran; our contract draft was wrong, not the code
shikiw/DAM-VP/models/prompters.py
code served (permissive licence) · get_code("fe803eb0c1276891")
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 FixedPatchPrompter. 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 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)

class Args:
    def __init__(self, image_size, prompt_size):
        self.image_size = image_size
        self.prompt_size = prompt_size

ARGS = {
    'args': Args(image_size=8, prompt_size=4)
}
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 FixedPatchPrompter — a FixedPatchPrompter output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a FixedPatchPrompter 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
get_dataset_classes Ran
ran on a synthesized input
shikiw/DAM-VP/data_utils/loader.py
code served (permissive licence) · get_code("0704fe8dcb551efd")
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 list, ndim 1, 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 numpy as np

torch.manual_seed(0)

class DatasetWithClasses:
    """Dataset with 'classes' attribute."""
    def __init__(self):
        self.classes = ['cat', 'dog', 'bird']

class DatasetWithClassIds:
    """Dataset with '_class_ids' attribute."""
    def __init__(self):
        self._class_ids = [0, 1, 2, 3]

class DatasetWithLabels:
    """Dataset with 'labels' attribute."""
    def __init__(self):
        self.labels = ['class_a', 'class_b', 'class_c', 'class_d', 'class_e']

# Use the first variant for the main test
dataset = DatasetWithClasses()

ARGS = {
    'dataset': dataset
}
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 list, ndim 1, dtype family float — a list 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
get_transforms Ran
ran on a synthesized input
shikiw/DAM-VP/data_utils/transforms.py
code served (permissive licence) · get_code("6edbfc9b90401b1e")
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 Compose. 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 torchvision as tv

ARGS = {
    'split': 'train',
    'size': 224,
    'pretrained_model': 'resnet50'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Compose — a Compose output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Compose 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
load_model_to_device Ran
ran on a synthesized input
shikiw/DAM-VP/models/builder.py
code served (permissive licence) · get_code("8dfb98b7312109ac")
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, 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 torch.nn as nn

torch.manual_seed(0)

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

class Args:
    def __init__(self, num_gpus=1):
        self.num_gpus = num_gpus

model = SimpleModel()
args = Args(num_gpus=1)

ARGS = {
    "model": model,
    "args": args
}
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, 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
padding Ran
ran; our contract draft was wrong, not the code
shikiw/DAM-VP/models/prompters.py
code served (permissive licence) · get_code("0076091e5644c4a0")
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 PadPrompter. 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)

class Args:
    def __init__(self, prompt_size, crop_size):
        self.prompt_size = prompt_size
        self.crop_size = crop_size

args = Args(prompt_size=2, crop_size=8)

ARGS = {"args": args}
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 PadPrompter — a PadPrompter output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a PadPrompter 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
random_patch Ran
ran; our contract draft was wrong, not the code
shikiw/DAM-VP/models/prompters.py
code served (permissive licence) · get_code("5debe27f7868e61c")
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 RandomPatchPrompter. 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 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 numpy as np

torch.manual_seed(0)

class ArgsConfig:
    def __init__(self, image_size, prompt_size):
        self.image_size = image_size
        self.prompt_size = prompt_size

ARGS = {
    "args": ArgsConfig(image_size=16, prompt_size=4)
}
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 RandomPatchPrompter — a RandomPatchPrompter output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a RandomPatchPrompter 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
refine_classname Ran
ran; our contract draft was wrong, not the code
shikiw/DAM-VP/meta-training/main_clip.py
pointer only (licence: MIT); the stored copy get_code serves, from s-enmt/MMFT, is pointer only (licence: NOASSERTION) · get_code("b32782e33156c848")
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 s-enmt/MMFT, 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.

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, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 4 later) and 3 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
fixed_patch 7 other papers
1 dated earlier, 6 later
2203.17274 (2022-03)
Exploring Visual Prompts for Adapting Large-Scale Models
2312.08010 (2023-12)
EZ-CLIP: Efficient Zeroshot Video Action Recognition
2401.04350 (2024-01)
Pre-trained Model Guided Fine-Tuning for Zero-Shot Adversarial Robustness
and 4 more not named here
padding 7 other papers
1 dated earlier, 6 later
2203.17274 (2022-03)
Exploring Visual Prompts for Adapting Large-Scale Models
2312.08010 (2023-12)
EZ-CLIP: Efficient Zeroshot Video Action Recognition
2401.04350 (2024-01)
Pre-trained Model Guided Fine-Tuning for Zero-Shot Adversarial Robustness
and 4 more not named here
random_patch 6 other papers
1 dated earlier, 5 later
2203.17274 (2022-03)
Exploring Visual Prompts for Adapting Large-Scale Models
2312.08010 (2023-12)
EZ-CLIP: Efficient Zeroshot Video Action Recognition
2401.04350 (2024-01)
Pre-trained Model Guided Fine-Tuning for Zero-Shot Adversarial Robustness
and 3 more not named here
refine_classname 3 other papers
2 dated earlier, 1 later
2203.17274 (2022-03)
Exploring Visual Prompts for Adapting Large-Scale Models
2212.10556 (2022-12)
Unleashing the Power of Visual Prompting At the Pixel Level
2601.21426 (2026-01)
MultiModal Fine-tuning with Synthetic Captions

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

We present Diversity-Aware Meta Visual Prompting (DAM-VP), an efficient and effective prompting method for transferring pre-trained models to downstream tasks with frozen backbone. A challenging issue in visual prompting is that image datasets sometimes have a large data diversity whereas a per-dataset generic prompt can hardly handle the complex distribution shift toward the original pretraining data distribution properly. To address this issue, we propose a dataset Diversity-Aware prompting strategy whose initialization is realized by a Meta-prompt. Specifically, we cluster the downstream dataset into small homogeneity subsets in a diversity-adaptive way, with each subset has its own prompt optimized separately. Such a divide-and-conquer design reduces the optimization difficulty greatly and significantly boosts the prompting performance. Furthermore, all the prompts are initialized with a meta-prompt, which is learned across several datasets. It is a bootstrapped paradigm, with the key observation that the prompting knowledge learned from previous datasets could help the prompt to converge faster and perform better on a new dataset. During inference, we dynamically select a proper prompt for each input, based on the feature distance between the input and each subset. Through extensive experiments, our DAM-VP demonstrates superior efficiency and effectiveness, clearly surpassing previous prompting methods in a series of downstream datasets for different pretraining models. Our code is available at: https://github.com/shikiw/DAM-VP.

For agents

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

get_harvested_code_for_paper("2303.08138")
get_code_for_paper("2303.08138")
have("2303.08138")

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

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

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

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

Connect an agent — have() is free.