SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1807.02811 · 2018

A Tutorial on Bayesian Optimization

arXiv · PDF · Open in the Atlas

Code that ran

9 of 10 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, 1 violated it and 7 have no contract verdict; 1 failure of our instrument; 1 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/1807.02811.json · badge: /api/ran/1807.02811.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
svedel/greattunes community (classifier label)
classifier basis not recorded on the link
6 ran · 1 no recorded run
rdturnermtl/bbo_challenge_starter_kit community (classifier label)
classifier basis not recorded on the link
3 ran · 0 no recorded run
FunctionStatusWhere it lives
GP_kernel_transform Ran
ran on a synthesized input
svedel/greattunes/greattunes/transformed_kernel_models/transformation.py
code served (permissive licence) · get_code("0a01ec9e2eb6b080")
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, 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

torch.manual_seed(0)

# Construct a simple x tensor: 2 rows x 4 covariates
# This will be used as input to GP_kernel_transform
x = torch.randn(2, 4, dtype=torch.double)

# Construct GP_kernel_mapping_covar_identification
# This is a list of dicts describing which columns need special transformation
# We'll create entries for:
# - An integer covariate at column 0
# - A categorical covariate at columns 1-2 (one-hot encoded)
GP_kernel_mapping_covar_identification = [
    {
        'type': int,
        'column': 0,
        'name': 'integer_var'
    },
    {
        'type': str,
        'column': [1, 2],
        'name': 'categorical_var'
    }
]

ARGS = {
    'x': x,
    'GP_kernel_mapping_covar_identification': GP_kernel_mapping_covar_identification
}
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, 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
copula_standardize Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
rdturnermtl/bbo_challenge_starter_kit/example_submissions/turbo/optimizer.py
code served (permissive licence) · get_code("411a49873bfde4d6")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned ndarray, ndim 1, dtype family float, shape (8,) 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 numpy as np

# Create a simple 1D numpy array for X
# The function expects a 1D array with finite values
X = np.array([1.5, 2.3, 1.5, 3.7, 2.3, 4.1, 1.5, 2.8])

