SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2410.13749 · NeurIPS · 2024

Supervised Kernel Thinning

Raaz Dwivedi, Albert Gong, Kyuseong Choi

arXiv · PDF · Open in the Atlas

Code that ran

10 of 14 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; 6 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 4 failures of our instrument; 4 no recorded run), measured 2026-11-24; 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.13749.json · badge: /api/ran/2410.13749.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
ag2435/npr canonical (classifier label)
classifier basis: census
10 ran · 4 no recorded run
FunctionStatusWhere it lives
euclidean_distances Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ag2435/npr/npr/util_k.py
code served (permissive licence) · get_code("c288f1ca96210258")
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, 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 numpy as np

np.random.seed(0)

# Create sample data with distinct dimensions
# samples: (batch_size=2, feature_dim=4)
samples = np.random.randn(2, 4).astype(np.float32)

# centers: (num_centers=3, feature_dim=4)
centers = np.random.randn(3, 4).astype(np.float32)

# squared parameter
squared = True

ARGS = {
    "samples": samples,
    "centers": centers,
    "squared": squared,
}
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 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
get_coreset_size Ran
ran, honoured the contract we drafted
ag2435/npr/npr/util_thin_dnc.py
code served (permissive licence) · get_code("28405ebd4b1a43ad")
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)

ARGS = {
    "n": 100,
    "m": 2
}
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
get_g Ran
ran, honoured the contract we drafted
ag2435/npr/npr/util_thin.py
code served (permissive licence) · get_code("48d9057a107a8bd5")
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 numpy as np

def log4(n):
    return np.log2(n) / 2

def get_g(n):
    return int(np.ceil(log4(log4(n))))

# Setup: n should be a positive number large enough that log4(log4(n)) is defined
# Let's trace through: 
# - log4(n) = log2(n) / 2
# - log4(log4(n)) = log2(log4(n)) / 2
# For this to work, we need log4(n) > 0, so n > 1
# Let's use n = 256 as a reasonable test value
# log4(256) = log2(256) / 2 = 8 / 2 = 4
# log4(4) = log2(4) / 2 = 2 / 2 = 1
# ceil(1) = 1

