Abstract
Normalizing flows provide high flexibility for density estimation but often lack the structural constraints necessary for data-efficient learning or domain-specific accuracy. This paper introduces Embedded-Model Flows (EMF), a framework that integrates explicit probabilistic models directly into flow architectures. By converting differentiable probabilistic programs into bijective layers and employing a gating mechanism to handle model misspecification, EMFs combine the strengths of structured inductive biases with the corrective power of model-free deep learning.
Introduction
Modern generative modeling faces a tension between flexibility and structure. Normalizing flows excel at capturing complex distributions from large datasets but are often "structure-blind," struggling when data is sparse or when domain knowledge (e.g., physical laws) is available. Conversely, explicit probabilistic models allow for the direct encoding of expert knowledge but are frequently too rigid to capture real-world noise—a phenomenon encapsulated by the adage "all models are wrong."
Embedded-Model Flows (EMF) resolve this tension by treating probabilistic programs as components of a larger neural architecture. This approach allows researchers to bake structural assumptions into a model while retaining the ability to learn data-driven corrections.
The EMF Framework
The core of the EMF approach is the interleaving of standard, model-free flow layers (such as Masked Autoregressive Flows) with structured layers derived from user-defined probabilistic programs.
Bijective Conversion and Gating
To integrate probabilistic programs into flows, the authors utilize a generalized Rosenblatt transform to convert differentiable programs into bijective transformations. Recognizing that expert models are rarely perfect, EMFs incorporate a gating mechanism. A learnable parameter $\lambda$ creates a convex combination between the structured model's output and an identity mapping. This "safety valve" allows the network to down-weight or bypass structured components that do not align with the observed data, effectively letting the data "veto" incorrect assumptions.
Empirical Evaluation
The authors tested EMFs across a variety of tasks, including 2D toy benchmarks, image modeling (MNIST), and complex time-series generated from stochastic differential equations (SDEs).
Density Estimation
On standard benchmarks like "Eight Gaussians" and MNIST, EMFs—particularly when combined with Neural Spline Flows (NSF)—consistently outperformed standard baselines. The structured layers provide a strong initialization that the model-free layers then refine.
Structured Inference
In time-series modeling (e.g., the Lorenz system) and variational inference (e.g., the "Eight Schools" model), EMFs demonstrated significant advantages. By embedding the prior's dependencies—such as temporal continuity—directly into the architecture, the model avoids the computational waste of re-learning these fundamental rules from scratch.
Discussion and Limitations
EMFs represent a significant step toward hybrid modeling. The gating mechanism is particularly noteworthy, as it allows the model to act as a "residual learner," focusing on the complex patterns that a simplified physical or statistical model might miss.
However, some challenges remain. EMFs are currently limited to homeomorphisms, meaning they cannot easily change the topology of the base distribution (e.g., splitting one component into two). Additionally, inverting certain structured layers can require numerical root-finding, which increases computational cost compared to standard analytic flows. Future work may explore automated model selection by embedding multiple competing structures within the same flow architecture.
Summary updated