SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2006.13409 · 2020

When Do Neural Networks Outperform Kernel Methods?

arXiv · PDF · Open in the Atlas

Code that ran

5 of 6 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 5 have no contract verdict; 0 failures 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/2006.13409.json · badge: /api/ran/2006.13409.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
bGhorbani/linearized_neural_networks canonical (classifier label)
classifier basis: census
5 ran · 1 no recorded run
FunctionStatusWhere it lives
NTK2 Ran
ran on a synthesized input
bGhorbani/linearized_neural_networks/Kernel_Fit.py
code served (permissive licence) · get_code("03f5166a86390f22")
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
import math

# Set random seed for reproducibility
np.random.seed(0)

# Create small test matrices
# X: d times n_1 matrix (feature dimension d=4, n_1=2 observations)
# Z: d times n_2 matrix (feature dimension d=4, n_2=3 observations)
d = 4
n_1 = 2
n_2 = 3

X = np.random.randn(d, n_1).astype(np.float32)
Z = np.random.randn(d, n_2).astype(np.float32)

ARGS = {
    "X": X,
    "Z": Z,
}
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
RFK2 Ran
ran on a synthesized input
bGhorbani/linearized_neural_networks/Kernel_Fit.py
code served (permissive licence) · get_code("96fa657135896791")
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 (3, 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 math
import numpy as np

# Set random seed for reproducibility
np.random.seed(0)

# Create sample data
# X: d times n_1 matrix (feature_dim x num_samples_1)
# Z: d times n_2 matrix (feature_dim x num_samples_2)
# Using distinct dimensions: 4 features, 3 samples for X, 2 samples for Z

d = 4  # feature dimension
n_1 = 3  # number of observations in X
n_2 = 2  # number of observations in Z

# Create random matrices with the required shape
X = np.random.randn(d, n_1)
Z = np.random.randn(d, n_2)

ARGS = {
    "X": X,
    "Z": Z,
}
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 (3, 2) — shape (3, 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
cifar_input Ran
ran on a synthesized input
bGhorbani/linearized_neural_networks/preprocess.py
code served (permissive licence) · get_code("2aa0e5b8694c4755")
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 sys
from unittest.mock import patch, MagicMock
import tempfile
import os
import pickle

# Create mock CIFAR-10 data files
temp_dir = tempfile.mkdtemp()
datasets_dir = os.path.join(temp_dir, 'datasets', 'cifar10py')
os.makedirs(datasets_dir, exist_ok=True)

# Create mock training batches
for i in range(1, 6):
    batch_data = {
        'data': np.random.randint(0, 256, (10, 3072), dtype=np.uint8),
        'labels': np.random.randint(0, 10, (10,)).tolist()
    }
    batch_path = os.path.join(datasets_dir, f'data_batch_{i}')
    with open(batch_path, 'wb') as f:
        pickle.dump(batch_data, f)

# Create mock test batch
test_data = {
    'data': np.random.randint(0, 256, (5, 3072), dtype=np.uint8),
    'labels': np.random.randint(0, 10, (5,)).tolist()
}
test_path = os.path.join(datasets_dir, 'test_batch')
with open(test_path, 'wb') as f:
    pickle.dump(test_data, f)

# Patch the file paths to use our temporary directory
original_dir = os.getcwd()
os.chdir(temp_dir)

ARGS = {
    'mode': 'train',
    'greyscale': False,
    'CNN': True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, skimage — 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
fun Ran
ran on a synthesized input
bGhorbani/linearized_neural_networks/RF_Kernel_Gen.py
code served (permissive licence) · get_code("119e6c7e5139d644")
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 numpy as np

def fun(x):
    return np.maximum(0, x)

# Create a small numpy array with mixed positive and negative values
x = np.array([[-1, 2, -3, 4], [5, -6, 7, -8]], dtype=np.float32)

ARGS = {
    'x': x
}
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, 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
unpickle Ran
ran on a synthesized input
bGhorbani/linearized_neural_networks/preprocess.py
code served (permissive licence) · get_code("306d40284d54ba3f")
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 dict. 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 sys
import pickle
import tempfile
import os

# Create a temporary pickle file with sample data
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "test.pkl")

# Create some sample data and pickle it
sample_data = {"key": "value", "numbers": [1, 2, 3, 4, 5]}
with open(temp_file, 'wb') as f:
    pickle.dump(sample_data, f)

# Define ARGS with the pickled file path
ARGS = {
    "add": temp_file
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
addHFNoise Not yet run
unverified (harvested, no recorded run)
bGhorbani/linearized_neural_networks/preprocess.py
code served (permissive licence) · get_code("e5126224ca60d357")
How it ran

no invocation recorded.

Also present in other papers' code

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

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

For a certain scaling of the initialization of stochastic gradient descent (SGD), wide neural networks (NN) have been shown to be well approximated by reproducing kernel Hilbert space (RKHS) methods. Recent empirical work showed that, for some classification tasks, RKHS methods can replace NNs without a large loss in performance. On the other hand, two-layers NNs are known to encode richer smoothness classes than RKHS and we know of special examples for which SGD-trained NN provably outperform RKHS. This is true even in the wide network limit, for a different scaling of the initialization. How can we reconcile the above claims? For which tasks do NNs outperform RKHS? If covariates are nearly isotropic, RKHS methods suffer from the curse of dimensionality, while NNs can overcome it by learning the best low-dimensional representation. Here we show that this curse of dimensionality becomes milder if the covariates display the same low-dimensional structure as the target function, and we precisely characterize this tradeoff. Building on these results, we present the spiked covariates model that can capture in a unified framework both behaviors observed in earlier work. We hypothesize that such a latent low-dimensional structure is present in image classification. We test numerically this hypothesis by showing that specific perturbations of the training distribution degrade the performances of RKHS methods much more significantly than NNs.

For agents

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

get_harvested_code_for_paper("2006.13409")
get_code_for_paper("2006.13409")
have("2006.13409")

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

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

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

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

Connect an agent — have() is free.