Local Accuracy, Global Failure: Why AI Simulators Can’t Just Be Glued Together
Even when AI models are trained to respect physics locally, gluing them together can break global conservation — a finding that challenges the modular future
22.68% of airflow vanishes when AI models of airway parts are stitched together — despite each part being locally
22.68%. That’s the error rate — the imbalance between mass flowing in and out — when researchers assembled a full airway tree simulation by stitching together independently trained AI models of its parts. It’s a number that shouldn’t work. Each individual piece — a straight tube, a Y-shaped split, a three-way junction — was trained to high precision, with physics-aware penalties to ensure local conservation of mass and momentum. The assembled simulation even captures the right flow patterns: air accelerates through narrowed sections, slows in widened ones, and distributes roughly as expected across branches. And yet, when you look at the whole system, nearly a quarter of the incoming airflow vanishes into mathematical thin air.
This isn’t a failure of AI. It’s a revelation about how we build complex systems from modular parts. In a new study, researchers from the University of Peradeniya demonstrate that even when every component of a physical simulation is locally accurate, the global result can still be wildly off. The reason? Local consistency does not guarantee global conservation. You can’t just train AI models on isolated pieces of a system, freeze them, and expect them to behave like a coherent whole — not without additional safeguards. This finding has profound implications for the future of scientific simulation, from climate modeling to drug delivery, where modular, reusable AI surrogates are being hailed as the next frontier.
The Science
The study focuses on a deceptively simple system: steady, incompressible airflow through an idealized two-dimensional model of the human bronchial tree. The airway is broken down into three fundamental building blocks — straight tubes, bifurcations (Y2), and trifurcations (Y3) — each treated as a reusable geometric primitive. For each type, the team trained a separate Deep Operator Network (DeepONet), a class of neural network designed to map input functions (like geometry and boundary conditions) to solution fields (like velocity and pressure).
These DeepONets were trained on 4,872 computational fluid dynamics (CFD) simulations, with each network learning from only its own type of component. Crucially, the training included not just direct supervision from CFD data, but also auxiliary physics-informed penalties: divergence (to enforce incompressibility), port-flux (to match flow at inlets and outlets), component-balance (to ensure mass conservation within each piece), and port-pressure (to align predicted pressures with known values). This is what makes the models “closure-aware” — they’re nudged toward physical consistency even in regions not directly observed.
But here’s the twist: once trained, the models were frozen. No further tuning, no iterative feedback, no global correction. To simulate a complete airway tree, the researchers simply ran each component’s DeepONet in isolation, then assembled the predicted velocity and pressure fields into a single global field using geometric transformations (
). The entire process took just 0.2 seconds on a CPU — orders of magnitude faster than traditional CFD. But speed came at a cost: the assembled simulation was not required to conserve mass globally. Instead, the researchers audited it post hoc, measuring how much mass was unaccounted for at the system level.
To test the robustness of their findings, the team conducted a sensitivity analysis across three random seeds, comparing three variants of the branching models: one trained only on data (Data), one with added divergence penalties (Div), and one with the full suite of physics penalties (Full). The Tube model was held fixed across all runs to isolate the effect of changes in the junctions. This allowed them to ask: if we improve local physical fidelity, does the global simulation get better?
What They Found
The answer, strikingly, is no.
At the level of individual components, the physics-informed models performed better. The Full model reduced the composite test score — a combined measure of field accuracy and physical consistency — by 26.7% for bifurcations (Y2) and 26.4% for trifurcations (Y3) compared to the Data-only model. It also slashed divergence errors by over 90% in Y2 and 75% in Y3, showing that the auxiliary penalties successfully enforced local incompressibility.
When these improved components were assembled into a full tree, local diagnostics also improved. The Full model reduced the root-mean-square (RMS) of component mass residuals by 7.2% and interface flux mismatches by 16.6% — signs that the pieces were fitting together more cleanly at their boundaries.
But the global picture was worse. Despite these local gains, the mean velocity error across the entire tree increased by 7.5%. More alarmingly, the external residual — the total mass imbalance at the system boundary — jumped from 17.49% ± 4.38% for the Data model to 26.77% ± 3.65% for the Full model. In other words, adding more physics to the local models made the global simulation less physically accurate.
Primitive Model Performance by Variant
Comparison of Data, Div, and Full models on Y2 and Y3 components. Full model achieves lowest composite score and divergence error.
| Label | Value |
|---|---|
| Y2 Score (Data) | 0.437 % |
| Y2 Score (Div) | 0.323 % |
| Y2 Score (Full) | 0.32 % |
| Y3 Score (Data) | 0.417 % |
| Y3 Score (Div) | 0.314 % |
| Y3 Score (Full) | 0.307 % |
| Y2 Div. Error (Data) | 1.926 % |
| Y2 Div. Error (Div) | 0.287 % |
This counterintuitive result is captured in the paper’s most telling figure.
shows side-by-side comparisons of CFD and DeepONet predictions for each primitive. While the velocity fields are visually similar, the error maps reveal systematic discrepancies — small but persistent — that accumulate when the components are linked. The pressure predictions, in particular, show offset patterns that don’t cancel out, leading to growing imbalances down the tree.
The final assembled tree simulation, while fast and qualitatively reasonable, fails a basic test of physical plausibility: it doesn’t conserve mass. The prescribed inlet flow is 3.74 × 10⁻⁴ m²/s, but the model reports a net loss of about 22.7% of that flow — a gap so large it would be immediately noticeable in any real-world application.
Global Simulation Errors by Model Variant
Component residual, interface mismatch, and external residual across Data, Div, and Full models. External residual increases with local regularization.
| Label | Value |
|---|---|
| Data | 17.49 % |
| Div | 33.75 % |
| Full | 26.77 % |
Why This Changes Things
This study delivers a sobering message to the growing field of scientific machine learning: modularity has limits. The dream of building complex simulators from reusable, plug-and-play AI components — a vision that promises faster design cycles, lower computational costs, and easier knowledge transfer — runs into a fundamental physical constraint. Conservation laws are global, not local. You can’t enforce them piece by piece and expect the whole to obey them.
The issue isn’t unique to airways. It applies to any branching system: blood vessels, river networks, power grids, supply chains. In each, flow must be conserved across the entire network. If a model of a single artery junction is off by 1%, that error might be tolerable in isolation. But in a 10-generation tree, such errors can compound, leading to predictions that are physically nonsensical.
Current approaches to physics-informed machine learning often assume that adding local constraints — like penalizing divergence or enforcing boundary conditions — will naturally lead to globally consistent solutions. This paper shows that assumption is flawed. Local regularization improves local diagnostics, but it doesn’t solve the interface problem. When models are trained in isolation, they develop incompatible “gauges” — arbitrary offsets in pressure or flow — that only become apparent when they’re connected.
This isn’t just an academic concern. In medicine, for example, AI surrogates are being developed to simulate airflow in patient-specific airways, helping diagnose conditions like asthma or chronic obstructive pulmonary disease (COPD). If such models silently violate conservation laws, they could mislead clinicians about where airflow is restricted or how drugs might distribute in the lungs. A model that says 20% of inhaled medication reaches the deep lung when the real number is 10% could have serious consequences.
The problem extends to climate modeling, where modular AI emulators are being used to replace expensive components of Earth system models. If a convection module and a cloud microphysics module are trained separately, their coupling could introduce artificial energy or moisture imbalances — errors that might destabilize long-term projections.
What this study reveals is that the path to trustworthy AI simulation isn’t just about better models. It’s about better architectures — ones that bake in global consistency from the start. The authors contrast their “frozen, single-pass” approach with iterative methods like Schwarz neural inference, where predictions are refined through repeated communication between subdomains. Those methods are slower, but they’re also more robust. This suggests a trade-off: speed versus reliability.
What’s Next
The immediate takeaway is clear: if you’re building a simulator from modular AI components, don’t assume local accuracy is enough. You need mechanisms to enforce global conservation — whether through iterative coupling, global projection, or post-processing correction.
One path forward is to design architectures that share information across components during inference. Instead of freezing each model, allow them to exchange flux and pressure data at interfaces, iterating until a consistent solution emerges. This would mimic classical domain decomposition methods, but with learned operators instead of hand-coded solvers.
Another approach is to train the components not just on isolated physics, but on their role in larger systems. This could involve meta-learning across tree configurations or using generative models that sample from a joint distribution of compatible components. The M2PDE framework mentioned in the paper, which uses a joint generative model for multiphysics simulation, points in this direction (Zhang et al., 2025).
A third option is to accept the modular approach but add a lightweight global correction step. After assembly, a small neural network could learn to adjust fluxes or pressures to close the mass balance, much like how weather models use data assimilation to correct drift. This would preserve the speed of single-pass inference while restoring physical consistency.
The study also highlights the need for better evaluation metrics in scientific machine learning. Standard benchmarks focus on field accuracy — how close the predicted velocity or pressure is to the truth. But this paper shows that a model can have low field error and still violate conservation laws. Future benchmarks should include system-level diagnostics like external residuals and interface mismatches.
Finally, the work underscores the importance of auditing AI models in realistic deployment scenarios. The researchers didn’t just test their models on the components they were trained on; they composed them into a novel, unseen configuration and measured the outcome. This kind of “zero-shot composition” test should become standard practice, especially for models intended for real-world use.
The dream of fast, reusable AI simulators isn’t dead. But this study shows it can’t be built on naive modularity. The laws of physics don’t care about software boundaries. If we want AI to simulate the real world reliably, we need architectures that respect the global nature of conservation — not just the local convenience of modular design.
As the authors put it: “Local field accuracy ⇏ globally consistent composition.” It’s a small symbol with a big meaning. And it should be etched into every textbook on scientific machine learning.
Local field accuracy ⇏ globally consistent composition.
Sign in to join the conversation.
Comments (0)
No comments yet. Be the first to share your thoughts.