SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2212.03220 · 2022

Visual Query Tuning: Towards Effective Usage of Intermediate Representations for Parameter and Memory Efficient Transfer Learning

arXiv · PDF · Open in the Atlas

Code that ran

3 of 5 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 1 has no contract verdict; 1 failure of our instrument; 2 no recorded run), measured 2026-11-21; 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/2212.03220.json · badge: /api/ran/2212.03220.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
andytu28/VQT canonical (classifier label)
classifier basis not recorded on the link
2 ran · 2 no recorded run
arkel23/clca extension (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
FunctionStatusWhere it lives
find_best_lrwd Ran
ran, honoured the contract we drafted
andytu28/VQT/tune_vtab.py
pointer only (licence: BSD-3-Clause); the stored copy get_code serves, from runtsang/VFPT, is pointer only (licence: NOASSERTION) · get_code("3e009472c0d2fa50")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (BSD-3-Clause), but get_code serves the stored copy, first harvested from runtsang/VFPT, 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.

find_best_lrwd Ran
ran on a synthesized input
andytu28/VQT/head2toe_sparsity_train.py
code served (permissive licence) · get_code("51201372d14e1a56")
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. 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 tempfile
import os

torch.manual_seed(0)

# Create temporary directory for test files
temp_dir = tempfile.mkdtemp()

# Create mock result dictionaries and save them as torch files
# File 1: lr=0.01, wd=0.0001, val_acc=0.95
results_dict_1 = {
    'epoch_0': {
        'classification': {
            'val_imagenet': {'top1': 0.85}
        }
    },
    'epoch_1': {
        'classification': {
            'val_imagenet': {'top1': 0.90}
        }
    },
    'epoch_2': {
        'classification': {
            'val_imagenet': {'top1': 0.95}
        }
    }
}
file_1 = os.path.join(temp_dir, 'lr0.01_wd0.0001_bs32/run_0/checkpoint.pt')
os.makedirs(os.path.dirname(file_1), exist_ok=True)
torch.save(results_dict_1, file_1)

# File 2: lr=0.001, wd=0.0005, val_acc=0.96 (better)
results_dict_2 = {
    'epoch_0': {
        'classification': {
            'val_imagenet': {'top1': 0.88}
        }
    },
    'epoch_1': {
        'classification': {
            'val_imagenet': {'top1': 0.92}
        }
    },
    'epoch_2': {
        'classification': {
            'val_imagenet': {'top1': 0.96}
        }
    }
}
file_2 = os.path.join(temp_dir, 'lr0.001_wd0.0005_bs32/run_0/checkpoint.pt')
os.makedirs(os.path.dirname(file_2), exist_ok=True)
torch.save(results_dict_2, file_2)

# File 3: lr=0.0005, wd=0.0005, val_acc=0.96 (same as file_2 but lower lr)
results_dict_3 = {
    'epoch_0': {
        'classification': {
            'val_imagenet': {'top1': 0.87}
        }
    },
    'epoch_1': {
        'classification': {
            'val_imagenet': {'top1': 0.91}
        }
    },
    'epoch_2': {
        'classification': {
            'val_imagenet': {'top1': 0.96}
        }
    }
}
file_3 = os.path.join(temp_dir, 'lr0.0005_wd0.0005_bs32/run_0/checkpoint.pt')
os.makedirs(os.path.dirname(file_3), exist_ok=True)
torch.save(results_dict_3, file_3)

ARGS = {
    'files': [file_1, file_2, file_3],
    'data_name': 'imagenet'
}
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
resize_pos_embed Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
arkel23/clca/models/vit_vqt.py
code served (permissive licence) · get_code("900ed88360f3d92f")
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 Tensor, ndim 3, dtype family float, shape (1, 17, 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)

# Create position embeddings for the old model
# Shape: (batch=1, num_tokens, embedding_dim)
# With num_prefix_tokens=1, we have 1 prefix token + 8 grid tokens (2x2 grid -> 4 tokens, but we'll use 9 total for 3x3)
# Actually, let's use 10 tokens: 1 prefix + 9 grid (3x3)
posemb = torch.randn(1, 10, 4)  # 1 prefix + 9 grid tokens, dim=4

# Create new position embeddings shape
# Let's say we want to resize to a 4x4 grid + 1 prefix = 17 tokens
posemb_new = torch.randn(1, 17, 4)  # 1 prefix + 16 grid tokens (4x4), dim=4

num_prefix_tokens = 1

# New grid size (4x4)
gs_new = (4, 4)

interpolation = 'bicubic'

antialias = False

ARGS = {
    'posemb': posemb,
    'posemb_new': posemb_new,
    'num_prefix_tokens': num_prefix_tokens,
    'gs_new': gs_new,
    'interpolation': interpolation,
    'antialias': antialias,
}
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 Tensor, ndim 3, dtype family float, shape (1, 17, 4) — shape (1, 17, 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
build_h2t_vit_sup_models Not yet run
unverified (harvested, no recorded run)
andytu28/VQT/src/models/build_h2t_model.py
code served (permissive licence) · get_code("639c2af1a7aac898")
How it ran

no invocation recorded.

get_lrwd_range Not yet run
unverified (harvested, no recorded run)
andytu28/VQT/head2toe_train.py
code served (permissive licence) · get_code("525deef23c0f7494")
How it ran

no invocation recorded.

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 distinct functions with an identity, 2 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 2 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
find_best_lrwd 5 other papers
5 later
2307.13770 (2023-07)
(d) Ours (c) Prompt tuning
2312.10376 (2023-12)
STA-VPT: SpatioTemporally Aligned Visual Prompt Tuning
aaai_28243 (2024 (year only))
SA 2 VP: Spatially Aligned-and-Adapted Visual Prompt
and 2 more not named here
resize_pos_embed 1 other paper
1 later
2406.18051 (2024-06)
ViT-1.58b: Mobile Vision Transformers in the 1-bit Era

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-21.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Intermediate features of a pre-trained model have been shown informative for making accurate predictions on downstream tasks, even if the model backbone is kept frozen. The key challenge is how to utilize these intermediate features given their gigantic amount. We propose visual query tuning (VQT), a simple yet effective approach to aggregate intermediate features of Vision Transformers. Through introducing a handful of learnable ``query'' tokens to each layer, VQT leverages the inner workings of Transformers to ``summarize'' rich intermediate features of each layer, which can then be used to train the prediction heads of downstream tasks. As VQT keeps the intermediate features intact and only learns to combine them, it enjoys memory efficiency in training, compared to many other parameter-efficient fine-tuning approaches that learn to adapt features and need back-propagation through the entire backbone. This also suggests the complementary role between VQT and those approaches in transfer learning. Empirically, VQT consistently surpasses the state-of-the-art approach that utilizes intermediate features for transfer learning and outperforms full fine-tuning in many cases. Compared to parameter-efficient approaches that adapt features, VQT achieves much higher accuracy under memory constraints. Most importantly, VQT is compatible with these approaches to attain even higher accuracy, making it a simple add-on to further boost transfer learning.

For agents

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

get_harvested_code_for_paper("2212.03220")
get_code_for_paper("2212.03220")
have("2212.03220")

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

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

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

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

Connect an agent — have() is free.