techlist.io

Generative Models

20 posts

OpenAI2016-11-132 min readCurated summary

On the quantitative analysis of decoder-based generative models

Generative models such as variational autoencoders, GANs, and generative moment matching networks share a decoder network, but their performance is hard to measure because their log-likelihoods are intractable and inspecting samples can be misleading. The post proposes Annealed Importance Sampling (AIS) as a way to estimate log-likelihoods for decoder-based models, and it validates the estimates with bidirectional Monte Carlo. The authors use this technique to assess how well these models perform, how reliable existing estimators are, how much they overfit, and how well they cover the modes of the data distribution. ## Decoder-Based Generative Models - A decoder is a parametric deep neural network that defines a generative distribution over data. - The approach covers several families: variational autoencoders, generative adversarial networks, and generative moment matching networks. - The post treats the decoder as the shared component across these otherwise different models, which is what makes a single evaluation method applicable to all of them. ## The Evaluation Problem - Log-likelihood is the standard quantitative metric for generative models, but it cannot be computed exactly for decoder-based models. - Visual inspection of samples is the common fallback, but the post argues it can mislead, since good-looking samples do not show whether the model covers the whole data distribution or merely memorizes parts of it. ## Annealed Importance Sampling for Log-Likelihood Estimation - AIS is used to estimate the log-likelihood of decoder-based models in place of an intractable exact computation. - Its accuracy is checked with bidirectional Monte Carlo, which bounds the estimate from both directions to show how close it is to the true value. - The evaluation code is released publicly so others can reproduce the method. ## What the Analysis Reveals - The approach measures overall performance of decoder-based models across the families above. - It tests how effective existing log-likelihood estimators are, not just the models themselves. - It quantifies the degree of overfitting to the training data. - It indicates how much of the data distribution these models fail to capture, specifically which important modes they miss. ## Practical Takeaway If you are comparing decoder-based generative models, relying on sample quality alone is insufficient. Estimating log-likelihood with AIS, and checking the estimate with bidirectional Monte Carlo, gives a more rigorous basis for comparison, including on overfitting and mode coverage.

OpenAI2016-11-102 min readCurated summary

A connection between generative adversarial networks, inverse reinforcement learning, and energy-based models

Generative adversarial networks (GANs), inverse reinforcement learning (IRL), and energy-based models (EBMs) are usually studied separately, but this post argues they are closely linked. The authors show that a sample-based algorithm for maximum entropy IRL is mathematically equivalent to a GAN in which the generator's density can be evaluated and fed to the discriminator. They then argue that GAN training can be understood as training an energy-based model, and they hope making these links explicit will help researchers transfer techniques for stabilizing and scaling these methods. ## Learning Cost Functions in Generative Modeling and Control - In a GAN, the generator is trained against a cost function that a discriminator learns at the same time. - Learning cost functions has a longer history in control and reinforcement learning, mainly for imitation learning from demonstrations. - In those fields, recovering the cost that explains observed behavior is called inverse reinforcement learning or inverse optimal control. ## Equivalence Between Maximum Entropy IRL and GANs - The authors show that certain IRL methods are not just analogous to GANs but mathematically equivalent to them. - The specific match is a sample-based algorithm for maximum entropy IRL and a GAN whose discriminator also receives the generator's density as an additional input. ## Connection to Energy-Based Models - Maximum entropy IRL is a special case of an energy-based model. - Because of this, GAN training can be interpreted as a way to train energy-based models. - The paper relates this view to other recent work that connects GANs and EBMs. ## Implications for Stability and Scalability - Stability and scalability are named as major open challenges in all three areas. - The authors suggest that ideas can move between the communities once the formal connections are clear, especially methods aimed at more stable and scalable training.

OpenAI2016-11-072 min readCurated summary

Variational lossy autoencoder

Variational Lossy Autoencoder proposes a way to learn global representations that capture overall structure while discarding irrelevant detail such as texture. The method combines a Variational Autoencoder (VAE) with neural autoregressive models. The architecture is designed so the latent code cannot encode fine-grained information, which makes the VAE a lossy autoencoder. The approach also improves generative performance, reaching state-of-the-art density estimation results on MNIST, OMNIGLOT, and Caltech-101 Silhouettes. ### Learning Global Representations - Representation learning aims to expose useful aspects of data in a form that supports downstream tasks like classification. - For 2D images, a good representation describes global structure and ignores detailed texture. ### Controlling the Latent Code with Architecture - The VAE architecture is designed to control what the global latent code can learn. - By restricting the latent code, the model is forced to discard irrelevant information such as texture, so the VAE only "autoencodes" the data in a lossy way. ### Autoregressive Priors and Decoders - Autoregressive models such as RNN, MADE, and PixelRNN/CNN serve as both the prior distribution p(z) and the decoding distribution p(x|z). - This substantially improves the generative modeling performance of VAEs. ### Benchmark Results - The model achieves new state-of-the-art results on density estimation for MNIST, OMNIGLOT, and Caltech-101 Silhouettes.

