Table of Contents
Fetching ...

Scaling physics-informed hard constraints with mixture-of-experts

Nithin Chalapathi, Yiheng Du, Aditi Krishnapriyan

TL;DR

This work develops a scalable approach to enforce hard physical constraints using Mixture-of-Experts (MoE), which can be used with any neural network architecture and achieves greater accuracy in the neural PDE solver setting for predicting the dynamics of challenging non-linear systems.

Abstract

Imposing known physical constraints, such as conservation laws, during neural network training introduces an inductive bias that can improve accuracy, reliability, convergence, and data efficiency for modeling physical dynamics. While such constraints can be softly imposed via loss function penalties, recent advancements in differentiable physics and optimization improve performance by incorporating PDE-constrained optimization as individual layers in neural networks. This enables a stricter adherence to physical constraints. However, imposing hard constraints significantly increases computational and memory costs, especially for complex dynamical systems. This is because it requires solving an optimization problem over a large number of points in a mesh, representing spatial and temporal discretizations, which greatly increases the complexity of the constraint. To address this challenge, we develop a scalable approach to enforce hard physical constraints using Mixture-of-Experts (MoE), which can be used with any neural network architecture. Our approach imposes the constraint over smaller decomposed domains, each of which is solved by an "expert" through differentiable optimization. During training, each expert independently performs a localized backpropagation step by leveraging the implicit function theorem; the independence of each expert allows for parallelization across multiple GPUs. Compared to standard differentiable optimization, our scalable approach achieves greater accuracy in the neural PDE solver setting for predicting the dynamics of challenging non-linear systems. We also improve training stability and require significantly less computation time during both training and inference stages.

Scaling physics-informed hard constraints with mixture-of-experts

TL;DR

This work develops a scalable approach to enforce hard physical constraints using Mixture-of-Experts (MoE), which can be used with any neural network architecture and achieves greater accuracy in the neural PDE solver setting for predicting the dynamics of challenging non-linear systems.

Abstract

Imposing known physical constraints, such as conservation laws, during neural network training introduces an inductive bias that can improve accuracy, reliability, convergence, and data efficiency for modeling physical dynamics. While such constraints can be softly imposed via loss function penalties, recent advancements in differentiable physics and optimization improve performance by incorporating PDE-constrained optimization as individual layers in neural networks. This enables a stricter adherence to physical constraints. However, imposing hard constraints significantly increases computational and memory costs, especially for complex dynamical systems. This is because it requires solving an optimization problem over a large number of points in a mesh, representing spatial and temporal discretizations, which greatly increases the complexity of the constraint. To address this challenge, we develop a scalable approach to enforce hard physical constraints using Mixture-of-Experts (MoE), which can be used with any neural network architecture. Our approach imposes the constraint over smaller decomposed domains, each of which is solved by an "expert" through differentiable optimization. During training, each expert independently performs a localized backpropagation step by leveraging the implicit function theorem; the independence of each expert allows for parallelization across multiple GPUs. Compared to standard differentiable optimization, our scalable approach achieves greater accuracy in the neural PDE solver setting for predicting the dynamics of challenging non-linear systems. We also improve training stability and require significantly less computation time during both training and inference stages.
Paper Structure (53 sections, 9 equations, 10 figures)

This paper contains 53 sections, 9 equations, 10 figures.

Figures (10)

  • Figure 1: Schematic of PI-HC-MoE in the 2D case. PI-HC-MoE is provided with the spatiotemporal grid and any PDE parameters (e.g., initial conditions, viscosity, Reynolds Number). $f_\theta$ is a NN parameterized by $\theta$ (blue box), which outputs a set of $N$ basis functions $\mathbf{b}$ (left-most orange box). $\mathbf{b}$'s domain, the same as the green box, is partitioned into the domains $\Omega_k$ of each expert by the MoE router. Each expert (purple boxes) solves the non-linear least squares problem defined by $\mathcal{F}_\phi(\mathbf{b}\cdot \omega_k^T) = \mathbf{0}$. The resulting $\omega_k$ values are used to produce a final solution $u_\theta = \Sigma_{k} \mathbf{b}\cdot \omega_k$. Finally, a loss is computed using the $L_2$-norm of the PDE residual (red box). We denote the forward pass with black arrows and the backwards pass with green arrows. Solid green arrows indicate the use of traditional auto-differentiation, while dashed green arrows denote implicit differentiation.
  • Figure 2: Relative $L_2$ error on the diffusion-sorption test set. (Left) The $L_2$ relative error on the test set over training iterations. (Right) The final $L_2$ relative error on the test set using the trained models. PI-HC-MoE converges faster and has greater accuracy than the other settings.
  • Figure 3: Predicted solution for the diffusion-sorption equation. (Top) Visualizations of the numerical solver solution and ML predictions for the soft constraint (PI-SC), hard constraint (PI-HC), and PI-HC-MoE. (Bottom) Difference plots of the ML predicted solutions compared to the numerical solver solution. White denotes zero. PI-SC is unable to recover the dynamics or scale of the solution. PI-HC is able to recover some information, but fails to capture the full dynamics. PI-HC-MoE is able to recover almost all of the solution and has the lowest error.
  • Figure 4: Runtime of PI-HC and PI-HC-MoE on diffusion-sorption. The time to perform a single training (left) and inference (right) step as the number of constrained sampled points increases.
  • Figure 5: Predicted solution for 2D Navier-Stokes. From top to bottom: (Row 1) Initial vorticity and its evolution as $T$ increases, computed via a numerical solver. The errors of PI-HC-MoE (Row 2), PI-HC (Row 3), and PI-SC (Row 4) are visualized for corresponding $T$, where the difference in the predicted solution is shown with respect to the numerical solver. Darker colors indicate higher error. Both PI-SC and PI-HC exhibit greater error compared to PI-HC-MoE, especially at later $T$.
  • ...and 5 more figures