Rare Event Probability Learning by Normalizing Flows

Zhenggqi Gao, Dinghuai Zhang, Luca Daniel, Duane S. Boning

TL;DR

Estimating the probability of rare events (like a one-in-a-million circuit failure) is notoriously difficult because standard simulations rarely "see" the event. This paper introduces NOFIS, a method that uses Normalizing Flows to learn a sequence of "bridge" distributions that gradually shift toward the rare event, enabling highly accurate probability estimation with far fewer expensive simulations than traditional methods.

What Problem Does This Paper Address?

In fields like aviation, autonomous driving, and microelectronics, we often need to calculate the probability of a "rare event"—an occurrence with a probability typically less than $10^{-4}$. For example, if a drug vial manufacturing process has a failure rate of $10^{-9}$, you might never see a defect in a million samples, but that one-in-a-billion failure could still cause a public health crisis.

The gold standard, the Monte Carlo (MC) method, is incredibly inefficient here. To reliably estimate a $10^{-6}$ probability, you might need $10^8$ samples. If each sample requires an expensive computer simulation (like a high-fidelity physics model), the cost becomes astronomical. While techniques like Importance Sampling (IS) and Subset Simulation exist, they often struggle with high-dimensional data or require complex manual tuning to find a good "proposal distribution" that targets the rare event region.

Methods

The authors propose NOFIS (Normalizing Flow assisted Importance Sampling). The core idea is to use a Normalizing Flow (NF)—a type of generative model that transforms a simple base distribution (like a standard Gaussian) into a complex target distribution through a series of invertible, trainable transformations.

Key components of the NOFIS approach include:

  • Nested Subset Events: Instead of trying to learn the rare event distribution all at once, NOFIS defines a sequence of "bridge" events $\Omega_{a_1} \supset \Omega_{a_2} \dots \supset \Omega_{a_M}$, where each event is slightly rarer than the last.
  • Sequential Training with Freezing: The NF is trained in $M$ steps. In each step, it learns to match a "temperature-modulated" version of the current subset event. Crucially, once a set of transformations is learned for an earlier (more common) subset, those layers are frozen. New layers are then appended to learn the shift to the next, rarer subset.
  • Reverse KL Divergence: The model is trained by minimizing the reverse Kullback-Leibler (KL) divergence, which allows the NF to "seek out" the modes of the target distribution effectively without needing to sample from the rare region directly at the start.
An illustration of the NOFIS approach showing the sequential training and freezing of NF layers.

Datasets

The authors evaluated NOFIS against six baseline methods (including standard Monte Carlo and Subset Simulation) across 10 test cases:

  1. Synthetic Benchmarks: 2D "Leaf" shape, 6D Cube, 10D Rosenbrock function, 20D Levy function, and 40D Powell function. These test the algorithm's ability to handle different geometries and high dimensionality.
  2. Real-World Engineering Problems:
    • Opamp Gain: Estimating failure in a three-stage operational amplifier.
  3. Oscillator: Parameter variations in a toy car model.
  4. Charge Pump (CP): Current mismatch in a circuit.
  5. Y-branch: Power transmission in a silicon photonic component.
  6. ResNet18: Performance degradation in a deep neural network under parameter noise (62 dimensions).

Key Insights and Ideas

  • The "Bridge" Strategy is Essential: You cannot effectively train a model to find a $10^{-9}$ event from scratch because the model will never see any "hits." By using nested subsets, NOFIS creates a gradient that the model can follow from the common regions into the extreme tails.
  • Freezing Prevents "Forgetting": By freezing earlier layers, the authors ensure that the model retains its knowledge of the broader distribution while the new layers focus exclusively on the marginal shift needed to reach the next rare threshold.
  • Temperature Modulation ($\tau$): The authors use a temperature parameter to smooth the target distribution. If $\tau$ is too high, the target becomes a sharp "step function" that is hard to train; if it's too low, the model doesn't focus enough on the rare region. They found a "bowl-shaped" relationship where a moderate $\tau$ (between 10 and 200) works best.

Key Results

NOFIS consistently outperformed baselines in terms of efficiency (number of function calls) and accuracy (logarithmic error).

  • Qualitative Success: As shown in Figure 2, NOFIS is capable of recovering highly complex, non-convex optimal proposal distributions that perfectly align with theoretical targets.
  • Quantitative Superiority: In the 6D "Cube" synthetic test (Golden $P_r \approx 2.15 \times 10^{-9}$), NOFIS achieved a log-error of 0.078 with ~197K calls, while standard Subset Simulation (SUS) required more calls (~206K) for a similar error, and other methods like Adapt-IS failed significantly (error of 6.23).
  • High-Dimensional Robustness: In the 62-dimensional ResNet18 case, NOFIS achieved the lowest error (0.61) with the fewest function calls (18K) compared to all other tested methods.
Figure 2: (a) The heatmap represents the data generating distribution p = N(0, I). (b)-(e) The top row displays the theoretically optimal proposal distribution q⋆defined in Eq. (3), while the bottom row illustrates the learned proposal distribution qMK generated by the NF using Algorithm 1. They exhibit a strong alignment in every case. When we overlay the highlighted green areas in (b)-(e) onto (a), we notice these areas occur at the tail of distribution p.

Limitations and Future Work

  • Manual Subset Selection: Currently, the sequence of thresholds $\{a_m\}$ and the number of steps $M$ are hyperparameters that require human intuition or trial-and-error. The authors identify the development of an automated method for defining these nested events as a critical next step.
  • Temperature Sensitivity: While robust within a range, the performance still depends on the temperature hyperparameter $\tau$, which might vary between different types of problems.
  • Computational Overhead of NF: While NOFIS reduces the number of expensive function calls (simulations), training the Normalizing Flow itself adds a computational cost in terms of GPU time, which is a trade-off to consider if the underlying simulation is relatively cheap.

Summary updated

BibTeX
@misc{gao2023rare,
  author = {Zhenggqi Gao and Dinghuai Zhang and Luca Daniel and Duane S. Boning},
  title = {{Rare Event Probability Learning by Normalizing Flows}},
  year = {2023},
  eprint = {2310.19167},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2310.19167},
}
Figure