skip to content

Search

← From Noise to Image

Part I — Before Diffusion (2006–2020)

The Generative Problem

What modeling p(x) means, density versus sampling, and why image generation stalled until deep learning's revival.

2006–2013 14 min read 2 papers

It is 2006. A neural network with a bottleneck eleven times narrower than its input learns to compress a handwritten digit down to thirty numbers and reconstruct it more faithfully than three decades of linear methods had managed. Nothing about that network, however, defines a probability distribution it can draw a fresh digit from — it can only echo back what it is shown. The gap between compressing what already exists and generating what could exist is the subject of this chapter, and of most of the book that follows.

Where We Were

A generative model of images has two jobs, and before 2006 no method did both of them well on anything resembling a photograph. The first job is density estimation: assign a number, p(x)p(x), to every possible image xx, high for images that look like the training data and low for images that do not. The second job is sampling: actually produce a new xx drawn from that distribution, one that was not in the training set but is recognizably the same kind of thing. A histogram over pixel values can estimate a crude density. A lookup table can “sample” by replaying training examples. Neither does anything a person would call imagining a picture.

The classical toolkit for the first job was built on Gaussian assumptions. Principal component analysis (PCA) finds the linear subspace that captures the most variance in a dataset and treats deviation from that subspace as noise; a mixture of Gaussians extends the same idea to a handful of clusters. Both are density estimators in a strict sense — each assigns a likelihood to a data point — and both are exactly solvable with linear algebra, no iterative training required. Natural images defeat them for a simple structural reason: the manifold of “images that look like faces” or “images that look like handwritten sevens” is nonlinear, curved through pixel space in a way no flat subspace or bell-curve cluster can trace. Compressing a face to thirty numbers with PCA blurs the eyes into the eyebrows; the linear model has no way to represent that a rotated nose and a shifted mouth are both small, structured changes rather than large, unstructured ones.

The alternative toolkit, older than PCA in one sense and newer in its practical form, was the Boltzmann machine: a network of binary units connected by symmetric weights, in which every joint configuration of units has an energy, and every configuration’s probability is a simple function of that energy. Unlike PCA, a Boltzmann machine can in principle do both jobs — it defines a genuine joint distribution over its units, and that distribution can be sampled by letting the network settle stochastically toward low-energy states. In practice, training a general Boltzmann machine required a form of statistical estimation that scaled miserably with the number of units, and stacking several layers of them to build a deep model made the required sampling exponentially harder still. Restricting the connections so that no two visible units and no two hidden units connect to each other — the restricted Boltzmann machine (RBM) — made a single layer tractable to train with a fast approximate procedure. Composing several such layers into something deep remained, through the 1980s and 1990s, a problem without a practical answer. Layer count in generative models of images stayed at one or two.

Two further pieces of context, dated precisely by the master timeline: the ImageNet dataset would not be published until 2009, and the GPU-trained convolutional network that would win a competition built on it would not arrive until 2012. Both belong to a different problem — classifying images into categories — that this book’s companion volume covers from the hardware side. The generative problem this chapter tracks ran on a slower clock, waiting less for a bigger dataset than for a way to train something deeper than one or two layers of Boltzmann units.

Two jobs, a century of tools, one breakthrough in depth Assign a probability to every image, then draw a new one. Before 2006 nothing learned did both beyond one or two layers. Grey monospace text is the chapter's number or verdict for that year. 1901 Principal components the flattest subspace that explains the most variance 30 dims on MNIST: error 135 blurs eyes into eyebrows 1985 Boltzmann machines every joint state has an energy, so a probability Z sums every configuration exponential in unit count 1986 Restricted Boltzmann no links within a layer, so one layer trains fast one or two layers, no more for twenty years 2006 Deep belief net stacked RBMs, sampled top down to the pixels MNIST 1.25% vs SVM 1.4% Hinton, Osindero, Teh 2009 ImageNet a benchmark for labelling pictures, not making them 3.2M labelled images no generative counterpart 2012 AlexNet GPU convnet wins the classification contest the other problem's win on two gaming GPUs 2013 Variational inference makes the code random and the network still trainable the VAE: next chapter sampling half, reframed one job, or both at one or two layers only density and sampling from a deep model a milestone for classification, not generation Classification and generation ran on different clocks: the coral cards belong to the companion volume, not to this problem.
A century of density estimators and one breakthrough in depth. The coral cards belong to the classification problem and the companion volume; the generative problem ran on its own, slower clock. PNG ↓

