  We apply the Hierarchical Autoregressive Neural (HAN) network sampling
algorithm to the two-dimensional $Q$-state Potts model and perform simulations
around the phase transition at $Q=12$. We quantify the performance of the
approach in the vicinity of the first-order phase transition and compare it
with that of the Wolff cluster algorithm. We find a significant improvement as
far as the statistical uncertainty is concerned at a similar numerical effort.
In order to efficiently train large neural networks we introduce the technique
of pre-training. It allows to train some neural networks using smaller system
sizes and then employing them as starting configurations for larger system
sizes. This is possible due to the recursive construction of our hierarchical
approach. Our results serve as a demonstration of the performance of the
hierarchical approach for systems exhibiting bimodal distributions.
Additionally, we provide estimates of the free energy and entropy in the
vicinity of the phase transition with statistical uncertainties of the order of
$10^{-7}$ for the former and $10^{-3}$ for the latter based on a statistics of
$10^6$ configurations.
