Papers
Topics
Authors
Recent
Search
2000 character limit reached

LLADA.CPP: Robust LAD-LASSO Solver

Updated 18 June 2026
  • LLADA.CPP is a compact, efficient framework for solving the LAD-LASSO regression problem using coordinate descent and ternary search.
  • It leverages convexity and piecewise-linear properties to guarantee global optimization and robust variable selection.
  • The framework is designed for scalability, supporting parallel GPU execution and browser-based modeling for numerous small-scale regressions.

LLADA.CPP is a compact, implementation-oriented algorithmic framework for efficiently solving the Least Absolute Deviation LASSO regression problem (LAD-LASSO) via coordinate descent augmented with a ternary-search “quadrature” approach. Originally designed to support interactive GPU- and browser-based mathematical modeling with robust variable selection, LLADA.CPP delivers a practical and general-purpose solver structure particularly well-suited for simultaneous solution of hundreds of small-scale regression tasks—either on single CPU threads or in parallelized browser GPU environments (Wright, 17 Oct 2025).

1. Mathematical Formulation and Problem Context

LLADA.CPP solves the LAD-LASSO regression objective, a convex optimization problem combining robust regression with L1-penalized variable selection. The task is, given data XRn×pX\in \mathbb{R}^{n\times p} and response vector yRny\in \mathbb{R}^n, to compute

F(β)=i=1nyixiTβ+λj=1pβjF(\beta) = \sum_{i=1}^n |y_i - x_i^T\beta| + \lambda\sum_{j=1}^p |\beta_j|

for regression coefficients βRp\beta \in \mathbb{R}^p and penalty parameter λ0\lambda\geq 0. The LAD loss offers superior robustness to outliers compared to OLS, while the L1 penalty provides sparsity for variable selection. This combination is relevant in applications where both statistical interpretability and robustness are required. The convexity of FF ensures a unique global minimizer, but the non-smooth, piecewise-linear nature complicates optimization using standard second-order or smooth-gradient methods.

2. Axis-wise Minima, Convex Locus, and Algorithmic Principle

A foundational observation is that—despite multiple axis-wise local minima—the locus of these minima forms a monotonic, convex one-dimensional set. Specifically, if all coordinates but jj are fixed, FF as a function of βj\beta_j is convex and piecewise linear, with a unique minimizer. By varying one distinguished coordinate (typically β1\beta_1) and, for each trial value, running cyclic coordinate descent (CCD) over the other yRny\in \mathbb{R}^n0 coordinates (fixing yRny\in \mathbb{R}^n1), one traces a curve of axis-wise minima with the crucial property of monotonicity in every coordinate. Restricting yRny\in \mathbb{R}^n2 to this curve yields a univariate convex function, making global optimization on this set tractable by single-variable convex search (e.g., ternary search).

This structure justifies the two-level approach of LLADA.CPP: an outer ternary search along the distinguished coordinate, and an inner coordinate descent to minimize yRny\in \mathbb{R}^n3 over the remaining axes for each fixed value.

3. Cyclic Coordinate Descent and Coordinate-wise Update Mechanics

For a fixed coordinate yRny\in \mathbb{R}^n4, the update in LLADA.CPP minimizes a univariate penalized LAD subproblem: yRny\in \mathbb{R}^n5 where yRny\in \mathbb{R}^n6 is the partial residual. This function is convex and piecewise linear in yRny\in \mathbb{R}^n7, with breakpoints at yRny\in \mathbb{R}^n8 for all yRny\in \mathbb{R}^n9 where F(β)=i=1nyixiTβ+λj=1pβjF(\beta) = \sum_{i=1}^n |y_i - x_i^T\beta| + \lambda\sum_{j=1}^p |\beta_j|0, and F(β)=i=1nyixiTβ+λj=1pβjF(\beta) = \sum_{i=1}^n |y_i - x_i^T\beta| + \lambda\sum_{j=1}^p |\beta_j|1 (due to the L1 penalty). The update is performed by evaluating the objective at these candidate breakpoints:

  1. Construct F(β)=i=1nyixiTβ+λj=1pβjF(\beta) = \sum_{i=1}^n |y_i - x_i^T\beta| + \lambda\sum_{j=1}^p |\beta_j|2.
  2. For each F(β)=i=1nyixiTβ+λj=1pβjF(\beta) = \sum_{i=1}^n |y_i - x_i^T\beta| + \lambda\sum_{j=1}^p |\beta_j|3, compute F(β)=i=1nyixiTβ+λj=1pβjF(\beta) = \sum_{i=1}^n |y_i - x_i^T\beta| + \lambda\sum_{j=1}^p |\beta_j|4.
  3. Set F(β)=i=1nyixiTβ+λj=1pβjF(\beta) = \sum_{i=1}^n |y_i - x_i^T\beta| + \lambda\sum_{j=1}^p |\beta_j|5 to the F(β)=i=1nyixiTβ+λj=1pβjF(\beta) = \sum_{i=1}^n |y_i - x_i^T\beta| + \lambda\sum_{j=1}^p |\beta_j|6 which minimizes F(β)=i=1nyixiTβ+λj=1pβjF(\beta) = \sum_{i=1}^n |y_i - x_i^T\beta| + \lambda\sum_{j=1}^p |\beta_j|7.