The Breakthrough

In 2006, three researchers at the University of Toronto solved the depth problem for Boltzmann-style generative models, and a fourth collaboration from the same lab reused the solution for a narrower, non-generative purpose — and the contrast between the two turned out to be more instructive than either result alone.

Geoffrey Hinton, Simon Osindero, and Yee-Whye Teh showed that a stack of RBMs, each trained on the hidden-unit activities produced by the layer below it, can be composed into a single deep model — a deep belief net (DBN) — whose top two layers form an undirected associative memory and whose lower layers form a chain of directed generative connections down to the pixels (Hinton, Osindero, and Teh, 2006). The greedy, layer-by-layer training procedure sidesteps the intractable joint estimation that had stalled deep Boltzmann machines for two decades, and the paper proves that adding each new layer, trained this way, is guaranteed under mild conditions to improve a bound on how well the composite model explains the training data. Fine-tuned with a contrastive version of the wake-sleep algorithm, their network classified MNIST digits with a reported 1.25 percent test error, edging out a contemporary support vector machine’s 1.4 percent — a result that helped reopen the field’s interest in deep architectures after roughly two decades in which “neural network” was mostly a term for a plateau rather than a frontier.

What made the DBN a genuine generative model, rather than merely a good classifier, is that the same network runs in reverse. Starting from a sample drawn from the top-layer associative memory and propagating downward through the directed connections produces a new, recognizable digit image that was never in the training set — ancestral sampling through a learned hierarchy, the second job of a generative model, done for the first time by a network with more than one or two effective layers. The full layer-wise training recipe, and the reason it needed one — the CPU hardware of 2006 could not have trained the deep joint model directly at any usable speed — is covered in The Hardware Lottery, which treats this same paper as a case study in algorithm and machine arriving out of step.

Geoffrey Hinton and Ruslan Salakhutdinov then pointed the identical pretraining trick at a different target. Instead of composing the stacked RBMs into a top-heavy associative memory, they unrolled the stack into a symmetric encoder-decoder — an 784-1000-500-250-30 network for 28-by-28 MNIST digits, encoding down to a 30-dimensional code and decoding back up to 784 pixels — and fine-tuned the whole thing end to end with ordinary backpropagation to minimize reconstruction error (Hinton and Salakhutdinov, 2006). On MNIST test images, the resulting deep autoencoder reached an average squared reconstruction error of 126 at a 30-dimensional bottleneck, against 135 for 30-dimensional PCA on the same data — a real but modest margin that mattered less than what it demonstrated: without the RBM-based layer-wise pretraining to find good starting weights, backpropagation alone gets stuck and cannot train a network this deep to reconstruct well at all. The same paper applied the technique to face images and to text-document retrieval, using the learned low-dimensional code as a compact fingerprint for nearest-neighbor lookup.

The 2006 deep autoencoder: 784 pixels squeezed to 30 numbers and back Band width is proportional to the layer's unit count. Each layer began life as an RBM; backpropagation then fine-tuned the whole hourglass for reconstruction. Grey monospace text is the unit count of each layer. ENCODER CODE DECODER 784 units the 28 by 28 input digit 1000 units wider than the input: an RBM layer 500 units 250 units 30 units a fingerprint for lookup, not a sample 250 units 500 units 1000 units mirror of the encoder weights 784 units reconstruction, error 126 vs PCA 135 pixels in, pixels out layers pretrained one RBM at a time the 30-number code, with no distribution over it The network only ever runs from a real image to its copy. The deep belief net built from the same layers runs from its top layer down to fresh pixels.
Twenty-six pixels of input for every number in the code. The hourglass is the best compressor of its day, and it only ever runs from a real image to its copy. PNG ↓

