Abstract
With the rapidly growing model complexity and data volume, training deep generative models (DGMs) for better performance has become an increasingly important challenge. Previous research on this problem has mainly focused on improving DGMs by either introducing new objective functions or designing more expressive model architectures. However, such approaches often introduce significantly more computational and/or design overhead. To resolve such issues, we introduce in this paper a generic framework called generative-model inference that is capable of enhancing pre-trained GANs effectively and seamlessly in a variety of application scenarios. Our basic idea is to efficiently infer the optimal latent distribution for the given requirements using Wasserstein gradient flow techniques, instead of re-training or fine-tuning pre-trained model parameters. Extensive experimental results on applications like image generation, image translation, text-to-image generation, image inpainting, and text-guided image editing suggest the effectiveness and superiority of our proposed framework.
Introduction
Deep Generative Models (DGMs), particularly Generative Adversarial Networks (GANs), have revolutionized image synthesis. However, they face two major hurdles: mode collapse, where models fail to capture the full diversity of training data, and significant computational overhead required for retraining or architectural modification. While newer alternatives like Diffusion Models (DDPMs) offer high quality, they are often slow to sample and require massive compute to train.
This paper proposes a shift from model training to latent inference. Instead of modifying the weights of a pre-trained GAN, the authors introduce a "plug-and-play" framework that finds the optimal distribution of latent codes for a specific task after the model is already trained. This approach unlocks the latent potential of frozen models without the need for expensive retraining.
Methodology: Generative-Model Inference
The core of the framework is the optimization of the latent distribution rather than assuming it must follow a fixed standard Gaussian. This is achieved through two primary mathematical innovations.
Wasserstein Gradient Flow (WGF)
The authors formulate the enhancement as a minimization of the KL-divergence between the generated image distribution and a target distribution (such as the training set or a text prompt). Using Wasserstein Gradient Flow, they derive an iterative update rule for latent codes $z$ that balances three distinct forces:
- Diversity (Entropy): Prevents mode collapse by pushing latent codes apart.
- Data Matching: Pulls generated samples toward the real training data distribution.
- Condition Matching: Aligns outputs with specific constraints, such as CLIP-based text prompts or inpainting masks.
Regularized Gradient Estimation
Calculating gradients in high-dimensional image space is notoriously difficult. To stabilize this, the authors introduce a regularized kernel using a "mollifier" (a smoothing function) solved via Kernel Ridge Regression (KRR). This smoothing of the search space makes the optimization robust against the sharp boundaries of low-dimensional data manifolds.
Experimental Results
The framework was evaluated across diverse benchmarks, including CIFAR-10, MS-COCO, and FFHQ.
- Quantitative Improvements: On CIFAR-10, applying this method to a standard SN-GAN improved the Frechet Inception Distance (FID) from 22.30 to 13.37, indicating a significant boost in both quality and diversity.
- Inpainting and Translation: When integrated with state-of-the-art models like Co-Mod-GAN, the method achieved superior FID scores on FFHQ and Places2, enhancing even the strongest baselines.
- Zero-Shot Flexibility: A key strength is the ability to perform out-of-domain generation and text-guided editing by integrating with models like DALL-E (VQ-VAE) and CLIP. This allows for complex, diverse generations from simple text prompts.
Conclusion and Future Work
Generative-model inference demonstrates that a pre-trained GAN's internal knowledge often exceeds its default output. By refining latent code selection, the framework provides a unified, training-free method for enhancing various generative tasks. Future research will focus on reducing the iterative overhead (currently 10-15 steps per image) and developing more native integrations for discrete latent spaces like those found in VQ-VAEs.
Summary updated