SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2410.20596 · NeurIPS · 2024

Practical Bayesian Algorithm Execution via Posterior Sampling

Yisong Yue, Raul Astudillo, Chu Cheng, Thomas Desautels

arXiv · PDF · Open in the Atlas

Code that ran

6 of 8 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; 6 failures of our instrument; 2 no recorded run), measured 2026-11-22; 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/2410.20596.json · badge: /api/ran/2410.20596.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
RaulAstudillo06/PSBAX canonical (classifier label)
classifier basis: census
6 ran · 2 no recorded run
FunctionStatusWhere it lives
generate_initial_data Ran
ran; our contract draft was wrong, not the code
RaulAstudillo06/PSBAX/src/utils.py
code served (permissive licence) · get_code("2e5bc7dbaffd4ea2")
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 torch
import numpy as np

torch.manual_seed(0)
np.random.seed(0)

# Define a simple objective function
def simple_obj_func(x):
    """Simple quadratic objective function"""
    return torch.sum(x ** 2, dim=-1, keepdim=True)

# Define initial data for x_init if needed
x_init = torch.randn(2, 4)

# Define noise level tensor with shape (1, num_obj) where num_obj=1
noise_level = torch.tensor([[0.1]])

ARGS = {
    'num_init_points': 3,
    'input_dim': 4,
    'obj_func': simple_obj_func,
    'noise_type': 'noisy',
    'noise_level': noise_level,
    'seed': 42,
    'x_init': x_init,
}
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 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
generate_random_points Ran
ran; our contract draft was wrong, not the code
RaulAstudillo06/PSBAX/src/utils.py
code served (permissive licence) · get_code("d6327611e7923cda")
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 2, dtype family float, shape (5, 3) 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 numpy as np

torch.manual_seed(0)
np.random.seed(0)

# Basic parameters
num_points = 5
input_dim = 3
seed = 42

# Optional kwargs - we'll test with edge_coords
edge_coords = np.random.randn(10, 3).astype(np.float32)
x_set = np.random.randn(8, 3).astype(np.float32)
x_batch_numpy = np.random.randn(6, 3).astype(np.float32)
x_batch_tensor = torch.randn(4, 3)

ARGS = {
    'num_points': num_points,
    'input_dim': input_dim,
    'seed': seed,
    'edge_coords': edge_coords,
    'x_set': x_set,
    'x_batch': x_batch_tensor,
}
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 Tensor, ndim 2, dtype family float, shape (5, 3) — shape (5, 3) 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
get_obj_vals Ran
ran; our contract draft was wrong, not the code
RaulAstudillo06/PSBAX/src/utils.py
code served (permissive licence) · get_code("d419657ba86bd33d")
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 2, dtype family float, shape (2, 3) 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 torch.nn as nn

torch.manual_seed(0)

# Define a simple objective function that takes inputs and returns objective values
class SimpleObjective(nn.Module):
    def __init__(self, input_dim, num_obj):
        super().__init__()
        self.linear = nn.Linear(input_dim, num_obj)
    
    def forward(self, x):
        return self.linear(x)

# Create the objective function
input_dim = 4
num_obj = 3
obj_func = SimpleObjective(input_dim, num_obj)

# Create inputs: (num_points, input_dim) = (2, 4)
inputs = torch.randn(2, 4)

# noise_type: either "noiseless" or "noisy"
noise_type = "noisy"

# noise_level: shape (1, num_obj) = (1, 3)
noise_level = torch.tensor([[0.1, 0.2, 0.15]])

ARGS = {
    "obj_func": obj_func,
    "inputs": inputs,
    "noise_type": noise_type,
    "noise_level": noise_level,
}
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 2, dtype family float, shape (2, 3) — shape (2, 3) 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
himmelblau Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
RaulAstudillo06/PSBAX/demos/level-set.py
code served (permissive licence) · get_code("86b360a7f2896630")
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 (2,) 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 expects:
# - X: torch.Tensor of shape (batch_size, 2) with values in [0, 1]
# - minimize: bool (optional, defaults to False)

X = torch.rand(2, 2)  # batch_size=2, 2D input (a, b coordinates)
minimize = False

ARGS = {
    "X": X,
    "minimize": minimize,
}
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 (2,) — shape (2,) 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
obj_func Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
RaulAstudillo06/PSBAX/demos/topk.py
code served (permissive licence) · get_code("537ea972d409a3c4")
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 (2,) 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 numpy as np
from botorch.test_functions.synthetic import Rosenbrock

torch.manual_seed(0)

args = {'dim': 3, 'len_path': 100, 'k': 4, 'batch_size': 1, 'max_iter': 30}

input_dim = args['dim']

domain = [[-2.0, 2.0]] * input_dim

rosenbrock = Rosenbrock(dim=input_dim, negate=True)

def obj_func(X, domain=domain):
    if isinstance(X, np.ndarray):
        X = torch.tensor(X)
    return rosenbrock(X)

# Create a small test input
X_test = np.random.randn(2, 3).astype(np.float32)

ARGS = {
    'X': X_test,
    'domain': domain
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
botorch, numpy, 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 (2,) — shape (2,) 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
query_discrete Ran
ran; our contract draft was wrong, not the code
RaulAstudillo06/PSBAX/src/problems.py
code served (permissive licence) · get_code("8efe859d5776f4bb")
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 torch

torch.manual_seed(0)

# X: shape [n, d], inputs
X = torch.randn(2, 4)

# y: shape [n], labels corresponding to X
y = torch.randint(0, 3, (2,))

# q: shape [m, d], query points
q = torch.randn(3, 4)

ARGS = {
    "X": X,
    "y": y,
    "q": q,
}
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 — 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
compute_performance_metrics Not yet run
unverified (harvested, no recorded run)
RaulAstudillo06/PSBAX/src/performance_metrics.py
code served (permissive licence) · get_code("931510599651d959")
How it ran

no invocation recorded.

obj_func Not yet run
unverified (harvested, no recorded run)
RaulAstudillo06/PSBAX/demos/local-bo.py
code served (permissive licence) · get_code("caa622205276825f")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 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 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.

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

We consider Bayesian algorithm execution (BAX), a framework for efficiently selecting evaluation points of an expensive function to infer a property of interest encoded as the output of a base algorithm. Since the base algorithm typically requires more evaluations than are feasible, it cannot be directly applied. Instead, BAX methods sequentially select evaluation points using a probabilistic numerical approach. Current BAX methods use expected information gain to guide this selection. However, this approach is computationally intensive. Observing that, in many tasks, the property of interest corresponds to a target set of points defined by the function, we introduce PS-BAX, a simple, effective, and scalable BAX method based on posterior sampling. PS-BAX is applicable to a wide range of problems, including many optimization variants and level set estimation. Experiments across diverse tasks demonstrate that PS-BAX performs competitively with existing baselines while being significantly faster, simpler to implement, and easily parallelizable, setting a strong baseline for future research. Additionally, we establish conditions under which PS-BAX is asymptotically convergent, offering new insights into posterior sampling as an algorithm design paradigm.

For agents

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

get_harvested_code_for_paper("2410.20596")
get_code_for_paper("2410.20596")
have("2410.20596")

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

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

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

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

Connect an agent — have() is free.