ARGS = {
    "n": 256
}
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 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
grid Ran
ran, honoured the contract we drafted
ag2435/npr/npr/util_sample.py
code served (permissive licence) · get_code("aeda13fd13f0720b")
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 (2500, 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 numpy as np

ARGS = {
    "k": 50,
    "d": 2,
    "mag": 1.0
}
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 2, dtype family float, shape (2500, 2) — shape (2500, 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
log4 Ran
ran, honoured the contract we drafted
ag2435/npr/npr/util_thin.py
code served (permissive licence) · get_code("5863f775093fc87c")
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 float64, ndim 0, 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

def log4(n):
    return np.log2(n) / 2

# Test with a simple numeric value
n = 16

ARGS = {
    "n": n
}
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 float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
numpy_to_torch Ran
ran, honoured the contract we drafted
ag2435/npr/npr/falkon/util_falkon_estimators.py
code served (permissive licence) · get_code("7ff5a16c39b40f14")
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
import numpy as np

torch.manual_seed(0)

# The function takes a numpy array and converts it to a torch tensor
# with float32 dtype. We need to provide a valid numpy array.

a = np.array([[1.0, 2.0, 3.0, 4.0],
              [5.0, 6.0, 7.0, 8.0]], dtype=np.float64)

ARGS = {
    'a': a
}
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 (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
pdf Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ag2435/npr/npr/util_sample.py
code served (permissive licence) · get_code("07a20869feecd04b")
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 (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 numpy as np
from scipy import stats

# Test case 1: Gaussian distribution with scalar input
x_scalar = 0.5
params_gauss_scalar = {
    'name': 'gauss',
    'var': 1.0,
    'd': 4
}

# Test case 2: Gaussian distribution with array input
x_array = np.array([[0.1, 0.2, 0.3, 0.4], [0.5, 0.6, 0.7, 0.8]])
params_gauss_array = {
    'name': 'gauss',
    'var': 0.5,
    'd': 4
}

# Test case 3: Diagonal mixture of Gaussians
x_mog = np.array([[0.1, 0.2, 0.3, 0.4], [0.5, 0.6, 0.7, 0.8]])
params_diag_mog = {
    'name': 'diag_mog',
    'weights': np.array([0.3, 0.7]),
    'd': 4,
    'means': np.array([[0.0, 0.0, 0.0, 0.0], [1.0, 1.0, 1.0, 1.0]]),
    'covs': np.array([0.5, 1.5])
}

# Define ARGS for the primary test case (Gaussian with array)
ARGS = {
    'x': x_array,
    'params_p': params_gauss_array
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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 (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
sample Ran
ran, honoured the contract we drafted
ag2435/npr/npr/util_sample.py
code served (permissive licence) · get_code("78aec322fa1d2623")
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 (10, 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 numpy as np
import numpy.random as rand

# Test with 'gauss' distribution
ARGS = {
    'n': 10,
    'params_p': {
        'name': 'gauss',
        'var': 1.0,
        'd': 4
    },
    'seed': 42
}
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 2, dtype family float, shape (10, 4) — shape (10, 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
to_product_kernel Ran
ran; our contract draft was wrong, not the code
ag2435/npr/npr/util_k.py
code served (permissive licence) · get_code("5181cca6881c5fc5")
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 function. 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

# Define a simple kernel function that takes two matrices and returns a kernel matrix
def simple_rbf_kernel(X1, X2):
    """
    Simple RBF kernel: K(X1, X2) where X1 is (n1, d) and X2 is (n2, d)
    Returns (n1, n2) matrix
    """
    # Compute pairwise squared distances
    n1 = X1.shape[0]
    n2 = X2.shape[0]
    
    # Simple kernel: just return a matrix of ones scaled by dimensions
    # This is a valid kernel for testing purposes
    return np.ones((n1, n2))

# Create test data
# Xy1: (2, 5) - 2 samples, 4 features + 1 y-value
# Xy2: (3, 5) - 3 samples, 4 features + 1 y-value
Xy1 = np.random.randn(2, 5).astype(np.float32)
Xy2 = np.random.randn(3, 5).astype(np.float32)

ARGS = {
    "K": simple_rbf_kernel,
    "ydim": 1,
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
to_regression_kernel Ran
ran; our contract draft was wrong, not the code
ag2435/npr/npr/util_k.py
code served (permissive licence) · get_code("80da1f69b8b758cd")
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 function. 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

def simple_kernel(X1, X2):
    """Simple RBF-like kernel: exp(-||x1 - x2||^2)"""
    # X1 shape: (n1, d), X2 shape: (n2, d)
    # Compute pairwise distances
    n1 = X1.shape[0]
    n2 = X2.shape[0]
    K_matrix = np.zeros((n1, n2))
    for i in range(n1):
        for j in range(n2):
            dist_sq = np.sum((X1[i] - X2[j]) ** 2)
            K_matrix[i, j] = np.exp(-dist_sq)
    return K_matrix

ARGS = {
    "K": simple_kernel,
    "ydim": 1,
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
add_noise Not yet run
unverified (harvested, no recorded run)
ag2435/npr/npr/util_load_data.py
code served (permissive licence) · get_code("dc1bd93d107d4ab8")
How it ran

no invocation recorded.

get_feature_matrix Not yet run
unverified (harvested, no recorded run)
ag2435/npr/npr/krr/utils.py
code served (permissive licence) · get_code("1ddab9f1ba46889a")
How it ran

no invocation recorded.

get_svhn_dataset Not yet run
unverified (harvested, no recorded run)
ag2435/npr/npr/util_load_data.py
code served (permissive licence) · get_code("2ed6ff7802b14b5c")
How it ran

no invocation recorded.

normalize Not yet run
unverified (harvested, no recorded run)
ag2435/npr/npr/util_load_data.py
code served (permissive licence) · get_code("c8859ad2976dc5ea")
How it ran

no invocation recorded.

Also present in other papers' code

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

Repositories linked to this paper

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

Abstract

The kernel thinning algorithm of [10] provides a better-than-i.i.d. compression of a generic set of points. By generating high-fidelity coresets of size significantly smaller than the input points, KT is known to speed up unsupervised tasks like Monte Carlo integration, uncertainty quantification, and non-parametric hypothesis testing, with minimal loss in statistical accuracy. In this work, we generalize the KT algorithm to speed up supervised learning problems involving kernel methods. Specifically, we combine two classical algorithms-Nadaraya-Watson (NW) regression or kernel smoothing, and kernel ridge regression (KRR)-with KT to provide a quadratic speed-up in both training and inference times. We show how distribution compression with KT in each setting reduces to constructing an appropriate kernel, and introduce the Kernel-Thinned NW and Kernel-Thinned KRR estimators. We prove that KT-based regression estimators enjoy significantly superior computational efficiency over the full-data estimators and improved statistical efficiency over i.i.d. subsampling of the training data. En route, we also provide a novel multiplicative error guarantee for compressing with KT. We validate our design choices with both simulations and real data experiments.

For agents

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

get_harvested_code_for_paper("2410.13749")
get_code_for_paper("2410.13749")
have("2410.13749")

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

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

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

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

Connect an agent — have() is free.