InfoCNF: An Efficient Conditional Continuous Normalizing Flow with Adaptive Solvers

Tan M. Nguyen, Animesh Garg, Richard G. Baraniuk, Anima AnandkumararXiv 2019

Abstract

Continuous Normalizing Flows (CNFs) offer powerful generative capabilities but suffer from high computational costs due to the large number of function evaluations (NFEs) required by ODE solvers. We present InfoCNF, an efficient conditional CNF that partitions the latent space into supervised and unsupervised components. Furthermore, we introduce learnable gating networks that adaptively tune ODE solver tolerances using reinforcement learning. Our approach achieves significant improvements in classification accuracy and training efficiency, reducing NFEs while maintaining or improving model performance on benchmarks like CIFAR-10.

Introduction

Continuous Normalizing Flows (CNFs) utilize Ordinary Differential Equations (ODEs) to model complex data distributions through invertible transformations. While they provide exact likelihood estimation, their practical application is hindered by the "speed limit" of ODE solvers. Training CNFs is computationally intensive because solvers often require numerous function evaluations to reach a solution.

This issue is exacerbated in conditional settings (e.g., generating specific image classes), where standard methods often lead to overparameterization and a corresponding surge in NFEs. Additionally, researchers typically have to manually tune solver error tolerances—a tedious process that often yields suboptimal results. InfoCNF aims to automate this tuning and streamline the architecture for better performance.

Methodology

InfoCNF addresses these challenges through two primary innovations: partitioned latent codes and adaptive error tolerances.

  1. Partitioned Latent Code: Inspired by InfoGAN, InfoCNF splits the latent space $z$ into a supervised code ($z_y$) for class-specific information and an unsupervised code ($z_u$) for residual variations. This partitioning reduces the parameter overhead for conditioning, leading to more efficient training and disentangled representations.
  2. Adaptive Solver Tolerances via Gating Networks: Rather than relying on fixed, hand-tuned tolerances, InfoCNF employs CNN Gating Networks. These networks analyze input data to predict optimal error tolerances for each ODE layer.
The InfoCNF architecture featuring partitioned latent codes and CNN Gating Networks for adaptive ODE solver tolerances.
  1. Reinforcement Learning for Optimization: Since selecting discrete tolerance levels is non-differentiable, the gating networks are trained using the REINFORCE algorithm. The reward function balances model accuracy against the number of function evaluations, encouraging the model to be "precise when it matters and fast when it doesn't."

Results and Discussion

The model was evaluated on CIFAR-10, MNIST, and synthetic datasets. Key results indicate that InfoCNF significantly outperforms baseline Conditional CNFs (CCNF).

On CIFAR-10, InfoCNF achieved a 12% reduction in test classification error in small-batch settings and a 10% reduction in large-batch settings. Crucially, this performance boost was accompanied by increased efficiency: NFEs were reduced by 16% and 11% for small and large batches, respectively.

Comparison of Negative Log-Likelihood (NLL) and Number of Function Evaluations (NFEs) between fixed and learned tolerances.

The impact of the gating mechanism is particularly noteworthy. As shown in the training curves, learned tolerances lead to a significant reduction in NFEs over the course of training compared to fixed tolerances, with minimal impact on the Negative Log-Likelihood (NLL). The authors suggest that the numerical noise introduced by looser tolerances may even act as a form of regularization, aiding generalization similar to stochastic depth.

Conclusion

InfoCNF demonstrates that partitioning latent spaces and adaptively tuning solver tolerances can significantly enhance the efficiency and accuracy of conditional generative models. While some gaps in NLL remain in specific small-batch settings, the overall gains in speed and classification performance mark a substantial step forward for practical CNF applications. Future work will explore more stable RL algorithms and the scaling of adaptive gating to larger, more complex architectures.

Summary updated

BibTeX
@misc{nguyen2019infocnf,
  author = {Tan M. Nguyen and Animesh Garg and Richard G. Baraniuk and Anima Anandkumar},
  title = {{InfoCNF: An Efficient Conditional Continuous Normalizing Flow with Adaptive Solvers}},
  year = {2019},
  eprint = {1912.03978},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1912.03978},
}
Figure