ARGS = {
    'X': X
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (8,) — shape (8,) 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
only Ran
ran on a synthesized input
rdturnermtl/bbo_challenge_starter_kit/example_submissions/hyperopt/optimizer.py
code served (permissive licence) · get_code("ba6bb726a3331aef")
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 int, ndim 0, dtype family int, 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 torch

torch.manual_seed(0)

# The function `only` unpacks a single-element sequence and returns that element.
# It uses tuple unpacking: y, = x
# This means x must be an iterable with exactly one element.

ARGS = {
    "x": [42]
}
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 int, ndim 0, dtype family int, 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
order_stats Ran
ran, violated the contract we drafted
rdturnermtl/bbo_challenge_starter_kit/example_submissions/turbo/optimizer.py
code served (permissive licence) · get_code("59d38e267656d07b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned ndarray, ndim 1, dtype family int, shape (8,) 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 numpy as np

# Create a simple 1D array with some repeated values
X = np.array([3, 1, 2, 1, 3, 2, 1, 4])

ARGS = {
    'X': X
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family int, shape (8,) — shape (8,) 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_convergence Ran
ran on a synthesized input
svedel/greattunes/greattunes/_plot.py
code served (permissive licence) · get_code("0f45cdcb76d7177e")
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 torch.nn as nn
import matplotlib.pyplot as plt
import copy

torch.manual_seed(0)

class MockOptimizer:
    def __init__(self):
        self.best_response_value = torch.tensor(
            [10.0, 9.5, 9.2, 8.8, 8.5, 8.3, 8.1, 8.0],
            dtype=torch.double
        )

mock_self = MockOptimizer()

ARGS = {
    'self': mock_self
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
matplotlib, 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
predictive_results Ran
ran on a synthesized input
svedel/greattunes/greattunes/_plot.py
code served (permissive licence) · get_code("2ccac6f41380031e")
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 2, 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 gpytorch
import copy

torch.manual_seed(0)

# Build a minimal GPyTorch model
class SimpleGPModel(gpytorch.models.ExactGP):
    def __init__(self, train_x, train_y, likelihood):
        super().__init__(train_x, train_y, likelihood)
        self.mean_module = gpytorch.means.ConstantMean()
        self.covar_module = gpytorch.kernels.ScaleKernel(gpytorch.kernels.RBFKernel())
    
    def forward(self, x):
        mean_x = self.mean_module(x)
        covar_x = self.covar_module(x)
        return gpytorch.distributions.MultivariateNormal(mean_x, covar_x)

# Create training data
train_x = torch.randn(2, 4, dtype=torch.double)
train_y = torch.randn(2, dtype=torch.double)

# Create likelihood and model
likelihood = gpytorch.likelihoods.GaussianLikelihood()
model = SimpleGPModel(train_x, train_y, likelihood)

# Put model in eval mode (as would be done after training)
model.eval()
likelihood.eval()

# Create a self-like object with a model dict attribute
class SelfObject:
    def __init__(self, model, likelihood):
        self.model = {'model': model}
        # Store likelihood in model so it can be accessed
        self.model['model'].likelihood = likelihood

self_obj = SelfObject(model, likelihood)

# Create prediction input
pred_X = torch.randn(3, 4, dtype=torch.double)

ARGS = {
    'self': self_obj,
    'pred_X': pred_X
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
gpytorch, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 2, 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
pretty2tensor_covariate Ran
ran on a synthesized input
svedel/greattunes/greattunes/data_format_mappings.py
code served (permissive licence) · get_code("65b7ca0b92a6965c")
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 3, dtype family float; no output shape is stated. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 pandas as pd
import numpy as np

torch.manual_seed(0)

# Build a simple pandas dataframe with covariate data
# We have 2 rows (batch size 2) and 3 covariate columns
x_pandas = pd.DataFrame({
    'age': [25.0, 35.0],
    'category': ['A', 'B'],
    'value': [1.5, 2.5]
})

# Define covariate details specifying the type of each covariate
covar_details = {
    'age': {'type': float},
    'category': {'type': str},
    'value': {'type': float}
}

# Define the mapped covariate names in tensor format
# For categorical variables, we need one-hot encoded columns
covar_mapped_names = [
    'age',
    'category_A',
    'category_B',
    'value'
]

# Device (CPU only)
device = torch.device('cpu')

ARGS = {
    'x_pandas': x_pandas,
    'covar_details': covar_details,
    'covar_mapped_names': covar_mapped_names,
    'device': device
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 3, 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
pretty2tensor_response Ran
ran on a synthesized input
svedel/greattunes/greattunes/data_format_mappings.py
code served (permissive licence) · get_code("81bbb13a7c92e0d5")
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 (4, 1) as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 pandas as pd
import numpy as np

torch.manual_seed(0)

# Create a simple pandas DataFrame with continuous response variable
# Single row as per docstring specification, but function actually accepts multiple rows
y_pandas = pd.DataFrame({
    'response_col': np.array([1.5, 2.3, 3.7, 4.2])
})

# Device parameter - set to None to let function auto-detect
device = None

ARGS = {
    'y_pandas': y_pandas,
    'device': device
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas, 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 (4, 1) — shape (4, 1) 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
tensor2pretty_covariate Ran
ran on a synthesized input
svedel/greattunes/greattunes/data_format_mappings.py
code served (permissive licence) · get_code("3b51147c60c60db1")
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 DataFrame. 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 pandas as pd

torch.manual_seed(0)

# Construct train_X_sample: a tensor of shape (2, 4) for 2 observations and 4 covariates
train_X_sample = torch.tensor([
    [1.5, 0.0, 1.0, 25.3],
    [2.7, 1.0, 0.0, 30.1]
], dtype=torch.float32)

# Construct covar_details: a dict with 3 covariate specifications
covar_details = {
    'age': {
        'type': int,
        'columns': 0
    },
    'category': {
        'type': str,
        'columns': [1, 2],
        'opt_names': ['category_option_a', 'category_option_b']
    },
    'score': {
        'type': float,
        'columns': 3
    }
}

ARGS = {
    'train_X_sample': train_X_sample,
    'covar_details': covar_details
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 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_1d_latest Not yet run
unverified (harvested, no recorded run)
svedel/greattunes/greattunes/_plot.py
code served (permissive licence) · get_code("fc29af0a780f575d")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 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 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
copula_standardize 2 other papers
2 later
2210.10199 (2022-10)
Bayesian Optimization over Discrete and Mixed Spaces via Probabilistic Reparameterization
2306.01324 (2023-06)
Hyperparameters in Reinforcement Learning and How To Tune Them
order_stats 2 other papers
2 later
2210.10199 (2022-10)
Bayesian Optimization over Discrete and Mixed Spaces via Probabilistic Reparameterization
2306.01324 (2023-06)
Hyperparameters in Reinforcement Learning and How To Tune Them

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

Bayesian optimization is an approach to optimizing objective functions that take a long time (minutes or hours) to evaluate. It is best-suited for optimization over continuous domains of less than 20 dimensions, and tolerates stochastic noise in function evaluations. It builds a surrogate for the objective and quantifies the uncertainty in that surrogate using a Bayesian machine learning technique, Gaussian process regression, and then uses an acquisition function defined from this surrogate to decide where to sample. In this tutorial, we describe how Bayesian optimization works, including Gaussian process regression and three common acquisition functions: expected improvement, entropy search, and knowledge gradient. We then discuss more advanced techniques, including running multiple function evaluations in parallel, multi-fidelity and multi-information source optimization, expensive-to-evaluate constraints, random environmental conditions, multi-task Bayesian optimization, and the inclusion of derivative information. We conclude with a discussion of Bayesian optimization software and future research directions in the field. Within our tutorial material we provide a generalization of expected improvement to noisy evaluations, beyond the noise-free setting where it is more commonly applied. This generalization is justified by a formal decision-theoretic argument, standing in contrast to previous ad hoc modifications.

For agents

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

get_harvested_code_for_paper("1807.02811")
get_code_for_paper("1807.02811")
have("1807.02811")

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

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

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

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

Connect an agent — have() is free.