Abstract
Variational Autoencoders (VAEs) often struggle with a trade-off between reconstruction quality and latent space properties. ControlVAE addresses this by introducing a feedback control mechanism—specifically a non-linear PI controller—to automatically tune the weight of the KL-divergence term during training. By treating the KL-divergence as a controlled variable and setting a target "set point," the model achieves a superior balance between data reconstruction quality and latent representation properties like disentanglement and diversity.
Introduction
Variational Autoencoders (VAEs) are powerful generative models, but they suffer from a notorious balancing act. Their objective function, the Evidence Lower Bound (ELBO), consists of two competing terms: the reconstruction log-likelihood (how well the model recreates the input) and the KL-divergence (how well the latent distribution matches a prior, like a Gaussian).
In practice, this leads to two major issues:
- KL Vanishing: In language modeling, the KL term often drops to zero, meaning the decoder ignores the latent variables entirely, leading to generic, non-diverse outputs.
- The Disentanglement Trade-off: To learn "disentangled" features (e.g., separating an object's scale from its rotation), researchers often use beta-VAEs, which heavily penalize the KL term. However, this usually comes at the cost of blurry, low-quality reconstructions.
Existing solutions like "KL annealing" blindly increase the weight of the KL term over time. They don't account for the model's actual state during training, making them difficult to tune and often ineffective at stabilizing the latent space.
The ControlVAE Framework
The authors propose ControlVAE, which replaces manual hyperparameter scheduling with a non-linear PI (Proportional-Integral) controller. Inspired by automatic control theory, the framework treats the KL-divergence as the output of a system. The user defines a "set point" (the desired KL value), and the controller calculates the error between the actual KL and that set point at every training step. It then automatically adjusts the hyperparameter beta(t)—the weight of the KL term—to minimize that error.
Non-linear PI Controller
The authors utilize a non-linear PI controller rather than a full PID controller. The "Derivative" (D) term is omitted because training deep learning models is inherently noisy; calculating the derivative of the error would likely introduce instability. The resulting non-linear PI controller allows beta to fluctuate dynamically, "locking in" the KL-divergence once it reaches the target.
Experimental Evaluation
The authors evaluated ControlVAE across three distinct domains: Language Modeling (PTB and Switchboard), Disentangled Representation Learning (dSprites), and Image Generation (CelebA).
Key Results
- Language Modeling: On the Switchboard dataset, ControlVAE achieved significantly higher diversity and lower Perplexity (PPL: 8.81 vs. 17.81 for cyclical annealing) than competitive baselines.
- Disentanglement: ControlVAE achieved a Mutual Information Gap (MIG) score of 0.5628 on the 2D Shapes dataset, outperforming beta-VAE (0.5138) while maintaining much lower reconstruction error. It successfully disentangled all five ground-truth factors.
- Image Quality: For CelebA, ControlVAE improved reconstruction quality over the original VAE. By slightly increasing the KL-divergence (setting a set point of 200), it achieved a better FID score (55.16 vs. 58.71), resulting in sharper, more accurate facial reconstructions.
Discussion and Conclusion
ControlVAE shifts VAE training from an "open-loop" process to a "closed-loop" process using real-time feedback. This approach averts KL vanishing by setting a minimum KL set point, ensuring the latent space remains informative. In disentanglement tasks, the controller starts with a high beta to force the model to find independent factors, then gradually lowers it to improve reconstruction quality once those factors are found.
While ControlVAE automates the tuning of beta, the user must still choose a KL set point. Future work could involve applying this control-based approach to other complex models, such as topic modeling or semi-supervised learning, where balancing multiple objective terms is a persistent challenge.
Summary updated