[Paper Review] Latent Constraints: Learning to Generate Conditionally from Unconditional Generative Models
This paper proposes a method to enable conditional generation from pre-trained unconditional generative models—specifically VAEs—by learning latent constraints in the form of critic functions that identify regions in latent space corresponding to desired attributes. By optimizing latent codes via gradient-based methods or amortized actors, the approach generates realistic, diverse samples while preserving identity and enabling zero-shot conditional control without retraining.
Deep generative neural networks have proven effective at both conditional and unconditional modeling of complex data distributions. Conditional generation enables interactive control, but creating new controls often requires expensive retraining. In this paper, we develop a method to condition generation without retraining the model. By post-hoc learning latent constraints, value functions that identify regions in latent space that generate outputs with desired attributes, we can conditionally sample from these regions with gradient-based optimization or amortized actor functions. Combining attribute constraints with a universal "realism" constraint, which enforces similarity to the data distribution, we generate realistic conditional images from an unconditional variational autoencoder. Further, using gradient-based optimization, we demonstrate identity-preserving transformations that make the minimal adjustment in latent space to modify the attributes of an image. Finally, with discrete sequences of musical notes, we demonstrate zero-shot conditional generation, learning latent constraints in the absence of labeled data or a differentiable reward function. Code with dedicated cloud instance has been made publicly available (https://goo.gl/STGMGx).
Motivation & Objective
- Enable conditional generation from pre-trained unconditional generative models without retraining.
- Address the challenge of generating realistic, diverse samples with specific attributes using only latent space constraints.
- Preserve identity during image attribute modification by minimizing latent space perturbations.
- Enable zero-shot conditional generation for discrete sequences (e.g., music) using rule-based constraints and no labeled data.
- Decouple the learning of attribute-specific constraints from the underlying data distribution via a universal realism constraint.
Proposed method
- Train a VAE to prioritize reconstruction quality, ensuring that encoded data points are close to the true data manifold.
- Learn two critic functions: one for attribute constraints ($D_{\text{attr}}$) and one for realism ($D_{\text{realism}}$), both trained to distinguish between real data latents and prior or transformed samples.
- Use gradient-based optimization to shift latent codes toward regions satisfying both $D_{\text{attr}}$ and $D_{\text{realism}}$, minimizing perturbation from original inputs.
- Train an amortized actor function $G(z)$ to map prior samples to latent codes satisfying both constraints, enabling efficient sampling.
- For zero-shot generation on discrete sequences, use rule-based constraints and train the actor-critic pair without labeled data or differentiable rewards.
- Combine attribute and realism constraints via joint optimization, ensuring generated samples are both attribute-compliant and perceptually realistic.
Experimental results
Research questions
- RQ1Can conditional generation be achieved on pre-trained unconditional VAEs without retraining?
- RQ2Can identity-preserving image transformations be achieved by minimizing latent space perturbations while satisfying attribute constraints?
- RQ3Can zero-shot conditional generation be performed on discrete sequences (e.g., music) without labeled data or differentiable reward functions?
- RQ4How can a universal realism constraint improve sample quality and diversity in latent space without sacrificing reconstruction fidelity?
- RQ5Can gradient-based optimization and amortized actor functions jointly enforce multiple latent constraints effectively across different data modalities?
Key findings
- The method successfully generates realistic, diverse conditional images from a pre-trained VAE by optimizing latent codes to satisfy both attribute and realism constraints.
- Identity-preserving transformations were achieved with minimal latent space adjustments, maintaining perceptual identity even when modifying attributes like expression or hair.
- For music generation, the approach satisfied C Major scale constraints 70.8% of the time with a minimal shift in latent space when only the pitch constraint was optimized.
- When both pitch and density constraints were applied, the method achieved high satisfaction rates with a slightly larger but still minimal latent shift.
- The realism constraint significantly improved sample quality without degrading reconstruction fidelity, outperforming standard VAEs with low likelihood variance.
- The approach enabled zero-shot conditional generation on discrete sequences using only rule-based constraints and no labeled data, demonstrating generalization beyond supervised setups.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.