siddhant

Encyclopedia

Generative AI

A systematic encyclopedia of generative models, foundation models, large language models, multimodal systems, diffusion, retrieval-augmented generation, alignment, evaluation, and production systems.

By Siddhant Krishna · Published 2026-10-06 · Updated 2026-10-06

Contents

  1. 01Definition
  2. 02Taxonomy
  3. 03Foundation Models
  4. 04Large Language Models
  5. 05The Generative AI Training Pipeline
  6. 06Attention and Context
  7. 07Text Generation
  8. 08Multimodal Generative AI
  9. 09Diffusion Models
  10. 10GANs and VAEs
  11. 11Retrieval-Augmented Generation
  12. 12Instruction Tuning and Alignment
  13. 13Prompting and In-Context Learning
  14. 14Generative Models as Components of Agents
  15. 15Evaluation
  16. 16Hallucination and Reliability
  17. 17Safety and Risk
  18. 18Inference Engineering
  19. 19Open Problems

Subtopics

01

Definition

Generative AI refers to models designed to produce new samples that resemble, continue, transform, or condition on data from a learned distribution. The generated object may be text, an image, audio, video, software source code, molecular structure, 3D geometry, or another machine-readable representation.

Generation is distinct from ordinary classification. A classifier estimates a label or decision; a generative model attempts to represent enough structure in the data to construct new outputs.

p(x),   p(x|c),   p(x,y),   or   p(x_t | x_{<t})

02

Taxonomy

  • Autoregressive models: generate elements sequentially according to conditional probabilities.
  • Latent-variable models: introduce hidden representations from which observations can be reconstructed or sampled.
  • Adversarial models: train a generator against a discriminator.
  • Diffusion models: learn a reverse process that transforms noise into structured samples.
  • Retrieval-augmented systems: combine learned parametric representations with externally retrieved information.
  • Multimodal foundation models: jointly operate over more than one modality.

These categories describe modeling mechanisms rather than mutually exclusive product categories. A production system can combine a transformer, retrieval, tool use, fine-tuning, and specialized generation modules.

03

Foundation Models

A foundation model is trained on broad data at scale and subsequently adapted to many downstream tasks. The concept emphasizes reuse: one pretrained representation can support prompting, fine-tuning, retrieval, classification, generation, or tool-mediated applications.

Large-scale pretraining changes the economics of machine learning. Instead of building one supervised model for every task, developers can start from a general pretrained model and specialize it for particular contexts.

  • Pretraining establishes broad representations and statistical regularities.
  • Post-training changes behavior, instruction following, preferences, or task specialization.
  • Application layers add retrieval, tools, memory, orchestration, safety controls, and domain-specific interfaces.

04

Large Language Models

A language model assigns probabilities to sequences of tokens. In an autoregressive formulation, the joint probability of a sequence can be factorized as:

P(x_1,...,x_T) = ∏_{t=1}^{T} P(x_t | x_1,...,x_{t-1})

Large language models increase model capacity, training data, and compute, then use the resulting learned representations for generation and in-context adaptation. GPT-3 demonstrated that scaling an autoregressive language model could substantially improve few-shot performance without gradient updates for each task.

  • Tokenization converts raw text into model-readable symbols.
  • Embeddings represent tokens and contextual information in continuous vector spaces.
  • The transformer processes relationships between tokens through attention.
  • The output head converts hidden states into a probability distribution over the vocabulary.

05

The Generative AI Training Pipeline

Modern generative systems normally involve several distinct phases rather than a single training operation.

  • Data acquisition and filtering.
  • Deduplication, normalization, and quality control.
  • Tokenization or modality-specific encoding.
  • Large-scale pretraining.
  • Supervised fine-tuning or instruction tuning.
  • Preference optimization or reinforcement learning.
  • Evaluation, red-teaming, deployment, and continuous monitoring.

The distinction between training and inference is fundamental. Training updates model parameters using data and an optimization objective. Inference keeps parameters fixed while computing outputs for new inputs.

06

Attention and Context

The transformer introduced an architecture based on attention rather than recurrence as the primary mechanism for sequence interaction. Self-attention allows each token representation to incorporate information from other positions.

Attention(Q,K,V) = softmax(QKᵀ / √d_k)V

A practical language model is constrained by its context representation and computational budget. Increasing context length can enable longer documents and richer interaction, but does not automatically guarantee reliable reasoning, retrieval, or faithful use of every piece of context.

  • Queries represent information being sought by a position.
  • Keys determine which representations are relevant.
  • Values carry the information aggregated by attention.
  • Positional information distinguishes token order.

07

Text Generation

Generation is a repeated sampling or selection process. After predicting the next-token distribution, the chosen token is appended to the context and the model predicts again.

  • Greedy decoding selects the highest-probability token at each step.
  • Temperature modifies the sharpness of the probability distribution.
  • Top-k restricts sampling to a fixed number of high-probability tokens.
  • Top-p restricts sampling to a probability-mass nucleus.
  • Beam search maintains several candidate sequences and is more common in structured sequence generation than in open-ended conversational generation.

08

Multimodal Generative AI

Multimodal models process or generate multiple data modalities, such as text, images, audio, video, or structured sensor information.

  • Vision-language models map visual and textual information into compatible representations.
  • Speech systems may combine acoustic encoders with language-model components.
  • Text-to-image systems condition generation on textual representations.
  • Video generation extends the problem to spatial and temporal consistency.
  • Multimodal assistants can coordinate perception, language, and tool use.

Multimodality introduces additional alignment problems: an output may be linguistically coherent while failing to preserve visual, temporal, physical, or semantic constraints.

09

Diffusion Models

Diffusion models generate data by learning a reverse denoising process. During the forward process, structured data is progressively corrupted with noise; the learned reverse process attempts to recover a plausible sample.

x_0 → x_1 → ... → x_T ≈ noise
noise → x_{T-1} → ... → x_0

Denoising diffusion probabilistic models established a powerful framework for high-quality image synthesis. Later improvements reduced sampling cost and improved likelihood and generation quality.

  • Forward diffusion defines a corruption process.
  • A neural network predicts information needed for denoising.
  • Sampling iteratively follows the learned reverse process.
  • Conditioning can steer the generated sample toward text, class labels, images, or other information.

10

GANs and VAEs

Generative Adversarial Networks

GANs train a generator and discriminator in opposition. The generator attempts to produce samples that appear to come from the data distribution, while the discriminator attempts to distinguish generated from real examples.

min_G max_D  E_{x~p_data}[log D(x)] + E_{z~p(z)}[log(1-D(G(z)))]

Variational Autoencoders

VAEs use latent variables and optimize a variational lower bound. An encoder produces a distribution over latent representations and a decoder reconstructs or generates observations from sampled latent variables.

ELBO = E_q(z|x)[log p(x|z)] - KL(q(z|x) || p(z))

Both GANs and VAEs remain historically important because they illustrate two different approaches to controllable generative modeling: adversarial learning and probabilistic latent-variable inference.

11

Retrieval-Augmented Generation

Retrieval-augmented generation separates some knowledge from model parameters. A retriever searches an external corpus and supplies relevant passages to a generator.

query → retriever → documents → context → generator

The original RAG formulation combined pretrained parametric memory with a dense vector index accessed through a neural retriever. This architecture addresses a central limitation of purely parametric models: factual knowledge stored in parameters can be difficult to update, inspect, or precisely retrieve.

  • Document ingestion and chunking.
  • Embedding or indexing.
  • Query transformation.
  • Candidate retrieval.
  • Reranking or filtering.
  • Context construction.
  • Grounded generation.
  • Citation and provenance handling.

12

Instruction Tuning and Alignment

Pretrained language models learn statistical structure from their training distribution, but the pretraining objective does not by itself guarantee that responses will follow user instructions or desired behavioral constraints.

Instruction tuning uses supervised examples demonstrating desired responses. Preference-based methods then optimize models toward outputs preferred by humans or other evaluators.

  • Supervised fine-tuning teaches explicit task and response formats.
  • Preference datasets provide relative judgments between candidate outputs.
  • Reward models can approximate those preferences.
  • RLHF uses reinforcement learning to optimize against a learned reward signal.
  • Other preference-optimization methods can optimize preference data without the exact same reinforcement-learning pipeline.

13

Prompting and In-Context Learning

A prompt is an inference-time specification of the task, context, constraints, or desired response format. In-context learning allows a pretrained model to infer a task from examples or instructions placed directly in the context.

  • Zero-shot prompting provides instructions without examples.
  • One-shot prompting provides one demonstration.
  • Few-shot prompting provides multiple demonstrations.
  • Structured prompting specifies output schemas or intermediate constraints.
  • Tool-oriented prompting describes available actions and execution policies.

Prompt engineering is therefore an interface-design problem as well as a linguistic one. Reliability depends on task specification, context quality, model capability, decoding, evaluation, and surrounding system controls.

14

Generative Models as Components of Agents

A generative model can act as the language or decision-making component inside a larger agentic system. The surrounding system can provide tools, memory, retrieval, planning, execution, and observation.

  • Model: produces predictions or candidate actions.
  • Tools: perform actions outside the model.
  • Memory: preserves selected information across interactions.
  • Retrieval: accesses external knowledge.
  • Planner or controller: decomposes and sequences tasks.
  • Verifier: evaluates outputs or intermediate results.

