[Paper Review] Optimizing the optimizer for data driven deep neural networks and physics informed neural networks
This paper evaluates first- and second-order optimizers—Adam, Levenberg-Marquardt (LM), BFGS, and L-BFGS—for training small-to-medium-sized deep neural networks and physics-informed neural networks (PINNs). It demonstrates that the LM optimizer achieves superior convergence to machine precision with no hyperparameter tuning, outperforming Adam by orders of magnitude in mean squared error (MSE), while Adam requires up to 26× more parameters to match LM's accuracy.
We investigate the role of the optimizer in determining the quality of the model fit for neural networks with a small to medium number of parameters. We study the performance of Adam, an algorithm for first-order gradient-based optimization that uses adaptive momentum, the Levenberg and Marquardt (LM) algorithm a second order method, Broyden,Fletcher,Goldfarb and Shanno algorithm (BFGS) a second order method and LBFGS, a low memory version of BFGS. Using these optimizers we fit the function y = sinc(10x) using a neural network with a few parameters. This function has a variable amplitude and a constant frequency. We observe that the higher amplitude components of the function are fitted first and the Adam, BFGS and LBFGS struggle to fit the lower amplitude components of the function. We also solve the Burgers equation using a physics informed neural network(PINN) with the BFGS and LM optimizers. For our example problems with a small to medium number of weights, we find that the LM algorithm is able to rapidly converge to machine precision offering significant benefits over other optimizers. We further investigated the Adam optimizer with a range of models and found that Adam optimiser requires much deeper models with large numbers of hidden units containing up to 26x more parameters, in order to achieve a model fit close that achieved by the LM optimizer. The LM optimizer results illustrate that it may be possible build models with far fewer parameters. We have implemented all our methods in Keras and TensorFlow 2.
Motivation & Objective
- To evaluate the performance of major optimizers—Adam, LM, BFGS, and L-BFGS—on small-to-medium-sized neural networks.
- To investigate how optimizers fit functions with variable amplitude and constant frequency, such as y = sinc(10x).
- To assess the impact of optimizer choice on model fit quality and convergence speed in physics-informed neural networks (PINNs).
- To determine whether second-order methods like LM can achieve better model accuracy with fewer parameters than first-order methods like Adam.
- To explore the practical implications of optimizer selection for scientific machine learning applications requiring high-precision regression.
Proposed method
- Trained a fully connected feedforward neural network with 20 hidden units to fit the function y = sinc(10x) over 20,000 training points.
- Applied Adam, Levenberg-Marquardt (LM), BFGS, and L-BFGS optimizers to minimize the mean squared error (MSE) loss function.
- Used Keras and TensorFlow 2 to implement all optimizers, including custom integration for LM and BFGS.
- Conducted a grid search over model architecture (1–4 dense layers, 16–80 hidden units) to improve Adam’s performance on the sinc function.
- Solved the 1D Burgers equation using a PINN with LM and BFGS optimizers to test performance on a PDE-constrained problem.
- Monitored training progress to analyze the order in which different amplitude components of the sinc function were learned.
Experimental results
Research questions
- RQ1How do first-order (Adam) and second-order (LM, BFGS) optimizers compare in fitting a challenging function with variable amplitude and constant frequency?
- RQ2Does the Levenberg-Marquardt optimizer achieve faster and more accurate convergence than Adam without requiring hyperparameter tuning?
- RQ3To what extent does the model architecture (depth and width) need to be increased to compensate for Adam’s poor convergence on low-amplitude components?
- RQ4Can the LM optimizer achieve higher accuracy in solving the Burgers equation using a PINN compared to other optimizers?
- RQ5Is there a significant advantage in parameter efficiency when using LM over Adam for small-to-medium-sized neural networks?
Key findings
- The Levenberg-Marquardt (LM) optimizer achieved machine precision convergence with no hyperparameter tuning, reducing the mean squared error (MSE) to below 1×10⁻⁸.
- Adam required up to 26× more parameters (13,201 vs. 507) in a 4-layer model to achieve an MSE below 1×10⁻⁶, still not matching LM’s performance.
- The LM optimizer was the only one capable of accurately fitting both high- and low-amplitude components of the sinc(10x) function, while Adam, BFGS, and L-BFGS failed on low-amplitude regions.
- For the Burgers equation PINN, the LM optimizer achieved higher accuracy than previously reported results using other optimizers.
- The LM optimizer converged rapidly and required no learning rate or momentum tuning, unlike Adam, which needed extensive hyperparameter adjustment.
- The study demonstrates that second-order optimizers like LM can enable significantly smaller, more efficient models compared to first-order methods like Adam, especially in scientific machine learning applications.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.