SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2303.14969 · 2023

Universal Few-shot Learning of Dense Prediction Tasks with Visual Token Matching

arXiv · PDF · Open in the Atlas

Code that ran

7 of 12 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; 2 honoured the contract we drafted, 2 violated it and 3 have no contract verdict; 0 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/2303.14969.json · badge: /api/ran/2303.14969.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
gitgyun/visual_token_matching canonical (classifier label)
classifier basis not recorded on the link
7 ran · 5 no recorded run
FunctionStatusWhere it lives
get_reshaper Ran
ran on a synthesized input
gitgyun/visual_token_matching/model/reshape.py
code served (permissive licence) · get_code("48da6c70a0c5a1f0")
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 function. 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
from einops import rearrange, repeat

torch.manual_seed(0)

# The function get_reshaper takes a pattern string for einops rearrange
# It returns a reshaper function that can handle tensors, dicts, tuples, and lists
# We need to test it with a valid einops pattern

ARGS = {
    "pattern": "b h w c -> b (h w) c"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
linear_sample Ran
ran, honoured the contract we drafted
gitgyun/visual_token_matching/dataset/augmentation.py
code served (permissive licence) · get_code("02a0579731cda8c1")
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 float, ndim 0, dtype family float, shape () 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 random

def linear_sample(p_range):
    if isinstance(p_range, float):
        return p_range
    else:
        return p_range[0] + random.random() * (p_range[1] - p_range[0])

# Test with a float value
ARGS = {
    "p_range": 0.5
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () 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
log_sample Ran
ran, honoured the contract we drafted
gitgyun/visual_token_matching/dataset/augmentation.py
code served (permissive licence) · get_code("98a7bede28cc1c47")
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 float, ndim 0, dtype family float, shape () 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 random
import math

# The function log_sample takes a parameter p_range which can be either:
# 1. A float (scalar value)
# 2. A tuple/list with two elements representing a range [min, max]

# Test case 1: p_range as a float
ARGS = {
    "p_range": 0.5
}

# Alternative test case with a range tuple (commented out, but showing the other valid input)
# ARGS = {
#     "p_range": (0.001, 0.1)
# }

# The current ARGS uses a float, which is a valid input to log_sample
# Uncommenting the alternative would also work - it would sample from the range [0.001, 0.1]
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () 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
normalize Ran
ran, violated the contract we drafted
gitgyun/visual_token_matching/dataset/augmentation.py
code served (permissive licence) · get_code("f1aba098ff5cbc05")
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 Tensor, ndim 1, dtype family float, shape (6,) 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

torch.manual_seed(0)

# The function 'normalize' takes a tensor x and normalizes it to [0, 1] range
# It uses: x.max(), x.min(), and arithmetic operations
# We need to provide a tensor with at least one element

x = torch.tensor([1.0, 2.5, 0.5, 3.0, 1.5, 2.0], dtype=torch.float32)

ARGS = {
    "x": x
}
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 Tensor, ndim 1, dtype family float, shape (6,) — shape (6,) 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
parse_BTN Ran
ran on a synthesized input
gitgyun/visual_token_matching/model/reshape.py
code served (permissive licence) · get_code("ad4fc7ecfc06e15f")
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 int; 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

torch.manual_seed(0)

# Test case 1: Tensor input
tensor_input = torch.randn(2, 3, 4)

# Test case 2: Tuple input
tuple_input = (torch.randn(2, 3, 4), torch.randn(2, 3, 4))

# Test case 3: List input
list_input = [torch.randn(2, 3, 4), torch.randn(2, 3, 4)]

# Test case 4: Dict input
dict_input = {
    'key1': torch.randn(2, 3, 4),
    'key2': torch.randn(2, 3, 4)
}

# We'll test with the tensor input as the primary test case
ARGS = {
    'x': tensor_input
}
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 int — 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 Ran
ran on a synthesized input
gitgyun/visual_token_matching/dataset/resize_buildings.py
code served (permissive licence) · get_code("8a5e2f2172266d78")
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 tempfile
import os
from PIL import Image
import numpy as np

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

# Create a small test image and save it
test_image = Image.new('RGB', (100, 100), color='red')
load_path = os.path.join(temp_dir, 'test_input.png')
test_image.save(load_path)

# Define output path
save_path = os.path.join(temp_dir, 'test_output.png')

# Define resize parameters
size = (50, 50)
mode = Image.Resampling.BILINEAR

# Construct the args tuple as expected by the function
args = (load_path, save_path, mode)

ARGS = {
    'args': args
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy — 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
str2bool Ran
ran, violated the contract we drafted
gitgyun/visual_token_matching/args.py
pointer only (licence: MIT); the stored copy get_code serves, from SeongwoongCho/meta-controller, is pointer only (licence: NONE) · get_code("0d5ccf3e418960d3")
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 SeongwoongCho/meta-controller, 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.

create_label_backbone Not yet run
unverified (harvested, no recorded run)
gitgyun/visual_token_matching/model/model_factory.py
code served (permissive licence) · get_code("b52cdf4b0a27435f")
How it ran

no invocation recorded.

forward_6d_as_4d Not yet run
unverified (harvested, no recorded run)
gitgyun/visual_token_matching/model/reshape.py
code served (permissive licence) · get_code("7fcd0270b2c5d231")
How it ran

no invocation recorded.

get_eval_loader Not yet run
unverified (harvested, no recorded run)
gitgyun/visual_token_matching/dataset/dataloader_factory.py
code served (permissive licence) · get_code("7ca5be9c02fa2823")
How it ran

no invocation recorded.

get_train_loader Not yet run
unverified (harvested, no recorded run)
gitgyun/visual_token_matching/dataset/dataloader_factory.py
code served (permissive licence) · get_code("a11b29bac73f5967")
How it ran

no invocation recorded.

get_validation_loaders Not yet run
unverified (harvested, no recorded run)
gitgyun/visual_token_matching/dataset/dataloader_factory.py
code served (permissive licence) · get_code("7ece316758a7a07d")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 4 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 4 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
str2bool 2 other papers
2 later
2404.18459 (2024-04)
Chameleon: A Data-Efficient Generalist for Dense Visual Prediction in the Wild
2412.12147 (2024-12)
Meta-Controller: Few-Shot Imitation of Unseen Embodiments and Tasks in Continuous Control
linear_sample 1 other paper
1 later
2404.18459 (2024-04)
Chameleon: A Data-Efficient Generalist for Dense Visual Prediction in the Wild
log_sample 1 other paper
1 later
2404.18459 (2024-04)
Chameleon: A Data-Efficient Generalist for Dense Visual Prediction in the Wild
normalize 1 other paper
1 later
2404.18459 (2024-04)
Chameleon: A Data-Efficient Generalist for Dense Visual Prediction in the Wild

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

Dense prediction tasks are a fundamental class of problems in computer vision. As supervised methods suffer from high pixel-wise labeling cost, a few-shot learning solution that can learn any dense task from a few labeled images is desired. Yet, current few-shot learning methods target a restricted set of tasks such as semantic segmentation, presumably due to challenges in designing a general and unified model that is able to flexibly and efficiently adapt to arbitrary tasks of unseen semantics. We propose Visual Token Matching (VTM), a universal few-shot learner for arbitrary dense prediction tasks. It employs non-parametric matching on patch-level embedded tokens of images and labels that encapsulates all tasks. Also, VTM flexibly adapts to any task with a tiny amount of task-specific parameters that modulate the matching algorithm. We implement VTM as a powerful hierarchical encoder-decoder architecture involving ViT backbones where token matching is performed at multiple feature hierarchies. We experiment VTM on a challenging variant of Taskonomy dataset and observe that it robustly few-shot learns various unseen dense prediction tasks. Surprisingly, it is competitive with fully supervised baselines using only 10 labeled examples of novel tasks (0.004% of full supervision) and sometimes outperforms using 0.1% of full supervision. Codes are available at https://github.com/GitGyun/visual_token_matching.

For agents

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

get_harvested_code_for_paper("2303.14969")
get_code_for_paper("2303.14969")
have("2303.14969")

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

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

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

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

Connect an agent — have() is free.