# MathOptAI.jl: Embed trained machine learning predictors into JuMP models

arXiv: https://arxiv.org/abs/2507.03159 · HTML: https://mlsanity.com/paper/2507.03159/

## Key facts

- Cited by 2 papers in the map (data through 14 Oct 2026).
- Builds on 7 of its 25 references that are in the map.
- First posted on arXiv 3 Jul 2025.

## Builds on (most cited first, 7 of 7)

- [PyTorch: An Imperative Style, High-Performance Deep Learning Library](https://mlsanity.com/paper/1912.01703/) (2019)
- [Parallelizing the dual revised simplex method](https://mlsanity.com/paper/1503.01889/) (2015)
- [JuMP 1.0: Recent improvements to a modeling language for mathematical optimization](https://mlsanity.com/paper/2206.03866/) (2022)
- [The SCIP Optimization Suite 9.0](https://mlsanity.com/paper/2402.17702/) (2024)
- [MathOptInterface: a data structure for mathematical optimization problems](https://mlsanity.com/paper/2002.03447/) (2020)
- [PySCIPOpt-ML: Embedding Trained Machine Learning Models into Mixed-Integer Programs](https://mlsanity.com/paper/2312.08074/) (2023)
- [A Comparison of Strategies to Embed Physics-Informed Neural Networks in Nonlinear Model Predictive Control Formulations Solved via Direct Transcription](https://mlsanity.com/paper/2501.06335/) (2025)

## Built on by (most cited first, 2 of 2)

- [Generating adversarial inputs for a graph neural network model of AC power flow](https://mlsanity.com/paper/2602.17975/) (2026)
- [Input convex neural networks as surrogates in mathematical optimisation](https://mlsanity.com/paper/2608.09707/) (2026)

## Abstract (arXiv)

We present textttMathOptAI.jl, an open-source Julia library for embedding trained machine learning predictors into a JuMP model. textttMathOptAI.jl can embed a wide variety of neural networks, decision trees, and Gaussian Processes into a larger mathematical optimization model. In addition to interfacing a range of Julia-based machine learning libraries such as textttLux.jl and textttFlux.jl, textttMathOptAI.jl uses Julia's Python interface to provide support for PyTorch models. When the PyTorch support is combined with textttMathOptAI.jl's gray-box formulation, the function, Jacobian, and Hessian evaluations associated with the PyTorch model are offloaded to the GPU in Python, while the rest of the nonlinear oracles are evaluated on the CPU in Julia. MathOptAI is available at https://github.com/lanl-ansi/MathOptAI.jl under a BSD-3 license.
