betaFeedback

WorksComputer Science

Reversible GNS for Dissipative Fluids with Consistent Bidirectional Dynamics

Abstract

Simulating physically plausible trajectories toward user-defined goals is a fundamental yet challenging task in fluid dynamics. While particle-based simulators can efficiently reproduce forward dynamics, inverse inference remains difficult, especially in dissipative systems where dynamics are irreversible and optimization-based solvers are slow, unstable, and often fail to converge. In this work, we introduce the Reversible Graph Network Simulator (R-GNS), a unified framework that enforces bidirectional consistency within a single graph architecture. Unlike prior neural simulators that approximate inverse dynamics by fitting backward data, R-GNS does not attempt to reverse the underlying physics. Instead, we propose a mathematically invertible design based on residual reversible message passing with shared parameters, coupling forward dynamics with inverse inference to deliver accurate predictions and efficient recovery of plausible initial states. Experiments on three dissipative benchmarks (Water-3D, WaterRamps, and WaterDrop) show that R-GNS achieves higher accuracy and consistency with only one quarter of the parameters, and performs inverse inference more than 100 times faster than optimization-based baselines. For forward simulation, R-GNS matches the speed of strong GNS baselines, while in goal-conditioned tasks it eliminates iterative optimization and achieves orders-of-magnitude speedups. On goal-conditioned tasks, R-GNS further demonstrates its ability to complex target shapes (e.g., characters "L" and "N") through vivid, physically consistent trajectories. To our knowledge, this is the first reversible framework that unifies forward and inverse simulation for dissipative fluid systems.

Introduction

Inverse problems are central to many fields, enabling the recovery of hidden causes from observable outcomes. For instance, estimating physical parameters from simulation results in physics or inferring joint motions from actions in robotics ([15, 4, 12, 5, 31]). Yet their application to complex systems is challenging: reversible networks impose strict constraints, making them difficult to extend to high-dimensional systems. ([1, 7, 3]), In fluid simulation, while forward models can efficiently reproduce flows, waves, and turbulence, it remains hard to infer an initial state that plausibly evolves into a desired outcome, such as smoke rising into a dragon-shaped cloud or waves forming characters on a shoreline.

Such goal-conditioned problems in fluid dynamics are particularly challenging. Most natural fluids are dissipative systems governed by irreversible dynamics, which makes inverse inference inherently ill-posed. Moreover, fluids are often modeled as particle systems ([21, 20]), where each particle carries its own physical attributes and interacts with a large number of neighbors, leading to extremely high system complexity. Existing approaches struggle to directly recover plausible past states of dissipative fluids ([2, 13, 14]). Optimization-based methods rely on differentiable simulators ([10, 9, 24, 16]) to iteratively refine initial conditions, but the process is computationally expensive, unstable, and becomes increasingly inaccurate or fails to converge as particle counts and inverse steps grow. Data-driven alternatives, such as feed-forward neural simulators ([21, 20, 25]), can generate inverse solutions more efficiently, yet directly fitting inverse data often causes the model to deviate from real physical principles and yields inconsistencies with forward simulations.

Pipeline illustrating unified bidirectional simulation

Figure 1. The pipeline illustrates unified bidirectional simulation: dashed arrows denote inverse inference and solid arrows denote forward simulation. Key advantages are highlighted along the pipeline: (1) 100× Faster: inverse inference is orders of magnitude faster than optimization-based solvers; (2) ¼ Parameters: a unified reversible network integrates forward and inverse reasoning with only one quarter of the parameters compared to two separately trained GNSs; (3) Consistent Goal Rollout: goal-conditioned rollouts reproduce target shapes with high consistency; (4) Accurate Simulation: R-GNS achieves high accuracy on dissipative fluids dataset with up to 13k particles; (5) Versatile Fluids Modeling: Beyond water, R-GNS effectively handles other dissipative fluids like sand, highlighting its robustness across material types.

To address these challenges, we introduce Reversible Graph Network Simulator (R-GNS), a compact architecture that unifies forward and inverse simulation within a single framework. Importantly, R-GNS does not assume that dissipative fluids are physically reversible; rather, it uses a mathematically reversible design to enforce forward–inverse consistency, recovering one plausible initial trajectory consistent with forward dynamics even when the underlying system is irreversible. By leveraging a reversible residual message-passing design, R-GNS propagates particle interactions in both directions while maintaining strict consistency. With shared parameters and a bidirectional training scheme, the model efficiently learns forward dynamics and simultaneously exploits this knowledge to guide inverse inference, ensuring physical plausibility and coherence between the two tasks.

We evaluate R-GNS on three dissipative fluid benchmarks: Water-3D, WaterRamps, and WaterDrop ([21]). And demonstrate state-of-the-art accuracy, efficiency, and consistency in both forward and inverse simulation. On a goal-conditioned character-shaping task, R-GNS successfully generates physically plausible trajectories to match target shapes.

In summary, our contributions are: (1) a unified reversible framework that achieves higher accuracy with one quarter of the parameters, and improves forward–inverse consistency via shared parameters and bidirectional training; (2) a feed-forward solution for inverse simulation in dissipative systems, which maintains forward speed comparable to strong GNS baselines in standard rollouts, while delivering orders-of-magnitude speedups on inverse tasks by eliminating iterative optimization, and (3) a residual reversible message-passing network that guarantees invertibility, enables faithful bidirectional propagation, and better captures underlying physical laws.

Related Work

