SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2206.08843 · NeurIPS · 2022

AutoML Two-Sample Test

Bernhard Schölkopf, Jonas Kübler, Krikamol Muandet, Vincent Stimper, Simon Buchholz

arXiv · PDF · Open in the Atlas

Code that ran

10 of 11 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, 0 violated it and 0 have no contract verdict; 8 failures of our instrument; 1 no recorded run), measured 2026-11-23; 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/2206.08843.json · badge: /api/ran/2206.08843.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
jmkuebler/automl-tst-paper canonical (classifier label)
classifier basis: classifier_2025
6 ran · 1 no recorded run
copy not recorded community
not in the paper's declared repositories
2 ran · 0 no recorded run
antoninschrab/fl-mmdagg application (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
FunctionStatusWhere it lives
MMDu Ran
ran; our contract draft was wrong, not the code
jmkuebler/automl-tst-paper/deep_kernel_utils.py
code served (permissive licence) · get_code("80d97d29c4bae90a")
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)

# Create small tensors for testing
# Fea: merged feature tensor, shape (nx + ny, feature_dim)
# Let's use nx=2, ny=2, feature_dim=4
nx = 2
ny = 2
feature_dim = 4
total_samples = nx + ny

Fea = torch.randn(total_samples, feature_dim)
Fea_org = torch.randn(total_samples, feature_dim)

ARGS = {
    "Fea": Fea,
    "len_s": nx,  # length of first set (X)
    "Fea_org": Fea_org,
    "sigma": 1.0,
    "sigma0": 0.1,
    "epsilon": 1e-10,
    "is_smooth": True,
    "is_var_computed": True,
    "use_1sample_U": True,
}
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
Pdist2 Ran
ran, honoured the contract we drafted
jmkuebler/automl-tst-paper/deep_kernel_utils.py
code served (permissive licence) · get_code("0b62387de45ba23b")
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

torch.manual_seed(0)

# Create small tensors for x and y
# x: shape (2, 4) - 2 samples, 4 dimensions
# y: shape (3, 4) - 3 samples, 4 dimensions
x = torch.randn(2, 4)
y = torch.randn(3, 4)

ARGS = {
    "x": x,
    "y": y
}
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
TST_MMD_u Ran
ran; our contract draft was wrong, not the code
jmkuebler/automl-tst-paper/deep_kernel_utils.py
code served (permissive licence) · get_code("677d78c5141590c0")
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 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 numpy as np

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

# Create small feature tensors
# Fea: combined features from two samples, shape (n_total, feature_dim)
# Split into X (first N1 rows) and Y (remaining rows)
n_total = 6
feature_dim = 4
N1 = 3  # number of samples in first group

Fea = torch.randn(n_total, feature_dim, dtype=torch.float32)
Fea_org = torch.randn(n_total, feature_dim, dtype=torch.float32)

# Parameters for MMD computation
sigma = torch.tensor(1.0, dtype=torch.float32)
sigma0 = 0.1
ep = 1e-10

# Test parameters
N_per = 5  # number of permutations
alpha = 0.05  # significance level
device = 'cpu'
dtype = torch.float32

