arXiv · 2610.26743
FOMTools: Development and AI-Assisted Code Generation for First-Order Methods
Abstract
We present FOMTools, an open-source Python package for developing, analyzing, and deploying first-order algorithms for parametric linear and convex quadratic optimization. The user specifies an iteration in Python, with syntax close to its mathematical description. The package represents the iteration as a computation graph of affine and piecewise affine operations. To analyze worst-case performance, FOMTools formulates a mixed-integer verification problem that maximizes a convergence residual over a specified set of problem instances and initial iterates. For probabilistic performance analysis, a batched GPU simulator collects algorithm trajectories and computes statistical bounds on the probability of exceeding a specified convergence tolerance. From the same algorithm description, FOMTools generates specialized solver code for embedded hardware, multicore CPUs, and GPUs. The package first generates the numerical data, factorizations, and matrix-vector routines without any agent. A coding agent then translates the iteration into C or CUDA code and iteratively optimizes the implementation. After each phase, the package runs the generated code on sampled inputs and compares it with a reference execution. FOMTools also serves as a CVXPYgen backend, generating and optimizing solvers for parametric CVXPY problems. We demonstrate FOMTools on sparse coding, network optimization, optimal control, and portfolio rebalancing. The verification bounds reveal worst-case behavior that sampling misses. The generated solvers run up to two orders of magnitude faster than NumPy implementations, and they outperform hand-written GPU code and the OSQP solvers generated by CVXPYgen.
Explore related subjects
Keep this discovery
Explore connections, maps & timelines
Vinit Ranjan, Daniel Deza, Anushka Acharya, Jisun Park, Bartolomeo Stellato. 2026-10-19. FOMTools: Development and AI-Assisted Code Generation for First-Order Methods. https://arxiv.org/abs/2610.26743
Cite the original work for its findings. Save a collection to share your selection of sources.