OpenAI2016-06-154 min readCurated summary

Generative models

# Generative Models as a Path to Machine Understanding OpenAI's June 2016 post argues that generative models, which learn to produce data resembling a training set, are one of the most promising routes to computers that understand the world. The core idea is that a model forced to compress large datasets into far fewer parameters must discover the essential structure of that data in order to reproduce it. The post illustrates this with image generation, explains the main model families, and summarizes four recent OpenAI projects that improve GANs, VAEs, and reinforcement learning exploration and imitation. ## Why Generating Data Builds Understanding - Generative models are trained on a large collection of data, such as ImageNet's 1.2 million images resized to 256x256x3 (about 200GB of pixels). - The model's parameter count (roughly 100 million) is far smaller than the data, so it must learn salient regularities: nearby pixels share colors, edges are horizontal or vertical, and objects appear in typical arrangements. - The post frames this with Feynman's line, "What I cannot create, I do not understand." ## How a Generative Model Is Trained - A network such as DCGAN takes a random code of 100 numbers drawn from a uniform distribution and outputs an image. Changing the code smoothly changes the image, which suggests the model learned features rather than memorizing examples. - Training aims to make the model distribution p̂θ(x) match the true data distribution p(x), typically by reducing a KL-divergence-style loss. - Because there are no explicit target images, training relies on indirect signals. In the GAN approach, a discriminator learns to separate real from generated images, and the generator is updated to fool it. ## Three Families of Generative Models - **GANs** pose training as a game between a generator and a discriminator. They produce the sharpest images but are hard to optimize because training dynamics are unstable. - **VAEs** maximize a lower bound on the data log-likelihood within a probabilistic graphical model framework. They support efficient Bayesian inference over latent variables, but their samples tend to be blurry. - **Autoregressive models such as PixelRNN** model each pixel conditioned on previously generated pixels, using RNNs that run horizontally and vertically. They train stably with a softmax loss and achieve the best log-likelihoods, but sampling is slow and they offer no simple low-dimensional codes. ## Four Projects from OpenAI - **Improving GANs:** The authors introduce techniques that stabilize GAN training and scale it to 128x128 ImageNet samples. Their CIFAR-10 samples fooled Mechanical Turk workers at a 21.3% error rate, where 50% would be chance. A semi-supervised variant, where the discriminator also predicts labels, reached 99.14% accuracy on MNIST with only 10 labeled examples per class. - **Improving VAEs with Inverse Autoregressive Flow (IAF):** IAF lets approximate posteriors be rich and highly flexible while remaining parallelizable, unlike earlier chain-conditioned approaches. The resulting 32x32 samples are noticeably sharper than vanilla VAE output and earlier DRAW samples. - **InfoGAN:** This extension adds a mutual-information objective between subsets of the latent code and the observation. The result is disentangled, interpretable factors, such as azimuth, elevation, lighting, and face width in 3D face images, learned without any supervision. - **VIME (Curiosity-driven exploration):** Using uncertainty in Bayesian neural network dynamics models, the agent seeks surprising state-action pairs. This helps on sparse-reward tasks, such as learning locomotion primitives without guidance, where naive exploration fails. - **Generative Adversarial Imitation Learning (GAIL):** Rather than learning a reward function and then running RL, GAIL extracts policies directly from expert demonstrations through a GAN-like connection. It works on hard OpenAI Gym environments such as Ant and Humanoid. ## Outlook - Near-term applications include image denoising, inpainting, super-resolution, structured prediction, RL exploration, and neural network pretraining when labeled data is scarce. - The authors anticipate creative tools such as on-demand art and editing commands like "make my smile wider." - The deeper promise is that learning to generate the world may give computers an actual understanding of what it is made of.

OpenAI2016-02-241 min readCurated summary

Weight normalization: A simple reparameterization to accelerate training of deep neural networks

Weight normalization is a reparameterization of neural network weight vectors that separates each vector's length from its direction. This improves the conditioning of the optimization problem and speeds up stochastic gradient descent. Unlike batch normalization, it creates no dependencies between examples in a minibatch, so it works for recurrent models, reinforcement learning, and generative models. The authors report that it captures much of batch normalization's speedup at lower computational cost. ### The Reparameterization - Each weight vector is split into a length component and a direction component. - Decoupling these two components improves conditioning of the optimization problem. ### Advantages over Batch Normalization - It is inspired by batch normalization but is simpler to implement. - It does not depend on minibatch statistics, so each example is processed independently. - It suits recurrent architectures like LSTMs, where batch normalization is less well suited. - It suits noise-sensitive settings such as deep reinforcement learning and generative modelling. - Its computational overhead is lower, so more optimization steps fit in the same training time. ### Demonstrated Applications - Supervised image recognition - Generative modelling - Deep reinforcement learning