Reinforcement Learning for Adaptive Mesh Refinement
Abstract
Adaptive Mesh Refinement (AMR) is a critical technique in computational science for optimizing simulation grids by focusing resolution on regions of high interest. Traditional AMR relies on human-designed heuristics that often fail to account for long-term simulation dynamics. This paper reformulates AMR as a Markov Decision Process (MDP) solved via Deep Reinforcement Learning. We introduce novel neural architectures—Independent Policy, Hypernetwork, and Graph Network policies—that accommodate the dynamic nature of meshes. Our results show that RL-based agents can learn anticipatory refinement strategies that outperform standard heuristics and generalize to simulations much larger than those encountered during training.
Introduction: The AMR Problem
Simulating physical phenomena like fluid dynamics or heat transfer requires discretizing space into a mesh. To balance accuracy and computational cost, researchers use Adaptive Mesh Refinement (AMR): they use a fine grid only where the action is (e.g., around a shockwave) and a coarse grid elsewhere.
The challenge lies in deciding which parts of the mesh to refine. Current simulations mostly rely on "greedy" heuristics—mathematical rules of thumb that react to current error. However, these heuristics are short-sighted and do not account for how a refinement decision now might affect accuracy many steps into the future. This research explores whether Reinforcement Learning (RL) can provide a more effective, "look-ahead" strategy for managing computational budgets.
AMR as a Markov Decision Process
The authors frame the refinement process as a sequential decision-making problem. In this MDP, the state $s_t$ represents the current mesh and the underlying physical field. The agent observes this state and selects an element $i$ to refine (action $a_i$), leading to a new mesh state at the next time step. This formulation allows the agent to optimize for long-term cumulative rewards, such as total error reduction over the entire simulation.
Specialized Neural Architectures
Standard neural networks require fixed-size inputs, which is incompatible with meshes that grow and change shape. To address this, the authors developed three specialized architectures designed to handle variable-sized inputs:
- Independent Policy Network (IPN): Processes each mesh element independently, making it highly scalable and local.
- Hypernetwork Policy: Uses a global view of the state to dynamically generate weights for a local network, capturing long-range interactions.
- Graph Network Policy: Models the mesh as a graph where elements are nodes and neighbors are connected, using "message passing" to understand spatial relationships.
Surrogate Rewards and Training Strategy
A key innovation is the use of a surrogate reward. Since the "true" analytical solution is often unknown in real-world engineering problems, the agent is rewarded based on the difference between the solution with and without the refinement. This clever proxy allows the agent to learn effective strategies even on problems where the ground truth is unavailable.
Key Insights and Results
The RL policies were evaluated on several challenges, including static function estimation and dynamic PDEs like the Burgers’ equation.
- Anticipatory Refinement: Unlike reactive heuristics, RL agents learned to "anticipate" feature movement. In Burgers' equation tests, the RL policy generated a refinement front that tracked moving regions of interest before they arrived.
- Generalization: A policy trained on a tiny $8 \times 8$ mesh can be successfully deployed on a $200 \times 200$ mesh (a 625x increase in elements). This suggests that the logic of refinement is local and transferable.
- Performance: RL-based methods matched or outperformed the widely-used Zienkiewicz-Zhu (ZZ) error estimator in 20 out of 24 test cases, showing particular strength in handling sharp discontinuities.
Limitations and Future Directions
While promising, the current model refines only one element per MDP step, which may be inefficient for massive industrial simulations. Additionally, the current work focuses on h-refinement (splitting cells) but does not yet implement derefinement (merging cells). Future work will explore multi-agent approaches and scaling these policies to 3D simulations with more complex fluid dynamics.
Summary updated