SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2111.06063 · NeurIPS · 2021

On the Equivalence between Neural Network and Support Vector Machine

Lam Nguyen, Wei Huang, Yilan Chen, Tsui-Wei Weng

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-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/2111.06063.json · badge: /api/ran/2111.06063.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
leslie-CH/equiv-nn-svm canonical (classifier label)
classifier basis not recorded on the link
9 ran · 1 no recorded run
FunctionStatusWhere it lives
activation_bound Ran
ran; our contract draft was wrong, not the code
leslie-CH/equiv-nn-svm/ibp.py
code served (permissive licence) · get_code("69017b3a991e0815")
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 torch.nn as nn

torch.manual_seed(0)

# Create a simple neural network layer that can be called on tensors
layer = nn.Linear(4, 3)

# Create prev_upper and prev_lower tensors
# These should be compatible with the layer's input dimension (4)
prev_upper = torch.randn(2, 4)
prev_lower = torch.randn(2, 4)

ARGS = {
    "layer": layer,
    "prev_upper": prev_upper,
    "prev_lower": prev_lower
}
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
binary_search Ran
ran on a synthesized input
leslie-CH/equiv-nn-svm/robust_svm.py
code served (permissive licence) · get_code("5966a7c925b28912")
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 numpy as np

torch.manual_seed(0)

# Analyzing the function:
# - m: numeric value (appears to be compared and used in arithmetic)
# - l: numeric value (left boundary, used in arithmetic)
# - r: numeric value (right boundary, used in arithmetic)
# - condition: numeric value (compared to 0 with > operator)

ARGS = {
    "m": 5.0,
    "l": 0.0,
    "r": 10.0,
    "condition": 1
}
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, 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
bound_ntk Ran
ran on a synthesized input
leslie-CH/equiv-nn-svm/robust_svm.py
code served (permissive licence) · get_code("70beef44814477b6")
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 numpy as np
import torch

torch.manual_seed(0)

# Parameters for bound_ntk function
delta = torch.tensor(0.1, dtype=torch.float32)
d = torch.tensor(4.0, dtype=torch.float32)
x_norm = torch.tensor(2.5, dtype=torch.float32)
x_X_train_dot = torch.tensor([0.5, -0.3, 1.2, 0.8], dtype=torch.float32)
X_train_norm = torch.tensor([1.5, 2.0, 1.8, 1.2], dtype=torch.float32)

ARGS = {
    'delta': delta,
    'd': d,
    'x_norm': x_norm,
    'x_X_train_dot': x_X_train_dot,
    'X_train_norm': X_train_norm,
}
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
h_map Ran
ran on a synthesized input
leslie-CH/equiv-nn-svm/robust_svm.py
code served (permissive licence) · get_code("fc955f4c0c5be375")
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 numpy as np
import torch

torch.manual_seed(0)

# The function h_map takes a single parameter u
# and applies mathematical operations on it.
# u should be a tensor (based on torch.arccos and torch.sqrt usage)
# Create a small tensor with values in valid range for arccos ([-1, 1])
u = torch.tensor([[0.5, 0.3, -0.2, 0.8],
                   [0.1, -0.5, 0.7, 0.0]], dtype=torch.float32)

ARGS = {
    "u": u
}
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
initial_bounds Ran
ran, violated the contract we drafted
leslie-CH/equiv-nn-svm/ibp.py
code served (permissive licence) · get_code("cfb1c3dd218b92f0")
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 5, 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

torch.manual_seed(0)

# x0 is a tensor of shape (b, c, h, w)
# The function performs simple arithmetic operations on it
x0 = torch.randn(2, 3, 4, 5)

# epsilon is a scalar value for the perturbation bounds
epsilon = 0.1

ARGS = {
    "x0": x0,
    "epsilon": epsilon,
}
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, ndim 5, 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
load_hparam Ran
ran on a synthesized input
leslie-CH/equiv-nn-svm/functions/hparams.py
code served (permissive licence) · get_code("81ac7e5de8c2e14b")
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 yaml
import tempfile
import os

# Create a temporary YAML file with multi-document content
temp_dir = tempfile.mkdtemp()
yaml_file = os.path.join(temp_dir, "test_hparams.yaml")

# Write a YAML file with multiple documents
yaml_content = """learning_rate: 0.001
batch_size: 32
---
epochs: 100
optimizer: adam
"""

with open(yaml_file, 'w') as f:
    f.write(yaml_content)