An agent should therefore be analyzed as a system rather than simply as a model. Tool permissions, state handling, verification, failure recovery, and termination conditions can dominate real-world reliability.

15

Evaluation

Generative systems require evaluation at multiple levels because a single benchmark rarely captures usefulness, factuality, safety, latency, cost, or robustness.

  • Task accuracy and benchmark performance.
  • Human preference and instruction following.
  • Factuality and groundedness.
  • Hallucination and contradiction rates.
  • Robustness to adversarial or malformed inputs.
  • Safety and policy compliance.
  • Latency, throughput, memory, and inference cost.
  • Long-context and multi-turn behavior.

Benchmark contamination, benchmark saturation, evaluator bias, and distribution shift complicate comparisons. Stanford's 2026 AI Index specifically notes that evaluation practices are struggling to keep pace with frontier-model development.

16

Hallucination and Reliability

A generative model can produce fluent output that is unsupported, incorrect, or internally inconsistent. This behavior is commonly described as hallucination, although different benchmarks operationalize the term differently.

  • Parametric generation can reproduce learned associations without verifying them against external evidence.
  • Retrieval can provide incorrect, stale, or irrelevant evidence.
  • A model can misinterpret correct evidence.
  • Generation can introduce claims that were absent from retrieved context.
  • Long reasoning chains can accumulate errors.

17

Safety and Risk

Generative AI introduces risks including misinformation, privacy leakage, security vulnerabilities, harmful content generation, intellectual-property disputes, bias, impersonation, and misuse at scale.

NIST's Generative AI Profile extends the AI Risk Management Framework with lifecycle-oriented considerations specific to generative systems. Risk management requires identifying, measuring, and responding to risks rather than assuming model behavior can be solved entirely through training.

  • Risk identification before deployment.
  • Data governance and provenance.
  • Adversarial testing and red-teaming.
  • Access controls and abuse monitoring.
  • Human oversight for consequential decisions.
  • Incident response and post-deployment monitoring.

18

Inference Engineering

Deployment introduces a second optimization problem after model training. The objective becomes delivering useful generation within latency, memory, throughput, reliability, and cost constraints.

  • Quantization reduces numerical precision to decrease memory and compute requirements.
  • Batching increases hardware utilization under suitable workloads.
  • Caching avoids recomputation of repeated computation or context.
  • Speculative decoding can use a smaller model to accelerate generation from a larger model.
  • Model routing chooses different models according to task requirements.
  • Distillation transfers behavior into a smaller model.

Production generative AI is consequently a systems-engineering problem involving models, GPUs or accelerators, networking, storage, observability, APIs, security, and product design.

19

Open Problems

  • Reliable reasoning and planning.
  • Grounded generation with verifiable provenance.
  • Efficient long-context processing.
  • Persistent memory without uncontrolled information retention.
  • Robust multimodal understanding and generation.
  • More sample-efficient post-training.
  • Lower-cost inference and training.
  • Evaluation beyond saturated benchmarks.
  • Interpretability and mechanistic understanding.
  • Reliable autonomous tool use.
  • Security against prompt injection and indirect attacks.
  • Alignment under distribution shift.

Generative AI is progressing rapidly, but increased capability does not imply solved reliability, controllability, or understanding. The central research problem is increasingly the design of dependable systems around increasingly capable generative models.

References

  1. Vaswani et al. (2017), Advances in Neural Information Processing Systems.
    https://arxiv.org/abs/1706.03762
  2. Brown et al. (2020), Advances in Neural Information Processing Systems.
    https://arxiv.org/abs/2005.14165
  3. Kingma & Welling (2013).
    https://arxiv.org/abs/1312.6114
  4. Goodfellow et al. (2014), NeurIPS.
    https://arxiv.org/abs/1406.2661
  5. Ho, Jain & Abbeel (2020).
    https://arxiv.org/abs/2006.11239
  6. Lewis et al. (2020).
    https://arxiv.org/abs/2005.11401
  7. Ouyang et al. (2022).
    https://arxiv.org/abs/2203.02155
  8. NIST AI 600-1 (2024; updated 2026).
    https://www.nist.gov/publications/artificial-intelligence-risk-management-framework-generative-artificial-intelligence
  9. Stanford Institute for Human-Centered Artificial Intelligence (2026).
    https://hai.stanford.edu/ai-index/2026-ai-index-report

Knowledge

Explore what I'm learning.

AI, machine learning, robotics, computer science, science, technology and everything in between.

↗