RiteeshGrandhi/sciclaimeval-shared-task huggingface dataset:
Pipeline Overview
We present an overview of our method in Fig. 1 . Our pipeline defines the designs with a low-dimensional parametric geometry representation (Sec. 2.2 ). The behavior and performance of the design in the fluid environment are evaluated by a dynamic differentiable Navier-Stokes simulator (Sec. 2.3 ). Both components are embedded in a gradient-based optimization framework that co-optimizes both the geometric design and the control signal until convergence.
Geometry Representation
We represent our geometry with a low-dimension representation. Take the illustration in the inset figure as an example, here we introduce the representation on a high level, and refer the readers to the appendix for the full details. We parameterize a closed 2D surface using its center c and a set of connected Bezier curves with their control points define in polar coordinates \rho_{i} for i\in[1,2,\dots,2N] , where every two control points define a 2D Bezier curve spanning \frac{2\pi}{N} radians in the polar coordinate system. This representation offers a compact way of defining diverse geometries. We further parameterize a closed 3D surface using a list of 2D surfaces defining the key cross-sections of the geometry along an extrusion axis z of the local object frame, where each 2D surface is parameterized as described above. The parameterization includes z=z_{0} and z_{1} , which determines the Z plane of the first and last cross-section, along with the parameters for each key 2D cross-section, which are assumed to be evenly spaced between z\in[z_{0},z_{1}] .The continuous geometry interpolates the key cross-sections along the z-axis. Finally, we construct more complex 3D geometries using operations from Constructive Solid Geometry (CSG): Union and intersection, which allows us to define a 3D parametric heart model using the union of four sub-geometries.
Differentiable Navier-Stokes Simulation
Our fluid dynamics is governed by the incompressible Navier-Stokes equations. These consist of the momentum equation (Eq. 1a ), accounting for temporal changes in velocity ( \bm{u} ), advective acceleration, viscous dissipation, and pressure ( p ) gradient forces for an incompressible fluid with fluid density \rho and kinematic viscosity \nu . The incompressibility condition (Eq. 1b ) requires the divergence of the velocity field must be zero to enforce the conservation of mass:

