  We present a flow-based method for simulating and calculating nucleation
rates of first-order phase transitions in scalar field theory on a lattice.
Motivated by recent advancements in machine learning tools, particularly
normalizing flows for lattice field theory, we propose the ``partitioning
flow-based Markov chain Monte Carlo (PFMCMC) sampling" method to address two
challenges encountered in normalizing flow applications for lattice field
theory: the ``mode-collapse" and ``rare-event sampling" problems. Using a
(2+1)-dimensional real scalar model as an example, we demonstrate the
effectiveness of our PFMCMC method in modeling highly hierarchical order
parameter probability distributions and simulating critical bubble
configurations. These simulations are then used to facilitate the calculation
of nucleation rates. We anticipate the application of this method to
(3+1)-dimensional theories for studying realistic cosmological phase
transitions.
