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.