SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2505.17010 · NeurIPS · 2025

Understanding Prompt Tuning and In-Context Learning via Meta-Learning

Anian Ruoss, Marcus Hutter, Laurent Orseau, Tim Genewein, Kevin Li, Wenliang, Jordi Grau-Moya

arXiv · PDF · Open in the Atlas

Code that ran

3 of 4 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; 0 failures of our instrument; 1 no recorded run), measured 2026-11-23; 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/2505.17010.json · badge: /api/ran/2505.17010.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
google-deepmind/thunnini canonical (classifier label)
classifier basis not recorded on the link
3 ran · 1 no recorded run
FunctionStatusWhere it lives
get_color_by_index Ran
ran on a synthesized input
google-deepmind/thunnini/src/plot_utils.py
code served (permissive licence) · get_code("4ddff8d3df0397fa")
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 torch
import numpy as np

# Setup for get_color_by_index function
torch.manual_seed(0)

# Test case 1: Default behavior (no colors list provided)
ARGS = {
    "index": 0,
    "colors": None,
}
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 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
plot_mean_and_variability_band Ran
ran on a synthesized input
google-deepmind/thunnini/src/plot_utils.py
code served (permissive licence) · get_code("621e18977b448e26")
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. 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 numpy as np
import matplotlib.pyplot as plt
from collections.abc import Callable

# Create sample data: multiple runs/trials of measurements
# Shape: (num_trials, num_timepoints)
lines_data = np.array([
    [1.0, 2.0, 3.0, 4.0],
    [1.1, 2.1, 2.9, 4.1],
    [0.9, 1.9, 3.1, 3.9],
    [1.0, 2.0, 3.0, 4.0]
])

# Create a figure and axis
fig, ax = plt.subplots()

# Create the plot config with default settings
plot_config = {
    'x_vector': np.array([0, 1, 2, 3]),
    'color': 'darkblue',
    'alpha': 0.25,
    'label': 'test_plot',
    'aggregate_linewidth': 1.5,
    'aggregate_fn': np.median,
    'variability_fn_upper': lambda x: np.quantile(x, 0.75),
    'variability_fn_lower': lambda x: np.quantile(x, 0.25),
    'apply_axis': 0,
    'aggregate_fn_only': False,
    'fill_band': True,
    'non_fill_band_linewidth': 0.5,
    'non_fill_band_linestyle': ':',
    'show_individual_lines': False,
    'individual_linewidth': 0.5,
    'show_gridlines': False
}

from dataclasses import dataclass

@dataclass(kw_only=True)
class MeanAndVariabilityPlotConfig:
    x_vector: np.ndarray | None = None
    color: str | np.ndarray = 'darkblue'
    alpha: float = 0.25
    label: str = ''
    aggregate_linewidth: float = 1.5
    aggregate_fn: Callable[[np.ndarray], np.ndarray] = np.median
    variability_fn_upper: Callable[[np.ndarray], np.ndarray] = lambda x: np.quantile(x, 0.75)
    variability_fn_lower: Callable[[np.ndarray], np.ndarray] = lambda x: np.quantile(x, 0.25)
    apply_axis: int = 0
    aggregate_fn_only: bool = False
    fill_band: bool = True
    non_fill_band_linewidth: float = 0.5
    non_fill_band_linestyle: str = ':'
    show_individual_lines: bool = False
    individual_linewidth: float = 0.5
    show_gridlines: bool = False

config = MeanAndVariabilityPlotConfig(
    x_vector=np.array([0, 1, 2, 3]),
    color='darkblue',
    alpha=0.25,
    label='test_plot',
    aggregate_linewidth=1.5,
    aggregate_fn=np.median,
    variability_fn_upper=lambda x: np.quantile(x, 0.75),
    variability_fn_lower=lambda x: np.quantile(x, 0.25),
    apply_axis=0,
    aggregate_fn_only=False,
    fill_band=True,
    non_fill_band_linewidth=0.5,
    non_fill_band_linestyle=':',
    show_individual_lines=False,
    individual_linewidth=0.5,
    show_gridlines=False
)

ARGS = {
    'lines': lines_data,
    'axis': ax,
    'plot_config': config
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
matplotlib, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is 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
sinusoid_positional_encoding Ran
ran on a synthesized input
google-deepmind/thunnini/src/transformer_utils.py
code served (permissive licence) · get_code("11c15e4a07e505dd")
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 ArrayImpl, ndim 2, dtype family float, shape (8, 16) 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 jax
from jax import numpy as jnp

# Set random seed for reproducibility
jax.config.update('jax_platform_name', 'cpu')

# Define ARGS with valid arguments for sinusoid_positional_encoding
ARGS = {
    'sequence_length': 8,
    'hidden_size': 16,
    'max_timescale': 10000.0,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, ndim 2, dtype family float, shape (8, 16) — shape (8, 16) 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
plot_performance_metric Not yet run
unverified (harvested, no recorded run)
google-deepmind/thunnini/src/plot_utils.py
code served (permissive licence) · get_code("2f1a510773730157")
How it ran

no invocation recorded.

Also present in other papers' code

Of 4 samples lifted from this paper's linked repositories, 4 carry a function identity and 0 do not. Of the 4 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 4 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.

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

Repositories linked to this paper

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

Abstract

Prompting is one of the main ways to adapt a pretrained model to target tasks. Besides manually constructing prompts, many prompt optimization methods have been proposed in the literature. Method development is mainly empirically driven, with less emphasis on a conceptual understanding of prompting. In this paper we discuss how optimal prompting can be understood through a Bayesian view, which also implies some fundamental limitations of prompting that can only be overcome by tuning weights. The paper explains in detail how meta-trained neural networks behave as Bayesian predictors over the pretraining distribution, whose hallmark feature is rapid in-context adaptation. Optimal prompting can be studied formally as conditioning these Bayesian predictors, yielding criteria for target tasks where optimal prompting is and is not possible. We support the theory with educational experiments on LSTMs and Transformers, where we compare different versions of prefix-tuning and different weight-tuning methods. We also confirm that soft prefixes, which are sequences of real-valued vectors outside the token alphabet, can lead to very effective prompts for trained and even untrained networks by manipulating activations in ways that are not achievable by hard tokens. This adds an important mechanistic aspect beyond the conceptual Bayesian theory.

For agents

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

get_harvested_code_for_paper("2505.17010")
get_code_for_paper("2505.17010")
have("2505.17010")

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

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

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

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

Connect an agent — have() is free.