\frac{\partial\bm{u}}{\partial t}=-(\bm{u}\cdot abla)\bm{u}+{\color[rgb]{0,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@color@gray@fill{0} u} abla^{2}\bm{u}-\frac{1}{\rho} abla p, (1a) abla\cdot\bm{u}=0 (1b)
Numerical Simulation
We build the fluid simulator by leveraging the operator-splitting method [ 9 ] [ 10 ] . A single simulation step comprises three sub-steps: advection, viscosity, and projection. See the Appendix B for details on time discretization. The simulation domain is discretized on a standard Marker-and-Cell (MAC) grid [ 11 ] , with pressures stored at cell centers and velocities at cell faces. By employing the finite-difference scheme on the MAC grid cells and faces, we construct the matrix \frac{1}{\Delta x}\textbf{G} for gradient operator and its negative transpose -\frac{1}{\Delta x}\textbf{G}^{T} for divergence operator. In the following sections, capital letters will refer to matrices or the flattened vectors induced by the fields denoted by the corresponding lowercase letters in Appendix B.
Back-propagation through Time
We construct our back-propagation algorithm to mirror the sequence of operations carried out in the forward pass but in a reversed order.

Given the gradients of the loss function J with respect to the velocity field \bm{u} at time step n+1 , denoted by \frac{\partial J}{\partial\textbf{U}^{n+1}} , our goal is to compute the corresponding gradients at time step n , \frac{\partial J}{\partial\textbf{U}^{n}} .
Back-propagation through Geometry
The parametric geometry affects simulation through the solid-fluid boundary during the projection step in Eq. 4 . Specifically, the SDF of the geometry \phi^{n+1} affects the volume matrix \textbf{S}^{n+1} and the velocity (in the case of moving geometry) of the geometry \textbf{U}^{n+1}_{s} affects the boundary condition. We can back-propagate \frac{\partial J}{\partial\textbf{P}^{n+1}} w.r.t these two parameters to derive

\frac{\partial J}{\partial\textbf{S}^{n+1}}=\bm{y}\textbf{G}^{T}(\hat{\textbf{U}}^{n+1}-\textbf{U}^{n+1}_{s})+\bm{y}\frac{\partial\textbf{A}}{\partial\textbf{S}^{n+1}}\textbf{P}^{n+1}, (9a) \frac{\partial J}{\partial\textbf{U}^{n+1}_{s}}=-\bm{y}\textbf{G}^{T}\textbf{S}^{n+1}. (9b)

Further back-propagating \frac{\partial J}{\partial\textbf{S}^{n+1}} first through the SDF \phi then through the distance computation and \frac{\partial J}{\partial\textbf{U}^{n+1}_{s}} through geometry velocity function allows us to optimize through the geometry iso-surface.
Neural Fluid Control
We can train neural-network parameterized closed-loop fluid controllers with gradients fully computed at both geometry and velocity throughout time. We parameterize our controllers with a two-layer MLP. The controller takes as input the observation of the fluid velocity field at each frame and outputs dynamic control signals that affect the geometry through our parametric geometry presentation, which further affects the flow field. Our fully differentiable framework allows gradient-based methods to train the controller efficiently. We implemented the backbone of our code in C++ and CUDA for computational efficiency. We derived gradients for the geometry and simulation module analytically, then exposed the differentiable simulation framework through pybind11 [ 13 ] to enable seamless integration with deep learning libraries, which in our case is PyTorch [ 14 ] .
Benchmarks and Applications
In this section, we introduce our fluidic design benchmarks and environments. We warp our environments using the standard protocol in the gym to facilitate learning practices. We will release our code publicly upon acceptance. We present six fluidic design and control tasks (Fig. 2 ) to assess the effectiveness of our computational pipeline for fluidic system design and learning. A comprehensive illustration of these design scenarios, including the visualization of the optimization process, is provided in Appendix Sec C and our supplemental video. Initial conditions are set for all optimizations using randomly sampled values. We use Adam as our optimizer. We summarize the simulation configuration and optimization configuration as well as relevant statistics in Table 1 .
Scalability to Complex Fluid Fields: A Case Study of Artificial Heart
We showcase the scalability of our method through an artificial heart design and control learning task (Fig. 3 ). Artificial heart development is difficult due to the complex blood flow movement within the heart. This case study provides a first step in studying the heart’s control strategies. We train a closed-loop controller that outputs the per-time-step contraction signal of the four muscles of a simplified heart model so that the outlet velocity matches a pre-defined target profile. The controller’s states include temporal encoding of the current time step and the current outflow norm, and they are parameterized using a two-layer MLP.
The heart’s geometry is parameterized as the union of the two inlets, one outlet, and the heart chamber. In two variants of the task, one target flow profile is parameterized using a cosine curve (Fig 3 top), and one target flow profile mimics the shape of an electrocardiogram (Fig 3 bottom). We define the loss function as the sum of the L2 norm of the difference between the average velocity norm of the fluid and the target velocity at each frame. In both variants, the trained controller successfully outputs signals that generate blood flow that matches the target, demonstrating the effectiveness of our gradient-based optimization framework. We further visualize the rollouts of the trained controllers at Fig 3 left.
Effects of Initialization on Optimization
This experiment studies the effect of random initialization in our fluid optimization tasks. Specifically, we randomly initialize the geometry and position of the geometry in the Shape Identifier task with 5 random seeds. We plot the optimization trajectory in Fig. 4 left. Although the seeds exhibit varying initial losses, they all converge to nearly zero loss by the end of optimization. This demonstrates that our gradient-based method, combined with low-dimensional geometry parameterization, makes the optimization process robust to random initialization. In the accompanying figure, we plot an extended version of the training trajectory, scaled logarithmically for better visualization, to compare the convergence of different random initializations. However, in practice, our method achieves the objective driven by the loss within tens of iterations, as is evident from the steep initial descent in the optimization curve. These curves offer valuable guidelines for practitioners using our method in their deployments: the gradients from our approach are robust to hyper-parameters and scalable to high-dimensional optimization problems.
Gradient-Based vs Gradient-Free Optimization
We study the effectiveness of our gradient-based method against gradient-free optimization methods in the Neural Heart task (Fig. 4 right). We choose Proximal Policy Optimization (PPO) [ 15 ] as the baseline for reinforcement learning and CMA-ES [ 16 ] for evolution strategies. This environment is particular challenging due to the sensitivity of the bloodflow to the control signal changes across time, which could result in large flow field change if adjacent rollouts have large changes. We initialize all methods to output stochastic control signals of small noise for stable initial simulation. Our gradient-based method quickly converges to near zero after 60 epochs, while both gradient-free methods struggle in this environment. We argue that the rapid and successful convergence stems from the clear gradient provided by our method. Note that our differentiable optimization pipeline depends on the differentiability of the loss function (e.g., the imitation loss we used). This can be problematic if the objective is too complex to be characterized in a differentiable manner, in which case gradient-free methods are better alternatives. However, our framework will still excel due to its outstanding forward simulation speed, which we will elaborate next.
Time Performance Profiling and Comparison
In this experiment, we demonstrate the performance efficiency of our framework through a comparison with PhiFlow. While PhiFlow operates with a TensorFlow-GPU backend, our framework is implemented in CUDA C++ and features a high-performance Geometric-Multigrid-Preconditioned-Conjugate-Gradient Poisson solver [ 17 ] . We benchmark both the one-step forward simulation time and gradient back-propagation time at different resolutions, as shown in Table 2 . The experiment runs on a workstation with a NVIDIA RTX A6000 GPU. Our high-performance framework consistently outperforms PhiFlow by an order of magnitude across all resolutions, thanks to the custom CUDA kernels and the rapid convergence of the Poisson solver. Our method enhances the speed of both forward and backward computations compared to the previous state-of-the-art approach, benefiting both gradient-based and gradient-free optimization techniques. We expect the speedup provided by our system to be particularly useful in domains related to fluid simulation, including applications in robotics and video generation. Furthermore, since our environments are built upon widely-adopted gym protocols [ 4 ] , it is extremely easy and fast for practitioners to import and test our library. We plan to release our code and accompanying documentation upon acceptance.
Conclusions, Limitation and Future Work
In this paper, we proposed a fully differentiable pipeline for neural fluidic system control and design, addressing the challenges of complex geometry representation, differentiable fluid simulation, and co-design optimization processes. Our pipeline features a low-dimensional parametric geometry representation and a differentiable Navier-Stokes simulator for predicting fluid behavior. We demonstrate the effectiveness of our pipeline in a number of complex control design tasks, ranging from different fluidic functional controls to complex neural heart control.

There are certain limitations and avenues for future work. First, the current pipeline assumes the standard Navier-Stokes model, which limits its applicability to Newtonian flow. Extending the framework to handle non-Newtonian flows or multi-physics interactions would be an interesting direction for future research. Additionally, the pipeline relies on parametric representation, which may encounter challenges in navigating complex design spaces with high-dimensional or discontinuous parameterizations such as coupling control design with topology optimization. Exploring alternative optimization algorithms or incorporating surrogate models could enhance the efficiency and robustness of the optimization process. Furthermore, while we demonstrate the effectiveness of our pipeline in several control and design tasks, additional validation and bench-marking against real-world physical experiments would be valuable to establish the pipeline’s reliability and generalizability.
C.1 Amplfier
We visualize the initial and optimized design for the amplifier task in Fig. 5 . The optimized design exhibits a funnel shape with flat outlet, successfully amplifying the original inflow by the targeted factor of three, validating the efficacy of our computational pipeline. The optimized design has the same shape shown in previous works [ 40 , 8 ] , validating the correctness of our optimization pipeline.
C.2 Switch
We visualize the initial and optimized design for the amplifier task in Fig. 6 .
C.2.1 Flow Modulator
We visualize the initial and optimized design for the Flow Modulator task in Fig. 7 . We run the task with two variants. In both cases, the optimization reaches near zero loss in a few optimization iterations.
Figure 1 : Pipeline Overview. (1) Our pipeline starts with an initial parametric geometry and a neural network parameterized controller. (2) The fluid dynamics is then simulated using a dynamic Navier-Stokes solver. (3) The performance of the design and control is evaluated using a loss function, the gradients of which are then back-propagated through our end-to-end differentiable framework. (4) The gradient-based optimization iteratively improves the geometry and control to achieve the task goal. This pipeline allows for efficient geometry and control co-optimization.; Pipeline Overview. (1) Our pipeline starts with an initial parametric geometry and a neural network parameterized controller. (2) The fluid dynamics is then simulated using a dynamic Navier-Stokes solver. (3) The performance of the design and control is evaluated using a loss function, the gradients of which are then back-propagated through our end-to-end differentiable framework. (4) The gradient-based optimization iteratively improves the geometry and control to achieve the task goal. This pipeline allows for efficient geometry and control co-optimization.
Figure 2 : Tasks Overview. In each task, the blue dashed line represents the inlet, the red dashed line indicates the outlet, the white arrows show the flow direction, and the orange shapes and arrows denote the geometry and its motion direction.; Tasks Overview. In each task, the blue dashed line represents the inlet, the red dashed line indicates the outlet, the white arrows show the flow direction, and the orange shapes and arrows denote the geometry and its motion direction.
Figure 3 : Artificial Heart. Left : visualization of the domain and the location of the muscles. Middle : Optimized control policy rollout visualization. Right: Optimization results visualization. The top and bottom diagrams visualize the cosine and the ECG target variants.; Artificial Heart. Left : visualization of the domain and the location of the muscles. Middle : Optimized control policy rollout visualization. Right: Optimization results visualization. The top and bottom diagrams visualize the cosine and the ECG target variants.
Figure 4 : Ablation Studies. Left: Optimization trajectories with different initialization. Iterations are visualized on a log scale. Right: Log scaled loss-iteration curves of our gradient-based method and other gradient-free optimization methods.; Ablation Studies. Left: Optimization trajectories with different initialization. Iterations are visualized on a log scale. Right: Log scaled loss-iteration curves of our gradient-based method and other gradient-free optimization methods.
Figure 5 : Amplifier. The goal of the task is to augment the initial velocity of 5 units to a target of 15 units. We visualize the initial and optimized designs. We overlay the design and the corresponding velocity field (colored by the norm) for both iterations.; Amplifier. The goal of the task is to augment the initial velocity of 5 units to a target of 15 units. We visualize the initial and optimized designs. We overlay the design and the corresponding velocity field (colored by the norm) for both iterations.
Figure 6 : Fluidic Switch. The switch rotates dynamically across time (dotted lines). The shape of the switch is parameterized as a 2D Polar Bezier, whose parameters, along with the parameters of the rotation signal are subject to optimization. The top and bottom of the illustration visualize information from the initial and optimized iteration respectively. For each iteration, we visualize the design geometry (left) and corresponding streamlines of the flow field (right) at 7 key-frames evenly sampled across time. We additionally plot the target (green) and outlet velocity norm profile (orange) across time and visualize their difference in grey shaded area.; Fluidic Switch. The switch rotates dynamically across time (dotted lines). The shape of the switch is parameterized as a 2D Polar Bezier, whose parameters, along with the parameters of the rotation signal are subject to optimization. The top and bottom of the illustration visualize information from the initial and optimized iteration respectively. For each iteration, we visualize the design geometry (left) and corresponding streamlines of the flow field (right) at 7 key-frames evenly sampled across time. We additionally plot the target (green) and outlet velocity norm profile (orange) across time and visualize their difference in grey shaded area.
Figure 7 : Flow Controller. The top row visualizes the initial parameters used to start the optimization of both variations and the streamlines of the fluid field. The design parameters include the parametric signal controlling the rotation and the four parametric polar Bezier curves (top left) controlling the geometry of the controller. The middle two rows depict the optimized geometry and control of the rotating flow controller. The bottom visualizes the optimization loss-iteration progress for both variations.
A key aspect of our simulation setup is the norm of the inflow velocity, set at a value of 2 . The primary objective of the optimization process is to elevate the average norm of the velocity in the targeted outlet area. Initially, this value stands at 3.388 , and the optimization aims to increase it to 2k . For values of k equal to 5 and 3 , the optimized outcomes are 9.283 and 5.748 , respectively.; Flow Controller. The top row visualizes the initial parameters used to start the optimization of both variations and the streamlines of the fluid field. The design parameters include the parametric signal controlling the rotation and the four parametric polar Bezier curves (top left) controlling the geometry of the controller. The middle two rows depict the optimized geometry and control of the rotating flow controller. The bottom visualizes the optimization loss-iteration progress for both variations.
A key aspect of our simulation setup is the norm of the inflow velocity, set at a value of 2 . The primary objective of the optimization process is to elevate the average norm of the velocity in the targeted outlet area. Initially, this value stands at 3.388 , and the optimization aims to increase it to 2k . For values of k equal to 5 and 3 , the optimized outcomes are 9.283 and 5.748 , respectively.
Task Specifications. We summarize the simulation and optimization configuration for the design tasks shown in Sec. 3 and report the initial and optimized loss. We note that because our implementation adopts CFL condition for numerical stability during simulation, the actual steps simulated and back-propagated are higher than the numbers shown in “# Frames”.
Time Performance. Our method achieves one order of magnitude speedup across all resolutions compared to PhiFlow in both forward simulation and backward gradient propagation.