Artificial Intelligence • Generative AI and Language Models • 15 min read

Generative AI and Generative Model Families

Generative artificial intelligence (generative AI) refers to AI systems designed to produce content such as text, images, audio, video, or structured data. Rather than returning only a label or a number, a generative model produces an output with many possible valid forms.

For example, a classifier may decide whether an image contains a dog. An image-generation model may instead produce an image of a dog in a park. Both can use deep learning, but their tasks and outputs differ.

Generative AI is not one algorithm. It includes several families of models with distinct training objectives, representations, and generation procedures. Understanding these families provides a foundation for studying Transformers, large language models, and multimodal systems.

Start with a simple example

Imagine two AI tasks involving photographs of cats. In the first, the system receives an image and predicts “cat” or “not cat.” In the second, it receives the words “a cat sitting by a window” and creates a new image. The first is a discriminative prediction task; the second is a generative task.

A generative system learns statistical structure from training examples and uses that learned structure to produce new output. New does not necessarily mean unique, correct, or safe: generated content may reproduce training patterns, invent false details, or fail to match a prompt.

Several generative model families solve this problem differently:

  • An autoregressive model produces one token or element at a time, conditioned on what came before.
  • A GAN trains a generator against a discriminator that tries to distinguish generated from real examples.
  • A VAE learns a structured latent representation and samples from a modeled distribution to generate data.
  • A diffusion model commonly starts from noise and iteratively transforms it toward a data-like result.

Think of these as different generation procedures, not four names for the same network. The model family, underlying neural-network architecture, training objective, and user-facing product are separate design choices.

1. What makes a model generative?

A generative model learns properties of a data distribution and uses them to produce new examples or complete partially specified examples. Its output may resemble the training data statistically without being an exact copy of any particular training example.

A dataset of handwritten digits, for instance, contains many different shapes for the digit 3. A useful generative model learns enough regularity to generate plausible new handwritten digits, including variations not explicitly present in its training set.

Generative and discriminative modeling

AspectGenerative modelingDiscriminative modeling
Central goalModel how data is distributed or producedPredict an outcome or distinguish categories
Example taskGenerate a plausible handwritten digitClassify an image as digit 0–9
Example outputAn image, text sequence, or audio segmentA label, score, or predicted value
Typical evaluationQuality, diversity, fidelity, usefulnessAccuracy, calibration, task-specific error

The distinction describes the modeling objective, not a strict division between products. A single system may use both generative and discriminative components. For example, an image generator may use a text-image similarity model to evaluate whether generated images match a prompt.

Unconditional and conditional generation

An unconditional generator produces samples without a task-specific input, apart from randomness or a start token. A conditional generator generates content based on a supplied condition, such as a text prompt, class label, image, or audio segment.

Conceptually, an unconditional model learns a distribution pθ(x)p_\theta(x), while a conditional model learns pθ(x∣c)p_\theta(x\mid c), where:

  • xx denotes the generated data.
  • cc denotes the condition, if present.
  • θ\theta denotes the learned model parameters.

The notation expresses a general modeling goal. Different model families may approximate, factorize, or sample from these distributions in different ways.

2. The generative AI workflow

A common lifecycle begins with a dataset, proceeds through model training, and ends with inference, during which the model produces new outputs.

Generative model workflow showing training data used to learn a model and a prompt or random input used at inference to produce a generated output
Training learns model parameters from examples. Inference uses those parameters to generate outputs from new inputs.
  1. Collect and prepare data. Text, images, or other examples are cleaned and represented in a suitable format.
  2. Choose a model architecture and objective. The objective determines what the system learns to predict, reconstruct, distinguish, or denoise.
  3. Train the model. An optimization process updates parameters according to the training objective.
  4. Evaluate the model. Tests examine output quality, diversity, safety, and performance on relevant tasks.
  5. Generate outputs. A user provides input or the system samples random values, and the trained model performs inference.

Training and inference are separate processes. A model does not ordinarily update its learned weights each time it generates a response, although a separate product may store conversation context, retrieve documents, or run additional learning procedures.

3. Autoregressive models

An autoregressive model generates a sequence one element at a time, using previously available elements as context. In text generation, the elements are commonly tokens rather than entire words.

For a sequence x1,x2,…,xTx_1, x_2, \ldots, x_T, the chain rule of probability gives:

p(x1,…,xT)=∏t=1Tp(xt∣x1,…,xt−1)p(x_1,\ldots,x_T) = \prod_{t=1}^{T} p(x_t\mid x_1,\ldots,x_{t-1})

An autoregressive model represents or approximates these conditional probabilities. During generation, it repeatedly predicts possible next elements, selects or samples one, and appends it to the context.

Worked example: generating a sentence

Given the prompt The robot moved, a language model might assign different probabilities to the next token:

Candidate next tokenIllustrative probability
forward0.50
slowly0.30
home0.15
.0.05

These numbers are invented for demonstration, not outputs from a particular model. If forward is selected, the model then predicts another token using the expanded context The robot moved forward.

Key characteristics

  • Natural fit for ordered data such as text and some audio representations.
  • Generates variable-length sequences through repeated prediction.
  • Can incorporate prompts and previously generated context.
  • Sequential generation can create latency because later elements depend on earlier elements.
  • Errors or undesirable choices can affect subsequent steps.

Modern decoder-only language models typically use Transformer architectures to implement autoregressive prediction. However, autoregressive describes the probability factorization and generation process, whereas Transformer describes a neural network architecture. They are not synonyms.

4. Generative Adversarial Networks (GANs)

A Generative Adversarial Network (GAN) trains two neural networks through an adversarial objective:

  • The generator creates synthetic examples, often from randomly sampled latent vectors.
  • The discriminator attempts to distinguish real training examples from generated ones.

The generator tries to produce examples that the discriminator cannot reliably identify as synthetic. The discriminator simultaneously improves its ability to distinguish the two sources.

Basic training idea

  1. Sample real examples from the training dataset.
  2. Sample random latent vectors and convert them into synthetic examples with the generator.
  3. Update the discriminator using real and generated examples.
  4. Update the generator according to the discriminator’s feedback.
  5. Repeat according to the chosen training procedure.

A classical minimax GAN objective is:

min⁡Gmax⁡D  Ex∼pdata[log⁡D(x)]+Ez∼p(z)[log⁡(1−D(G(z)))]\min_G\max_D\; \mathbb{E}_{x\sim p_{\mathrm{data}}}[\log D(x)] + \mathbb{E}_{z\sim p(z)}[\log(1-D(G(z)))]

Here, GG is the generator, DD is the discriminator, zz is a sampled latent vector, and pdatap_{\mathrm{data}} represents the real-data distribution. Practical GAN variants frequently use modified objectives and stabilization techniques.

Strengths and limitations

GANs can create detailed synthetic images and have been used for image translation, restoration, and related tasks. Their training can be unstable, and a generator may suffer from mode collapse, producing too little variety even when the training data is diverse. Good visual quality alone does not guarantee sufficient diversity or faithful coverage of the data distribution.

5. Variational Autoencoders (VAEs)

A Variational Autoencoder (VAE) is a latent-variable generative model. It learns a compressed probabilistic representation of data and uses this representation to generate or reconstruct examples.

A typical VAE contains two learned components:

  • An encoder, which maps an input xx to parameters of an approximate distribution over latent variables zz.
  • A decoder, which models how an example xx may be generated from a latent variable zz.

The encoder commonly predicts the mean and variance parameters of a latent distribution. Sampling a latent vector and passing it through the decoder yields a reconstruction or new example.

The VAE objective

A common objective is the Evidence Lower Bound (ELBO):

LELBO=Eqϕ(z∣x)[log⁡pθ(x∣z)]−DKL(qϕ(z∣x)  ∥  p(z))\mathcal{L}_{\mathrm{ELBO}} = \mathbb{E}_{q_\phi(z\mid x)}[\log p_\theta(x\mid z)] - D_{\mathrm{KL}}\big(q_\phi(z\mid x)\;\|\;p(z)\big)

This objective balances two goals:

  1. Reconstruction quality: Make the decoded output likely given the sampled latent representation.
  2. Latent regularization: Keep the approximate latent distribution related to a chosen prior, often a standard normal distribution.

The encoder parameters are represented by ϕ\phi and the decoder parameters by θ\theta. The KL-divergence term connects directly to Entropy, Cross-Entropy, and KL Divergence.

Why the latent space matters

A learned latent space can support interpolation and controlled variation. For example, two latent vectors corresponding to different handwritten digits may be interpolated to explore intermediate decoded shapes. These intermediate outputs are not guaranteed to be meaningful, but they help illustrate how VAEs organize variation.

VAEs are useful in representation learning, probabilistic generation, and some image and scientific-data applications. Depending on the architecture and objective, outputs may be less visually sharp than those from competing high-fidelity generation methods.

6. Diffusion models

A diffusion model learns to generate examples by reversing, or otherwise modeling, a gradual noise-related process. In a common image-generation formulation, training progressively corrupts images with noise, and the model learns information needed to reverse that corruption.

Forward and reverse processes

  • Forward process: Add increasing amounts of noise to a clean training example over a sequence of steps.
  • Learned reverse process: Estimate how to transform a noisy representation toward a sample consistent with the learned data distribution.

During inference, many diffusion systems begin from random noise and perform a series of learned denoising steps. A conditional image generator may use a text representation to influence those steps.

A common forward-noising formulation is:

q(xt∣x0)=N(αˉt x0,  (1−αˉt)I)q(x_t\mid x_0) = \mathcal{N}\left(\sqrt{\bar{\alpha}_t}\,x_0,\;(1-\bar{\alpha}_t)I\right)

Here x0x_0 is a clean example, xtx_t is its noisy version at step tt, and αˉt\bar{\alpha}_t controls the remaining signal. The equation is specific to a common Gaussian diffusion formulation, not every generative approach that uses the term diffusion.

What diffusion models do well

Diffusion-based methods have been particularly influential in image synthesis and editing. They often provide strong image quality and can support conditioning, inpainting, and other controlled-generation workflows. Some systems perform many sampling steps, which can increase inference cost, although accelerated samplers and alternative formulations can reduce the number of steps.

Important: A diffusion model does not merely apply a conventional photo-denoising filter. Its learned iterative process is used to sample new content from a learned distribution.

7. Comparing the four major model families

FamilyCore generation mechanismCommon use casesCommon challenge
AutoregressiveGenerate each element conditioned on earlier elementsText, code, sequential audioSequential decoding latency
GANGenerator competes with a discriminatorImages, image translationTraining instability and mode collapse
VAESample a latent representation and decodeRepresentation learning, reconstruction, synthetic dataReconstruction–regularization trade-offs
DiffusionLearn and sample through a noise-related reverse processImage synthesis and editing, other modalitiesMulti-step sampling cost

These families can be combined. For instance, a system may use an autoencoder to represent images in a compact latent space and a diffusion model to generate those latent representations. A product may also combine a language model with a separate image-generation model.

8. A small Python example: autoregressive sampling

The following code illustrates sequential generation from a handwritten probability table. It is not a trained language model; its purpose is to show why each generated token depends on the previous context.

import random

transitions = {
    "<start>": [("AI", 0.6), ("Models", 0.4)],
    "AI": [("generates", 1.0)],
    "Models": [("generate", 1.0)],
    "generates": [("text", 0.5), ("images", 0.5)],
    "generate": [("outputs", 1.0)],
    "text": [("<end>", 1.0)],
    "images": [("<end>", 1.0)],
    "outputs": [("<end>", 1.0)],
}

rng = random.Random(7)
current = "<start>"
result = []

for _ in range(10):
    options = transitions[current]
    tokens = [token for token, probability in options]
    probabilities = [probability for token, probability in options]
    current = rng.choices(tokens, weights=probabilities, k=1)[0]

    if current == "<end>":
        break
    result.append(current)

print(" ".join(result))

The sampler selects an element from a conditional distribution and repeats until an end token appears. A trained neural language model replaces the hardcoded table with probabilities computed from learned parameters and a much larger context.

What this example does not demonstrate

  • There is no dataset or training procedure.
  • It uses only the immediately preceding token as state.
  • It cannot generalize beyond the explicitly listed transitions.
  • It does not implement a Transformer or represent real LLM output quality.

Those distinctions matter: generating a sequence is not by itself evidence that a system has learned language.

9. How generative systems are evaluated

A generated sample may be fluent or visually appealing without being correct, diverse, or useful. Evaluation therefore depends on the task and the conditions under which the system will operate.

DimensionQuestion to investigate
Quality or fidelityDoes the output resemble a plausible example of the target type?
DiversityDoes the model produce a useful variety of outputs rather than repeating a narrow pattern?
Conditional relevanceDoes the output follow the prompt or other supplied condition?
Factual reliabilityAre factual claims correct and supported where necessary?
SafetyDoes the system avoid unacceptable harmful or privacy-violating behavior?
GeneralizationDoes performance hold on representative unseen prompts or data?
EfficiencyWhat are the inference latency, memory requirements, and cost?

Automated metrics can help, but no single score establishes overall usefulness. Human review and task-specific evaluation remain important, especially for open-ended generated content.

10. Risks and practical limitations

Hallucination and factual errors

A text generator can produce a plausible statement without verifying it against an authoritative source. Generation quality should not be confused with factual accuracy. Systems dealing with changing or private information may use Retrieval-Augmented Generation to provide relevant external context, although retrieval does not guarantee a correct answer.

Bias and unsuitable training data

A generative system can learn and reproduce stereotypes, mistakes, or other undesirable patterns present in its data. Dataset quality, evaluation, and deployment controls matter as much as architecture.

Memorization and privacy

Generative models may sometimes reproduce training examples or sensitive information. Responsible development includes appropriate data collection, access controls, privacy testing, and output safeguards.

Cost and computational constraints

Training advanced models may require substantial computation and data. Inference costs vary with model size, modality, input length, output length, and the generation process. A small, task-specific system can sometimes provide better engineering value than a very large general-purpose model.

The limits of model-family labels

Model families are useful categories, but modern architectures are increasingly hybrid. The practical question is not which label sounds most advanced. It is which modeling objective, data representation, generation method, and evaluation process fit the task.

11. Choosing a generative approach

Before selecting a model, determine:

  1. Output modality: Does the application generate text, images, audio, structured data, or multiple modalities?
  2. Conditioning: Must it obey a prompt, use reference material, or modify an existing input?
  3. Quality requirements: Which errors are tolerable, and how will outputs be assessed?
  4. Data and compute budget: Is training necessary, or can a pretrained model be integrated?
  5. Deployment constraints: What latency, memory, privacy, and reliability limits apply?

For a document assistant, adapting or integrating an existing language model may be more practical than training one from scratch. For custom synthetic image generation, an image-specific generative model may be a better starting point. The model family alone does not settle the decision: data, licensing, safety, and operational requirements also matter.

12. Connections to other PlainCS concepts

Some linked articles are planned parts of the AI Knowledge Map and may not yet be published.

References and further reading

  1. Goodfellow, I., Bengio, Y., & Courville, A. Deep Learning, Chapter 20: Deep Generative Models. Deep Learning book.
  2. Goodfellow, I., et al. (2014). Generative Adversarial Nets. NeurIPS paper.
  3. Kingma, D. P., & Welling, M. (2013). Auto-Encoding Variational Bayes. arXiv:1312.6114.
  4. Ho, J., Jain, A., & Abbeel, P. (2020). Denoising Diffusion Probabilistic Models. NeurIPS paper.
  5. Vaswani, A., et al. (2017). Attention Is All You Need. arXiv:1706.03762.

Related articles in

Image preview

Fit