Here is the contrast the chapter is named for. The deep belief net is a probability distribution: query it for p(x)p(x), or run it forward from noise to get a new xx. The deep autoencoder, initialized with the exact same stack of pretrained RBMs, is a deterministic function: feed it an xx, get back a code and a reconstruction, and get nothing at all if you feed it noise instead of a real image — there is no probability distribution over its 30-dimensional codes to sample from. One 2006 paper solved the generative problem, in miniature, for small binary images. The other paper borrowed its machinery to build the best compressor of its day and, in doing so, made unmistakably clear that compression and generation are not the same capability, however similar the training recipes look.

One pretraining recipe, two machines, only one of them generative The identical stack of RBMs becomes a probability distribution or a deterministic compressor, depending on what is bolted on top. Grey monospace text names the paper, layer sizes or number behind each step. THE GENERATIVE BRANCH THE COMPRESSION BRANCH Pretrained RBM stack one greedy layer at a time, on 2006 CPUs the same weights feed both compose unroll Build a deep belief net top two layers form a memory, lower layers point downward Hinton, Osindero, Teh 2006 Sample top down draw from the memory, follow the directed links to pixels ancestral sampling A new digit appears never in the training set, recognisably a seven as a classifier: 1.25% error Unroll to autoencoder encoder down to 30 numbers, mirror decoder back up 784-1000-500-250-30 Fine-tune with backprop minimise squared pixel error end to end, whole stack MNIST error 126 vs PCA 135 Nothing to sample feed it noise, get noise: no distribution over codes compression is not generation but built once, reused by both the model shape chosen what works the capability that is missing, however good the compressor
The same pretrained weights, two machines. Only the branch that defines a distribution can run from noise to a new image; the better compressor cannot. PNG ↓

The Mathematics

Every generative model in this book is, at bottom, an attempt to solve the same fitting problem: choose parameters θ\theta that make a model distribution assign high probability to observed data.

θ∗=arg⁡max⁡θ∑i=1Nlog⁡pθ(xi)\theta^{*} = \arg\max_{\theta} \sum_{i=1}^{N} \log p_{\theta}(x_i)
SymbolMeaning
θ\thetathe parameters of the model being fit
NNthe number of training images
xix_ithe ii-th training image
pθp_{\theta}the model’s distribution over images, as a function of θ\theta

An RBM instantiates pθp_\theta concretely, over a set of visible units xx (the pixels) and hidden units hh (learned binary features), by way of an energy function:

p(x,h)=1Zexp⁡(−E(x,h)),E(x,h)=−a⊤x−b⊤h−x⊤Whp(x, h) = \frac{1}{Z}\exp\left(-E(x, h)\right), \qquad E(x, h) = -a^{\top}x - b^{\top}h - x^{\top}Wh
SymbolMeaning
xxvisible units — the observed pixels or features
hhhidden units — learned binary latent features
WWweight matrix connecting visible and hidden units
a,ba, bbias vectors for the visible and hidden units
E(x,h)E(x, h)the energy of a joint configuration; lower means more probable
ZZthe partition function, summed over every possible configuration

The deep autoencoder that Hinton and Salakhutdinov fine-tuned optimizes a much simpler, deterministic objective:

L(θ)=1N∑i=1N∥xi−gθ(fθ(xi))∥2\mathcal{L}(\theta) = \frac{1}{N}\sum_{i=1}^{N} \left\lVert x_i - g_{\theta}\big(f_{\theta}(x_i)\big) \right\rVert^{2}
SymbolMeaning
L(θ)\mathcal{L}(\theta)the reconstruction loss, averaged over the training set
fθf_\thetathe encoder, mapping an image to a low-dimensional code
gθg_\thetathe decoder, mapping a code back to a reconstructed image
xix_ithe ii-th training image
NNthe number of training images

What It Enabled

Neither 2006 paper produced anything that generated a convincing photograph, and neither was meant to. What they established was the vocabulary and the fault line the rest of this book’s first act runs along: a model can define a density, or support sampling, or compress well, and 2006 was the first time a single family of learned, multi-layer networks could be pointed at any one of those three jobs at will — just not, yet, at all three simultaneously for anything more complex than small grayscale digits and faces.