The coordinate-wise update is F(β)=i=1nyixiTβ+λj=1pβjF(\beta) = \sum_{i=1}^n |y_i - x_i^T\beta| + \lambda\sum_{j=1}^p |\beta_j|8 in the worst case but practical for moderate F(β)=i=1nyixiTβ+λj=1pβjF(\beta) = \sum_{i=1}^n |y_i - x_i^T\beta| + \lambda\sum_{j=1}^p |\beta_j|9 (βRp\beta \in \mathbb{R}^p0) and highly suitable for parallelization in GPU settings.

4. Ternary-Search Quadrature and Global Minimization

The outer optimization in LLADA.CPP proceeds via a ternary search over a selected coordinate (commonly βRp\beta \in \mathbb{R}^p1 or βRp\beta \in \mathbb{R}^p2). An initial bracket βRp\beta \in \mathbb{R}^p3 is established (e.g., via a doubling search) to ensure the global minimizer lies within. The ternary search iteratively refines this bracket:

  • Evaluate βRp\beta \in \mathbb{R}^p4 at βRp\beta \in \mathbb{R}^p5 and βRp\beta \in \mathbb{R}^p6 by fixing βRp\beta \in \mathbb{R}^p7 at βRp\beta \in \mathbb{R}^p8 or βRp\beta \in \mathbb{R}^p9 and performing inner CCD on the other coordinates.
  • Retain the bracket half that contains the lower value of λ0\lambda\geq 00.
  • Terminate when the bracket width is below the preset tolerance.

The solution is finalized via one complete CCD pass at the midpoint of the last bracket. All steps maintain convexity guarantees: the minimizer found is global for λ0\lambda\geq 01 (Wright, 17 Oct 2025).

5. Initialization, Convergence, and Hyperparameters

Initialization uses λ0\lambda\geq 02 as the starting point (always feasible). Convergence in the inner CCD loop is determined by a coordinate-wise tolerance or a maximum number of cycles. Outer ternary search accuracy is set by the bracket reduction tolerance (e.g., λ0\lambda\geq 03 to λ0\lambda\geq 04). The penalty parameter λ0\lambda\geq 05 can be selected for robustness (λ0\lambda\geq 06) or for variable selection (via λ0\lambda\geq 07-fold cross-validation from λ0\lambda\geq 08 to λ0\lambda\geq 09). It is essential to enforce FF0 to address non-uniqueness in flat stretches of the objective.

6. Implementation Structure and Computational Considerations

LLADA.CPP is designed for ease of translation to C++ and by extension to WebGL-style GPU kernels. The data matrix FF1 is stored as a 1D row-major array, with auxiliary vectors for FF2, FF3, and residuals. All primary routines are simple for-loops, and all memory management is explicit—no dynamic allocations inside core loops. Candidate sets are stored in preallocated buffers of size FF4. No external dependency is required beyond basic standard libraries. The resulting implementation is efficient on single CPU threads and trivially parallelizable for GPU execution over multiple independent regression tasks.

A minimal C++ structure for LLADA.CPP, covering all main mechanics and control flows, can be constructed directly from the algorithmic summary above. It is fully functional while leaving room for further enhancement, such as cross-validation loops, multi-threaded parallelization, or additional logging (Wright, 17 Oct 2025).

7. Practical Scope, Extensions, and Applications

LLADA.CPP enables simultaneous robust regression and feature selection in contexts where extreme scale (hundreds of tasks) or deployment constraints (browser, WebGL, or single-threaded platforms) prohibit heavyweight optimization toolkits. The algorithm’s structure is suitable for GPU parallelization, as each coordinate-update subproblem is computationally simple and each regression instance is independent. Extensions may include more efficient one-dimensional minimization for coordinate updates, adaptive convergence tolerances, or custom initialization schemes. The outlined approach is central to interactive mathematical modeling, especially in decision support tools requiring live model fitting and interpretation with outlier robustness.

Potential avenues for further research or implementation enhancement include exploring advanced memory layouts, alternative regularization schemes, and integration into distributed computation frameworks targeting low-latency environments.


For detailed algorithmic explanation and pseudocode suitable for direct implementation, see "A simple LAD-LASSO coordinate descent algorithm for interactive browser-based GPU applications" (Wright, 17 Oct 2025).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to LLADA.CPP.