SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2301.13670 · 2023

What Makes Good Examples for Visual In-Context Learning?

arXiv · PDF · Open in the Atlas

Code that ran

2 of 9 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 0 have no contract verdict; 2 failures of our instrument; 7 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/2301.13670.json · badge: /api/ran/2301.13670.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
zhangyuanhan-ai/visual_prompt_retrieval canonical (classifier label)
classifier basis not recorded on the link
2 ran · 7 no recorded run
FunctionStatusWhere it lives
get_obj_from_str Ran
ran; our contract draft was wrong, not the code
zhangyuanhan-ai/visual_prompt_retrieval/vqgan.py
code served (permissive licence) · get_code("221b2d116fdf1032")
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 type. 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 importlib
import torch
import torch.nn as nn

torch.manual_seed(0)

# The function get_obj_from_str takes a string like "module.path.ClassName"
# and returns the class/object by:
# 1. Splitting on the last dot to get module path and class name
# 2. Optionally reloading the module if reload=True
# 3. Importing the module and getting the attribute (class/object)

# We need to provide:
# - string: a valid module.class path that exists
# - reload: boolean flag

# Using a built-in class that's guaranteed to exist
string_value = "torch.nn.Linear"
reload_value = False

ARGS = {
    "string": string_value,
    "reload": reload_value,
}
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 type — a type output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a type 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_timestep_embedding Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
zhangyuanhan-ai/visual_prompt_retrieval/vqgan.py
code served (permissive licence) · get_code("cb49209c125de1b4")
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 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 math

torch.manual_seed(0)

# The function takes two parameters:
# 1. timesteps: a 1D tensor of timestep indices
# 2. embedding_dim: an integer specifying the embedding dimension

# Create a small 1D tensor of timesteps (batch size 2)
timesteps = torch.tensor([0, 5], dtype=torch.int64)

# Create an embedding dimension (use 4 as specified)
embedding_dim = 4

ARGS = {
    "timesteps": timesteps,
    "embedding_dim": embedding_dim,
}
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 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: none by the harness; any seed is in the setup block
calculate_metric Not yet run
unverified (harvested, no recorded run)
zhangyuanhan-ai/visual_prompt_retrieval/evaluate/evaluate_colorization.py
pointer only (licence: CC0-1.0); the stored copy get_code serves, from alhojel/visual_task_vectors, is pointer only (licence: NONE) · get_code("764136a5eff74434")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (CC0-1.0), but get_code serves the stored copy, first harvested from alhojel/visual_task_vectors, 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. No invocation recorded.

calculate_metric Not yet run
unverified (harvested, no recorded run)
zhangyuanhan-ai/visual_prompt_retrieval/evaluate/evaluate_reasoning.py
pointer only (licence: CC0-1.0); the stored copy get_code serves, from alhojel/visual_task_vectors, is pointer only (licence: NONE) · get_code("69532fa60013e9f4")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (CC0-1.0), but get_code serves the stored copy, first harvested from alhojel/visual_task_vectors, 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. No invocation recorded.

get_demo_predictions Not yet run
unverified (harvested, no recorded run)
zhangyuanhan-ai/visual_prompt_retrieval/viz_utils.py
pointer only (licence: CC0-1.0); the stored copy get_code serves, from alhojel/visual_task_vectors, is pointer only (licence: NONE) · get_code("c68f71948cfa9d7c")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (CC0-1.0), but get_code serves the stored copy, first harvested from alhojel/visual_task_vectors, 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. No invocation recorded.

get_demo_predictions_with_mask Not yet run
unverified (harvested, no recorded run)
zhangyuanhan-ai/visual_prompt_retrieval/viz_utils.py
pointer only (licence: CC0-1.0); the stored copy get_code serves, from alhojel/visual_task_vectors, is pointer only (licence: NONE) · get_code("8c8d20b40760059c")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (CC0-1.0), but get_code serves the stored copy, first harvested from alhojel/visual_task_vectors, 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. No invocation recorded.

instantiate_from_config Not yet run
unverified (harvested, no recorded run)
zhangyuanhan-ai/visual_prompt_retrieval/vqgan.py
pointer only (licence: CC0-1.0); the stored copy get_code serves, from ZhengyaoFang/RS-STE, is pointer only (licence: NONE) · get_code("f0ac78b4e05be194")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (CC0-1.0), but get_code serves the stored copy, first harvested from ZhengyaoFang/RS-STE, 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. No invocation recorded.

