NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

L0Learn: A Scalable Package for Sparse Learning using L0 Regularization

Hussein Hazimeh, Rahul Mazumder, Tim Nonet

TL;DR

L0Learn is a high-performance open-source library that makes $\ell_0$ regularization (best subset selection) practical for massive datasets. By combining coordinate descent with local combinatorial search, it achieves state-of-the-art sparsity and predictive accuracy at speeds comparable to standard Lasso solvers, even with millions of features.

What Problem Does This Paper Address?

In high-dimensional statistics, we often want to find the smallest set of features that explains our data—a property called sparsity. The "gold standard" for this is $\ell_0$ regularization, which directly penalizes the number of non-zero coefficients in a model. This is known as best subset selection.

However, solving the $\ell_0$ problem is NP-hard. For decades, researchers have relied on "proxies" like the $\ell_1$ norm (the Lasso), which are easier to solve mathematically but often introduce unwanted bias or include too many irrelevant features (false positives). While recent advances in Mixed Integer Programming (MIP) can find the mathematically perfect $\ell_0$ solution, they are often too slow for real-world datasets with millions of variables. L0Learn fills this gap by providing a scalable, approximate solver that is fast enough for everyday use while maintaining the statistical advantages of $\ell_0$ regularization.

Methods

L0Learn implements a hybrid algorithmic approach to minimize the empirical risk with $\ell_0$ penalties (and optional $\ell_1$ or $\ell_2$ shrinkage to prevent overfitting). The core engine consists of two main components:

  1. Cyclic Coordinate Descent (CD): A fast, iterative method that updates one coefficient at a time. While standard CD theory doesn't apply to the discontinuous $\ell_0$ objective, the authors utilize a specialized variant that is guaranteed to converge to a local minimizer.
  2. Local Combinatorial Optimization: To avoid getting stuck in poor local minima, the algorithm performs a "local search." It explores a neighborhood of the current solution by swapping features—removing one active variable and adding a previously inactive one—to see if the objective function improves.

The package is written in C++ for speed, utilizing the Armadillo library for linear algebra and BLAS for hardware acceleration. It provides user-friendly wrappers for both R and Python, supporting both dense and sparse data matrices.

Datasets

The paper evaluates the package using synthetic datasets designed to mimic high-dimensional regression challenges:

  • Setup: A linear regression model with $n=1000$ samples and $k=50$ true features.
  • Scaling: The number of features ($p$) was varied across three orders of magnitude: $10^3$, $10^4$, and $10^5$.
  • Correlation: Features were generated using an exponential correlation model ($\rho = 0.3$) to simulate realistic data dependencies.

While the paper focuses on these controlled benchmarks, it notes that the package has been successfully applied to real-world genomics and healthcare datasets in related studies.

Key Insights and Ideas

  • The Power of Swapping: The combination of CD and local search is the "secret sauce." CD provides the speed, while the combinatorial search allows the algorithm to "jump" out of local optima that trap simpler methods.
  • Data-Dependent Grids: $\ell_0$ problems are unique because different regularization strengths ($\lambda$) can result in the exact same model. L0Learn uses a novel method to compute a data-dependent grid of $\lambda$ values, ensuring the solver doesn't waste time re-calculating identical solutions.
  • Efficiency via Active Sets: The implementation uses "active set" strategies and correlation screening, which allow it to ignore most irrelevant features early in the computation, drastically reducing the memory and CPU footprint.

Key Results

The authors compared L0Learn against popular sparse learning packages including glmnet (Lasso), ncvreg (MCP), picasso, and abess.

As shown in the experimental results (Figure 1), L0Learn consistently outperformed or matched its competitors across several metrics:

  • Sparsity and Accuracy: L0Learn achieved zero false positives (FP) across all tested feature sizes ($p=10^3$ to $10^5$), identifying the exact 50 true features. In contrast, glmnet and picasso included hundreds of irrelevant features.
  • Speed: L0Learn was significantly faster than most competitors. For $p=10^5$, it computed a full regularization path in just 4.4 seconds, compared to 8 seconds for glmnet and nearly 20 seconds for ncvreg.
  • Robustness: While abess failed on the largest dataset ($p=10^5$) due to memory issues, L0Learn handled it with ease.
Table 1: Performance comparison of L0Learn against other sparse learning toolkits. Note the zero False Positives (FP) and competitive timing for L0Learn.

Limitations and Future Work

The primary limitation is that L0Learn provides approximate solutions. While these approximations are high-quality and statistically excellent, they do not come with a certificate of global optimality like slower MIP-based solvers.

For future work, the authors suggest exploring the use of these coordinate descent and combinatorial search techniques for neural network pruning, where $\ell_0$-based methods could help create much smaller, more efficient deep learning models without sacrificing accuracy.

Summary updated

BibTeX
@article{hazimeh2023l,
  author = {Hussein Hazimeh and Rahul Mazumder and Tim Nonet},
  title = {{L0Learn: A Scalable Package for Sparse Learning using L0 Regularization}},
  journal = {J. Mach. Learn. Res.},
  year = {2023},
}
Figure