SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2004.06152 · 2020

Sparse Regression at Scale: Branch-and-Bound rooted in First-Order Optimization

arXiv · PDF · Open in the Atlas

Code that ran

12 of 18 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 12 have no contract verdict; 0 failures of our instrument; 6 no recorded run), measured 2026-11-21; 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/2004.06152.json · badge: /api/ran/2004.06152.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
alisaab/l0bnb canonical (classifier label)
classifier basis: census
9 ran · 2 no recorded run
rahulmaz/L0BnB community (classifier label)
classifier basis not recorded on the link
3 ran · 4 no recorded run
FunctionStatusWhere it lives
gen_synthetic Ran
ran on a synthesized input
alisaab/l0bnb/l0bnb/gensynthetic.py
code served (permissive licence) · get_code("978c558c7627b9e9")
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

ARGS = {
    "n": 50,
    "p": 20,
    "supp_size": 10,
    "rho": 0.5,
    "snr": 10,
    "seed": 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 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
gen_synthetic_2 Ran
ran on a synthesized input
alisaab/l0bnb/l0bnb/gensynthetic.py
code served (permissive licence) · get_code("f8967c94dfd3e170")
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
from numpy.random import normal

ARGS = {
    "n": 50,
    "p": 20,
    "supp_size": 10,
    "rho": 0.5,
    "snr": 10,
    "seed": 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 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_active_components Ran
ran on a synthesized input
alisaab/l0bnb/l0bnb/relaxation/_utils.py
code served (permissive licence) · get_code("66b42348cb4bb6d3")
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 numpy as np

torch.manual_seed(0)

# Small dimensions: batch=2, total_dims=4, active_subset=3
batch_size = 2
total_dims = 4
active_dims = 3

# Create a subset of active indices
act_set = torch.tensor([0, 1, 3])  # Select 3 out of 4 dimensions

# x: shape (batch_size, total_dims)
x = torch.randn(batch_size, total_dims)

# beta: shape (total_dims,)
beta = torch.randn(total_dims)

# zlb (lower bounds): shape (total_dims,)
zlb = torch.randn(total_dims)

# zub (upper bounds): shape (total_dims,)
zub = torch.randn(total_dims)

# xi_norm: shape (total_dims,)
xi_norm = torch.randn(total_dims)

ARGS = {
    "act_set": act_set,
    "x": x,
    "beta": beta,
    "zlb": zlb,
    "zub": zub,
    "xi_norm": xi_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 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
is_integral Ran
ran on a synthesized input
alisaab/l0bnb/l0bnb/relaxation/core.py
code served (permissive licence) · get_code("2f811ae2b259699c")
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 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

# Create a numpy array solution
solution = np.array([1.2, 2.4, 3.1, 0.9])

# Create a tolerance value
tol = 0.3

ARGS = {
    "solution": solution,
    "tol": tol,
}
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 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
is_integral Ran
ran on a synthesized input
alisaab/l0bnb/l0bnb/utilities.py
code served (permissive licence) · get_code("39442d5f7d0c8fff")
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 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

# Test case 1: solution with fractional parts
solution_fractional = np.array([1.3, 2.7, 0.4, 3.1])
tol_value = 0.2

ARGS = {
    "solution": solution_fractional,
    "tol": tol_value
}
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 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
is_integral Ran
ran on a synthesized input
rahulmaz/L0BnB/l0bnb/utilities.py
code served (permissive licence) · get_code("5d543829beddd546")
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 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

# Test case 1: integral solution (all values very close to integers)
solution_integral = np.array([1.0, 2.0, 3.0, 4.0])
tol_integral = 0.1

# Test case 2: fractional solution (values with significant fractional parts)
solution_fractional = np.array([1.3, 2.7, 3.2, 4.6])
tol_fractional = 0.1

ARGS = {
    "solution": solution_fractional,
    "tol": tol_fractional
}
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 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
max_fraction_branching Ran
ran on a synthesized input
alisaab/l0bnb/l0bnb/utilities.py
code served (permissive licence) · get_code("17c8f5a1d22ccc5d")
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 int64, 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

# Create a valid numpy array solution
# The function checks if solution.size != 0, accesses elements via indexing,
# and performs arithmetic operations on the array
solution = np.array([0.2, 0.6, 0.1, 0.9, 0.3])

# Create a tolerance value for the branching criterion
tol = 0.3

ARGS = {
    "solution": solution,
    "tol": tol,
}
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 int64, 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
max_fraction_branching Ran
ran on a synthesized input
rahulmaz/L0BnB/l0bnb/utilities.py
code served (permissive licence) · get_code("38ece7d2872d4edb")
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 int64, 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

# Create a solution array with some fractional values
# The function casts to int and checks the difference from the original
solution = np.array([1.3, 2.7, 3.1, 4.6, 5.2])

# Tolerance for checking if fractional part is significant
tol = 0.1

ARGS = {
    "solution": solution,
    "tol": tol,
}
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 int64, 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
new_z Ran
ran on a synthesized input
alisaab/l0bnb/l0bnb/utilities.py
code served (permissive licence) · get_code("6edb5ed14eaf4651")
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 int; 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

class Node:
    def __init__(self):
        self.zlb = [1, 2, 3]
        self.zub = [4, 5, 6]

node = Node()
index = 7

ARGS = {
    "node": node,
    "index": index
}
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 2, dtype family int — 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
new_z Ran
ran on a synthesized input
rahulmaz/L0BnB/l0bnb/utilities.py
code served (permissive licence) · get_code("ddcdc2422cf06418")
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 int; 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 copy

torch.manual_seed(0)

class Node:
    def __init__(self):
        self.lower_bound_z = [2.3, 5.7, 1.1, 8.9]
        self.zlb = [0, 0, 0, 0]
        self.zub = [10, 10, 10, 10]

node = Node()
index = 1

ARGS = {
    "node": node,
    "index": index
}
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 2, dtype family int — 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
process_data Ran
ran on a synthesized input
alisaab/l0bnb/l0bnb/regpath.py
code served (permissive licence) · get_code("b621fc226310f0ff")
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

# Create sample data with distinct dimensions
x = np.array([
    [1.0, 2.0, 3.0],
    [4.0, 5.0, 6.0]
], dtype=np.float64)  # shape (2, 3)

y = np.array([1.0, 2.0], dtype=np.float64)  # shape (2,)

intercept = True
normalize = False

ARGS = {
    "x": x,
    "y": y,
    "intercept": intercept,
    "normalize": normalize
}
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 — 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
upper_bound_solve Ran
ran on a synthesized input
alisaab/l0bnb/l0bnb/node/_utils.py
code served (permissive licence) · get_code("d2130c83f5944cdf")
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
from scipy import optimize as sci_opt

np.random.seed(0)

# Small dataset: 5 samples, 4 features
n_samples = 5
n_features = 4

x = np.random.randn(n_samples, n_features)
y = np.random.randn(n_samples)

# Regularization parameters
l0 = 0.1  # L0 regularization strength
l2 = 0.01  # L2 regularization strength

# Bound parameter
m = 1.0  # Bound on coefficients

# Support set (subset of feature indices)
support = [0, 2]  # Use features 0 and 2

ARGS = {
    "x": x,
    "y": y,
    "l0": l0,
    "l2": l2,
    "m": m,
    "support": support,
}
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 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
fit_path Not yet run
unverified (harvested, no recorded run)
alisaab/l0bnb/l0bnb/regpath.py
code served (permissive licence) · get_code("74d912504d7fd043")
How it ran

no invocation recorded.

fit_path Not yet run
unverified (harvested, no recorded run)
rahulmaz/L0BnB/l0bnb/regpath.py
code served (permissive licence) · get_code("1ec18a0ab8dc9db6")
How it ran

no invocation recorded.

l0gurobi Not yet run
unverified (harvested, no recorded run)
alisaab/l0bnb/l0bnb/relaxation/gurobi.py
code served (permissive licence) · get_code("66a2bcf680baf71d")
How it ran

no invocation recorded.

l0gurobi Not yet run
unverified (harvested, no recorded run)
rahulmaz/L0BnB/l0bnb/_third_party.py
code served (permissive licence) · get_code("830425539c1d8a53")
How it ran

no invocation recorded.

l0mosek Not yet run
unverified (harvested, no recorded run)
rahulmaz/L0BnB/l0bnb/_third_party.py
code served (permissive licence) · get_code("bbd8a1d3965ddb2d")
How it ran

no invocation recorded.

profile Not yet run
unverified (harvested, no recorded run)
rahulmaz/L0BnB/profiler.py
code served (permissive licence) · get_code("7359de55f733ea7b")
How it ran

no invocation recorded.

Also present in other papers' code

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

Repositories linked to this paper

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

Abstract

We consider the least squares regression problem, penalized with a combination of the $\ell_{0}$ and squared $\ell_{2}$ penalty functions (a.k.a. $\ell_0 \ell_2$ regularization). Recent work shows that the resulting estimators are of key importance in many high-dimensional statistical settings. However, exact computation of these estimators remains a major challenge. Indeed, modern exact methods, based on mixed integer programming (MIP), face difficulties when the number of features $p \sim 10^4$. In this work, we present a new exact MIP framework for $\ell_0\ell_2$-regularized regression that can scale to $p \sim 10^7$, achieving speedups of at least $5000$x, compared to state-of-the-art exact methods. Unlike recent work, which relies on modern commercial MIP solvers, we design a specialized nonlinear branch-and-bound (BnB) framework, by critically exploiting the problem structure. A key distinguishing component in our framework lies in efficiently solving the node relaxations using a specialized first-order method, based on coordinate descent (CD). Our CD-based method effectively leverages information across the BnB nodes, through using warm starts, active sets, and gradient screening. In addition, we design a novel method for obtaining dual bounds from primal CD solutions, which certifiably works in high dimensions. Experiments on synthetic and real high-dimensional datasets demonstrate that our framework is not only significantly faster than the state of the art, but can also deliver certifiably optimal solutions to statistically challenging instances that cannot be handled with existing methods. We open source the implementation through our toolkit L0BnB.

For agents

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

get_harvested_code_for_paper("2004.06152")
get_code_for_paper("2004.06152")
have("2004.06152")

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

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

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

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

Connect an agent — have() is free.