Particle-based Fluid Simulation. Particle-based modeling has long been a powerful paradigm for simulating complex physical systems, from molecular dynamics to large-scale fluids, where each particle encapsulates its own state and interacts with many others. Traditional physics-based solvers, such as SPH and MPM ([18, 26]), can deliver highly accurate forward dynamics, but require careful manual specification of fluid parameters and simulation settings, which limits their accessibility and flexibility.Recent neural simulators ([21, 25, 29, 20, 28, 22]; Toshev et al., [27, 28], such as GNS and DMCF, alleviate this burden by implicitly learning particle interactions from data, enabling efficient approximations of dynamics; however, they often struggle to maintain strict physical consistency. Moreover, the inherent complexity of particle systems varies significantly across scenarios, motivating our choice of datasets that span different levels of difficulty and setting the stage for methods that can adapt across such scales.

Optimization-based Inverse Solvers. Optimization-based inverse solvers built upon differentiable simulation frameworks (e.g., DiffTaichi, PhiFlow, Jax-MD) [10, 9, 24, 16] typically recover initial states through iterative optimization algorithms such as Adam or L-BFGS [11, 19, 17]. These approaches refine candidate trajectories step by step via gradient-based updates, but the process is computationally expensive and sensitive to instability. The challenge becomes more pronounced in particle-based systems, where the extremely high dimensionality exacerbates the difficulty of optimization. In dissipative fluids, where multiple plausible solutions exist and the dynamics are inherently irreversible, optimization often fails to converge, further limiting its practical applicability and underscoring the need for alternatives beyond purely iterative solvers.

Invertible / Reversible Neural Network. Invertible and reversible neural networks [1, 7, 3] provide a principled way to construct architectures where inputs can be exactly recovered from outputs. Such designs have been widely adopted in areas such as density estimation, robotics, and physical parameter estimation [15, 4, 12]. However, these models often rely on strong symmetry assumptions or restrictive architectural designs, which limit their flexibility in practice. The high dimensionality and large particle counts of fluid systems make reversible simulation particularly challenging, motivating the design of frameworks that ensure exact invertibility while scaling to complex dynamics.

Methodology

Problem Formulation

Fluids can be represented as a particle-based system consisting of NN particles, the state at time step tt is denoted by χt={xit}i=1N\chi^t = \{x_i^t\}_{i=1}^{N}, xit=[pit,mi]x_i^t = [p_i^t, m_i], where pitp_i^t represents the position of particle ii at time tt, and mim_i denotes its static attributes (e.g., material type, mass). We introduce a bidirectional simulator consisting of a forward operator ϕ\phi and its inverse counterpart ψ\psi. (1) Forward simulation: Given an initial state χ~0\tilde{\chi}^0, the simulator produces a trajectory by recursively applying ϕ\phi: χ~t+1=ϕ(χ~t),t=0,...,K−1\tilde{\chi}^{t+1} = \phi(\tilde{\chi}^t), t = 0, ..., K - 1. This process corresponds to standard rollouts in particle-based fluid simulation and is consistent with existing neural simulators. (2) Inverse inference: Unlike optimization-based methods that solve for an initial condition through iterative refinement, we instead infer it directly by applying the inverse operator ψ\psi: χ~t=ψ(χ~t+1),t=K−1,...,0\tilde{\chi}^t = \psi(\tilde{\chi}^{t+1}), t = K - 1, ..., 0. This formulation enables efficient backward reasoning and provides trajectories that are inherently tied to the forward dynamics. In both directions, we denote the resulting trajectory compactly as a “rollout”, either forward (χ~0:K\tilde{\chi}^{0:K}) or inverse (χ~K:0\tilde{\chi}^{K:0}), depending on the operator applied.

In this work, we aim to learn a bidirectional simulator FθF_\theta that unifies the forward operator ϕ\phi and the inverse operator ψ\psi, trained from particle trajectories and capable of generalizing to unseen environments and initializations. The model is expected to satisfy three requirements: (1) Accurate forward dynamics: produce faithful, long-horizon rollouts. (2) Consistent inverse inference: recover plausible initial states aligned with forward trajectories. and (3) Robust generalization: adapt to novel particle configurations and boundary conditions without retraining.

This formulation underscores the central challenge: while existing neural simulators achieve efficiency, they often sacrifice forward–inverse consistency; meanwhile, optimization-based solvers remain unstable and computationally costly. Our objective is therefore to design a unified framework that performs both forward and inverse simulation within a single reversible architecture.

Preliminary

Graph Network Simulator (GNS) GNS [21] is a neural particle simulator where particles are represented as nodes and their interactions as edges. Its architecture consists of an encoder MLP, a multi-layer message-passing (Gilmer et al. [6]; Scarselli et al. [23]) core, and a decoder MLP. The message-passing update is given by:

nil+1=nil+fn(nil,∑j∈Nife(nil,njl,eij)),(1)n_i^{l+1}=n_i^l+f^n\left(n_i^l,\sum_{j\in\mathcal{N}_i}f^e(n_i^l,n_j^l,e_{ij})\right), \tag*{(1)}

where niln_i^l denotes the feature of particle ii at layer ll, eije_{ij} are edge features, and fnf^n, fef^e are MLP layers.

Reversible Networks (RevNet) The vanilla RevNet achieves bijective transformations between two partitions of an input vector through dimensional splitting and dual mappings (Gomez et al. [7]). Specifically:

y1=x1+f(x2),y2=x2+g(y1),x2=y2−g(y1),x1=y1−f(x2).(2)\begin{aligned} y_1 &= x_1+f(x_2), \\ y_2 &= x_2+g(y_1), \end{aligned} \qquad \begin{aligned} x_2 &= y_2-g(y_1), \\ x_1 &= y_1-f(x_2). \tag*{(2)} \end{aligned}

This design ensures exact invertibility at each layer and forms the basis of reversible architectures.

These preliminaries lay the foundation for our Reversible Graph Network Simulator (R-GNS), introduced in the next section.

Reversible Graph Network Simulator

We propose the Reversible Graph Network Simulator (R-GNS), a unified simulator Fθ\mathcal{F}_{\theta} that performs both forward dynamics ϕ\phi and inverse inference ψ\psi within a single reversible architecture. Compared to separate neural simulators R-GNS achieves higher accuracy and stronger forward–inverse consistency with only one quarter of the parameters, while offering orders-of-magnitude faster inverse inference than optimization-based approaches. The design is particularly suited for dissipative systems, where irreversibility and multiple-solution ambiguity make inverse inference ill-posed.

As illustrated in Figure 2, our framework consists of three tightly coupled components: (1) Semi-Symmetric Input–Output Design. In panel (a), the input graph encodes velocity history, current positions, and static attributes, while the output is masked to retain only the predicted velocity. This design preserves structural symmetry required for reversibility while reducing the difficulty of mapping by updating only dynamic quantities. (2) Invertible Linear Projection (ILP) Encoder/Decoder. Shown at the transition between the physics and latent spaces in panel (b), the projection consists of a linear mapping and its pseudo-inverse, enabling an exactly reversible transformation between physical states and latent features. (3) Residual Reversible Message Passing (RRMP). At the center of panel (b), RRMP propagates particle interactions through a mathematically invertible residual message-passing network with shared parameters. This backbone guarantees layerwise reversibility, enforces bidirectional consistency at scale, and reduces parameter redundancy.

Figure 2. Overview of the R-GNS framework. (a) Semi-Symmetric Input–Output Design: Static quantities (pp, mm) remain fixed, while dynamic quantities are symmetric in time. The model consumes full velocity history (vt:t−k+1v_{t:t-k+1}) but predicts only vt+1v^{t+1}, with other outputs masked. Positions are updated to pt+1p^{t+1} using ptp^t and vt+1v^{t+1}. The inverse process mirrors this update, preserving symmetry and reversibility. (b) Invertible Linear Projection: establishes a mathematically reversible mapping between physical and latent spaces, preserving all information in structured particle states. (c) Residual Reversible Message Passing: splits node dynamics into complementary halves and updates them via residual connections conditioned on fixed edges, enabling exact bidirectional propagation of latent states.

Semi-Symmetric Input–Output Design

A central difficulty in combining reversible networks with physical simulators is reconciling two conflicting requirements: reversible architectures demand symmetric input–output structures, while physical dynamics are inherently asymmetric. This conflict is particularly evident in particle systems, where particles carry static attributes as well as dynamic quantities.

To address this, we propose a semi-symmetric input-output design: both input and output are represented as structurally symmetric graph data, satisfying the reversibility requirement, but only node dynamic quantity are predicted while other quantities are masked. In practice, the encoder consumes the complete graph state, while the decoder outputs only the motion-related node updates needed to advance the system.

As shown in Figure 2(a), at time step tt, forward simulation and inverse inference share the same physical attributes and particle positions, while dynamic quantities (velocities) are treated symmetrically. We encode relative particle positions as edge features and dynamic quantities as node features. During updates, edge features remain fixed as conditions, while node features are updated to capture dynamics. This design preserves structural symmetry and exact reversibility, while remaining consistent with the intrinsic update rules of physical dynamics.

Invertible Linear Projection En/Decoder

Building on the semi-symmetric design, we introduce an Invertible Linear Projection (ILP) encoder–decoder to map between the physical state space and the latent feature space. Unlike learned nonlinear approximations, ILP is defined as a linear transformation paired with its pseudo-inverse:

n=Wχ+B(encode),χ=W†(n−B)(decode)(3)n = W\chi+ B \quad\text{(encode)}, \qquad\chi= W^{\dagger}(n - B) \quad\text{(decode)} \tag*{(3)}

where χ\chi and nn denote physical and latent node features respectively, WW and BB are learnable parameters, and W†W^{\dagger} is the pseudo-inverse of WW.

This construction guarantees exact reversibility up to numerical precision, with empirical reconstruction error bounded by ∥χ−dec⁡(enc⁡(χ))∥2≈10−7\lVert\chi- \operatorname{dec}(\operatorname{enc}(\chi))\rVert_2 \approx10^{-7}. As shown in Figure 2(b), ILP provides a stable bridge between physical states and latent features, allowing dimension changes without information loss. ILP is deliberately chosen over nonlinear encoders to avoid approximation drift, improving training stability and ensuring that reversible propagation is mathematically exact.

Residual Reversible Message Passing

Building on the semi-symmetric design and ILP, the latent space consists of symmetric node features {nit}i=1N\{n_i^t\}_{i=1}^{N}, {nit+1}i=1N\{n_i^{t+1}\}_{i=1}^{N} and fixed edge features {eij}\{e_{ij}\}. Our objective is to define a conditional reversible process:

forward⁡({nit},{eij})↦{nit+1},inverse⁡({nit+1},{eij})↦{nit},(4)\operatorname{forward}(\{n_i^t\}, \{e_{ij}\}) \mapsto\{n_i^{t+1}\}, \qquad\operatorname{inverse}(\{n_i^{t+1}\}, \{e_{ij}\}) \mapsto\{n_i^t\}, \tag*{(4)}

where {n}\{n\}, {e}\{e\} denote the entire system, while nin_i, eije_{ij} denote individual node and edge features. note that edge features remain fixed since particle positions are identical across forward and inverse steps (see § 3.3.1).

While standard RevNets achieve invertibility through dimensional splitting, they operate on flat vectors and cannot directly handle graph-structured states with conditional edge interactions. Moreover, the latent representation is a high-dimensional matrix (N×dN \times d), making direct reversible mapping infeasible.

To overcome these challenges, we introduce Residual Reversible Message Passing (RRMP) 2(c), which extends RevNet-style updates to graph-structured data by embedding message-passing operations inside reversible residual blocks. Following the standard RevNet formulation, node features are split into two partitions nil→(ni,1l,ni,2l)n_i^l \to(n_{i,1}^l,n_{i,2}^l), with two coupled functions ff and gg applied in an alternating manner. Specific, the forward update is:

ni,1l+1=ni,1l+fn(ni,2l,∑j∈Nife(ni,2l,nj,2l,eij,2)),ni,2l+1=ni,2l+gn(ni,1l+1,∑j∈Nige(ni,1l+1,nj,1l+1,eij,1)).(5)\begin{aligned} n_{i,1}^{l+1} &= n_{i,1}^{l} + f^n\left(n_{i,2}^{l}, \sum_{j\in\mathcal{N}_i} f^e\left(n_{i,2}^{l},n_{j,2}^{l},e_{ij,2}\right)\right),\\ n_{i,2}^{l+1} &= n_{i,2}^{l} + g^n\left(n_{i,1}^{l+1}, \sum_{j\in\mathcal{N}_i} g^e\left(n_{i,1}^{l+1},n_{j,1}^{l+1},e_{ij,1}\right)\right). \tag*{(5)} \end{aligned}

and the corresponding inverse update is:

ni,2l=ni,2l+1−gn(ni,1l+1,∑j∈Nige(ni,1l+1,nj,1l+1,eij,1)),ni,1l=ni,1l+1−fn(ni,2l,∑j∈Nife(ni,2l,nj,2l,eij,2)).(6)\begin{aligned} n_{i,2}^{l} &= n_{i,2}^{l+1} - g^n\left(n_{i,1}^{l+1}, \sum_{j\in\mathcal{N}_i} g^e\left(n_{i,1}^{l+1},n_{j,1}^{l+1},e_{ij,1}\right)\right),\\ n_{i,1}^{l} &= n_{i,1}^{l+1} - f^n\left(n_{i,2}^{l}, \sum_{j\in\mathcal{N}_i} f^e\left(n_{i,2}^{l},n_{j,2}^{l},e_{ij,2}\right)\right). \tag*{(6)} \end{aligned}

Here, fe,gef^e,g^e denote edge-update networks (MLPs applied on edge features), while fn,gnf^n,g^n denote node-update networks. This design establishes a theoretically exact reversible process in the latent space, ensuring consistent bidirectional rollouts of graph-structured particle systems while scaling to large node sets and complex interactions.

In practice, RRMP scales to thousands of particles and complex interactions while retaining theoretical guarantees of invertibility. The combination of residual coupling, message passing, and recomputed interaction graphs makes RRMP both expressive and stable, ensuring that forward and backward simulations remain tightly aligned.

Experiments

Experiment Settings

Dataset. We evaluate on three dissipative fluid datasets of increasing complexity: WaterDrop, WaterRamp, and Water_3D [21]. WaterDrop (2D) contains up to 1k particles with simple droplet dynamics. WaterRamp (2D) increases difficulty with up to 2.3k particles interacting with complex obstacles. Water_3D is a large-scale setting with rich fluid motions and up to 13k particles. This progression from small-scale to large-scale systems provides a rigorous testbed for evaluating model generalization and scalability.

Task & Baseline. To comprehensively assess R-GNS, we consider three tasks: (1) Forward Simulation. Given initial states, the model predicts long-horizon rollouts (300 steps) and is compared against leading neural feed-forward simulators, including GNS [21], DMCF [20], EGNN [22, 27], and NeuralSPH [28]. (2) Inverse Inference. The goal is to recover initial states from given outcomes. We benchmark R-GNS against optimization-based solvers with differentiable framework DiffTaichi, physics solver SPH and the Adam optimizer [10, 16]. For neural baselines, we compare with two separately trained GNS models, denoted as Sep-GNS. To probe stability, we evaluate prediction consistency under varying numbers of backward steps, in addition to efficiency. (3) Goal-Conditioned Tasks. To demonstrate full bidirectional reasoning, we task simulators with generating physically plausible trajectories that guide fluid waves into target shapes ("L", "N").

Evaluation Metrics. For forward quality, we use Rollout MSE, mean squared error between predicted and ground-truth rollouts, as the primary metric, with additional distributional metrics OT, MMD [30, 8] reported in Appendix. For inverse and goal-conditioned performance, we report Consistency MSE, measuring temporal coherence and forward–inverse alignment. Efficiency is evaluated by inference time, memory and parameter counts.

Implementation Details. We implement the Reversible Residual Message-Passing network with 10 propagation steps and a hidden dimension of 128. Within reversible blocks, the feature vector is split into two 64-dimensional halves for coupling updates. A linear projection with pseudo-inverse is used as the encoder–decoder, and the dynamic quantity is masked as the only predicted output to preserve symmetry. All models are trained using the Adam optimizer with an initial learning rate of 1e-4 and cosine decay. The batch size is set to 2, and early stopping is applied based on validation loss. For scalability, training is conducted on NVIDIA A800 GPUs, with smaller datasets (WaterDrop, WaterRamps) using 2 GPUs and the larger Water_3D dataset using 4 GPUs.

Results

Forward Simulation

We first evaluate forward prediction accuracy across all three datasets. Graph Network vs. Convolutional Network. Qualitative results on the 2D datasets (WaterDrop and WaterRamp) are presented in Figure 3, covering the convolutional method DMCF, the strongest graph-based baseline (GNS), our bidirectional R-GNS, and its unidirectionally trained variant (R-GNS{sup}†`). In comparison with the convolutional baseline, graph-based methods more effectively capture fine-grained particle interactions, reflecting their suitability for particle dynamics. Within this category, R-GNS most faithfully reproduces intricate wave structures in the WaterDrop scene and demonstrates strong capability in modeling fluid–obstacle interactions in the WaterRamp scenario.

Qualitative results on 2D datasets

Figure 3. Qualitative results on 2D datasets. R-GNS is able to achieve more faithful results on 2D datasets. On WaterDrop, R-GNS more accurately reproduces the intricate structures of wave motion during simulation. On WaterRamps, R-GNS more accurately captures the motion patterns of fluids in environments with complex fluid–obstacle interactions.

Prediction Accuracy Comparison. Full quantitative comparisons with all methods are reported in Table 1. R-GNS consistently achieves the lowest rollout MSE across all datasets, with additional metrics (MMD and OT) in the Appendix confirming the same trend. Across datasets, R-GNS consistently achieves the best forward accuracy among all baselines. R-GNS{sup}†` generally outperforms GNS, though the margin varies across datasets. Moreover, R-GNS outperforms all other non-reversible neural baselines, demonstrating the broad benefit of unifying bidirectional simulation. This highlights that a unified reversible framework yields improved forward accuracy through richer bidirectional supervision.

Dataset/MethodsNeuralSPHEGNNDMCFGNSR-GNS{sup}†`R-GNS
Water_3D14.215.226.012.113.89.5
WaterDrop0.671.413.200.700.590.31
WaterRamp10.515.916.310.910.19.0

Table 1. Rollout MSE (1e-3) in the Forward Process

Efficiency Comparison. Table 2 reports efficiency metrics across models. R-GNS requires only one quarter of the parameters of Sep-GNS (i.e., half of a single GNS) and substantially reduces inference memory. Its inference speed is comparable to GNS, the fastest baseline. Overall, R-GNS demonstrates markedly higher efficiency.

Metrics / MethodsNeuralSPHEGNNDMCFGNSR-GNS{sup}†`R-GNS
Parameter Count (M)1.724.272.171.590.780.78
Inference Time (ms/step)14.5234.0114.1811.2713.4113.41
Inference Memory (MB)103.64319.52343.1191.5559.2759.27

Table 2. Efficiency Comparison on the WaterDrop Dataset

Taken together, these results demonstrate that R-GNS delivers the best overall trade-off: it achieves state-of-the-art accuracy in forward simulation while maintaining superior efficiency in terms of parameters, memory, and inference speed.

Inverse Inference

Inverse Solve Stability. Inverse inference results are shown in Figure 4(a–Figure 4b). (a) Optimization-based solvers exhibit unstable behavior: even on the simpler WaterDrop dataset, short-range inference already introduces noticeable noise, and solutions quickly deteriorate. On the more challenging Water-3D dataset, where particle counts are an order of magnitude larger, we observed that optimization-based solvers collapse after as few as 5 steps, producing no valid solutions. (b) In contrast, neural feed-forward methods demonstrate far greater stability. On WaterDrop, they maintain coherent trajectories over long horizons, while optimization-based solvers collapse. Among them, R-GNS achieves the most reliable rollouts, preserving physically plausible dynamics even at long-range inference.

Inverse inference results

Figure 4. Inverse inference results. (a) Short-range inference: optimization-based solvers are unstable. At step 10 they roughly recover the fluid shape but already exhibit noticeable noise, which further amplifies by step 30, leading to inaccurate solutions. (b) Long-range inference at step 100: optimization completely collapses, whereas feed-forward approaches (R-GNS and Sep-GNS) maintain stable and accurate predictions. R-GNS achieves more faithful recovery, including more accurate initial heights and forward simulation. (c) Inverse–forward consistency across varying steps: both feed-forward models converge toward near-zero error within 40 steps, with R-GNS consistently achieving higher consistency than Sep-GNS over the entire range.

Consistency Comparison. As discussed earlier, optimization-based solvers deteriorate rapidly, exceeding 10−210^{-2} consistency error within fewer than 10 steps. In contrast, the neural approaches compared in Figure 4(c) maintain errors within the 10−310^{-3} scale even at 100 steps. R-GNS further improves over Sep-GNS, exhibiting higher consistency and slower error growth, maintaining reliable forward–inverse alignment over long horizons.

Comprehensive Comparison. Table 3 reports consistency MSE, inference time, parameter counts, and maximum stable step. R-GNS runs over 100×100\times faster than optimization-based solvers, achieves longer stable rollouts, and uses only one quarter the parameters of Sep-GNS while maintaining higher consistency. These advantages make it particularly suitable for large-scale dissipative fluid simulations.

Optimization MethodFeed-Forward Methods
MethodsDiffTaichi+SPHSep-GNSR-GNS
Consistency MSE (1e-3)9.070.0170.002
Inference Time (s)236.7920.4510.536
Parameter Counts (M)/3.180.78
Max Stable Steps<40>100>100

Table 3. Inverse Inference Comparison on the WaterDrop (inverse step=40)

In summary, R-GNS delivers stable and consistent inverse inference across diverse datasets, sustaining reliable forward–inverse alignment even under long rollouts. Especially in dissipative fluids, where inversion is inherently ill-posed and optimization-based solvers break down, R-GNS exploits forward dynamics as a physical prior, enabling accurate and efficient recovery of initial states.

Goal-Conditioned Task

The Water-3D dataset, with thousands of particles and dissipative dynamics, is intractable for optimization-based solvers, which collapse after only a few steps. As shown in Figure 5, R-GNS successfully addresses this task through consistent bidirectional inference and forward simulation. It reliably scales to large particle counts and reproduces target shapes with high fidelity, whereas Sep-GNS fails to maintain structural consistency. These results highlight the robustness of R-GNS’s unified reversible framework, leveraging forward physical priors to enable reliable inverse inference even in dissipative fluid systems.

Goal-conditioned simulation on the Water_3D dataset

Figure 5. Goal-conditioned simulation on the Water_3DWater\_3D dataset. Target particle configurations shaped as “L” and “N” (given state) are inverse-inferenced to plausible initial states (inferenced state) and then rolled forward to reproduce the targets (reproduced state). R-GNS achieves close reproduction of the intended shapes, whereas Sep-GNS loses structural fidelity.

Ablation Study

Fig. 6 summarizes the ablation results. (a) Compared four loss designs: DL_1 (MSE and MMD), DL_2 (MSE, cosine similarity and MMD), DL_3 (MSE and cosine), DL_4 (MSE). Using only MSE (DL_4) yields the best performance in both forward accuracy and consistency, suggesting auxiliary losses may introduce noise. (b) ILP, as a reversible encoder–decoder, substantially improves inverse inference consistency compared to MLP. (c) Fixing edge features is not critical but provides a modest performance gain, supporting its inclusion in our final design.

Ablation study on the Water-3D dataset

Figure 6. Ablation study on the Water-3DWater\text{-}3D dataset, measuring rollout and consistency MSE. (a) Four Loss designs (b) Encoder–decoder: MLP vs. ILP. (c) Edge features: fixed vs. update in latent space.

Conclusion & Future Work

We introduced R-GNS, the first reversible simulator for dissipative fluids. As a bidirectional simulator, it achieves inverse inference at the same fast speed as forward rollout, orders of magnitude faster than optimization-based solvers. Built on a unified reversible framework that couples forward and inverse simulation, R-GNS attains higher accuracy with only one quarter of the parameters of separate models. Its reversible components (ILP and RRMP) ensure mathematically exact propagation and strict forward–inverse consistency, while shared parameters and bidirectional training leverage forward physical priors to capture underlying laws and recover faithful initial states, even in dissipative systems with multiple plausible solutions.

R-GNS enables efficient goal-conditioned control of dissipative fluids. For example, it can drive flows to form user-defined shapes, making it useful for controllable simulation in world models, embodied agents, and visual effects. However, richer goal conditioning demands finer fluid detail, implying much larger particle counts (on the order of 10510^{5}–10610^{6} or more). Although R-GNS supports long-horizon rollouts at about 10410^{4} particles, computational efficiency degrades as system size grows; scaling further will likely require techniques such as hierarchical message passing, domain decomposition, and multi-resolution scheduling, which we leave for future exploration.

Methodology Proofs

In this section, we present the theoretical justification and implementation details of the two core reversible components: ILP encoder-decoder and the Residual Reversible Message-Passing Network.

Proof of ILP Encoder-Decoder

We employ a single-layer linear network as the encoder and its corresponding inverse transformation as the decoder. This process is formalized in Equation (3). The encoding matrix W∈Rb×aW \in\mathbb{R}^{b \times a} projects node features from physical space Ra\mathbb{R}^{a} to latent space Rb\mathbb{R}^{b} (where b>ab > a). To enable reversibility, we compute its pseudoinverse W†W^{\dagger} via singular value decomposition (SVD), which serves as the decoding transformation. The computation of the pseudoinverse proceeds as follows:

First, compute the singular value decomposition (SVD) of WW, expressed as:

where r=rank⁡(W)r = \operatorname{rank}(W), U∈Ra×aU \in\mathbb{R}^{a \times a} and V∈Rb×bV \in\mathbb{R}^{b \times b} are orthogonal matrices, VTV^{T} denotes the transposes of matrix VV. Σ\Sigma is the singular value matrix, with non-negative singular values along its main diagonal, Σ=diag⁡(σ1,…,σr,0,…,0)\Sigma= \operatorname{diag}(\sigma_1, \ldots, \sigma_r, 0, \ldots, 0).

The pseudoinverse is then given by:

W†=VΣ†U⊤,Σ†=diag⁡(σ1−1,…,σr−1,0,…,0)(7)W^{\dagger} = V\Sigma^{\dagger}U^{\top}, \qquad\Sigma^{\dagger} = \operatorname{diag}\left(\sigma_1^{-1}, \ldots, \sigma_r^{-1}, 0, \ldots, 0\right) \tag*{(7)}

Since WW is a non-square matrix, decoding via its pseudoinverse corresponds to the least-squares solution of the inverse encoding process, that is:

χ~=arg min⁡χ∥Wχ−(n−B)∥22(8)\tilde{\chi} = \underset{\chi}{\operatorname{arg\,min}}\left\lVert W\chi- (n-B)\right\rVert_2^2 \tag*{(8)}

We quantified the reconstruction error of this process, finding that ∥χ−dec⁡(enc⁡(χ))∥22<10−6\left\lVert\chi- \operatorname{dec}(\operatorname{enc}(\chi))\right\rVert_2^2 < 10^{-6}. Therefore, the encoder-decoder constructed via pseudoinverse and matrix transformations demonstrates nearly perfect reversibility.

Proof of Residual Reversible Message-Passing Network

We propose a Residual Reversible Message-Passing Network that performs forward or backward propagation of node features in the latent space, enabling an invertible mapping between node states at time steps tt and t+1t+1. For a Residual Reversible Message-Passing Network with MM layers, the forward and backward propagation between layer ll and layer l+1l+1 are formally defined in Equations (5) and (6). At each propagation step, the features of all nodes in the graph are simultaneously updated. The forward and backward processes can be compactly expressed as:

{nil+1}i=1N=layer⁡fwdl+1({nil}i=1N,{e})(9)\{n_i^{l+1}\}_{i=1}^{N} = \operatorname{layer}_{\mathrm{fwd}}^{l+1}\left(\{n_i^l\}_{i=1}^{N}, \{e\}\right) \tag*{(9)}

and

{nil}i=1N=layer⁡bwdl+1({nil+1}i=1N,{e})(10)\{n_i^l\}_{i=1}^{N} = \operatorname{layer}_{\mathrm{bwd}}^{l+1}\left(\{n_i^{l+1}\}_{i=1}^{N}, \{e\}\right) \tag*{(10)}

The full forward propagation over MM layers is obtained by iteratively applying Equation (9) for MM steps:

{ni1}i=1N=layer⁡fwd1({ni0}i=1N,{e}){ni2}i=1N=layer⁡fwd2({ni1}i=1N,{e})⋯{niM}i=1N=layer⁡fwdM({niM−1}i=1N,{e})(11)\begin{aligned} \{n_i^1\}_{i=1}^{N} &= \operatorname{layer}_{\mathrm{fwd}}^1\left(\{n_i^0\}_{i=1}^{N}, \{e\}\right)\\ \{n_i^2\}_{i=1}^{N} &= \operatorname{layer}_{\mathrm{fwd}}^2\left(\{n_i^1\}_{i=1}^{N}, \{e\}\right)\\ &\cdots\\ \{n_i^M\}_{i=1}^{N} &= \operatorname{layer}_{\mathrm{fwd}}^M\left(\{n_i^{M-1}\}_{i=1}^{N}, \{e\}\right) \tag*{(11)} \end{aligned}

The corresponding full reverse propagation is performed by applying Equation (10) in reverse order for MM steps:

{{nM−1}i=1N=layer⁡fwdM({nM}i=1N,{e}){nM−2}i=1N=layer⁡fwdM−1({nM−1}i=1N,{e})⋯{n0}i=1N=layer⁡fwd1({n1}i=1N,{e})(12)\left\{ \begin{aligned} \{n^{M-1}\}_{i=1}^{N} &= \operatorname{layer}^{M}_{fwd}\left(\{n^{M}\}_{i=1}^{N}, \{e\}\right) \\ \{n^{M-2}\}_{i=1}^{N} &= \operatorname{layer}^{M-1}_{fwd}\left(\{n^{M-1}\}_{i=1}^{N}, \{e\}\right) \\ &\cdots\\ \{n^{0}\}_{i=1}^{N} &= \operatorname{layer}^{1}_{fwd}\left(\{n^{1}\}_{i=1}^{N}, \{e\}\right) \end{aligned} \right. \tag*{(12)}

Additional Experiments

Evaluation with Additional Metrics

To provide a more comprehensive assessment of simulation accuracy, we report results using two additional metrics. Optimal Transport (OT) quantifies global differences in particle distributions, while Maximum Mean Discrepancy (MMD) captures discrepancies in high-dimensional feature space. As summarized in Table 4, R-GNS consistently achieves the best performance across both metrics, further demonstrating its superior accuracy and stronger adherence to physical consistency.

MethodsNeuralSPHEGNNDMCFGNSR-GNS*R-GNS
OT (1e-3)0.310.491.370.270.250.18
MMD (1e-2)0.520.790.820.600.570.23

Table 4. Simulation Performance Across Models on WaterDrop

References

  1. [1]Lynton Ardizzone, Jakob Kruse, Sebastian Wirkert, Daniel Rahner, Eric W Pellegrini, Ralf S Klessen, Lena Maier-Hein, Carsten Rother, and Ullrich Köthe. Analyzing inverse problems with invertible neural networks. arXiv preprint arXiv:1808.04730, 2018.arxiv.org/abs/1808.04730
  2. [2]J Beck, WWL Chen, and Y Yang. Irreversible and dissipative systems. arXiv preprint arXiv:2404.00078, 2024.arxiv.org/abs/2404.00078
  3. [3]Jens Behrmann, Will Grathwohl, Ricky TQ Chen, David Duvenaud, and Jörn-Henrik Jacobsen. Invertible residual networks. In International conference on machine learning, pp. 573–582. PMLR, 2019.arxiv.org/abs/1811.00995
  4. [4]Laurent Dinh, Jascha Sohl-Dickstein, and Samy Bengio. Density estimation using real nvp. arXiv preprint arXiv:1605.08803, 2016.arxiv.org/abs/1605.08803
  5. [5]Partha Ghosh, Dominik Zietlow, Michael J Black, Larry S Davis, and Xiaochен Hu. Invgan: invertible gans. In DAGM German Conference on Pattern Recognition, pp. 3–19. Springer, 2022.arxiv.org/abs/2112.04598
  6. [6]Justin Gilmer, Samuel S Schoenholz, Patrick F Riley, Oriol Vinyals, and George E Dahl. Neural message passing for quantum chemistry. In International conference on machine learning, pp. 1263–1272. PMLR, 2017.arxiv.org/abs/1704.01212
  7. [7]Aidan N Gomez, Mengye Ren, Raquel Urtasun, and Roger B Grosse. The reversible residual network: Backpropagation without storing activations. Advances in neural information processing systems, 30, 2017.arxiv.org/abs/1707.04585
  8. [8]Arthur Gretton, Karsten M Borgwardt, Malte J Rasch, Bernhard Schölkopf, and Alexander Smola. A kernel two-sample test. The journal of machine learning research, 13(1):723–773, 2012.DOI
  9. [9]Philipp Holl, Vladlen Koltun, and Nils Thuerey. Learning to control pdes with differentiable physics. arXiv preprint arXiv:2001.07457, 2020.arxiv.org/abs/2001.07457
  10. [10]Yuanming Hu, Luke Anderson, Tzu-Mao Li, Qi Sun, Nathan Carr, Jonathan Ragan-Kelley, and Frédo Durand. DiffTaichi: Differentiable programming for physical simulation. arXiv preprint arXiv:1910.00935, 2019.arxiv.org/abs/1910.00935
  11. [11]Diederik P Kingma. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.arxiv.org/abs/1412.6980
  12. [12]Durk P Kingma and Prafulla Dhariwal. Glow: Generative flow with invertible 1x1 convolutions. Advances in neural information processing systems, 31, 2018.arxiv.org/abs/1807.03039
  13. [13]René Lefever. The rehabilitation of irreversible processes and dissipative structures’ 50th anniversary. Philosophical Transactions of the Royal Society A: Mathematical, Physical and Engineering Sciences, 376(2124):20170365, 2018.DOI
  14. [14]Natalia Levashova, Alexandr Gorbachev, Raul Argun, and Dmitry Lukyanenko. The problem of the non-uniqueness of the solution to the inverse problem of recovering the symmetric states of a bistable medium with data on the position of an autowave front. Symmetry, 13(5):860, 2021.DOI
  15. [15]Jiefeng Li, Siyuan Bian, Qi Liu, Jiasheng Tang, Fan Wang, and Cewu Lu. Niki: Neural inverse kinematics with invertible neural networks for 3d human pose and shape estimation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 12933–12942, 2023a.arxiv.org/abs/2305.08590
  16. [16]Zhehao Li, Qingyu Xu, Xiaohan Ye, Bo Ren, and Ligang Liu. Difffr: Differentiable sph-based fluid-rigid coupling for rigid body control. ACM Transactions on Graphics (TOG), 42(6):1–17, 2023b.DOI
  17. [17]Dong C Liu and Jorge Nocedal. On the limited memory bfgs method for large scale optimization. Mathematical programming, 45(1):503–528, 1989.
  18. [18]Joe J Monaghan. Smoothed particle hydrodynamics. Reports on progress in physics, 68(8):1703, 2005.
  19. [19]Jorge Nocedal. Updating quasi-newton matrices with limited storage. Mathematics of computation, 35(151):773–782, 1980.DOI
  20. [20]Lukas Prantl, Benjamin Ummenhofer, Vladlen Koltun, and Nils Thuerey. Guaranteed conservation of momentum for learning particle-based fluid dynamics. Advances in Neural Information Processing Systems, 35:6901–6913, 2022.arxiv.org/abs/2210.06036
  21. [21]Alvaro Sanchez-Gonzalez, Jonathan Godwin, Tobias Pfaff, Rex Ying, Jure Leskovec, and Peter Battaglia. Learning to simulate complex physics with graph networks. In International conference on machine learning, pp. 8459–8468. PMLR, 2020.
  22. [22]Victor Garcia Satorras, Emiel Hoogeboom, and Max Welling. E (n) equivariant graph neural networks. In International conference on machine learning, pp. 9323–9332. PMLR, 2021.
  23. [23]Franco Scarselli, Marco Gori, Ah Chung Tsoi, Markus Hagenbuchner, and Gabriele Monfardini. The graph neural network model. IEEE transactions on neural networks, 20(1):61–80, 2008.DOI
  24. [24]Samuel Schoenholz and Ekin Dogus Cubuk. Jax md: a framework for differentiable physics. Advances in Neural Information Processing Systems, 33:11428–11441, 2020.arxiv.org/abs/1912.04232
  25. [25]Yidi Shao, Chen Change Loy, and Bo Dai. Transformer with implicit edges for particle-based physics simulation. In European conference on computer vision, pp. 549–564. Springer, 2022.arxiv.org/abs/2207.10860
  26. [26]Deborah Sulsky, Shi-Jian Zhou, and Howard L Schreyer. Application of a particle-in-cell method to solid mechanics. Computer physics communications, 87(1-2):236–252, 1995.DOI
  27. [27]Artur P Toshev, Gianluca Galletti, Johannes Brandstetter, Stefan Adami, and Nikolaus A Adams. Learning lagrangian fluid mechanics with e (3)-equivariant graph neural networks. In International Conference on Geometric Science of Information, pp. 332–341. Springer, 2023.arxiv.org/abs/2305.15603
  28. [28]Artur P Toshev, Jonas A Erbesdobler, Nikolaus A Adams, and Johannes Brandstetter. Neural sph: Improved neural modeling of lagrangian fluid dynamics. arXiv preprint arXiv:2402.06275, 2024.arxiv.org/abs/2402.06275
  29. [29]Benjamin Ummenhofer, Lukas Prantl, Nils Thuerey, and Vladlen Koltun. Lagrangian fluid simulation with continuous convolutions. In International conference on learning representations, 2019.
  30. [30]Cédric Villani et al. Optimal transport: old and new, volume 338. Springer, 2008.
  31. [31]Tianyuan Zhang, Hong-Xing Yu, Rundi Wu, Brandon Y Feng, Changxi Zheng, Noah Snavely, Jiajun Wu, and William T Freeman. Physdreamer: Physics-based interaction with 3d objects via video generation. In European Conference on Computer Vision, pp. 388–406. Springer, 2024.arxiv.org/abs/2404.13026

Paper details

vlnc:W_8b9rxeby
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 10

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents