A generative adversarial network (GAN) is a class of machine learning frameworks and a prominent framework for approaching generative AI. The concept was initially developed by Ian Goodfellow and his colleagues in June 2014. In a GAN, two neural networks compete with each other in the form of a zero-sum game, where one agent's gain is another agent's loss.
Given a training set, this technique learns to generate new data with the same statistics as the training set. For example, a GAN trained on photographs can generate new photographs that look at least superficially authentic to human observers, having many realistic characteristics. Though originally proposed as a form of generative model for unsupervised learning, GANs have also proved useful for semi-supervised learning, fully supervised learning, and reinforcement learning.
The core idea of a GAN is based on the "indirect" training through the discriminator, another neural network that can tell how "realistic" the input seems, which itself is also being updated dynamically. This means that the generator is not trained to minimize the distance to a specific image, but rather to fool the discriminator. This enables the model to learn in an unsupervised manner. GANs are similar to mimicry in evolutionary biology, with an evolutionary arms race between both networks.
Architecture and Training
A GAN consists of two main components: a generator and a discriminator. The generator is a neural network that takes random noise from a latent space (often a multivariate normal distribution) and maps it to a data sample, such as an image. The discriminator is another neural network that receives both real samples from the training dataset and synthetic samples from the generator, and outputs a probability that a given input is real rather than generated.
Training proceeds as an iterative game. The discriminator is first trained on a known dataset to distinguish real from fake with acceptable accuracy. Then, the generator is trained based on whether it succeeds in fooling the discriminator. Independent backpropagation procedures are applied to both networks: the generator adjusts its weights to produce more convincing samples, while the discriminator improves its ability to flag synthetic inputs. When used for image generation, the generator is typically a deconvolutional neural network, and the discriminator is a convolutional neural network.
The objective function for the original GAN game is defined over the reference distribution (real data) and the generator distribution. The discriminator aims to maximize the log-probability of correctly classifying real and fake inputs, while the generator aims to minimize the same objective, effectively trying to make the discriminator output 1 for generated samples. This zero-sum formulation drives both networks to improve until the generator's distribution closely matches the reference distribution.
Mathematical Formulation
Formally, the GAN game is defined on a probability space (Ω, μ_ref). The generator's strategy set is the set of all probability measures μ_G on Ω, while the discriminator's strategy set consists of Markov kernels from Ω to probability measures on [0,1]. The objective function is:
L(μ_G, μ_D) = E_{x~μ_ref, y~μ_D(x)}[ln y] + E_{x~μ_G, y~μ_D(x)}[ln(1-y)]
The generator aims to minimize this objective, approaching μ_G ≈ μ_ref, while the discriminator aims to maximize it, outputting values close to 1 for real data and close to 0 for generated data. This minimax game has a theoretical equilibrium where the generator perfectly replicates the reference distribution and the discriminator cannot do better than random guessing.
Relation to Other Generative Models
GANs are implicit generative models, meaning they do not explicitly model the likelihood function nor provide a means for finding the latent variable corresponding to a given sample, unlike alternatives such as flow-based generative models. Compared to fully visible belief networks such as WaveNet and PixelRNN, and autoregressive models in general, GANs can generate one complete sample in a single pass, rather than requiring multiple passes through the network.
Unlike Boltzmann machines and linear ICA, GANs impose no restriction on the type of function used by the network. Since neural networks are universal approximators, GANs are asymptotically consistent. As of 2026, variational autoencoders have also been proven to be universal approximators, but GANs remain distinct in their adversarial training paradigm. This approach has made GANs particularly effective for tasks like image synthesis, style transfer, and data augmentation, where generating realistic high-dimensional samples is critical.
Applications and Impact
GANs have driven significant advances in deep learning and machine learning applications. They have been widely used for generating realistic images, including faces, landscapes, and medical images. In artificial intelligence research, GANs have enabled progress in semi-supervised learning, where labeled data is scarce, and in reinforcement learning, where they can model environments or generate training experiences.
The adversarial training concept has also influenced other areas, such as transformers and large language models, though those architectures use different training objectives. GANs remain a foundational framework in generative modeling, with ongoing research addressing challenges like training instability and mode collapse, where the generator produces limited variety. Their evolutionary arms race analogy continues to inspire new methods in both academia and industry.
Limitations and Challenges
Despite their power, GANs face several known difficulties. Training can be unstable, as the two networks must be kept in balance; if the discriminator becomes too strong, the generator receives vanishing gradients, and if it becomes too weak, the generator may not learn effectively. Mode collapse is another common issue, where the generator produces only a small subset of the possible outputs, failing to capture the full diversity of the training data.
Evaluating GAN performance is also non-trivial, since there is no explicit likelihood to measure. Researchers often use metrics like the Inception Score or Fréchet Inception Distance, but these have limitations. As of the mid-2020s, newer generative models, including diffusion models, have gained popularity for some tasks, but GANs remain an active area of research, particularly for real-time applications and settings where single-pass generation is advantageous.