ARGS = {
    'Fea': Fea,
    'N_per': N_per,
    'N1': N1,
    'Fea_org': Fea_org,
    'sigma': sigma,
    'sigma0': sigma0,
    'ep': ep,
    'alpha': alpha,
    'device': device,
    'dtype': dtype,
    'is_smooth': True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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, 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
compute_pairwise_matrix Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
this paper's copy was not recorded; identical code first harvested from antoninschrab/mmdagg
pointer only · get_code("139c7796806ebcb2")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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_weights Ran
ran, honoured the contract we drafted
antoninschrab/fl-mmdagg/mmdagg.py
code served (permissive licence) · get_code("8aafc51eaf6abeef")
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 ndarray, ndim 1, dtype family float, shape (5,) 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

# Test with different values of N and weights_type
N = 5
weights_type = 'uniform'

ARGS = {
    'N': N,
    'weights_type': weights_type
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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 float, shape (5,) — shape (5,) 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_item Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
jmkuebler/automl-tst-paper/deep_kernel_utils.py
code served (permissive licence) · get_code("ada1992bbe1e1e8b")
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 ndarray, 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 numpy as np

torch.manual_seed(0)

# Create a small tensor for testing
x = torch.randn(2, 4)

# is_cuda parameter
is_cuda_value = False

ARGS = {
    "x": x,
    "is_cuda": is_cuda_value
}
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 ndarray, 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
kernel_matrix Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
this paper's copy was not recorded; identical code first harvested from antoninschrab/mmdagg
pointer only · get_code("4e7beb2199214856")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

mmdagg Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
antoninschrab/fl-mmdagg/mmdagg.py
code served (permissive licence) · get_code("58fe8d6ec4056d56")
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 bool, 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 numpy as np
import scipy.spatial

# Create small sample data
np.random.seed(42)
m = 5  # number of samples
d = 4  # dimensionality

X = np.random.randn(m, d).astype(np.float64)
Y = np.random.randn(m, d).astype(np.float64)

ARGS = {
    'X': X,
    'Y': Y,
    'alpha': 0.05,
    'kernel': 'laplace_gaussian',
    'number_bandwidths': 10,
    'weights_type': 'uniform',
    'B1': 100,
    'B2': 100,
    'B3': 10,
    'seed': 42,
    'return_dictionary': False,
    'permutations_same_sample_size': False,
}
Setup block drafted by
a language model, Claude Haiku 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 bool, 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
sample_blobs_Q Ran
ran; our contract draft was wrong, not the code
jmkuebler/automl-tst-paper/blob.py
code served (permissive licence) · get_code("c4af21b192891614")
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 tuple, ndim 3, 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 numpy as np

# Set random seed for reproducibility
np.random.seed(42)
rs = np.random.RandomState(42)

# Construct sigma_mx_2: array of shape [9, 2, 2] with valid covariance matrices
sigma_mx_2 = np.zeros([9, 2, 2])
for i in range(9):
    # Create a valid positive definite covariance matrix
    A = np.random.randn(2, 2)
    sigma_mx_2[i] = np.dot(A, A.T) + np.eye(2) * 0.1

# Define ARGS
ARGS = {
    'N1': 10,
    'sigma_mx_2': sigma_mx_2,
    'rows': 3,
    'cols': 3,
    'rs': rs
}
Setup block drafted by
a language model, Claude Haiku 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 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
snr_score Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
jmkuebler/automl-tst-paper/blob.py
code served (permissive licence) · get_code("6df8371a03ba59bc")
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 float64, 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 numpy as np
from sklearn.base import BaseEstimator, ClassifierMixin

class DummyClassifier(BaseEstimator, ClassifierMixin):
    """Minimal classifier that implements predict_proba for testing."""
    
    def __init__(self):
        pass
    
    def fit(self, X, y):
        return self
    
    def predict_proba(self, X):
        # Return probability estimates: shape (n_samples, 2)
        # Column 0 is P(y=0), column 1 is P(y=1)
        n_samples = X.shape[0]
        probs = np.random.rand(n_samples, 2)
        probs = probs / probs.sum(axis=1, keepdims=True)
        return probs

# Create test data
np.random.seed(0)
x_test = np.random.randn(10, 4)  # 10 samples, 4 features
y_test = np.array([0, 1, 0, 1, 0, 1, 0, 1, 0, 1])  # Binary labels

# Create and fit estimator
estimator = DummyClassifier()
estimator.fit(x_test, y_test)

ARGS = {
    "estimator": estimator,
    "x_test": x_test,
    "y_test": y_test,
    "permutations": None,
    "discrete": False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, 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
h1_mean_var_gram Not yet run
unverified (harvested, no recorded run)
jmkuebler/automl-tst-paper/deep_kernel_utils.py
code served (permissive licence) · get_code("fa83a7df3804d085")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 5 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 2 the same month, 2 later) and 6 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
Pdist2
brick of this paper's assembly: helper
4 other papers
1 dated earlier, 3 later · 3 only as an assembly brick
2106.07636 (2021-06)
Meta Two-Sample Testing: Learning Kernels for Testing with Limited Data
2402.16041 (2024-02)
Detecting Machine-Generated Texts by Multi-Population Aware Optimization for Maximum Mean Discrepancy
2506.05047 (2025-06)
Reliably Detecting Model Failures in Deployment Without Labels
and 1 more not named here
compute_pairwise_matrix
brick of this paper's assembly: helper
2 other papers
1 dated earlier, 1 the same month
2110.15073 (2021-10)
MMD Aggregated Two-Sample Test
2206.09194 (2022-06)
Efficient Aggregated Kernel Tests using Incomplete $U$-statistics
kernel_matrix
brick of this paper's assembly: helper
2 other papers
1 dated earlier, 1 the same month
2110.15073 (2021-10)
MMD Aggregated Two-Sample Test
2206.09194 (2022-06)
Efficient Aggregated Kernel Tests using Incomplete $U$-statistics
create_weights
brick of this paper's assembly: helper
1 other paper
1 dated earlier
2202.00824 (2022-02)
KSD Aggregated Goodness-of-fit Test
get_item
brick of this paper's assembly: helper
1 other paper
1 later
2306.08777 (2023-06)
MMD-FUSE: Learning and Combining Kernels for Two-Sample Testing Without Data Splitting

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

Two-sample tests are important in statistics and machine learning, both as tools for scientific discovery as well as to detect distribution shifts. This led to the development of many sophisticated test procedures going beyond the standard supervised learning frameworks, whose usage can require specialized knowledge about two-sample testing. We use a simple test that takes the mean discrepancy of a witness function as the test statistic and prove that minimizing a squared loss leads to a witness with optimal testing power. This allows us to leverage recent advancements in AutoML. Without any user input about the problems at hand, and using the same method for all our experiments, our AutoML two-sample test achieves competitive performance on a diverse distribution shift benchmark as well as on challenging two-sample testing problems. We provide an implementation of the AutoML two-sample test in the Python package autotst.

For agents

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

get_harvested_code_for_paper("2206.08843")
get_code_for_paper("2206.08843")
have("2206.08843")

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

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

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

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

Connect an agent — have() is free.