We introduce the flow perturbation method, which incorporates optimized stochastic perturbations into the flow. By reweighting trajectories generated by the perturbed flow, our method achieves unbiased sampling of the Boltzmann distribution with orders of magnitude speedup compared to both brute force Jacobian calculations and the Hutchinson estimator.
Flow Perturbation++ (FP++) is a variance-reduced extension of Flow Perturbation for unbiased Boltzmann sampling with continuous normalizing flows (CNFs).
High-dimensional CNFs are limited by the computational cost of Jacobian-determinant evaluation, which requires (D) backpropagation passes through the flow layers. Existing stochastic Jacobian estimators, such as the Hutchinson trace estimator, reduce computation but introduce bias. FP++ discretizes the probability-flow ODE and performs unbiased stepwise Jacobian estimation, retaining unbiasedness while substantially reducing estimator variance.
- Unbiased stepwise Jacobian estimation via multi-step flow decomposition
- Variance reduction compared with single-step Flow Perturbation
- Seamless integration with SMC-based CNF sampling pipelines
- Benchmarked on high-dimensional synthetic and molecular systems
- Mandatory
- pytorch>=2.0
- numpy==1.26.4
- easydict
- bgmol (for Chignolin)
- bgflow (for Chignolin)
- mdtraj==1.9.9 (for Chignolin)
- All hyper-parameters and training details are provided in config files (), and free feel to tune these parameters../configs/*.yml
python train.py ./configs/GMM10D_default.yml ./models/GMM10D
python train.py ./configs/GMM1000D_default.yml ./models/GMM1000D
python train.py ./configs/CGN_default.yml ./models/CGN- The model checkpoints will be saved in the specified directory,e.g., ./models/GMM10D
- The Metropolis MC simulations are provided in the following files:
python MC.py ./configs/CGN_default.yml ./models/CGN --method 0 --M 1
python MC.py ./configs/GMM1000D_default.yml ./models/GMM1000D --method 0 --M 1- The first argument specifies the configuration file, while the second argument indicates the model directory. The
--methodoption determines the approach for running the Monte Carlo (MC) simulations:
0: Flow Perturbation (FP)-1: Jacobian-based method-2: Stochastic Normalizing Flow (SNF)1-n: Hutchinson trace estimator--eps_typeparameter: Defines the type of perturbation to use, such as Rademacher, Gaussian, etc.--M'Multiple Noises: Noise Vectors Generated by the FP Method.
- The Sequential Monte Carlo in the following files:
python SMC.py ./configs/GMM10D_default.yml ./models/GMM10D --method 0 --eps_type Rademacher --M 1
python SMC.py ./configs/GMM1000D_default.yml ./models/GMM1000D --method 0 --eps_type Rademacher --M 1
python SMC.py ./configs/CGN_default.yml ./models/CGN --method 0 --eps_type Rademacher --M 1- The first argument specifies the configuration file, while the second argument indicates the model directory. The
--methodoption determines the approach for running the Sequential Monte Carlo (SMC) simulations:-3: Original Flow Perturbation (FP)-2: FP++-1: Jacobian-based method0: Stochastic Normalizing Flow (SNF)1-n: Hutchinson trace estimator
--eps_typeparameter: Defines the type of perturbation to use, such as Rademacher, Gaussian, etc.--M'Multiple Noises: Noise Vectors Generated by the FP Method.
- The result datasets presented in the paper can be found in the
Resultfolder of this repository.

