skip to content

Search

← From Frames to Worlds

Part I — Prehistory (2014–2021)

Why Video Is Hard

Dimensionality, temporal coherence, and the blurry-MSE lesson that frames the whole book.

2014–2015 15 min read 2 papers

It is February 2015. Image generation already has a working, if imperfect, vocabulary — a density and a sampler, competing over how to get both from the same network — and sequence models already have a working memory cell for text that spans hundreds of steps. Neither thread has been pointed at video, where a “sample” is not one image but many, arranged in an order that itself carries most of the meaning. Within nine months, two papers establish the same unwelcome fact from two different angles: taught the straightforward way, a network that predicts what a video does next settles for a blur, and getting past that blur means changing what the network is asked to minimize, not just how big it is.

Where We Were

By early 2015 the generative-modeling toolkit for single images had two working answers to the two-job problem of density estimation and sampling: the variational autoencoder (VAE), which optimizes a tractable bound on log-likelihood, and the generative adversarial network (GAN), which sidesteps likelihood with a learned discriminator — both covered in full in the image-generation book, which also covers the GAN objective. Sequence modeling for text had its own working answer to a different problem — not “generate a plausible instance” but “carry information across an arbitrary number of steps” — solved by the long short-term memory (LSTM) cell and refined into an encoder-decoder pattern that reads a whole input sequence before generating a whole output sequence, the subject of Recurrent Networks and seq2seq.

Video sits at the intersection and inherits the hard parts of both problems without inheriting a ready-made combined solution. A single video frame is already the same high-dimensional object an image model has to handle — height times width times color channels, tens of thousands of numbers for even a modest resolution. A video multiplies that by however many frames the clip contains, and does so without a matching increase in the labeled data available to constrain the extra dimensions: ImageNet-scale labeled still-image datasets existed by 2015, but nothing comparable existed for labeled video motion. Worse, the added axis is not just “more of the same kind of number” — frames are not independent samples the way images in a dataset are; frame t+1t+1 is heavily constrained by frame tt, in ways a model has to discover (objects persist, motion is usually smooth, occlusion and revealment happen at object boundaries) rather than being told.

There was also, in 2015, a strong non-learned baseline sitting in the way of any new video model’s claim to progress: optical flow. Decades of computer vision research had produced algorithms that estimate, for each pixel, how it moved between two frames, without training a generative model at all — a mature, well-understood technique for a narrower task than full frame prediction. Any learned video model claiming an advance had to beat not only the previous learned model, but a classical method with no training data requirement and no blur problem, because it never predicts new content — it only rearranges pixels that were already there.

Two working toolkits meet a problem sixteen times bigger Image generation had a density and a sampler; sequence modelling had a memory cell. Video needed both, and had far more numbers to fit. Grey monospace text names the paper and the number the chapter quotes for it. 1997 LSTM a gated cell carries state across hundreds of steps Hochreiter and Schmidhuber memory for text, not pixels 2013 VAE a tractable bound on the likelihood, plus a sampler Kingma and Welling one image at a time 2014 GAN a learned discriminator replaces the likelihood Goodfellow et al. sharp samples, single frames 2014 seq2seq read a whole sequence, then write a whole sequence encoder-decoder LSTM built for translation Feb 2015 Video LSTM seq2seq pointed at frames instead of words Srivastava et al. 2015 UCF-101 74.5% to 75.8% Nov 2015 Beyond MSE names the blur, blames the loss, adds GDL and a GAN Mathieu et al. 2015 PSNR 26.5 to 31.5 dB WHAT THE TIME AXIS ADDS one 64 x 64 x 3 frame 12,288 numbers a 16-frame clip at the same size 196,608 T x H x W x C: sixteen times the numbers, with no matching labelled video to constrain them image generation thread sequence memory thread the two papers this chapter is about Neither thread had been pointed at video before 2015. Optical flow, which never invents content and never blurs, was the baseline both had to beat.
Two mature toolkits, neither yet pointed at video, and the reason video needed more than either: a clip carries sixteen times the numbers of a frame without sixteen times the labels to pin them down. PNG ↓

The Breakthrough

The breakthrough arrived in two acts, nine months apart, attacking two different halves of the same underlying problem: the first act asks what a network should learn from unlabeled video at all; the second asks why, once it learns something, its predictions look wrong.

