§16.0 A language for distributions over many variables
Part III’s research topics — RBMs, deep belief nets, deep Boltzmann machines, variational autoencoders — are all probabilistic models over thousands of variables. Before we can build them we need a way to write them down. That language is the structured probabilistic model structured probabilistic model (Graphical model) a factorization of a joint distribution described by a graph: nodes = RVs, edges = direct interaction. defined in ch. 3 — open in glossary , also called a graphical model graphical model Synonym for a structured probabilistic model: a distribution described by a graph whose nodes are random variables and whose edges are direct interactions (missing edges = independence assumptions). defined in ch. 16 — open in glossary : a probability distribution described by a graph (graph-theory sense — vertices joined by edges) in which
- each node is a random variable, and
- each edge is a direct interaction between two variables.
We met this idea briefly in §3.14; this chapter is self-contained and develops it in full. The payoff is enormous and worth stating up front: by declaring which variables interact directly, the graph lets us model a distribution with far fewer parameters, estimate it from less data, and store, query, and sample it far more cheaply. The deep-learning community uses these models in its own distinctive way — that is the subject of §16.7 — but the machinery is shared with the wider graphical-models field.
§16.1 Why the naive table is hopeless
The goal of deep learning is to scale machine learning up to AI: to understand high-dimensional data with rich structure — natural images, speech waveforms, documents. A classifier takes such an input and collapses it to a single label, discarding most of the information and freely ignoring large parts of the input (the background of a photo, say). Many other probabilistic tasks are more demanding: they need a complete model of the entire input, with no option to ignore any of it.
| Task | Given → returns | |
|---|---|---|
| Density estimation | estimate p(x) | an input x → its probability under the data distribution |
| Denoising | recover clean x | a corrupted x̃ → an estimate of the true x |
| Missing-value imputation | fill in the gaps | some elements of x → a distribution over the unobserved ones |
| Sampling | generate new x | nothing → a fresh sample from p(x) |
Figure 16.1 in the book shows the sampling task on natural images: real CIFAR-10 tiles on top, and below them samples from a structured model — each placed at the grid position of its nearest training image, so you can see the model is synthesizing new pictures rather than memorizing:
The exponential wall
Suppose we model only binary variables — the simplest possible case — and try to store the joint as a lookup table with one probability per outcome. For a small 32×32 pixel RGB image that is possible images: a number over times larger than the estimated number of atoms in the universe. In general, for discrete variables taking values each, the table needs
and this is infeasible on four separate counts:
| Cost | Why the table fails | |
|---|---|---|
| Memory | storing the model | kⁿ values to keep in memory |
| Statistical efficiency | fitting the model | each of the kⁿ entries is a free parameter to learn |
| Runtime — inference | querying the model | marginals/conditionals sum over the whole table |
| Runtime — sampling | sampling the model | inverse-CDF walk scans the whole table |
The deep problem is that the table explicitly models every possible interaction among every subset of variables. Real distributions are far simpler than that: most variables influence each other only indirectly.
The relay race
Three runners — Alice, Bob, Carol — run a relay in that order, each handing off a baton. Model each finishing time as a continuous random variable.
- Alice runs first, so her time depends on no one.
- Bob can’t start until Alice hands off, so depends directly on .
- Carol can’t start until Bob hands off, so depends directly on .
Does Carol’s time depend on Alice’s? Only indirectly — through Bob. If we already know Bob’s finishing time, learning Alice’s tells us nothing more about Carol’s. So the whole race needs just two direct interactions, Alice→Bob and Bob→Carol; the indirect Alice→Carol link can be left out of the model entirely.
How much does modeling only direct interactions save? Discretize each runner’s time into 100 buckets. The full joint table over needs values. But storing one small table per direct interaction — 99 values for , then each for and — comes to just 19,899: a saving of more than 50×. Explore how that gap grows with the number of variables:
bar length ∝ log₁₀(params); axis to 10^6
m is the most variables in any one conditional table. As long as m ≪ n — few parents per node — the graph replaces an exponential table with a handful of small ones. Push n up with a full table (m = n) to watch the cost explode; a 32×32 RGB image is n = 3072, k = 2 → 2³⁰⁷², off this chart.
What the graph is really doing
A structured probabilistic model is a formal framework for modeling only direct interactions. Every edge you omit is an assumption that two variables do not need to interact directly. Because the parameter count scales with the size of the largest interaction you keep — not with the number of variables — a sparse graph turns an intractable distribution into a cheap one to store, fit, query, and sample.
§16.2 Two graph languages
Structured probabilistic models come in two broad families, distinguished by whether the edges carry arrows:
| Family | Edge meaning | Best fit | |
|---|---|---|---|
| Directed | directed acyclic graph | an arrow a→b: b's distribution is defined conditionally on a | clear one-way causality (the relay race) |
| Undirected | undirected graph (Markov random field) | a plain edge: the two variables interact, with no preferred direction | symmetric interactions (who infects whom) |
Both are just ways of saying which variables interact directly; the direct interactions imply all the indirect ones, and only the direct ones are written down. Next we make each precise — starting with directed models, undirected models, and the partition function.
Check yourself — structured models & the unstructured wall
1.In a structured probabilistic model, what does an EDGE encode — and what does a MISSING edge encode?
2.Why is storing the joint distribution of a 32×32 RGB binary image as a lookup table infeasible?
3.In the relay race, does Carol's finishing time t₂ depend on Alice's t₀?
4.Predict the outcome — in ParamBlowupLab you set n = 3, k = 100 and slide m from 3 (full table) down to 2 (chain). What happens to the two parameter counts?
5.Which task is generally EASIER than the four listed probabilistic tasks, and why?