SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2310.10807 · NeurIPS · 2023

Regularization properties of adversarially-trained linear regression

Thomas Schön, Antônio Ribeiro, Dave Zachariah, Francis Bach

arXiv · PDF · Open in the Atlas

Code that ran

8 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, 1 violated it and 0 have no contract verdict; 5 failures of our instrument; 3 no recorded run), measured 2026-11-24; 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/2310.10807.json · badge: /api/ran/2310.10807.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
antonior92/advtrain-linreg canonical (classifier label)
classifier basis: census
8 ran · 3 no recorded run
FunctionStatusWhere it lives
estimate_adv_radius Ran
ran; our contract draft was wrong, not the code
antonior92/advtrain-linreg/comparing_methods/estimate.py
code served (permissive licence) · get_code("dde87153c64c3d40")
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

# Construct valid arguments for estimate_adv_radius
# The function expects:
# - X: a numpy array with shape (n_train, n_features)
# - _y: a label array (used in function signature but not in body)
# - seed: random seed (int)
# - n_samples: number of samples (int)

n_train = 5
n_features = 3

# Create a small dataset X with shape (n_train, n_features)
X = np.random.randn(n_train, n_features).astype(np.float32)

# Create dummy labels _y (not used in function body but required in signature)
_y = np.array([0, 1, 0, 1, 0])

ARGS = {
    "X": X,
    "_y": _y,
    "seed": 1,
    "n_samples": 10
}
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
estimate_sqrt_lasso_reg Ran
ran; our contract draft was wrong, not the code
antonior92/advtrain-linreg/comparing_methods/estimate.py
code served (permissive licence) · get_code("9a58fec7b7bae791")
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

# Create a small dataset X with shape (n_train, n_features)
n_train = 5
n_features = 3
X = np.random.randn(n_train, n_features)

# Create a dummy target variable _y (not used in the function but required as parameter)
_y = np.random.randn(n_train)

