Papers › SA²VP: Spatially Aligned-and-Adapted Visual Prompt

SA²VP: Spatially Aligned-and-Adapted Visual Prompt

16 Dec 2023arXiv:2312.10376archive 2025-07-28

Wenjie Pei, Tongqi Xia, Fanglin Chen, Jinsong Li, Jiandong Tian, Guangming Lu

As a prominent parameter-efficient fine-tuning technique in NLP, prompt tuning is being explored its potential in computer vision. Typical methods for visual prompt tuning follow the sequential modeling paradigm stemming from NLP, which represents an input image as a flattened sequence of token embeddings and then learns a set of unordered parameterized tokens prefixed to the sequence representation as the visual prompts for task adaptation of large vision models. While such sequential modeling paradigm of visual prompt has shown great promise, there are two potential limitations. First, the learned visual prompts cannot model the underlying spatial relations in the input image, which is crucial for image encoding. Second, since all prompt tokens play the same role of prompting for all image tokens without distinction, it lacks the fine-grained prompting capability, i.e., individual prompting for different image tokens. In this work, we propose the \mymodel model (SA²VP), which learns a two-dimensional prompt token map with equal (or scaled) size to the image token map, thereby being able to spatially align with the image map. Each prompt token is designated to prompt knowledge only for the spatially corresponding image tokens. As a result, our model can conduct individual prompting for different image tokens in a fine-grained manner. Moreover, benefiting from the capability of preserving the spatial structure by the learned prompt token map, our SA²VP is able to model the spatial relations in the input image, leading to more effective prompting. Extensive experiments on three challenging benchmarks for image classification demonstrate the superiority of our model over other state-of-the-art methods for visual prompt tuning. Code is available at https://github.com/tommy-xq/SA2VP.

PaperPDFCodeCode Syntology ran

In Syntology View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.

Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, on Syntology's MCP service (how to connect):

Code

Syntology 14 code samples: 10 from 1 repository linked to this paper, 4 identical to code harvested from another paper's repository. Across all 14: 14 ran (of which 0 constructed an object rather than computing a result; 9 with no instrument failure: 2 honoured, 2 violated, 5 with no contract checked; 5 where Syntology's instrument failed) · 0 unverified. Where Syntology's instrument failed: 3 where our contract draft was wrong; 2 where the contract check could not run; failures of Syntology's instrument, not of the code.