ARGS = {
    "filename": yaml_file
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
yaml — 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
make_layers Ran
ran on a synthesized input
leslie-CH/equiv-nn-svm/models/model.py
code served (permissive licence) · get_code("bdd93f20e2c85cfa")
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 Sequential. 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
from torch import nn

torch.manual_seed(0)

ARGS = {
    "hidden_layer": 2,
    "width": 128,
    "input_size": 3 * 32 * 32,
    "output_size": 10
}
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 Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 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
merge_dict Ran
ran on a synthesized input
leslie-CH/equiv-nn-svm/functions/hparams.py
code served (permissive licence) · get_code("0cfe2baee7e49f75")
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 torch
import numpy as np

torch.manual_seed(0)

# The function merge_dict recursively merges a user dict into a default dict.
# It requires two parameters: user and default, both should be dicts.
# The function checks isinstance for dict, iterates over items, and handles nested dicts.

# Create a simple nested user dict
user_dict = {
    "model": {
        "layers": 2,
    },
    "learning_rate": 0.01,
}

# Create a simple nested default dict with some overlapping and new keys
default_dict = {
    "model": {
        "layers": 3,
        "hidden_size": 128,
    },
    "learning_rate": 0.001,
    "batch_size": 32,
    "epochs": 10,
}

ARGS = {
    "user": user_dict,
    "default": default_dict,
}
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 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
weighted_bound Ran
ran on a synthesized input
leslie-CH/equiv-nn-svm/ibp.py
code served (permissive licence) · get_code("f928c5703d66d699")
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 torch.nn as nn
import torch.nn.functional as F

torch.manual_seed(0)

# Create a simple Linear layer for testing
linear_layer = nn.Linear(in_features=4, out_features=3)

# Create prev_upper and prev_lower tensors
# Shape: (batch_size=2, features=4)
prev_upper = torch.randn(2, 4)
prev_lower = torch.randn(2, 4)

# Ensure prev_lower < prev_upper for validity
prev_lower = prev_lower - 1.0

ARGS = {
    "layer": linear_layer,
    "prev_upper": prev_upper,
    "prev_lower": prev_lower
}
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
load_hparam_str Not yet run
unverified (harvested, no recorded run)
leslie-CH/equiv-nn-svm/functions/hparams.py
code served (permissive licence) · get_code("70da19149f22400f")
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, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 2 later) and 7 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
activation_bound 5 other papers
2 dated earlier, 3 later
1907.09470 (2019-07)
Characterizing Attacks on Deep Reinforcement Learning
2008.01976 (2020-08)
Robust Deep Reinforcement Learning through Adversarial Loss
2402.02165 (2024-02)
Towards Optimal Adversarial Robust Q-learning with Bellman Infinity-error
and 2 more not named here
initial_bounds 4 other papers
2 dated earlier, 2 later
1907.09470 (2019-07)
Characterizing Attacks on Deep Reinforcement Learning
2008.01976 (2020-08)
Robust Deep Reinforcement Learning through Adversarial Loss
2402.02165 (2024-02)
Towards Optimal Adversarial Robust Q-learning with Bellman Infinity-error
and 1 more not named here
merge_dict 3 other papers
3 dated earlier
1703.10135 (2017-03)
Tacotron: Towards End-to-End Speech Synthesis
1710.10467 (2017-10)
Generalized End-to-End Loss for Speaker Verification
2010.11607 (2020-10)
Backdoor Attack against Speaker Verification

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

Recent research shows that the dynamics of an infinitely wide neural network (NN) trained by gradient descent can be characterized by Neural Tangent Kernel (NTK) [27]. Under the squared loss, the infinite-width NN trained by gradient descent with an infinitely small learning rate is equivalent to kernel regression with NTK [4]. However, the equivalence is only known for ridge regression currently [6], while the equivalence between NN and other kernel machines (KMs), e.g. support vector machine (SVM), remains unknown. Therefore, in this work, we propose to establish the equivalence between NN and SVM, and specifically, the infinitely wide NN trained by soft margin loss and the standard soft margin SVM with NTK trained by subgradient descent. Our main theoretical results include establishing the equivalences between NNs and a broad family of 2 regularized KMs with finite-width bounds, which cannot be handled by prior work, and showing that every finite-width NN trained by such regularized loss functions is approximately a KM. Furthermore, we demonstrate our theory can enable three practical applications, including (i) non-vacuous generalization bound of NN via the corresponding KM; (ii) non-trivial robustness certificate for the infinite-width NN (while existing robustness verification methods would provide vacuous bounds); (iii) intrinsically more robust infinite-width NNs than those from previous kernel regression. Our code for the experiments is available at https://github.com/leslie-CH/equiv-nn-svm. 35th Conference on Neural Information Processing Systems (NeurIPS 2021).

For agents

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

get_harvested_code_for_paper("2111.06063")
get_code_for_paper("2111.06063")
have("2111.06063")

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

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

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

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

Connect an agent — have() is free.