Act one: treat a video like a sentence. Srivastava, Mansimov, and Salakhutdinov (February 2015) applied the encoder-decoder LSTM framework, already established for translation, directly to raw video (Srivastava, Mansimov & Salakhutdinov, 2015). Where seq2seq feeds one word per time step into an encoder LSTM and decodes one word per time step out of a second LSTM, this paper feeds one video frame per time step — either a raw 32×3232 \times 32 pixel patch or a 4096-dimensional “percept” vector extracted from an ImageNet-pretrained convolutional network — and asks a decoder LSTM to produce a target sequence of frames. The paper tests three decoder targets. An Autoencoder Model decodes the same frames it was given, in reverse order, forcing the fixed-length encoder state to retain enough to reconstruct the input — a video-specific version of the deterministic compression problem covered for images in The Generative Problem. A Future Predictor Model decodes the frames that come after the input sequence instead, forcing the encoder state to capture motion well enough to extrapolate it. A Composite Model runs both decoders off one shared encoder, so the learned representation has to support reconstruction and extrapolation simultaneously — which the paper argues prevents each individual failure mode: a pure autoencoder can cheat by memorizing enough to reconstruct without learning anything about motion, and a pure future predictor can cheat by attending only to the last few input frames rather than the whole sequence.

Treat a video like a sentence: one encoder, two decoders, one shared state The Composite Model makes a single fixed-length vector answer for both the past and the future, so neither decoder can take its shortcut. Grey monospace text is the paper's setting or result for that step. RECONSTRUCT THE PAST alone, it can memorise the input and learn nothing about motion PREDICT THE FUTURE alone, it can watch only the last few frames and ignore the rest Frames, one per step raw patches or CNN percepts 32x32 px or 4096-d percept Encoder LSTM reads the whole clip first 2 layers, 2048 units each One fixed-length state all either decoder receives Sports-1M, 300 h unlabelled Reconstruction decoder replays the input backwards the Autoencoder Model Input frames, reversed proves the state kept detail Moving MNIST for the pictures same vector Future decoder extrapolates the motion the Future Predictor Model Frames after the clip proves the state kept motion one label: 29.6% to 34.3% same vector unlabelled video in an LSTM the representation both decoders must share what the decoders must produce Trained with no labels on one Titan GPU in 18 to 20 hours. The gain is largest where labels are scarcest: one clip per class lifts HMDB-51 from 14.4% to 19.1%.
The Composite Model's trick is the single shared vector: it has to hold enough detail to rebuild the past and enough motion to extend the future, so neither decoder's shortcut survives. PNG ↓

Trained on a 300-hour subset of unlabeled YouTube clips from the Sports-1M dataset, plus a synthetic Moving MNIST dataset of digits bouncing inside a frame for controlled visualization, the best Composite Model used two stacked layers of 2048 or 4096 LSTM units. The result the paper is built around: features learned with no labels at all, by nothing more than reconstructing the past and predicting the future, transfer to a supervised action-recognition task, and the transfer benefit is largest exactly where labeled examples are scarcest. On the full UCF-101 dataset, fine-tuning from Composite Model weights raised classification accuracy from a 74.5% LSTM baseline to 75.8%; on HMDB-51, from 42.8% to 44.1%. With only one labeled video per class, the gap widened sharply — UCF-101 accuracy rose from 29.6% to 34.3%, HMDB-51 from 14.4% to 19.1%.

Act two: diagnose the blur, then fix the loss. Mathieu, Couprie, and LeCun (November 2015) started from a different question: given a network trained to predict the next frame directly in pixel space, why do its outputs look soft and smeared rather than sharp, no matter how the architecture is tuned (Mathieu, Couprie & LeCun, 2015)? Their answer, worked out in full in the next section, is that the standard squared-error (MSE, or ℓ2\ell_2) loss used almost everywhere else in supervised deep learning is mathematically the wrong tool whenever a video’s future is genuinely uncertain. The paper proposes three complementary fixes, trained together on one convolutional generator. A multi-scale architecture predicts recursively from coarse resolution upward — four scales in their main experiments, from 4×44 \times 4 patches up to 32×3232 \times 32, later fine-tuned at 64×6464 \times 64 — each scale predicting a correction added to an upsampled coarser prediction, addressing the limited receptive field of a single-scale convolutional network. Adversarial training adapts the GAN, covered for images in The Adversarial Game, to frame prediction for the first time: a discriminator network looks at a full sequence of frames and predicts whether its last frames are real continuations or network-generated ones, which lets it exploit temporal coherence across the whole clip rather than judging one frame in isolation. And a new Gradient Difference Loss (GDL), described with its exact formula in the next section, directly penalizes mismatches between the predicted frame’s spatial edges and the true frame’s spatial edges, independent of whether raw pixel intensities line up.

Three losses for three symptoms of the same blur A pixel loss stays as the stable backbone; an edge loss and a discriminator are bolted on to stop the generator settling for the average future. Grey monospace text is the paper's setting; the weights on the arrows are the best configuration reported. Input frames X four real frames in a row UCF-101, moving regions Multi-scale generator coarse guess, finer corrections 4 scales, 4x4 up to 32x32 Predicted frame Y-hat one frame, in pixel space fine-tuned at 64x64 Ground truth Y the frame that actually came what every loss compares to compared Pixel loss distance in raw intensity l_p, the stable backbone Gradient difference edge maps must match GDL, exponent alpha >= 1 Discriminator real or generated sequence? the first GAN on video weight 1 weight 1 weight 0.05 One weighted sum the only signal G trains on 0.05 adv + 1 l_p + 1 GDL PSNR ON UCF-101, ONE FRAME FROM FOUR single-scale squared error 26.5 dB adversarial + gradient difference 31.5 dB same, fine-tuned on UCF-101 32.0 dB optical flow, no learning at all 31.6 dB frames a network a loss term that fights blur squared error alone: the mean of two futures Squared error alone predicts the midpoint of the futures it cannot choose between, and the midpoint of two shifted edges is a soft edge. The fixes beat optical flow only barely, and only after fine-tuning.
A pixel loss stays as the backbone; the edge loss and the discriminator are bolted on to stop the generator averaging its futures. The bars show what that bought, and how narrowly it edged past optical flow. PNG ↓

The Mathematics

How much bigger video is than an image. The dimensionality gap between the two problems this book is about is not subtle:

Dimage=H×W×C,Dvideo=T×H×W×CD_{\text{image}} = H \times W \times C, \qquad D_{\text{video}} = T \times H \times W \times C
SymbolMeaning
H,WH, Wframe height and width, in pixels
CCnumber of color channels
TTnumber of frames in the clip
Dimage,DvideoD_{\text{image}}, D_{\text{video}}total dimensionality of one image versus one clip

Why squared-error prediction blurs. Mathieu et al. trace the blur to a basic fact about what squared error minimizes. For a scalar target vv drawn from some distribution, the value that minimizes expected squared error against it is the distribution’s mean, not any value the distribution is likely to actually produce:

v^∗=arg⁡min⁡v^  E[(v−v^)2]=E[v]\hat v^{*} = \arg\min_{\hat v} \; \mathbb{E}\big[(v - \hat v)^2\big] = \mathbb{E}[v]
SymbolMeaning
vvthe true (uncertain) target value, e.g. one pixel’s next-frame intensity
v^\hat va candidate prediction
v^∗\hat v^{*}the squared-error-optimal prediction
E[⋅]\mathbb{E}[\cdot]expectation — the probability-weighted average
v1,v2,vavgv_1, v_2, v_{\text{avg}}two equally likely outcomes and their midpoint

The fix: penalize blurred edges directly. The Gradient Difference Loss compares spatial gradients — simple pixel-to-neighbor differences — of the predicted frame Y^\hat Y against the ground-truth frame YY, rather than comparing raw pixel values:

Lgdl(Y,Y^)=∑i,j(∣ ∣Yi,j−Yi−1,j∣−∣Y^i,j−Y^i−1,j∣ ∣α+∣ ∣Yi,j−1−Yi,j∣−∣Y^i,j−1−Y^i,j∣ ∣α)\mathcal{L}_{gdl}(Y, \hat Y) = \sum_{i,j} \Big( \big| \,|Y_{i,j} - Y_{i-1,j}| - |\hat Y_{i,j} - \hat Y_{i-1,j}|\, \big|^{\alpha} + \big| \,|Y_{i,j-1} - Y_{i,j}| - |\hat Y_{i,j-1} - \hat Y_{i,j}|\, \big|^{\alpha} \Big)
SymbolMeaning
Y,Y^Y, \hat Yground-truth and predicted frame
i,ji, jpixel row and column indices
α\alphainteger exponent, ≥1\geq 1, controlling penalty sharpness
Lgdl\mathcal{L}_{gdl}the total gradient-difference loss over the frame

Combining the three losses. The generator GG is trained to minimize a single weighted sum:

L(X,Y)=λadv LadvG(X,Y)+λℓp Lp(X,Y)+λgdl Lgdl(X,Y)\mathcal{L}(X, Y) = \lambda_{adv}\, \mathcal{L}^{G}_{adv}(X, Y) + \lambda_{\ell_p}\, \mathcal{L}_p(X, Y) + \lambda_{gdl}\, \mathcal{L}_{gdl}(X, Y)
SymbolMeaning
X,YX, Yinput frames and the ground-truth target frame
L(X,Y)\mathcal{L}(X, Y)the total training loss for the generator
LadvG(X,Y)\mathcal{L}^{G}_{adv}(X, Y)the adversarial term, from the discriminator’s judgment of the generator’s output
Lp(X,Y)\mathcal{L}_p(X, Y)the standard ℓp\ell_p pixel-distance term
Lgdl(X,Y)\mathcal{L}_{gdl}(X, Y)the gradient-difference term defined above
λadv,λℓp,λgdl\lambda_{adv}, \lambda_{\ell_p}, \lambda_{gdl}hand-set weights on the three terms

What It Enabled

Neither 2015 paper produced a video model anyone would call visually convincing by later standards, and neither claimed to. What they established were the two problems every later chapter in this book answers a different way: how to represent a clip’s dimensionality without training on raw, full-length pixel tensors, and how to keep a learned predictor from collapsing to the statistically safe average of an uncertain future.

ApproachHow it handles the time axisHow it handles (or falls into) blurWhere it’s covered
Classical optical flow, pre-2015Estimates per-pixel motion between two real frames; generates nothing newSharp by construction — it only moves existing pixels — but cannot invent occluded or novel contentBaseline throughout this era
Video LSTM Composite Model, Feb 2015Learns a fixed-length latent state via an encoder-decoder LSTM, decoded into a future sequenceTrained with plain squared or cross-entropy error; reconstructions and predictions are visibly blurryThis chapter
Multi-scale adversarial predictor, Nov 2015Feed-forward convolutional network, no recurrence; predicts one or a few frames at a timeLoss function engineered against blur directly (GDL plus adversarial term); still limited to a short prediction horizonThis chapter
GAN-based video generationA discriminator judges a full generated clip’s realism rather than scoring per-pixel accuracyGAN Video
Latent world modelsPredicts and plans inside a learned, compressed latent space instead of pixel spacePredicting the Next Frame
Tokenized autoregressive videoCompresses frames to discrete tokens first, then models the token sequenceTokens for Video
Video diffusion modelsIterative denoising sampling reintroduces stochastic detail an average would eraseVideo Diffusion Models

The 2015 quantitative record itself is worth keeping, because it shows how close the gap to a decades-old, non-learned baseline still was. Mathieu et al.’s evaluation on UCF-101, restricted to moving image regions and predicting one frame from four inputs, measured Peak Signal-to-Noise Ratio (PSNR), Structural Similarity (SSIM), and a purpose-built sharpness-difference score:

Loss configurationPSNR (dB)SSIMSharpness (dB)
Single-scale squared error26.50.8424.7
Absolute-error loss28.70.8824.8
Gradient difference loss + absolute error29.40.9025.0
Adversarial loss alone30.60.8925.2
Adversarial + gradient difference loss31.50.9125.4
Adversarial + gradient difference, fine-tuned on UCF-10132.00.9225.4
Non-learned optical-flow baseline31.60.9325.3

Every engineered fix improved on plain squared error, and the best combination edged past the classical optical-flow baseline on two of three measures — but only barely, and only after specifically fine-tuning on the test domain. Sharper video generation, in other words, did not arrive by scaling a squared-error model; it arrived by first proving that squared error was structurally the wrong objective, a lesson GAN Video and every later chapter’s model absorbs in its own way.

Two problems named in 2015, two lineages, one meeting point Every later chapter answers blur or dimensionality a different way; video diffusion is where the two answers arrive together. Grey monospace text names the chapter in this book that covers each step. COMMIT TO ONE FUTURE SHRINK THE SPACE FIRST Two problems, 2015 blur and dimensionality chapter 1, this one Scene-dynamics GANs a discriminator judges clips not the mean of the futures GAN Video sharp, short, hard to train chapter 2 blur Latent world models predict in a compressed space 16 frames = 196,608 numbers Next-frame prediction plan inside the latent, not pixels chapter 3 dimensionality Video diffusion denoising restores the detail an average would erase chapter 5, both at once the diagnosis judge the whole clip work in a smaller space both at once Tokenised autoregressive video (chapter 4) sits on the lower branch too: compress frames to discrete tokens, then model the token sequence.
Every later chapter picks up one of the two problems this one names. Video diffusion is where the two lineages arrive together: a compressed space to work in, and a sampler that puts back the detail an average would erase. PNG ↓

Key Papers

PaperAuthorsYearLinkWhy it matters
Unsupervised Learning of Video Representations using LSTMsSrivastava, Mansimov & Salakhutdinov2015arXivFirst encoder-decoder LSTM applied directly to video frames; shows unsupervised pretraining helps action recognition most exactly when labeled data is scarcest
Deep Multi-Scale Video Prediction Beyond Mean Square ErrorMathieu, Couprie & LeCun2015arXivProves why squared-error frame prediction blurs, and fixes it with a multi-scale architecture, the first video GAN, and a new gradient-difference loss

PM Lens

Papers referenced