By repository: official repository: 10 samples from 1 repository, 10 ran (9 with no instrument failure; 1 where Syntology's instrument failed); 4 identical to code first harvested elsewhere. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

Levels written between 2026-09-22 and 2026-09-25 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed. 2 of the 14 samples that ran have no recorded date.

tommy-xq/sa2vp officialmentioned in papermentioned on GitHubpytorchMITSyntology: 10 samples, 10 ran (1 instrument-failed) · 0 unverified report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

14 samples harvested: 14 ran (of which 0 constructed an object rather than computing a result; 9 with no instrument failure: 2 honoured, 2 violated, 5 with no contract checked; 5 where Syntology's instrument failed) · 0 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page last changed ; when this build read Syntology's graph is in the build record. That date is not when the samples ran.

2ran · honoured contract
2ran · violated contract
3ran · our draft was wrong
2ran; the contract check could not run
5ran

Licence: 10 of the 14 samples are pointer only, meaning Syntology does not serve that copy's text. For 6 of them, this paper's copy is under a permissive licence and cleared, but the stored copy of the same code that Syntology serves is not; the licence label's tooltip gives Syntology's recorded reason. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from tommy-xq/sa2vp. 4 samples are listed last, in a group without a repository. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.

Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of six reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity. A census tag appears when Syntology's census ran implementations with that name on one shared input per bucket: it gives how many were compared, from how many papers, and how many distinct outputs they produced, and names this sample's bucket when this sample was one of them.

tommy-xq/sa2vp official repository 10 samples, 10 ran (1 instrument-failed) · 0 unverified
cosine_scheduler in 74 papers utils.py ran · honoured contract MIT (permissive) here; the stored copy is pointer only · b700fb0a3496b255 · report fixture: signature base_value:float/0/float, final_value:float/0/float, epochs:int/0/int, niter_per_ep:int/0/int, warmup_epochs:int/0/int, start_warmup_value:float/0/float, warmup_steps:int/0/int · returned ndarray · level recorded 2026-09-25
cosine_scheduler_epoch utils.py ran MIT (permissive) · 7468079f7c4e2b5e · report fixture: signature base_value:float/0/float, final_value:float/0/float, epochs:int/0/int, niter_per_ep:int/0/int, warmup_epochs:int/0/int, start_warmup_value:float/0/float, warmup_steps:int/0/int · returned ndarray · level recorded 2026-09-24
find_best_lrwd in 6 papers vpt_main/tune_vtab.py ran MIT (permissive) here; the stored copy is pointer only · 3e009472c0d2fa50 · report fixture: signature files:list/1/str, data_name:str/0/str · returned tuple · level recorded 2026-09-25
get_loss_scale_for_deepspeed in 20 papers engine_for_train.py ran · honoured contract MIT (permissive) here; the stored copy is pointer only · 29416043c7035e7c · report fixture: signature model:callable/0/? · returned float · level recorded 2026-09-25
get_num_layer_for_vit in 23 papers optim_factory.py ran fingerprinted MIT (permissive) · a3448702d6025ce6 · report fixture: signature var_name:str/0/str, num_max_layer:int/0/int · returned int · level recorded 2026-09-24
get_parameter_groups in 30 papers optim_factory.py ran MIT (permissive) here; the stored copy is pointer only · 0ef0019514eaaa09 · report fixture: signature model:callable/0/?, weight_decay:float/0/float, skip_list:tuple/1/empty, get_num_layer:callable/0/?, get_layer_scale:callable/0/? · returned list · level recorded 2026-09-25
has_file_allowed_extension in 38 papers dataset_folder.py ran · violated contract MIT (permissive) here; the stored copy is pointer only · 18ae3e6ef2cf02ec · report fixture: signature filename:str/0/str, extensions:tuple/1/str · returned bool · level recorded 2026-09-24
is_image_file in 157 papers dataset_folder.py ran · violated contract MIT (permissive) here; the stored copy is pointer only · 8ac50ae8773b9431 · report fixture: signature filename:str/0/str · returned bool · level recorded 2026-09-24
make_dataset in 144 papers dataset_folder.py ran · our draft was wrong MIT (permissive) · fb6aea1653b20bba · report fixture: signature directory:str/0/str, class_to_idx:dict/0/?, extensions:tuple/1/str, is_valid_file:NoneType/0/? · returned list · level recorded 2026-09-24
train_class_batch in 17 papers engine_for_train.py ran MIT (permissive) · d15b621dd834bc4f · report fixture: signature model:callable/0/?, samples:Tensor/2/float, target:Tensor/2/float, criterion:callable/0/? · returned tuple · level recorded 2026-09-24
Repository not located 4 samples, 4 ran (4 instrument-failed) · 0 unverified
4 samples are identical to code Syntology harvested from another paper's repository; this paper's own copy was not located, so no repository is named and no licence is recorded.
np2th in 31 papers
census: 2 implementations from 9 papers, 1 distinct output on one shared input this sample: bucket 1 of 1, arg 1: rank 4, kind float, dtype float32
repository not located ran; the contract check could not run (RAISES) · metamorphic tier: invariant licence of this copy not recorded · 7d8eaf5537f699e4 · report fixture: signature weights:ndarray/4/float, conv:bool/0/bool · returned Tensor · level recorded, date not recorded
swish in 258 papers
census: 14 implementations from 37 papers, 2 distinct outputs on one shared input this sample: bucket 1 of 1, arg 1: rank 2, kind float, dtype float32
repository not located ran · our draft was wrong fingerprinted licence of this copy not recorded · 0f786c407fb1ee4c · report fixture: signature x:Tensor/2/float · returned Tensor · level recorded, date not recorded
window_partition in 377 papers
census: 13 implementations from 17 papers, 5 distinct outputs across 3 buckets, one shared input per bucket
repository not located ran; the contract check could not run (RAISES) · metamorphic tier: invariant fingerprinted licence of this copy not recorded · f9fd6241d935f07b · report fixture: signature x:Tensor/4/float, window_size:int/0/int · returned Tensor · level recorded 2026-09-22
window_reverse in 296 papers repository not located ran · our draft was wrong licence of this copy not recorded · fb32094c6dbece71 · report fixture: signature windows:Tensor/4/float, window_size:int/0/int, H:int/0/int, W:int/0/int · returned Tensor · level recorded 2026-09-22

Tasks

Image ClassificationVisual Prompt Tuningimage-classificationparameter-efficient fine-tuning

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

ALIGNSET

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections