Generative Latent Diffusion Model for Inverse Modeling and Uncertainty Analysis in Geological Carbon Sequestration Zhao Feng, Xin-Yang Liu, Meet Hemant Parikh, Junyi Guo, Pan Du, Bicheng Yan, Jian-Xun Wang Abstract Geological Carbon Sequestration (GCS) has emerged as a promising strategy for mitigating global warming, yet its effectiveness heavily depends on accurately characterizing subsurface flow dynamics. The inherent geological uncertainty, stemming from limited observations and reservoir heterogeneity, poses significant challenges to predictive modeling. Existing methods for inverse modeling and uncertainty quantification are computationally intensive and lack generalizability, restricting their practical utility. Here, we introduce a Conditional Neural Field Latent Diffusion (CoNFiLD-geo) model, a generative framework for efficient and uncertainty-aware forward and inverse modeling of GCS processes. CoNFiLD-geo synergistically combines conditional neural field encoding with Bayesian conditional latent-space diffusion models, enabling zero-shot conditional generation of geomodels and reservoir responses across complex geometries and grid structures. The model is pretrained unconditionally in a self-supervised manner, followed by a Bayesian posterior sampling process, allowing for data assimilation for unseen/unobserved states without task-specific retraining. Comprehensive validation across synthetic and real-world GCS scenarios demonstrates CoNFiLD-geo’s superior efficiency, generalization, scalability, and robustness. By enabling effective data assimilation, uncertainty quantification, and reliable forward modeling, CoNFiLD-geo significantly advances intelligent decision-making in geo-energy systems, supporting the transition toward a sustainable, net-zero carbon future. keywords Generative modeling, Geological carbon sequestration, Uncertainty quantification, Data assimilation, Bayesian learning 1 Introduction The escalating threats posed by climate change represent an urgent global imperative for Earth’s ecosystems and human civilization, necessitating the deployment of effective decarbonization strategies. Geological Carbon Sequestration (GCS) has emerged as a promising solution for large-scale reduction of atmospheric carbon dioxide ( \mathrm{CO_{2}} ) RN23 . GCS involves injecting captured \mathrm{CO_{2}} , sourced from industrial emissions or direct air capture, into deep subsurface geological formations such as saline aquifers huppert_fluid_2014 , depleted hydrocarbon reservoirs lyu_role_2021 , and basaltic rocks matter_rapid_2016 for permanent storage. This injected \mathrm{CO_{2}} displaces the in-situ fluids, forming complex multicomponent multiphase flow systems. This process leads to gaseous plume migration and pressure buildup, which together constitute key components of the dynamic reservoir responses. Accurately characterizing these dynamic reservoir responses is crucial for reliable assessment of storage capacity, leakage risks, and operational decisions. However, intrinsic geological uncertainties arising from limited observations and inherent subsurface heterogeneity significantly compromise the predictive reliability. Inverse modeling, or data assimilation, provides a systematic framework for inferring the uncertain geological parameters from field observational data. Inversion methods broadly fall into deterministic and stochastic categories oliver_inverse_2008 . Deterministic approaches identify optimal geomodels by minimizing discrepancies between observed reservoir responses and model predictions through gradient-based gao_improved_2006 ; shirangi_improved_2016 or heuristic optimization lee_field_2019 ; jeong_theoretical_2019 . However, these methods yield only point estimates, thus limiting their capability to explore the full posterior distribution for uncertainty quantification (UQ). In contrast, stochastic methods leverage Bayesian inference to update prior distributions using observational data, employing sampling-based techniques such as Markov Chain Monte Carlo (MCMC) han_surrogate_2024 ; wang_efficient_2021 or optimization-based ensemble algorithms gao2021bi ; tang_deep_2022 ; jiang_history_2024 . Traditional inverse modeling workflows, however, are computationally demanding due to repeated forward model evaluations, exacerbated by the strong nonlinearities, multiphysics coupling, and extensive spatiotemporal scales inherent in GCS. Recent advancements in machine learning (ML) and deep learning (DL) offer promising pathways to tackle these challenges, introducing computationally efficient surrogate models to bypass costly forward simulations. Convolutional Neural Networks (CNNs), in particular, have gained popularity for subsurface flow prediction on structured grids, framing the tasks as image-to-image regression wen_towards_2021 ; feng_hybrid_2025 ; seabra_ai_2024 ; qin_fluid_2025 ; xu_novel_2023 . Typically employing encoder–decoder architectures, these models encode geological parameters into latent representations and reconstruct flow dynamics through autoregressive rollouts mo_deep_2019 , recurrent connections tang_deep-learning-based_2022 ; feng_encoder-decoder_2024 , or explicit temporal conditioning yan_physics-constrained_2022 ; tariq2024transunet . Graph Neural Networks (GNN) have similarly demonstrated utility in unstructured grid applications jiang_graph_2023 , especially for emulating GCS in faulted reservoirs ju2024learning . Additionally, neural operators, such as Fourier Neural Operators (FNOs) li_fourier_2021 , Deep Operator Networks (DeepONets) lu_learning_2021 and their variants, have been used to learn functional mappings from geological parameters to reservoir responses. Examples include U-Net enhanced FNO (U-FNO) wen_u-fnoenhanced_2022 , nested FNO wen_real-time_2023 , and hybrid frameworks combining DeepONet and FNO jiang_fourier-mionet_2024 ; lee_efficient_2024 for surrogate GCS modeling. Despite their computational advantages, these surrogate approaches generally require task-specific retraining or repeated inference steps when applied to new observational scenarios, thereby limiting generalizability and practical utility. Moreover, errors introduced by surrogates may propagate into inversion outcomes, particularly beyond training regimes. A complementary line of investigation leverages dimension reduction techniques to compactly represent the complex geomodel spatial variability within low-dimensional latent spaces, thereby rendering traditional inversion algorithms computationally tractable. Classic methods such as Principal Component Analysis (PCA) oliver_multiple_1996 ; vo_new_2014 ; wang_physics-informed_2024 , CNN-PCA liu_deep-learning-based_2019 ; liu_3d_2021 , and Convolutional Autoencoders (CAEs) xiao_modelreduced_2022 ; razak_latent-space_2022 achieve substantial reductions in parameter dimensionality, thus simplifying the subsequent inversion process. More recently, deep generative models, particularly Variational Autoencoders (VAEs) laloy_inversion_2017 ; jiang_deep_2021 ; bao_variational_2022 and Generative Adversarial Networks (GANs) laloy_training-image_2018 ; fu_deep_2023 ; ling_improving_2024 ; zhan_integrated_2022 ; tetteh_leveraging_2024 , have been adopted to further refine latent representations. These generative architectures often explicitly enforce Gaussian-distributed latent variables, facilitating compatibility with Bayesian inversion techniques, particularly ensemble-based approaches feng_deep_2024 . Nevertheless, despite the use of probabilistic generative models, existing workflows predominantly exploit these methods as dimension reduction tools, with posterior exploration still relying on traditional inversion algorithms. Consequently, the intrinsic probabilistic capabilities offered by generative modeling remain largely underutilized. Additionally, reliance on iterative posterior updates and repeated forward simulations continues to constrain the computational efficiency and practical applicability of these methods. Therefore, there remains a need for a unified inversion framework capable of leveraging the full strengths of generative models to directly model the posterior, avoiding iterative retraining or excessive forward simulations. Diffusion probabilistic models have recently emerged as a powerful paradigm in generative modeling, demonstrating exceptional success in image/video generation to solving and Beyond yang2023diffusion . These models, broadly classified into denoising diffusion probabilistic models (DDPMs) sohl-dickstein_deep_2015 ; ho_denoising_2020 and score-based generative models song_generative_2019 , share a unified theoretical foundation within the stochastic differential equation (SDE) framework song_score-based_2021 . Compared to traditional generative methods, diffusion models stand out by offering stable training, high-fidelity sample generation, and particularly effective conditional sampling capabilities dhariwal_diffusion_2021 . These properties make them particularly attractive from a Bayesian perspective for inverse problems, allowing for generating posterior samples conditioned on observations daras2024survey . Recent advances have demonstrated the growing potential of diffusion models for inverse problems and data assimilation in computational mechanics gao2024bayesian ; du_conditional_2024 ; liu_confild-inlet_2024 ; li_learning_2024 ; dasgupta2025conditional ; valencia2025learning ; fan2025neural . A particularly notable contribution is the Conditional Neural Field Latent Diffusion (CoNFiLD) framework, which integrates conditional neural fields with latent diffusion modeling du_conditional_2024 . CoNFiLD has exhibited strong performance across various challenging tasks, such as turbulent flow generation and reconstruction. In these applications, CoNFiLD has enabled accurate Bayesian conditional sampling, producing physically consistent and observation-consistent flow fields directly from sparse and noisy data without the need for retraining. Studies such as CoNFiLD-inlet and other conditional diffusion-based models liu_confild-inlet_2024 have demonstrated the framework’s robustness, generalizability, and data-efficiency in modeling highly nonlinear and stochastic spatiotemporal systems. Despite these promising results, the application of diffusion models to subsurface multiphase flow inversion remains relatively unexplored. Some recent studies have explored this direction, offering initial insights. Zhan et al. zhan_toward_2025 employed a Latent Diffusion Model (LDM) to infer aquifer heterogeneity, conditioning the generative process on fully observed flow fields. While the approach demonstrated promise for both unconditional generation and surrogate modeling, it required retraining for each new data assimilation scenario and was constrained by the structured-grid limitations of convolutional VAEs. In another study, Wang et al. wang_generative_2025 utilized diffusion models with classifier-free guidance to directly generate geomodels from sparse observations. Although effective in sparse-data settings, the method showed limited generalization to new observational configurations. Moreover, by operating directly in physical space, the model faced scalability challenges in high-dimensional settings, and generated only static geological realizations, thus requiring separate numerical simulations to obtain the associated flow responses. To address the aforementioned limitations, we propose the Conditional Neural Field Latent Diffusion model for geoscience (CoNFiLD-geo), a unified generative framework that jointly models geological parameters and spatiotemporal reservoir responses without the need for task-specific retraining. CoNFiLD-geo synergistically integrates Conditional Neural Fields (CNFs) with latent diffusion probabilistic models, enabling the learning of joint distributions over geomodels and reservoir responses in a shared, mesh-agnostic latent space. By leveraging CNFs for nonlinear dimension reduction, the framework supports both structured and unstructured grids, allows continuous querying at arbitrary spatial locations, and scales efficiently to high-dimensional settings. CoNFiLD-geo is pretrained in an unconditional, self-supervised manner, during which it learns joint prior distribution of both geological structures and flow dynamics. At inference, observational data are incorporated via a Bayesian posterior sampling strategy that guides the generative process without requiring retraining. This zero-shot conditional generation capability enables robust and adaptive data assimilation across diverse data assimilation scenarios. In contrast to the original CoNFiLD framework du_conditional_2024 and most existing literature that focus on solely modeling the distribution of states, CoNFiLD-geo captures the joint distribution of both the parameter (input) and the state (output) spaces simultaneously, which allows the framework to operate as both a forward surrogate and as a generative inverse solver, offering comprehensive data assimilation and UQ for subsurface multiphase flow systems. We demonstrate the efficacy of CoNFiLD-geo across a range of GCS applications, including both synthetic and field-scale case studies, targeting hydrodynamic and stratigraphic inversion tasks. The results highlight the model’s ability to generate physically consistent geomodel–response pairs from sparse, noisy, and geometrically complex observational data. While our focus is on GCS, the CoNFiLD-geo framework is broadly applicable to other geo-energy systems involving coupled multiphysics processes. As such, this work presents a generalizable, inference-efficient generative modeling paradigm for geoscience and marks a step toward realizing artificial general intelligence in data-scarce, physics-informed domains. 2 Results In this section, an overview of the proposed CoNFiLD-geo framework is first presented, followed by numerical experiments over a wide range of GCS scenarios, including \mathrm{CO_{2}} drainage in heterogeneous reservoirs, field-scale \mathrm{CO_{2}} sequestration at the Sleipner site in Norway, and \mathrm{CO_{2}} injection coupled with brine production in stratigraphically complex formations. The first two cases aim to quantify uncertainty in hydrodynamic parameters, whereas the final case is dedicated to inferring stratigraphic heterogeneity. 2.1 Overview of the CoNFiLD-geo framework CoNFiLD-geo is a probabilistic generative framework, synergistically integrating a Conditional Neural Field (CNF) and a Latent Diffusion Model (LDM) through a modular design. It functions through a two-stage process: an offline pretraining stage and an online generation stage. During pretraining, CoNFiLD-geo learns the joint distribution of geomodels and the corresponding reservoir responses, implicitly capturing the prior physical knowledge across parameter and solution spaces. At deployment, CoNFiLD-geo allows for the real-time integration of diverse observational data sources, such as satellite remote sensing, surface seismic monitoring, and subsurface borehole measurements, to guide the generation process. CoNFiLD-geo can be broadly applied to data assimilation, UQ, and surrogate modeling, providing a unified framework for geoscientific inverse and forward modeling (Fig. 1 a). Figure 1: Overview of the proposed CoNFiLD-geo framework. (a) Left: schematic of GCS and its monitoring system. Right: schematic of CoNFiLD-geo; the unconditional pretrained model serves as a prior, while multi-source of monitoring data is fused to guide the zero-shot conditional generation. (b) In the pretraining stage, the CNF encodes the spatiotemporal field \bm{\Phi}(\bm{x},t) , which is the concatenation of the geomodel \bm{M}(\bm{x}) and the corresponding reservoir responses \bm{U}(\bm{x},t) , into a latent variable \bm{z}_{0} . The LDM then learns the joint distribution in the latent through bidirectional diffusion and denoising processes. (c) In the generation stage, arbitrary types of conditional information \bm{\Psi} (e.g., sparse probed measurements, low resolution fields, and damaged data) are utilized to steer the generation within a Bayesian formulation. The generated latent variable is decoded back into physical space by the trained CNF. No training is involved in the conditional generation process. A schematic illustration of the pretraining process is shown in Fig. 1 b. Given a realization of geomodel \bm{M}(\bm{x})\in\mathbb{R}^{N_{d}\times N_{m}} , the corresponding spatiotemporal reservoir responses resulting from engineering perturbations are denoted by \bm{U}(\bm{x},t)\in\mathbb{R}^{N_{d}\times N_{t}\times N_{u}} , where N_{d} represents the spatial dimension, N_{m} the set of geological parameters, N_{t} the temporal length, and N_{u} the number of state variables. The model parameter-solution pairs are simultaneously encoded by a CNF, which implicitly captures their spatial and temporal correlations in a unified representation. Specifically, the static geomodel is concatenated with the dynamic reservoir responses via temporal broadcasting, forming a joint spatiotemporal field \bm{\Phi}(\bm{x},t)\in\mathbb{R}^{N_{d}\times N_{t}\times N_{\Phi}} , where N_{\Phi}=N_{m}+N_{u} corresponds to the total feature dimension combining both geological parameters and state variables. The CNF \mathscr{E}_{\zeta,\gamma}(\bm{X},\bm{L}) is then applied to encode the high-dimensional \bm{\Phi}(\bm{x},t) into a sequence of latents \bm{z}_{0}\in\mathbb{R}^{N_{l}\times N_{t}} , where each column \bm{L}_{t}\in\mathbb{R}^{N_{l}} corresponds to the low-dimensional latent vector at time step t , i.e., \bm{z}_{0}=[\bm{L}_{1},\bm{L}_{2},...,\bm{L}_{N_{t}}] . In this work, the CNF encoder \mathscr{E}_{\zeta,\gamma}(\bm{X},\bm{L}) is formulated in an auto-decoding fashion park_deepsdf_2019 , where the learnable condition vector \bm{L} is fed into a hypernetwork parameterized by \gamma , which modulates the main network \zeta through full-projection conditioning liu_confild-inlet_2024 . The latent variable \bm{z}_{0} serves as a reduced-dimensional joint representation that bridges the functional spaces of the geological parameters and the corresponding reservoir responses. This property facilitates the LDM to learn the joint distribution in a compact latent space. A diffusion probabilistic model ho_denoising_2020 is employed to approximate p(\bm{z}_{0}) through a Markovian denoising transition kernel starting from a standard Gaussian distribution. This process involves asymptotically adding handcrafted Gaussian noise to the latent variable until the original representation becomes an isotropic Gaussian. Subsequently, a neural network (parameterized by \theta ) is trained to reverse this diffusion process by denoising the latent variables in a step-wise manner. Once trained, the diffusion model can generate new realizations of \bm{z}_{0} from randomly sampled white noises by iteratively applying the learned denoising network. To ensure optimization stability, the training of CoNFiLD-geo is decoupled into two stages: the CNF encoder is pretrained, followed by the training of the latent diffusion model. In the online inference stage, various types of observational data (denoted as \bm{\Psi} ) can be utilized on-the-fly to guide the generation of the full field \bm{\Phi} without retraining (Fig. 1 c). This is accomplished via Bayesian posterior sampling, where the pretrained unconditional CoNFiLD-geo serves as a prior, and the likelihood is evaluated based on the discrepancy between the given observations \bm{\Psi} and the modeled observables computed from generated latent variable \bm{z}_{\tau} (see Methods for detailed derivation). The differentiable nature of the entire framework enables continuous refinement of the latents during sampling, thereby ensuring that the conditionally generated results satisfy both observed conditions and follow the prior learned by the pretrained model. The ultimate posterior \bm{z}_{0} is subsequently decoded into physical space by the trained CNF \mathscr{E}_{\zeta^{*},\gamma^{*}} , yielding the joint spatiotemporal field \bm{\Phi}(\bm{x},t) . The synthesized geomodel \bm{M}(\bm{x}) and its associated reservoir responses \bm{U}(\bm{x},t) can be retrieved by disentangling \Phi(\bm{x},t) along the feature dimension. The static component \bm{M}(\bm{x}) is obtained by temporal averaging, which potentially mitigates numerical artifacts and enhances the consistency of the generated geomodel. An ensemble of inferred geomodel and reservoir responses can be generated in batch mode, facilitating UQ of the flow system in a real-time manner. 2.2 \mathrm{CO_{2}} drainage in heterogeneous reservoirs As a fundamental physical process in GCS operations, we first consider the \mathrm{CO_{2}} - \mathrm{H_{2}O} displacement in 2D synthetic reservoirs characterized by heterogeneous permeability. The heterogeneity is represented by spatially correlated structures realized from a geological continuity model, specifically a Gaussian random field. This case simulates \mathrm{CO_{2}} migration within a 640 m \times 640 m aquifer domain for 500 days, with a constant injection rate of 0.45 kg/s imposed at the left boundary, while a fixed hydraulic pressure is prescribed at the right boundary. We collect the heterogeneous permeability fields \bm{K} and the corresponding state variables ( \mathrm{CO_{2}} saturation \bm{S_{g}} and pressure \bm{P} ) from high-fidelity numerical simulation (see Supplementary Note 2.2 for setup details). CoNFiLD-geo is unconditionally trained to learn the joint distribution of \bm{\Phi}=[\bm{K},\bm{S_{g}},\bm{P}] , and then tested on unseen observations \bm{\Psi} via zero-shot conditional generation. We investigate two representative observation scenarios: time-lapse seismic monitoring of \mathrm{CO_{2}} plume and sparse well measurements. Figure 2: Inferring heterogeneous permeability fields (log transformed) and \mathrm{CO_{2}} saturation from time-lapse seismic monitoring data. (a) Reference permeability field and \mathrm{CO_{2}} saturation trajectory from high-fidelity simulations, with snapshots taken at 30, 100, 200, 300, and 500 days. \mathrm{CO_{2}} is injected from the left boundary at a constant rate. (b) Permeability field and \mathrm{CO_{2}} saturation snapshots generated by CoNFiLD, conditioned on varying levels of low-resolution \mathrm{CO_{2}} plume seismic monitoring data (obtained by downsampling the reference saturation fields to resolutions of 4\times 4 , 8\times 8 , and 16\times 16 ). (c) Comparison between the inferred and reference permeability fields along the profiling location (denoted by the dash-dot line in (a)). Shaded areas indicate the standard deviation (uncertainty) across an ensemble of 10 generated samples. (d) Structural Similarity Index Measure (SSIM) between the inferred and reference permeability fields under the three low-resolution conditions. (e) Temporal variation of SSIM between the inferred and reference \mathrm{CO_{2}} saturation fields for three low-resolution settings, with shaded regions indicating standard deviations. Time-lapse seismic monitoring is an effective and non-intrusive tool for characterizing \mathrm{CO_{2}} migration in subsurface reservoirs reynolds_introduction_nodate ; eid_seismic_2015 ; ajayi_review_2019 . The interpreted \mathrm{CO_{2}} plume, constrained by observational precision, may be coarsely resolved and potentially noisy. Figure 2 presents the results of inferring the high-resolution fields from different levels of low-resolution seismic monitoring data. Figure 2 a depicts a heterogeneous permeability field and its corresponding snapshots of \mathrm{CO_{2}} saturation from numerical simulation at 30, 100, 200, 300, and 500 days. This trajectory \bm{\Phi}\in\mathcal{A}_{\mathrm{test}} is downsampled to various lower resolutions to emulate coarse observation data \bm{\Psi} , which serve as conditional inputs for CoNFiLD-geo to synthesize samples consistent with the available observations. As the observation resolution increases (from bottom to top in Fig. 2 b), the conditionally generated high-resolution \mathrm{CO_{2}} plume patterns and the inferred permeability field exhibit progressively better alignment with the reference. We refer the reader to Supplementary Note 6.1 for visualizing the contours of pressure. A distinguishing feature of CoNFiLD-geo is its ability to quantify the uncertainties inherent in the generated full fields. Fig. 2 c displays the permeability values along the profiling location (dash-dot line in Fig. 2 a) evaluated across an ensemble of 10 generated samples (ensemble size is 10 throughout this manuscript unless otherwise specified). Complementarily, Fig. 2 d shows the Structural Similarity Index Measure (SSIM) between the generated and reference permeability fields, where values closer to 1 indicate greater similarity to the reference, Together, these results substantiate that CoNFiLD-geo can effectively infer the geological parameters from low-resolution \mathrm{CO_{2}} plume observations. The uncertainty decreases monotonically as more resolved observational information becomes available, which aligns with the expectations from Bayesian perspective. In addition, CoNFiLD-geo provides accurate predictions of the spatiotemporal evolution of \mathrm{CO_{2}} saturation, as shown in Fig. 2 e. The generated saturation trajectory converges to the reference one as the observation resolution increases. More generated samples can be found in Supplementary Note 7.1. In subsurface engineering, drilling wells provides direct measurements of flow states and reservoir properties matter_rapid_2016 ; massarweh_co2_2024 . Fig. 3 presents the results of generating the full fields conditioned on different number of wells and different type of well measurements. These conditions \bm{\Psi} inform the generation process by querying the CNF only at specific data points instead of reconstructing the entire field, thereby significantly reducing the computational burden for LDM. The inferred permeability fields and \mathrm{CO}_{2} saturation spatiotemporal dynamics (Fig. 3 b) increasingly align with the reference (Fig. 3 a) as more monitoring well data become available. Moreover, direct measurements of permeability (such as core sampling and well logging) provide more precise constraints on the permeability distribution (Fig. 3 c). We further quantify the uncertainties of the inferred results. When permeability is directly probed at the wells, the inferred values at those locations exactly match the reference due to the provided ground truth. As the distance from the wells increases, both the discrepancies and associated uncertainties grow due to diminishing conditional constraints. In contrast, when permeability is not directly observed, the inferred fields tend to be overly smoothed and exhibit broader uncertainty bands (Fig. 3 d). For saturation, the generated trajectories consistently align with the reference at well locations, while noticeable uncertainties emerge in unobserved regions of the reservoir (Fig. 3 e). Introducing additional monitoring wells effectively reduces the uncertainties in both the geomodel and the associated reservoir responses. These results underscore the ability of CoNFiLD-geo to achieve accurate inverse modeling even under highly sparse observational conditions, as demonstrated by the scenario with 20 wells probing both state variables and reservoir parameters, which accounts for only 0.5% of the total data points. We have also compared the generation performance under regularly placed monitoring wells in Supplementary Note 7.1. In addition to scenarios involving \mathrm{CO_{2}} seismic monitoring data and sparse well measurements, we also consider settings where observations of either permeability or saturation are incomplete. Notably, CoNFiLD-geo enables data restoration under such conditions, which is particularly valuable in the presence of corrupted or missing data, thereby ensuring continuity and reliability in GCS monitoring (see Supplementary Note 3 for details). Figure 3: Reconstructing heterogeneous permeability fields and \mathrm{CO_{2}} saturation from sparse well measurements. (a) Reference permeability field and \mathrm{CO_{2}} saturation snapshots at 30, 100, 200, 300, and 500 days. (b) Permeability field and \mathrm{CO_{2}} saturation snapshots generated by CoNFiLD, conditioned on different number of monitoring wells (1, 5, and 20). For each well configuration, the upper row shows generated results from wells with probed reservoir responses (saturation and pressure; wells marked by crosses), while the lower row presents generated results from wells with probed reservoir responses and permeability values (wells marked by triangles). (c) SSIM of the inferred permeability under different well configurations and types of probed data. (d) From bottom to top, spatial variation of the generated and reference permeability fields along the profiling location (denoted by the dash-dot line in (a)) for 1, 5 and 20 wells. The vertical line indicates the well location. The shaded regions denote the uncertainty. (e) From bottom to top, temporal variation of the generated and reference \mathrm{CO_{2}} saturation fields at the well location (solid line) and a nearby reservoir location (dashed line) location for 1, 5 and 20 wells. The reservoir location is offset by 50 m from the corresponding well. The shaded regions denote the uncertainty. 2.3 Field-scale \mathrm{CO_{2}} sequestration at the Sleipner site Figure 4: Inferring heterogeneous permeability fields and \mathrm{CO_{2}} saturation at the Sleipner site in Norway. (a) Map of the Sleipner GCS project. The zoom-in box shows the geometric configuration of the Utsira L9 layer. (b) Schematic illustration of 6 and 18 monitoring well configurations (well marked by triangles). (c) Reference permeability field and \mathrm{CO_{2}} saturation snapshots at 2.5, 5, 7.5 and 10 years. (d) Generated permeability field and \mathrm{CO_{2}} saturation snapshots conditioned on \mathrm{CO_{2}} plume monitoring data. (e) Upper row: generated permeability field and \mathrm{CO_{2}} saturation snapshots under 6 monitoring wells with probed permeability, saturation and pressure. Lower row: results under 18 monitoring wells. (f) Spatial profiles of the generated and reference permeability fields along the dash-dot profiling location (denoted in (b)) for the three monitoring strategies. Shaded regions indicate uncertainty. (g) Root Mean Square Error (RMSE) of generated \mathrm{CO_{2}} saturation over time for the three monitoring strategies, with shaded regions indicating standard deviation. (h) Spatial profiles of the generated and reference permeability fields under different levels of temporal sparsity in the 18 monitoring strategy. Shaded regions indicate uncertainty. (i-k) Temporal evolution of the generated and reference \mathrm{CO_{2}} saturation fields under different levels of temporal sparsity: (i) full observations at all time steps, (j) partial observations in the initial 2.5 years (k) annual observations. The Sleipner project is the world’s first industrial-scale GCS initiative. Since 1996, separated \mathrm{CO_{2}} from a nearby gas field has been injected into the Utsira Sand formation, a saline aquifer located at a depth of 1012\ \mathrm{m} beneath the North Sea, offshore Norway (see Fig. 4 a for the location). The complete numerical model of the Sleipner site is described in Supplementary Note 2.2. In this study, we focus on a specific sublayer, Utsira L9, which is bounded by a low-permeability shale interlayer and an overlying caprock, forming a relatively independent hydrosystem. We adopt the realistic stratigraphic structure of the reservoir as determined by field-based geological surveys sleipner2019 . The reservoir extends over an area of 3.2\ \mathrm{km}\times 5.9\ \mathrm{km} , exhibiting spatial variability in both depth and thickness arising from natural sedimentary processes. The domain is discretized using a lateral resolution of 50\times 50\ \mathrm{m} and a single vertical layer, as the simulation primarily targets the lateral migration of the \mathrm{CO_{2}} plume. Given the large horizontal extent of the reservoir relative to its modest thickness of approximately 50\ \mathrm{m} , vertical flow is considered to play a limited role in governing plume dynamics. All boundaries are modeled as open-flow conditions, except for the impermeable top and bottom. \mathrm{CO_{2}} is injected through a single injection well operating at a constant rate of 32\ \mathrm{kg/s} . The numerical model setup is illustrated in Fig. 4 a and detailed in Supplementary Note 2.2. To explore a diverse range of geological scenarios, we generate the heterogeneous permeability fields using a Gaussian covariance kernel. In combination with the corresponding simulated state variables, our objective is to infer the full fields \bm{\Phi} (Fig. 4 c) conditioned on specified observations \bm{\Psi} . We first consider the availability of \mathrm{CO_{2}} seismic data. In this scenario, the generated \mathrm{CO_{2}} saturation closely resembles the reference enabled by access to direct observations. However, the inferred permeability deviates notably from the reference one (Fig. 4 d). We further investigate scenarios involving sparse well measurements with probed state variables and reservoir parameters. Results indicate that using 18 monitoring wells yields markedly improved inversion accuracy for both permeability and saturation, relative to the scenario with only 6 wells (Fig. 4 e). The permeability profiles along the cross-sectional line (dash-dotted in Fig. 4 b) further substantiate that deploying 18 monitoring wells significantly reduces uncertainty and more accurately captures the underlying geological heterogeneity (Fig. 4 f). While seismic plume data offer the highest precision in inferring \mathrm{CO_{2}} saturation (Fig. 4 g), the 18-well configuration provides the best overall performance by jointly improving the reconstruction of both permeability and saturation fields. These results showcase that CoNFiLD-geo provides a remarkable solution for inverse modeling in realistic GCS projects, while simultaneously enabling UQ without the need for task-specific retraining. Considering the long operational lifespan of GCS projects (e.g., 10 years in this case), continuous access to monitoring well data may be limited due to equipment maintenance, calibration periods, or cost-saving considerations. Accordingly, we assess the robustness of CoNFiLD-geo in performing inverse modeling when well measurements are temporally sparse or incomplete. Overall, as shown in Fig. 4 h, CoNFiLD-geo is capable of recovering permeability variations with only minor discrepancies near the periphery, even when observations are limited to a quarter of the temporal sequence (25% of total time steps) or collected exclusively on an annual basis (7.8% of total time steps). Compared to the fully observed monitoring data (Fig. 4 i), CoNFiLD-geo can still generate reliable saturation dynamics with minimal uncertainty. A slight increase in uncertainty is observed at time steps farther from the observation points due to the temporal dilution of conditional information (Fig. 4 j,k). See Supplementary Note 7.2 for additional conditional generation results and Supplementary Note 6.2 for pressure fields. These findings underscore CoNFiLD-geo’s scalability to real-world applications, demonstrating its flexibility in accommodating diverse monitoring data and its robustness to spatial and temporal sparsity. 2.4 \mathrm{CO_{2}} injection and brine production in stratigraphically complex reservoirs Figure 5: Inverse modeling of reservoir geometry (depth and thickness) and \mathrm{CO_{2}} saturation from multi-source monitoring data. (a) Geometric configuration of a stratigraphically complex reservoir. The domain is discretized using unstructured triangular grids. (b) Reference reservoir geometry and \mathrm{CO_{2}} saturation snapshots at 2, 6, and 10 years. (c) Generated reservoir geometry and \mathrm{CO_{2}} saturation conditioned on sparse well measurements and \mathrm{CO_{2}} plume monitoring data. The sparse well configuration is identical to the 18-well setup in the Sleipner case. (d) Generated reservoir geometry and \mathrm{CO_{2}} saturation conditioned on sparse well measurements and geological seismic data. (e) Generated reservoir geometry and \mathrm{CO_{2}} saturation conditioned on \mathrm{CO_{2}} plume monitoring data and geological seismic data. (f) Performance of the three multi-source monitoring strategies evaluated by RMSE for generated reservoir depth, thickness and \mathrm{CO_{2}} saturation. Error bars along the radial directions represent standard deviations. (g) Performance of the three single-source monitoring strategies evaluated by RMSE for generated reservoir depth, reservoir thickness and \mathrm{CO_{2}} saturation. The Sleipner case reveals that reservoir geometry, particularly depth and thickness, exerts a substantial influence on the spatiotemporal dynamics of the state variables. Previous studies have predominantly focused on the inverse modeling of seepage-related parameters laloy_inversion_2017 ; jiang_history_2024 ; han_surrogate_2024 ; tang_deep-learning-based_2020 ; zhu_bayesian_2018 , leaving the stratigraphic structure of the reservoir largely overlooked, despite its critical role in flow dynamics. Therefore, in this case, we assess the capability of CoNFiLD-geo to jointly reconstruct reservoir geometry and the corresponding flow responses ( \bm{\Phi} ) based on integrated multi-source monitoring data ( \bm{\Psi} ). The operation is configured as \mathrm{CO_{2}} injection coupled with brine production within a closed hydrosystem (Fig. 5 a), aiming to introduce additional physical complexity, thereby enabling a rigorous evaluation of CoNFiLD-geo’s ability to accommodate varied operational conditions. The lateral extent is retained from the Sleipner case, while the reservoir depth and thickness are constructed using Gaussian random fields to span a broad range of structural variability. To facilitate a high-fidelity representation of complex reservoir geometry, the domain is discretized using an unstructured triangular mesh (Fig. 5 a). This gridding scheme is natively compatible with CoNFiLD-geo, as the CNF operates as a mesh-agnostic method. In contrast, traditional CNN-based dimension reduction techniques are typically limited to structured grids and therefore lack the capacity to resolve such geometric complexity. Details of the numerical model setup are provided in Supplementary Note 2.3. We consider the integration of different monitoring data modalities as conditional information for inverse modeling. In general, monitoring approaches can be categorized into either intrusive methods, such as monitoring wells, or non-intrusive methods, such as seismic surveys. Although non-intrusive techniques are often more cost-effective, they are typically subject to a certain level of noise. In this study, non-intrusively acquired data — such as the \mathrm{CO_{2}} plume and geological seismic surveys — are assumed to contain 5% noise, whereas the intrusive well measurements are considered noise-free. Under conditions of sparse well data and noisy plume observations, CoNFiLD-geo produces saturation fields that are consistent with the reference (Fig. 5 b), despite the inferred depth and thickness fields being marginally smoother (Fig. 5 c). When geological seismic surveys, which provide global but noisy estimates of depth and thickness, are combined with sparse well measurements, the reconstruction of reservoir geometry becomes accurate, whereas minor discrepancies appear in the \mathrm{CO_{2}} saturation near the plume front (Fig. 5 d). The generated field \bm{\Phi} aligns most closely with the reference when both \mathrm{CO_{2}} plume data and geological seismic information are available (Fig. 5 e). This is further corroborated by the radar plot in Fig. 5 g, which shows that combining the two non-intrusive monitoring modalities yields the most accurate reconstruction results. The results for single-source monitoring are presented in Fig. 5 g and Supplementary Note 7.3. Overall, relying on a single data source turns out to be a suboptimal strategy. Together with the pressure generation results in Supplementary Note 6.3, the findings underscore that CoNFiLD-geo is capable of accurately reconstructing the geomodel and associated reservoir responses, even under noisy observational conditions. Its ability to flexibly fuse multi-source monitoring data further highlights its versatility as an inverse modeling framework for GCS applications under realistic and challenging settings. 3 Discussion We have presented CoNFiLD-geo, a generative framework for zero-shot conditional reconstruction of geomodels and corresponding reservoir responses from diverse types of observational data, enabling real-time inversion with UQ in realistic GCS projects. In CoNFiLD-geo, a CNF-based dimension reduction module is first employed to compress high-dimensional geodata into a compact latent space, followed by the LDM to learn the joint distribution of both input parameters and output states. Once pretrained, CoNFiLD-geo can conditionally generate state samples consistent with observations via Bayesian posterior sampling, alleviating the need for task-specific retraining. The capabilities of the framework have been demonstrated on three representative GCS scenarios of different complexity: the \mathrm{CO_{2}} drainage in 2D heterogeneous reservoirs, field-scale \mathrm{CO_{2}} sequestration in the Sleipner site of Norway, and \mathrm{CO_{2}} injection coupled with brine production in stratigraphically complex reservoirs. The results substantiate the predictive fidelity, generalizability, and robustness of CoNFiLD-geo in inverse modeling of subsurface heterogeneity and the resulting spatiotemporal dynamics of reservoir responses, even under sparse and noisy observational conditions. Moreover, as a unified framework, CoNFiLD-geo also enables efficient surrogate modeling in the forward direction. It outperforms the deterministic U-FNO in scenarios where input parameters are low-resolution and sparse, a situation commonly encountered in subsurface environments (Supplementary Note 4). Figure 6: Uncertainty and bias analysis in CoNFiLD-geo, based on the first 2D case. (a) Spatial variation of the reference and inferred permeability fields under varying noise levels (0%, 10% and 30%). The conditional input is fully observed permeability field perturbed by different levels of Gaussian noise. The shaded regions indicate the aleatoric uncertainty. (b) Spatial variation of the reference and inferred permeability fields under different types of conditioning inputs drawn from distinct functional spaces: either the parameter space (permeability), the solution space (pressure and saturation), or both. All conditioning inputs are fully observed and noise-free. The shaded regions indicate the epistemic uncertainty. (c) Comparison of RMSE in permeability fields for CNF decoding (serving as a reconstruction baseline) and for different conditioning scenarios. (d) Temporal variation of the reference and inferred saturation fields under varying noise levels. The conditional inputs are fully observed saturation fields perturbed by different levels of Gaussian noise. (e) Temporal variation of the reference and inferred saturation fields under different types of conditioning inputs drawn from distinct functional spaces. (f) Comparison of RMSE in saturation fields for CNF decoding and for different conditioning scenarios. CoNFiLD-geo can also function as a fast numerical emulator through unconditional generation, facilitating preliminary screening of reservoir responses (Supplementary Note 8). The computational costs of both conditional and unconditional generation, relative to numerical simulation, are reported in Supplementary Note 9, revealing that CoNFiLD-geo achieves a substantial speedup over conventional simulation methods. We further analyze the sources of uncertainties and biases within the framework. The generated field exhibits aleatoric uncertainty when the conditioning input has measurement uncertainties (Fig. 6 a,d). Even when the observation data is noise-free, the generated field still shows minor discrepancies. In this setting, the total generation error comprises two components: the reconstruction bias introduced by the CNF decoder and the sampling bias arising from the stochastic nature of the gradient-based sampling process (Fig. 6 c,f). While the reconstruction bias can be reduced by further tuning the CNF, the sampling bias is inherently irreducible. CoNFiLD-geo models the joint distribution between parameter and solution Spaces. Generating one field conditioned on complete knowledge of the other, without direct observations in the target space, introduces epistemic uncertainty (Fig. 6 b,e). This discrepancy is referred to as alignment bias, originating from a physical misalignment between the two function spaces (Fig. 6 c,f). As a modular framework, CoNFiLD-geo allows for the integration of alternative dimensionality reduction techniques. In Supplementary Note 5, we evaluate the performance of the well-established Proper Orthogonal Decomposition (POD) as a substitute. However, compared to the expressive CNF, POD remains a suboptimal choice for dimensionality reduction due to its inferior reconstruction fidelity and limited compression capability. In addition, the generative modeling component stands to benefit from ongoing advances in generative AI. In the future, we aim to further accelerate generation by adopting expedited sampling methods such as those used in flow matching models lipman_flow_2023 ; hemant2025conditional . Moreover, although the current model implicitly learns physical priors through data-intensive training, the incorporation of domain knowledge offers a promising pathway to reduce such dependence bastek_physics-informed_2025 . This is particularly critical in subsurface engineering, where high-quality data are costly to acquire. One promising strategy is to introduce physics-based constraints during the sampling stage, which enforce the generation of physically consistent parameter–solution pairs and help mitigate alignment bias. 4 Methods 4.1 Subsurface multiphase flow governing equations The dynamics of \mathrm{CO_{2}} migration in reservoirs are governed by the mass conservation of subsurface multiphase flow in the porous media pruess_tough2_1999 , \frac{\partial}{\partial t}\left(\varphi\sum_{\xi}\bm{S}_{\xi}\rho_{\xi}\chi_{\xi}^{\nu}\right)-\nabla\cdot\left(\bm{K}\sum_{\xi}\chi_{\xi}^{\nu}\frac{k_{r,\xi}\rho_{\xi}}{\mu_{\xi}}(\nabla\bm{P}_{\xi}-\rho_{\xi}\bm{g})\right)-\sum_{\xi}\rho_{\xi}\chi_{\xi}^{\nu}q^{\nu}=0. (1) Here, the subscript \xi denotes the fluid phase, the superscript \nu represents the fluid component. The reservoir responses of interest are characterized by the spatiotemporal saturation \bm{S}_{\xi}(\bm{x},t) and pressure \bm{P}_{\xi}(\bm{x},t) . The permeability field \bm{K}(\bm{x}) is one of the key hydrodynamic quantities to be inferred through inversion. Other constitutive parameters in the above equation include the porosity \varphi , the density \rho_{\xi} , the viscosity \mu_{\xi} , the mass fraction \chi_{\xi}^{\nu} , the relative permeability coefficient k_{r,\xi} , the gravitational acceleration \bm{g} , and the well volumetric flow rate q^{\nu} . The constitutive relatioships are detailed in Supplementary Note 2.1. 4.2 Conditional neural field with full-projection Neural field is a class of coordinate-based neural networks that parameterize a continuous field of interest by learning a mapping from spatial coordinates to field values, i.e., \bm{X}\in\mathbb{R}^{N_{d}}\mapsto\bm{\Phi}(\bm{x},t_{i}) . A Conditional Neural Field (CNF) extends this formulation by incorporating a set of latent vectors \bm{L} to modulate the field across different snapshots in time, resulting in a conditional mapping (\bm{X},\bm{L})\mapsto\bm{\Phi}(\bm{x},t) . Once trained, the CNF encodes the field \bm{\Phi}(\bm{x},t) as a neural implicit representation defined over space and time, i.e., \bm{\Phi}(\bm{x},t)\approx\mathscr{E}_{\zeta^{*},\gamma^{*}}(\bm{X},\bm{L}) . The encoding process is implemented in an auto-decoding fashion by solving the following optimization problem, \bm{L}^{*},\zeta^{*},\gamma^{*}=\argmin_{\bm{L},\zeta,\gamma}\sum_{i}^{N_{t}}\sum_{j}^{N_{d}}\left\|\bm{\Phi}(\bm{X}_{j},t_{i})-\mathscr{E}(\bm{X}_{j},\bm{L}_{i};\zeta,\gamma)\right\|^{2}, (2) where \bm{L}^{*} denotes the optimized latent vectors, \zeta^{*} and \gamma^{*} are the optimal parameters of the main network and the modulation network, respectively. In this work, the main network is constructed using the sinusoidal representation network (SIREN) sitzmann_implicit_2020 , \displaystyle\mathscr{E}_{\zeta}\big(\bm{x}) \displaystyle=\bm{W}_{p}(\sigma_{p-1}\circ\sigma_{p-2}\circ...\circ\sigma_{0}(\bm{x})\big)+\bm{b}_{p}, \displaystyle\sigma_{i}(\bm{\eta}_{i}) \displaystyle=\sin{\big(\omega_{0}(\bm{W}_{i}\bm{\eta}_{i}+\bm{b}_{i})\big)},\ \ i=0,...,p-1, (3) where \bm{\eta}_{0}=\bm{x} and (\bm{\eta}_{i})_{i\geq 1} are the hidden outputs throughout the network. \omega_{0}\in\mathbb{R}_{+} is a hyperparameter that controls the frequency spectrum of the network, \bm{W}_{i} and \bm{b}_{i} are the trainable weights and biases of the i -th layer. SIREN requires a specialized initialization scheme, wherein the weights of the first layer are initialized as \bm{W}_{0}\sim\mathcal{U}(-1/d,1/d) and the subsequent layers as (\bm{W}_{i})_{i\geq 1}\sim\mathcal{U}(-\sqrt{\dfrac{6}{\omega_{0}^{2}d}},\sqrt{\dfrac{6}{\omega_{0}^{2}d}}) , where d denotes the input dimensionality of the corresponding layer.. This ensures that the inputs to the sinusoidal activation functions are approximately normally distributed with unit variance, thereby stabilizing gradient propagation. The SIREN is modulated by full-projected conditioning liu_confild-inlet_2024 for its consistent and expressive representation, \displaystyle\mathscr{E}_{\zeta,\gamma}(\bm{x},\bm{L}) \displaystyle=\bm{W}_{p}(\sigma^{\prime}_{p-1}\circ\sigma^{\prime}_{p-2}\circ...\circ\sigma^{\prime}_{0}(\bm{x})\big)+\bm{b}_{p}, \displaystyle\sigma^{\prime}_{i}(\bm{\eta}_{i},\delta\bm{W}_{i},\delta\bm{b}_{i}) \displaystyle=\sin{\big((\bm{W}_{i}+\delta\bm{W}_{i})\bm{\eta}_{i}+\bm{b}_{i}+\delta\bm{b}_{i}\big)},\ \ i=0,...,p-1, (4) where \delta\bm{W}_{i} and \delta\bm{b}_{i} are regressed from the condition \bm{L} as, \displaystyle\delta\bm{W}_{i}(\bm{L}) \displaystyle=\bm{W}_{i}^{w}\bm{L}+\bm{b}_{i}^{w}, \displaystyle\delta\bm{b}_{i}(\bm{L}) \displaystyle=\bm{W}_{i}^{b}\bm{L}+\bm{b}_{i}^{b}. (5) Here, \zeta=\{\bm{W}_{i},\bm{b}_{i}\}_{i=0}^{p} denotes the shared parameters of SIREN and \gamma=\{\bm{W}_{i}^{w},\bm{b}_{i}^{w},\bm{W}_{i}^{b},\bm{b}_{i}^{b}\}_{i=0}^{p-1} represents the instance associated parameters of the modulation network. The CNF in CoNFiLD-geo serves a dual role as both encoder and decoder. During the offline training stage, the optimized latent vector \bm{L}^{*} functions as a concise encoding of the physical field \bm{\Phi}\in\mathcal{A}_{\mathrm{train}} at a specific time frame. A whole trajectory can then be represented as a 2-D latent image \bm{z}_{0} by concatenating \bm{L}^{*} along the temporal dimension. It is noteworthy that CoNFiLD-geo, in contrast to the orginal CoNFiLD, simultaneously encodes the geomodel and its corresponding reservoir responses, thereby providing a joint implicit representation of both the parameter space and the solution space. This enables the generative model to capture the joint distribution, facilitating both inverse and forward modeling. The auto-decoding design works synergistically with the latent generative model, which serves as a “latent optimizer” that circumvents the need to retrain the CNF. Therefore, during the online inference stage, the physical field \bm{\Phi}\in\mathcal{A}_{\mathrm{test}} can be retrieved by simply feeding the generated latent vectors and spatial coordinates into the trained CNF. 4.3 Latent diffusion probabilistic model A diffusion probabilistic model is employed to approximate the underlying distribution of the CNF-encoded latent variable \bm{z}_{0} by a neural network p_{\theta}(\bm{z}_{0}) . This is achieved through learning a Markovian transition kernel, which iteratively transforms a tractable Gaussian prior p(\bm{z}_{N_{\tau}})=\mathcal{N}(\bm{z}_{\tau};\bm{0},\bm{I}) to the target distribution over N_{\tau} steps, p_{\theta}(\bm{z}_{0:N_{\tau}})=p(\bm{z}_{N_{\tau}})\prod_{\tau=1}^{N_{\tau}}p_{\theta}(\bm{z}_{\tau-1}|\bm{z}_{\tau}), (6) where the transition kernel at each diffusion step \tau is formulated as a Gaussian conditional density, with its mean and variance parameterized by a neural network with learnable weights \theta , p_{\theta}(\bm{z}_{\tau-1}|\bm{z}_{\tau})=\mathcal{N}(\bm{z}_{\tau-1};\bm{\mu}_{\theta}(\bm{z}_{\tau},\tau),\Sigma_{\theta}(\bm{z}_{\tau},\tau)\bm{I}). (7) The above process is referred to as the reverse denoising process. To train the denoising network, a forward diffusion process is defined to progressively corrupt the latent variable \bm{z}_{0} through a Markov chain, q(\bm{z}_{1:N_{\tau}}|\bm{z}_{0})=\prod_{\tau=1}^{N_{\tau}}q(\bm{z}_{\tau}|\bm{z}_{\tau-1}), (8) where the transition kernel is a Gaussian conditional density with fixed variance schedule \beta_{\tau} , q(\bm{z}_{\tau}|\bm{z}_{\tau-1})=\mathcal{N}(\bm{z}_{\tau};\sqrt{1-\beta_{\tau}}\bm{z}_{\tau-1},\beta_{\tau}\bm{I}). (9) With sufficient perturbation steps, the marginalized distribution q(\bm{z}_{N_{\tau}}|\bm{z}_{0}) converges to a zero-mean Gaussian distribution p(\bm{z}_{N_{\tau}})=\mathcal{N}(\bm{z}_{\tau};\bm{0},\bm{I}) , which aligns with the prior used in the reverse process and is trival to sample. It is noteworthy that the forward process admits a closed-form expression at any noise level \tau conditioned on the initial latent \bm{z}_{0} using the re-parameterization trick kingma_auto-encoding_2022 , \displaystyle q(\bm{z}_{\tau}|\bm{z}_{0}) \displaystyle=\mathcal{N}\left(\bm{z}_{\tau};\sqrt{\bar{\alpha}_{\tau}}\bm{z}_{0},(1-\bar{\alpha}_{\tau})\bm{I}\right), (10) \displaystyle\bm{z}_{\tau} \displaystyle=\sqrt{\bar{\alpha}_{\tau}}\bm{z}_{0}+\sqrt{1-\bar{\alpha}_{\tau}}\bm{\epsilon}, (11) where \bm{\epsilon}\sim\mathcal{N}(\bm{0},\bm{I}) is the isotropic Gaussian noise, \alpha_{\tau}=1-\beta_{\tau} , and \bar{\alpha}_{\tau}=\prod_{s=1}^{\tau}\alpha_{s} . The neural network is trained by optimizing the variational lower bound ( L_{\mathrm{vlb}} ) on the negative log likelihood (derivation can be found in sohl-dickstein_deep_2015 ), \displaystyle\min_{\theta}\mathbb{E}[-\log{p_{\theta}(\bm{z}_{0})}]\leq L_{\mathrm{vlb}} \displaystyle=\mathbb{E}_{q}\left[-\log{\frac{p_{\theta}(\bm{z}_{0:N_{\tau}})}{q(\bm{z}_{1:N_{\tau}}|\bm{z}_{0})}}\right] \displaystyle=\mathbb{E}_{q}\bigg[D_{\mathrm{KL}}(q(\bm{z}_{N_{\tau}}|\bm{z}_{0})\parallel p(\bm{z}_{N_{\tau}})) \displaystyle+\sum_{\tau=2}^{N_{\tau}}D_{\mathrm{KL}}(q(\bm{z}_{\tau-1}|\bm{z}_{\tau},\bm{z}_{0})\parallel p_{\theta}(\bm{z}_{\tau-1}|\bm{z}_{\tau}))-\log{p_{\theta}(\bm{z}_{0}|\bm{z}_{1})}\bigg], (12) where D_{\mathrm{KL}}(\cdot\parallel\cdot) denotes the Kullback-Leibler (KL) divergence operation. The first term of L_{\mathrm{vlb}} contains no trainable parameters and therefore can be omitted. The forward posterior q(\bm{z}_{\tau-1}|\bm{z}_{\tau},\bm{z}_{0}) is tractable when conditioned on \bm{z}_{0} by using Bayes’ rule and Eqs. ( 9 - 11 ), q(\bm{z}_{\tau-1}|\bm{z}_{\tau},\bm{z}_{0})=\frac{q(\bm{z}_{\tau}|\bm{z}_{\tau-1})q(\bm{z}_{\tau-1}|\bm{z}_{0})}{q(\bm{z}_{\tau}|\bm{z}_{0})}=\mathcal{N}(\bm{z}_{\tau-1};\tilde{\bm{\mu}}_{\tau}(\bm{z}_{\tau},\bm{\epsilon}),\tilde{\beta}_{\tau}\bm{I}), (13) where \displaystyle\tilde{\bm{\mu}}_{\tau}(\bm{z}_{\tau},\bm{\epsilon}) \displaystyle=\frac{1}{\sqrt{\alpha_{\tau}}}\left(\bm{z}_{\tau}-\frac{1-\alpha_{\tau}}{\sqrt{1-\bar{\alpha}_{\tau}}}\bm{\epsilon}\right), (14) \displaystyle\tilde{\beta}_{\tau} \displaystyle=\frac{1-\bar{\alpha}_{\tau-1}}{1-\bar{\alpha}_{\tau}}\beta_{\tau}. (15) Since the two distributions in the second term of L_{\mathrm{vlb}} are Gaussian, the KL divergence can be evaluated in an analytical form. Ho et al. ho_denoising_2020 set the variance \Sigma_{\theta}(\bm{z}_{\tau},t)=\beta_{\tau} as non-trainable constant, and parametrized the mean as follows, \bm{\mu}_{\theta}(\bm{z}_{\tau},\tau)=\frac{1}{\sqrt{\alpha_{\tau}}}\left(\bm{z}_{\tau}-\frac{1-\alpha_{\tau}}{\sqrt{1-\bar{\alpha}_{\tau}}}\bm{\epsilon}_{\theta}(\bm{z}_{\tau},\tau)\right), (16) where the noise function \bm{\epsilon}_{\theta}(\bm{z}_{\tau},\tau) is approximated by a U-Net variant with residual blocks, self-attention, and diffusion step embedding. The loss function can then be simplified as, L_{\mathrm{simple}}=\mathbb{E}_{\tau,\bm{z}_{0},\bm{\epsilon}}\left[\left\|\bm{\epsilon}-\bm{\epsilon}_{\theta}(\sqrt{\bar{\alpha}_{\tau}}\bm{z}_{0}+\sqrt{1-\bar{\alpha}_{\tau}}\bm{\epsilon},\tau)\right\|^{2}\right], (17) where \tau is randomly sampled from a discrete uniform distribution \mathcal{U}(1,N_{\tau}) and \bm{\epsilon} is randomly sampled from a standard Gaussian distribution \mathcal{N}(\bm{0},\bm{I}) . The t=1 case corresponds to the last term of L_{\mathrm{vlb}} , while the t>1 cases correspond to the second term. However, L_{\mathrm{simple}} ignores the effect of the reverse kernel’s covariance, which potentially undermines the learning efficacy at the initial diffusion steps nichol_improved_2021 . To this end, a hybrid form of loss function is adopted in this work to account for both mean and variance approximation, resulting in the following optimization objective, \theta^{*}=\argmin_{\theta}\sum_{\mathscr{E}_{\zeta^{*},\gamma^{*}}(\bm{z}_{0})\in\mathcal{A}_{\mathrm{train}}}\bigg(L_{\mathrm{simple}}+\lambda L_{\mathrm{vlb}}\bigg), (18) where \lambda is a weighting coefficient and L_{\mathrm{vlb}} is incorporated to guide the network to learn \Sigma_{\theta}(\bm{z}_{\tau},t) . Specifically, in additional to the noise function, the network also outputs a vector \bm{v} , which functions as an interpolation coefficient between \beta_{\tau} and \tilde{\beta}_{\tau} , i.e., \Sigma_{\theta}(\bm{z}_{\tau},t)=\exp(\bm{v}\log{\beta_{\tau}}+(1-\bm{v})\log{\tilde{\beta}_{\tau}}) . 4.4 Bayesian posterior sampling Once trained, the diffusion model can generate new realizations of \bm{z}_{0} by sampling a white noise \bm{z}_{N_{\tau}} from an isotropic multivariant Gaussian distribution \mathcal{N}(\bm{0},\bm{I}) , and progressively denoising it through the learned reverse transition kernel p_{\theta^{*}}(\bm{z}_{\tau-1}|\bm{z}_{\tau})=\mathcal{N}(\bm{z}_{\tau-1};\bm{\mu}_{\theta^{*}}(\bm{z}_{\tau},\tau),\Sigma_{\theta^{*}}(\bm{z}_{\tau},\tau)\bm{I}) as, \bm{z}_{\tau-1}=\frac{1}{\sqrt{\alpha_{\tau}}}\left(\bm{z}_{\tau}-\frac{1-\alpha_{\tau}}{\sqrt{1-\bar{\alpha}_{\tau}}}\bm{\epsilon}_{\theta^{*}}(\bm{z}_{\tau},\tau)\right)+\sqrt{\Sigma_{\theta^{*}}(\bm{z}_{\tau},\tau)}\bm{\epsilon},\ \bm{\epsilon}\sim\mathcal{N}(\bm{0},\bm{I}),\ \tau=N_{\tau},...,1. (19) This unconditional generation process aligns with the Langevin dynamics sampling in score-based generative models by introducing the Stein score function song_generative_2019 , \bm{s}_{\theta}(\bm{z}_{\tau},\tau)\coloneq\nabla_{\bm{z}_{\tau}}\log p_{\theta}(\bm{z}_{\tau})=-\frac{1}{\sqrt{1-\bar{\alpha}_{\tau}}}\bm{\epsilon}_{\theta}(\bm{z}_{\tau},\tau), (20) and the denoising function can be rewritten as, \bm{z}_{\tau-1}=\frac{1}{\sqrt{\alpha_{\tau}}}\bigg(\bm{z}_{\tau}+(1-\alpha_{\tau})\bm{s}_{\theta^{*}}(\bm{z}_{\tau},\tau)\bigg)+\sqrt{\Sigma_{\theta^{*}}(\bm{z}_{\tau},\tau)}\bm{\epsilon},\ \bm{\epsilon}\sim\mathcal{N}(\bm{0},\bm{I}),\ \tau=N_{\tau},...,1. (21) The generated latent \bm{z}_{0} is then decoded back to the physical space via the trained CNF decoder, \bm{\Phi}=\mathscr{E}_{\zeta^{*},\gamma^{*}}(\bm{x},\bm{z}_{0}) . The unconditional generation process can yield synthetic geological parameters \bm{M} along with the corresponding reservoir responses \bm{U} simultaneously, as the joint distribution of \bm{M} and \bm{U} is learned by CoNFiLD-geo after the unconditional training. Compared to unconditional generation, conditional generation offers deeper insight in geoscientific modeling by leveraging available field observations to quantify the uncertainty inherent in geomodels, thereby facilitating robust decision-making in practical field applications. In the context of subsurface multiphase flow, observations may arise from sparse measurements, low-resolution seismic monitoring, well logging data, or any other accessible field information pertaining to the geomodel and its associated reservoir responses. Let \bm{\Psi}\in\mathbb{R}^{N_{\bm{\Psi}}} be a condition vector from either the geomodel \bm{M} , the reservoir responses \bm{U} , or both. The choice of \bm{\Psi} depends on the type of observations in the specific application. The conditional generation can be conceptualized as a Bayesian inverse problem, which involves sampling from the posterior distribution, p(\bm{\Phi}|\bm{\Psi})\propto p(\bm{\Psi}|\bm{\Phi})p(\bm{\Phi}), (22) where the prior p(\bm{\Phi})\approx p(\bm{\Phi};\theta^{*},\zeta^{*},\gamma^{*}) has been learned by CoNFiLD-geo through uncontional training. The relationship between \bm{\Psi} and \bm{\Phi} can be generally formulated as oliver_inverse_2008 , \bm{\Psi}=\mathcal{F}(\bm{\Phi})+\bm{\epsilon}_{c}=\mathcal{F}\bigg(\mathscr{E}_{\zeta^{*},\gamma^{*}}(\bm{z}_{0};\zeta^{*},\gamma^{*})\bigg)+\bm{\epsilon}_{c}, (23) where \mathcal{F}:\ \mathbb{R}^{N_{d}\times N_{t}}\rightarrow\mathbb{R}^{N_{\bm{\Psi}}} is a nonlinear mapping from the full field \bm{\Phi} to the partial observations \bm{\Psi} , \bm{\epsilon}_{c} denotes the observational error arising from monitoring uncertainty, typically modeled as \bm{\epsilon}_{c}\sim\mathcal{N}(\bm{0},\sigma_{c}^{2}\bm{I}) . Concretely, \mathcal{F} can take various forms depending on the specific application. For instance, \mathcal{F} may act as a downsampling operator when reconstructing fields from low-resolution observations, or as a masking operator that selects specific coordinates when inferring complete fields from sparse or noisy measurements. The likelihood function in Eq. ( 22 ) then takes the form, p(\bm{\Psi}|\bm{\Phi})=\frac{1}{\sqrt{(2\pi)^{N_{\bm{\Psi}}}\sigma_{c}^{2N_{\bm{\Psi}}}}}\exp{\left[-\frac{\|\bm{\Psi}-\mathcal{F}(\bm{\Phi})\|^{2}}{2\sigma_{c}^{2}}\right]}. (24) In the latent space, conditional generation corresponds to modifying the score function as \nabla_{\bm{z}_{\tau}}p(\bm{z}_{\tau}|\bm{\Psi}) , which can be further decomposed by Bayes’ rule, \nabla_{\bm{z}_{\tau}}p(\bm{z}_{\tau}|\bm{\Psi})=\nabla_{\bm{z}_{\tau}}p(\bm{z}_{\tau})+\nabla_{\bm{z}_{\tau}}p(\bm{\Psi}|\bm{z}_{\tau}), (25) where the first term can be viewed as the pre-trained unconditional generative model \bm{s}_{\theta^{*}}(\bm{z}_{\tau},\tau) , and the second term serves as a guidance that steers the generated samples towards satisfying the condition \bm{\Psi} . To deduce the analytical form of the guidance term, we first factorize it by, p(\bm{\Psi}|\bm{z}_{\tau})=\int p(\bm{\Psi}|\bm{z}_{0},\bm{z}_{\tau})p(\bm{z}_{0}|\bm{z}_{\tau})d\bm{z}_{0}=\int p(\bm{\Psi}|\bm{z}_{0})p(\bm{z}_{0}|\bm{z}_{\tau})d\bm{z}_{0}, (26) which can be approximated by Jensen’s inequality, p(\bm{\Psi}|\bm{z}_{\tau})=\mathbb{E}_{\bm{z}_{0}\sim p(\bm{z}_{0}|\bm{z}_{\tau})}[p(\bm{\Psi}|\bm{z}_{0})]\simeq p(\bm{\Psi}|\mathbb{E}_{\bm{z}_{0}\sim p(\bm{z}_{0}|\bm{z}_{\tau})}[\bm{z}_{0}]). (27) Recalling the forward diffusion function in Eq. ( 11 ) and the relation in Eq.( 20 ), the unique mean of p(\bm{z}_{0}|\bm{z}_{\tau}) can be derived by Tweedie’s formula chung_diffusion_2024 ; efron_tweedies_2011 , \hat{\bm{z}}_{0}\coloneq\mathbb{E}[\bm{z}_{0}|\bm{z}_{\tau}]=\mathbb{E}_{\bm{z}_{0}\sim p(\bm{z}_{0}|\bm{z}_{\tau})}[\bm{z}_{0}]=\frac{1}{\sqrt{\bar{\alpha}_{\tau}}}\bigg(\bm{z}_{\tau}+(1-\bar{\alpha}_{\tau})\nabla_{\bm{z}_{\tau}}\log p(\bm{z}_{\tau})\bigg), (28) where the unconditional score function \nabla_{\bm{z}_{\tau}}\log p(\bm{z}_{\tau}) can be approximated by \bm{s}_{\theta^{*}}(\bm{z}_{\tau},\tau) . Now, since p(\bm{\Psi}|\bm{z}_{\tau})\simeq p(\bm{\Psi}|\hat{\bm{z}}_{0}) , and recalling the formulation in Eq. ( 24 ), we obtain the likelihood function in the latent space based on the nested probabilistic relationship, \displaystyle\nabla_{\bm{z}_{\tau}}\log p(\bm{\Psi}|\bm{z}_{\tau}) \displaystyle\simeq\nabla_{\bm{z}_{\tau}}\log p_{\theta^{*},\zeta^{*},\gamma^{*}}(\bm{\Psi}|\bm{z}_{\tau}) \displaystyle=-\frac{1}{\sigma_{c}^{2}}\nabla_{\bm{z}_{\tau}}\bigg\|\bm{\Psi}-\mathcal{F}\bigg(\mathscr{E}_{\zeta^{*},\gamma^{*}}\big(\hat{\bm{z}}_{0}^{*}(\bm{z}_{\tau},\tau;\theta^{*});\zeta^{*},\gamma^{*}\big)\bigg)\bigg\|^{2}, (29) where \hat{\bm{z}}_{0}^{*}(\bm{z}_{\tau},\tau;\theta^{*}) is the approximated clean latent provided by the pre-trained unconditional generative model. Eq. ( 4.4 ) can be computed via the chain rule, \nabla_{\bm{z}_{\tau}}\log p_{\theta^{*},\zeta^{*},\gamma^{*}}(\bm{\Psi}|\bm{z}_{\tau})=-\frac{2}{\sigma_{c}^{2}}(\bm{\Psi}-\mathcal{F}(\mathscr{E}_{\zeta^{*},\gamma^{*}}))\frac{\partial\mathcal{F}(\mathscr{E}_{\zeta^{*},\gamma^{*}})}{\partial{\mathscr{E}_{\zeta^{*},\gamma^{*}}}}\frac{\partial{\mathscr{E}_{\zeta^{*},\gamma^{*}}}(\hat{\bm{z}}_{0}^{*})}{\partial\hat{\bm{z}}_{0}^{*}}\frac{\partial\hat{\bm{z}}_{0}^{*}(\bm{z}_{\tau},\tau;\theta^{*})}{\partial\bm{z}_{\tau}}, (30) through automatic differentiation (AD) as long as \mathcal{F} is fully differentiable. This can be seamlessly implemented in modern differentiable programming frameworks such as PyTorch paszke_pytorch_2019 . Therefore, the conditional score function in Eq. ( 25 ) now comes at, \displaystyle\nabla_{\bm{z}_{\tau}}p(\bm{z}_{\tau}|\bm{\Psi}) \displaystyle\simeq\bm{s}_{\theta^{*}}(\bm{z}_{\tau},\tau)+\nabla_{\bm{z}_{\tau}}\log p_{\theta^{*},\zeta^{*},\gamma^{*}}(\bm{\Psi}|\bm{z}_{\tau})=s^{\mathrm{guide}}_{\theta^{*},\zeta^{*},\gamma^{*}}(\bm{\Psi},\bm{z}_{\tau},\tau), (31) where s^{\mathrm{guide}}_{\theta^{*},\zeta^{*},\gamma^{*}}(\bm{\Psi},\bm{z}_{\tau},\tau) is the guided score function for the conditional generation. Replacing \bm{s}_{\theta^{*}}(\bm{z}_{\tau},\tau) in Eq. ( 21 ) with s^{\mathrm{guide}}_{\theta^{*},\zeta^{*},\gamma^{*}}(\bm{\Psi},\bm{z}_{\tau},\tau) , we can generate \bm{\Phi} given conditions on \bm{\Psi} without retraining the latent diffusion model. This enables CoNFiLD-geo to synthesize diverse geological models \bm{M} and their associated reservoir responses \bm{U} , conditioned on arbitrary unseen observations. At inference time, only a pre-trained unconditional CoNFiLD-geo model is required, and conditional generation can then be performed in a plug-and-play manner. This distinctive capability paves the way for real-time UQ in practical GCS scenarios. Data availability All the data and codes needed to evaluate the conclusions in the paper will be made publicly available upon acception. Compliance with ethical standards Conflict of Interest: The authors declare that they have no conflict of interest. See pages - of CoNFiLD_geo_SI.pdf