CapabilityPCA / Gaussian mixtureRBM / deep belief net (2006)Deep autoencoder (2006)Where it gets resolved together
Defines an explicit density p(x)p(x)yes, but poorly fits nonlinear manifoldsyes, via the energy functionnoVariational Autoencoders
Exact, tractable normalizationyes (closed form)no — ZZ is intractable beyond tiny networksnot applicableGenerative Adversarial Networks sidesteps likelihood entirely
Can sample a genuinely novel xxyes, but samples look blurred and genericyes, by ancestral sampling downwardno — no distribution over its codesBoth chapters above, then Diffusion Foundations
Learns nonlinear latent structurenoyes, via stacked hidden layersyes, via the 30-dimensional bottleneckCarried forward as “latent space” in every later chapter
Practical image scale, mid-2000ssmall, low-resolutionsmall binary or grayscale imagessmall grayscale imagesNatural photographs wait for the chapters above

The evaluation problem this era exposed turned out to be just as durable as the modeling problem. There was, in 2006, no agreed way to score how good a generative model’s samples looked to a person, and the two candidate proxies each failed differently.

Evaluation methodWhat it measuresWhere it fails
Held-out log-likelihoodhow much probability the model assigns to unseen real dataa model can maximize this while still producing blurry, low-quality samples; intractable to compute exactly for models like RBMs
Pixel reconstruction errorhow closely an autoencoder’s output matches its inputrewards averaging over plausible details, producing blur, and says nothing about sampling from scratch
Human inspectionperceptual realism of generated samplesdoes not scale, is not reproducible across papers, and was the de facto standard throughout this era

That gap between a number a model can be trained against and a number that tracks what a human would call a good image persisted for another decade before a dedicated perceptual metric arrived — the subject of Evaluation, Provenance, and Safety.

Where the fault line goes: three answers and one unpaid debt Each thing 2006 could not do at once became a chapter. Evaluation, the question nobody could score, waited longest. Grey monospace text names the paper and the chapter of this book that picks the thread up. THE MODELLING PROBLEM THE EVALUATION GAP The 2006 fault line a density, a sample or a compression, never all three stacked RBMs, MNIST digits and no way to score any of it A code you can draw from make the 30 numbers random the autoencoder had no p(code) Sampling without Z sidestep the likelihood entirely Z is exponential in units An exact, tractable p(x) one pixel conditioned on the last no partition function needed Variational autoencoders the encoder outputs a distribution Kingma, Welling 2013 · ch. 2 Adversarial networks a critic replaces the likelihood Goodfellow et al. 2014 · ch. 3 Pixels one at a time autoregressive image models PixelRNN, PixelCNN 2016 · ch. 5 Diffusion foundations density and samples in one model, at photograph scale ch. 8 and everything after No score for samples likelihood, pixel error and eyeballing each fail differently blur can maximise likelihood a decade A perceptual metric what a person would call good ch. 21: evaluation and safety where this chapter leaves the problem the missing capability the chapter that supplies it the question that stayed open longest Adversarial nets and pixel models did not descend from the VAE; all three answer the same 2006 shortfall from different sides.
Each thing 2006 could not do at once became a chapter of this book. Adversarial nets and pixel models did not descend from the VAE; all three answer the same shortfall from different sides, and evaluation waited longest. PNG ↓

Key Papers

PaperAuthorsYearLinkWhy it matters
Reducing the Dimensionality of Data with Neural NetworksHinton and Salakhutdinov2006doiShows RBM-based layer-wise pretraining can initialize a deep autoencoder that beats PCA at compression — and shows, by omission, that a superb compressor is not automatically a generative model
A Fast Learning Algorithm for Deep Belief NetsHinton, Osindero, and Teh2006doiSolves the depth problem for Boltzmann-style generative models, producing the first practical multi-layer network that both estimates a density and can be sampled top-down

PM Lens

Papers referenced