生成式AI导论:概念演进与技术版图
Chapter 1: Introduction to Generative AI — Concept Evolution and Technology Landscape
The distinction between understanding the world and creating it defines one of the most fundamental divides in artificial intelligence. When a model learns to classify an image as containing a cat or a dog, it operates within the realm of comprehension—recognizing patterns that already exist, mapping observations to predefined categories. This is discriminative modeling, the workhorse of modern computer vision and natural language processing for the past two decades. But when a model generates an entirely new image of a cat that has never existed, composed of pixel arrangements that no camera has ever captured, it ventures into the territory of creation itself. This chapter explores the conceptual foundations, historical development, and current technological landscape of generative artificial intelligence—the branch of AI dedicated not merely to recognizing what is, but to imagining what could be.
The Fundamental Distinction: Discriminative versus Generative Models
Understanding generative AI requires first grasping the philosophical and mathematical differences between two complementary approaches to machine learning. Discriminative models and generative models, while often using similar underlying architectures, pursue fundamentally different objectives that reflect distinct perspectives on what it means to "understand" data.
Discriminative models, as their name suggests, focus on learning the boundaries between different categories. In statistical terms, a discriminative model learns the conditional probability distribution $P(y|x)$, where $x$ represents the input data and $y$ represents the class label. The model asks: "Given this input, what is the probability that it belongs to each of my predefined categories?" A spam classifier using this approach learns the characteristics that distinguish spam from legitimate email—not the essence of what makes an email spam, but rather the statistical surface that differentiates it from non-spam. The model builds a decision boundary in the feature space, effectively learning where to draw lines between categories.
Generative models, in contrast, learn the joint probability distribution $P(x, y)$ or, in the unsupervised setting, the distribution of the data itself $P(x)$. Rather than learning to discriminate between categories, generative models learn the underlying structure and patterns that characterize a particular type of data. A generative model trained on images of cats learns the internal rules—the statistical regularities—that govern what makes an image look like a cat. It learns the probability distribution over the space of all possible cat images, understanding not just how to classify a cat, but how to create one. When such a model generates a new image, it samples from the learned distribution, producing an output that is statistically consistent with the training data but does not correspond to any specific training example.
The mathematical implications of this distinction are profound. Consider a discriminative classifier for handwritten digits. It learns a function $f: \mathbb{R}^{784} \to \{0, 1, ..., 9\}$ that maps from the 784-dimensional pixel space to one of ten digit categories. Its knowledge is encapsulated in decision boundaries that separate the digit classes. Now consider a generative model for the same task. It learns a probability distribution $P(x)$ over the 784-dimensional space of all possible 28×28 images, with high probability density concentrated in regions that correspond to recognizable handwritten digits. To generate a new digit, the model samples from this distribution. To classify an existing digit, it can compute the likelihood under different digit-specific distributions—a fundamentally different computational strategy.
This generative approach offers several theoretical advantages. Generative models can potentially handle missing data more gracefully, as they model the full data distribution rather than just the conditional relationships. They can provide more interpretable representations, as understanding the data distribution often requires learning interpretable latent factors. Perhaps most significantly, generative models naturally support the generation of new samples—the capability that has captured both scientific attention and public imagination.
The practical gap between these approaches has, until recently, been enormous. Discriminative models achieved human-level or superhuman performance on image classification tasks by the early 2010s, while generative models struggled to produce anything resembling realistic images. The challenge of generation—essentially, the challenge of creating coherent, high-dimensional data from a learned probability distribution—proved extraordinarily difficult. This chapter traces how researchers gradually bridged this gap, moving from simple parametric distributions through increasingly sophisticated deep learning architectures to arrive at today's powerful generative systems.
Historical Evolution of Generative Models
The story of generative AI is not a simple narrative of steady progress. It is marked by paradigm shifts, abandoned approaches, and the gradual accumulation of insights that only later revealed their significance. Understanding this history illuminates both the current state of the field and the principles that guide its development.
Early Statistical Approaches
The earliest generative models in machine learning were relatively simple parametric distributions. Gaussian mixture models (GMMs), for instance, represent complex data distributions as weighted combinations of Gaussian distributions. While mathematically tractable, these models suffered from a fundamental limitation: they assumed specific parametric forms for the data distribution that rarely matched the true complexity of real-world data. A GMM with hundreds of components might approximate the distribution of handwritten digits, but it would do so through a crude discretization, unable to capture the intricate geometric and semantic structure of the data.
Hidden Markov Models (HMMs) represented another early approach, particularly successful for sequential data like speech. These models assume that observations are generated by a sequence of hidden states, with transitions between states governed by probabilistic rules. An HMM trained on speech signals learns the statistical patterns of phonemes and their transitions, enabling both recognition and synthesis of speech. The generative nature of HMMs—producing observable sequences from hidden state sequences—made them foundational to early speech processing, though their limited expressiveness eventually gave way to more powerful approaches.
Naive Bayes classifiers, despite their name, embodied the generative modeling philosophy with particular clarity. These models estimate $P(x|y)$ by assuming conditional independence between features given the class—a strong assumption that renders the model mathematically tractable. While rarely competitive with discriminative approaches for classification accuracy, naive Bayes models demonstrate the generative paradigm: estimate how each class generates the data, then use Bayes' rule to invert the relationship for classification.
The Rise of Latent Variable Models
The inadequacy of simple parametric distributions drove interest in latent variable models—architectures where observed data is explained through unobserved (latent) variables that capture underlying structure. These models posited that observed data arises from a two-step process: first, a latent variable is sampled from some simple distribution, and then the observed data is generated from a conditional distribution parameterized by this latent variable.
The expectation-maximization (EM) algorithm provided the primary tool for fitting such models. By iteratively updating estimates of