is_square Not yet run
unverified (harvested, no recorded run)
zhangyuanhan-ai/visual_prompt_retrieval/evaluate/evaluate_reasoning.py
pointer only (licence: CC0-1.0); the stored copy get_code serves, from alhojel/visual_task_vectors, is pointer only (licence: NONE) · get_code("ce2513917f2cc4b5")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (CC0-1.0), but get_code serves the stored copy, first harvested from alhojel/visual_task_vectors, 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. No invocation recorded.

reverse_trans Not yet run
unverified (harvested, no recorded run)
zhangyuanhan-ai/visual_prompt_retrieval/tta.py
pointer only (licence: CC0-1.0); the stored copy get_code serves, from alhojel/visual_task_vectors, is pointer only (licence: NONE) · get_code("ebd3af8bde9488f1")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (CC0-1.0), but get_code serves the stored copy, first harvested from alhojel/visual_task_vectors, 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. No invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 9 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 2 the same month, 9 later) and 0 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
get_timestep_embedding 91 other papers
16 dated earlier, 2 the same month, 72 later, 1 same year, order not determinable · 7 only as an assembly brick
2104.07652 (2021-04)
Geometry-Free View Synthesis: Transformers and no 3D Priors
2106.00132 (2021-06)
On Fast Sampling of Diffusion Probabilistic Models
2106.06819 (2021-06)
D2C: Diffusion-Denoising Models for Few-shot Conditional Generation
and 88 more not named here
get_obj_from_str 54 other papers
7 dated earlier, 1 the same month, 45 later, 1 same year, order not determinable · 12 only as an assembly brick
2006.11239 (2020-06)
Denoising Diffusion Probabilistic Models
2102.05379 (2021-02)
Argmax Flows and Multinomial Diffusion: Learning Categorical Distributions
2112.00384 (2021-12)
Exploration into Translation-Equivariant Image Quantization
and 51 more not named here
instantiate_from_config 13 other papers
1 dated earlier, 12 later · 1 only as an assembly brick
2112.00384 (2021-12)
Exploration into Translation-Equivariant Image Quantization
2306.14795 (2023-06)
MotionGPT: Human Motion as a Foreign Language
2310.03502 (2023-10)
Kandinsky: an Improved Text-to-Image Synthesis with Image Prior and Latent Diffusion
and 10 more not named here
calculate_metric 2 other papers
2 later
2311.03648 (2023-11)
Instruct Me More! Random Prompting for Visual In-Context Learning
2404.05729 (2024-04)
Finding Visual Task Vectors
calculate_metric 2 other papers
2 later
2311.03648 (2023-11)
Instruct Me More! Random Prompting for Visual In-Context Learning
2404.05729 (2024-04)
Finding Visual Task Vectors
get_demo_predictions 2 other papers
2 later
2311.03648 (2023-11)
Instruct Me More! Random Prompting for Visual In-Context Learning
2404.05729 (2024-04)
Finding Visual Task Vectors
get_demo_predictions_with_mask 2 other papers
2 later
2311.03648 (2023-11)
Instruct Me More! Random Prompting for Visual In-Context Learning
2404.05729 (2024-04)
Finding Visual Task Vectors
is_square 2 other papers
2 later
2311.03648 (2023-11)
Instruct Me More! Random Prompting for Visual In-Context Learning
2404.05729 (2024-04)
Finding Visual Task Vectors
reverse_trans 2 other papers
2 later
2311.03648 (2023-11)
Instruct Me More! Random Prompting for Visual In-Context Learning
2404.05729 (2024-04)
Finding Visual Task Vectors

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

Large-scale models trained on broad data have recently become the mainstream architecture in computer vision due to their strong generalization performance. In this paper, the main focus is on an emergent ability in large vision models, known as in-context learning, which allows inference on unseen tasks by conditioning on in-context examples (a.k.a.~prompt) without updating the model parameters. This concept has been well-known in natural language processing but has only been studied very recently for large vision models. We for the first time provide a comprehensive investigation on the impact of in-context examples in computer vision, and find that the performance is highly sensitive to the choice of in-context examples. To overcome the problem, we propose a prompt retrieval framework to automate the selection of in-context examples. Specifically, we present (1) an unsupervised prompt retrieval method based on nearest example search using an off-the-shelf model, and (2) a supervised prompt retrieval method, which trains a neural network to choose examples that directly maximize in-context learning performance. The results demonstrate that our methods can bring non-trivial improvements to visual in-context learning in comparison to the commonly-used random selection.

For agents

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

get_harvested_code_for_paper("2301.13670")
get_code_for_paper("2301.13670")
have("2301.13670")

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

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

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

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

Connect an agent — have() is free.