Search arXiv⌕ Search

arXiv · 2611.40024

Discovering Practical Algorithms for Least Squares using Language Models

Abstract

Least squares is a central problem in scientific computing with applications across many domains such as the natural and social sciences. The design and implementation of state-of-the-art algorithms for solving least squares are often based on worst-case theoretical analysis and tailored to provide numerically stable solutions. These principles are often too conservative in real-world settings, incurring severe runtime slowdowns. Manually designing per-use-case algorithm implementations, on the other hand, requires domain knowledge and tedious trial-and-error. In this work, we leverage recent progress in large language model-guided automated discovery to automate the design of practical algorithms for numerical linear algebra applications. More specifically, our methodology frames the search for practical least squares algorithms as a meta-discovery problem: given a family of downstream solver tasks, we combine language model-guided algorithm evolution with robust meta-evaluation accounting for runtime and solver accuracy. We demonstrate the effectiveness and flexibility of our framework by discovering faster practical algorithms across an extensive list of synthetic and real-world least squares tasks. The discovered algorithms are $2\times$ faster than optimized baselines on large kernel regression tasks from the SUSY dataset for high-energy particle physics classification with up to one million rows. Additionally, we analyze the algorithms discovered by our framework and decompose the runtime improvements across algorithmic changes, hyperparameter optimization, and code engineering.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Marco Pirazzini, Robert Tjarko Lange. 2026-11-29. Discovering Practical Algorithms for Least Squares using Language Models. https://searcharxiv.org/abs/2611.40024

Citations retain the original authors and DOI and include this site’s record URL. If this discovery service contributed to your research, you can also cite Search arXiv by Indiciae: BibTeX · RIS.

KEEP EXPLORING

Related papers

Dual Numbers for Arbitrary Order Automatic Differentiation

We present DNAOAD-FPM, a modern Fortran package for univariate automatic differentiation with arbitrary-order dual numbers. Its complex-valued components store ordinary derivatives through a user-selected order within a compiled capacity. A generic composition routine computes all requested orders using one table of partial Bell polynomials per composition. For $\exp(\sin x)$ at $x=0.5$, DNAOAD-FPM had lower median evaluation times at the tested orders through 8, and ADOL-C's higher-order forward sweep with a reused tape had lower medians at the tested orders from 12 to 24. Two applications illustrate how dual results pass between routines. In the first, a Newton--Raphson solver for Kepler's equation returns the dual eccentric anomaly to a routine that computes orbital position. Checking every active residual component prevents premature termination at a converged scalar root. An eighth-order expansion met a position tolerance of $10^{-12}$ times the semimajor axis at all 256 query points at each of two centers. Including construction, the ratio of direct scalar solution time to expansion time ranged from 1.03 to 3.33 across the two centers and two compilers. In the second application, a geometry routine returns an orthonormal frame attached to the coupler of a spherical four-bar linkage. A single evaluation of this frame through order eight supplies the coupler's angular velocity and its first seven time derivatives. All components through angular snap reproduce published values to their reported precision. At the tested configuration, the four higher-order vectors agree with an independent calculation to within $1.2\times10^{-15}$ in relative Euclidean norm.

math.NA↗

Function approximation in numerically rank-deficient bases

We study least-squares function approximation in a finite basis under finite-precision arithmetic. In a highly non-orthogonal basis, certain directions are only weakly represented and hence very sensitive to rounding errors. Such a basis is called numerically rank-deficient. In the first part, we characterize the influence of rounding in such bases through an explicit, method-agnostic treatment of rounding errors. The numerical error is bounded above by the approximation error plus a penalty proportional to the unit roundoff and the size of the expansion coefficients. Lower bounds of the same form hold in expectation under a stochastic model for the rounding errors and, for a single fixed rounding realization, in terms of two explicit constants. These bounds justify l2-regularized approximation with a parameter of the order of the unit roundoff, which we term finite-precision regularization. This regularization also controls the amplification of algorithmic errors during the computation of the expansion coefficients and relaxes the conditions required for accurate least-squares approximation from sampled data. In the second part, we make this relaxation concrete for randomized sampling, using a regularized variant of the Christoffel function. The resulting sample complexity bounds depend on an effective dimension, which counts the directions that are insensitive to rounding. Moreover, the regularized Christoffel function can be evaluated accurately by stable algorithms for a sufficiently large regularization parameter, unlike the standard one. For univariate Fourier extension frames with n functions, the theory indicates that the sample complexity bound for uniformly random samples grows at least quadratically in n in exact arithmetic, but only (log-)linearly with finite-precision regularization, under an assumed bound on the sup-norms of the singular functions.

math.NA↗

A PINNs approach for the computation of eigenvalues in elliptic problems

In this paper, we propose a method for computing eigenvalues of elliptic problems using Deep Learning techniques. A key feature of our approach is that it is independent of the space dimension and can compute arbitrary eigenvalues without requiring the prior computation of lower ones. Moreover, the method can be easily adapted to handle nonlinear eigenvalue problems.

math.NA↗