# Define the arguments dictionary
ARGS = {
    "X": X,
    "_y": _y,
    "seed": 1,
    "n_samples": 10
}
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
generate_random_ortogonal Ran
ran, honoured the contract we drafted
antonior92/advtrain-linreg/datasets.py
code served (permissive licence) · get_code("2824a1210c63d6d0")
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 (5, 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

# Create a random number generator
rng = np.random.RandomState(seed=42)

# Define parameters for the function
p = 5  # number of rows
d = 3  # number of columns

# Construct ARGS dictionary
ARGS = {
    "p": p,
    "d": d,
    "rng": rng
}
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 (5, 3) — shape (5, 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_dataset Ran
ran; our contract draft was wrong, not the code
antonior92/advtrain-linreg/datasets.py
code served (permissive licence) · get_code("6a90f732312ff406")
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 pandas as pd
import sklearn.model_selection
from sklearn import datasets
from sklearn.kernel_approximation import RBFSampler
import os

# Create a minimal mock file structure for the MAGIC dataset case
# (we won't actually use it since we'll test with simpler datasets)

ARGS = {
    'dset': 'gaussian',
    'seed': 1,
    'parameter_norm': 1.0,
    'noise_std': 1.0,
    'test': False,
    'n_features': 10,
    'n_samples': 20,
    'sparsity': 3,
    'input_folder': 'WEBSITE/DATA'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas, sklearn — 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
get_median_and_quantiles Ran
ran, honoured the contract we drafted
antonior92/advtrain-linreg/magic/plot.py
code served (permissive licence) · get_code("6df7e6cfbf2117d1")
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 numpy as np

# Construct test data
# x: array of values that will be grouped (some duplicates expected)
# y: array of corresponding y values

x = np.array([1, 2, 1, 3, 2, 1, 3, 3])
y = np.array([10.0, 20.0, 15.0, 30.0, 25.0, 12.0, 35.0, 32.0])

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
numpy — 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
get_quantiles Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
antonior92/advtrain-linreg/utils.py
code served (permissive licence) · get_code("40ab339cc59ce96b")
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 numpy as np

# Create small arrays for testing get_quantiles
# xaxis: array of x-coordinates (can have duplicates)
# r: array of corresponding y-values

xaxis = np.array([1.0, 1.0, 2.0, 2.0, 3.0, 3.0])
r = np.array([0.5, 0.7, 1.2, 1.5, 2.1, 2.3])

ARGS = {
    "xaxis": xaxis,
    "r": r,
    "quantileslower": 0.25,
    "quantilesupper": 0.75,
}
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 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
get_quantiles_df Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
antonior92/advtrain-linreg/utils.py
code served (permissive licence) · get_code("243707ae2686e411")
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 numpy as np
import pandas as pd

# Create sample data for the function
np.random.seed(0)

# Create a simple DataFrame with x and y columns
xname = 'x_values'
yname = 'y_values'

# Create data where some x values repeat (so we can group by them)
x_data = np.array([1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4])
y_data = np.array([1.0, 1.1, 1.2, 2.0, 2.1, 2.2, 3.0, 3.1, 3.2, 4.0, 4.1, 4.2])

df = pd.DataFrame({
    xname: x_data,
    yname: y_data
})

ARGS = {
    'df': df,
    'xname': xname,
    'yname': yname
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — 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
ridge Ran
ran, violated the contract we drafted
antonior92/advtrain-linreg/training.py
code served (permissive licence) · get_code("1a4b4921f59dd821")
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 (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 scipy.linalg as linalg

torch_imported = False
try:
    import torch
    torch_imported = True
except:
    pass

# Set seed for reproducibility
if torch_imported:
    torch.manual_seed(0)
np.random.seed(0)

# Create small test data
# X should be a 2D array (samples x features)
# y should be a 1D array (samples,)
X = np.random.randn(2, 4).astype(np.float64)
y = np.random.randn(2).astype(np.float64)

# regularization parameter
regul = 0.1

ARGS = {
    'X': X,
    'y': y,
    'regul': regul
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, torch — 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 (4,) — shape (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
comput_advradius_zero Not yet run
unverified (harvested, no recorded run)
antonior92/advtrain-linreg/comparing_methods/estimate.py
code served (permissive licence) · get_code("d679e1db4f2edfe2")
How it ran

no invocation recorded.

compute_adv_attack Not yet run
unverified (harvested, no recorded run)
antonior92/advtrain-linreg/adversarial_attack.py
code served (permissive licence) · get_code("ec6c5f1280eb088b")
How it ran

no invocation recorded.

compute_q Not yet run
unverified (harvested, no recorded run)
antonior92/advtrain-linreg/advtrain.py
code served (permissive licence) · get_code("b65631d31bb9f5cb")
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, 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 11 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

State-of-the-art machine learning models can be vulnerable to very small input perturbations that are adversarially constructed. Adversarial training is an effective approach to defend against it. Formulated as a min-max problem, it searches for the best solution when the training data were corrupted by the worst-case attacks. Linear models are among the simple models where vulnerabilities can be observed and are the focus of our study. In this case, adversarial training leads to a convex optimization problem which can be formulated as the minimization of a finite sum. We provide a comparative analysis between the solution of adversarial training in linear regression and other regularization methods. Our main findings are that: (A) Adversarial training yields the minimum-norm interpolating solution in the overparameterized regime (more parameters than data), as long as the maximum disturbance radius is smaller than a threshold. And, conversely, the minimumnorm interpolator is the solution to adversarial training with a given radius. (B) Adversarial training can be equivalent to parameter shrinking methods (ridge regression and Lasso). This happens in the underparametrized region, for an appropriate choice of adversarial radius and zero-mean symmetrically distributed covariates. (C) For ℓ ∞ -adversarial training-as in square-root Lasso-the choice of adversarial radius for optimal bounds does not depend on the additive noise variance. We confirm our theoretical findings with numerical examples.

For agents

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

get_harvested_code_for_paper("2310.10807")
get_code_for_paper("2310.10807")
have("2310.10807")

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

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

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

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

Connect an agent — have() is free.