Autoregressive models like PixelCNN have long been the gold standard for image density estimation, producing high-fidelity samples by modeling the probability of each pixel conditioned on all previous ones. However, they harbor a fatal flaw for production environments: inference is agonizingly slow. Because pixels are generated sequentially in raster order, a $512 \times 512$ image requires over 260,000 forward passes of a deep neural network.
In this paper, researchers from DeepMind propose a Multiscale PixelCNN that shatters this $O(N)$ bottleneck, achieving $O(\log N)$ sampling complexity. This allows for the practical generation of high-resolution images and videos without sacrificing the competitive performance that makes autoregressive models so attractive.
TL;DR
By introducing a multiscale architecture and judiciously assuming conditional independence between specific pixel groups, the authors reduce PixelCNN sampling time from $O(N)$ to $O(\log N)$. This enables orders-of-magnitude speedups (up to 100x for images and 5000x for video) and the generation of high-quality $512 \times 512$ images.
What Problem Does This Paper Address?
The core issue is the sequential nature of autoregressive sampling. Standard PixelCNNs factorize the joint distribution of an image into a product of conditional distributions: $p(x) = \prod p(x_i | x_{<i})$. While training can be parallelized using causal masking, inference cannot. You must know pixel 1 to generate pixel 2, and so on.
For a resolution of $N$ pixels, this is $O(N)$ complexity. Caching activations helps, but the serial dependency remains. This makes real-time applications or high-resolution synthesis (where $N$ is large) computationally prohibitive. The challenge is to find a way to generate multiple pixels in parallel without losing the ability to model the complex, high-frequency spatial correlations that define natural images.
Methods
The authors propose a coarse-to-fine approach. Instead of a single raster scan, the model generates an image through a series of upscaling steps.
1. Pixel Grouping and Conditional Independence
The key innovation is how pixels are grouped at each scale. The image is tiled into $2 \times 2$ blocks. The four pixels in each block are assigned to four different groups (e.g., top-left, top-right, bottom-left, bottom-right).
As shown in Figure 2, the model generates Group 1 first (often from a lower-resolution version). Then, all pixels in Group 2 are generated in parallel, conditioned on Group 1. Then Group 3 is generated in parallel, conditioned on Groups 1 and 2, and so on. Because no two pixels in the same group are adjacent, the model can safely assume they are conditionally independent given the previously generated groups and the lower-resolution context.
2. Upscaling Networks
The authors describe two types of upscaling modules (Figure 3):
- Type A: A deep ResNet that directly produces a group of pixels from the context.
- Type B: A ResNet that extracts features, which are then fed into a "shallow PixelCNN" to capture finer local dependencies.
Since the resolution doubles at each step and the number of evaluations per scale is constant, the total sampling complexity becomes $O(\log N)$.
Datasets
The model was evaluated across a diverse range of generative tasks:
- ImageNet: Class-conditional generation at $32 \times 32$, $64 \times 64$, and $128 \times 128$.
- CUB (Birds) & MPII (Human Pose): Text-to-image synthesis conditioned on captions and part keypoints.
- MS-COCO: Complex scene generation from text and segmentation masks.
- Google Robot Pushing: Action-conditional video generation ($64 \times 64$ to $256 \times 256$).
Key Insights and Ideas
- Spatial Locality is Key: You don't need global autoregression for every pixel. By providing a low-resolution "anchor" image, the high-frequency details in distant parts of the image become effectively independent.
- Avoiding Border Artifacts: The $2 \times 2$ tiling strategy is clever because it ensures that when a group is generated, it always has "neighbors" from a previous group to act as context, preventing the checkerboard or border artifacts common in parallel generation.
- Video as a Special Case: In video, the previous high-resolution frames provide such strong context that the authors found they could sometimes sample in $O(1)$ time per frame—generating all pixels of the new frame in just a few parallel passes.
Key Results
The quantitative and qualitative results demonstrate that speed doesn't have to come at the cost of quality.
- Speedup: On $32 \times 32$ ImageNet, the multiscale model is 102x faster than a standard PixelCNN. For video generation, the $O(T)$ model achieved a staggering 5078x speedup over the original Video Pixel Network (VPN).
- Density Estimation: The model achieved negative log-likelihood (NLL) scores that were significantly better than other fast-sampling models like Real NVP and ConvDRAW, remaining competitive with the original $O(N)$ PixelCNN.
- High-Resolution Synthesis: The model successfully generated $512 \times 512$ images (see Figure 1), a feat previously impractical for autoregressive models.
Limitations and Future Work
- Model Capacity: The authors noted that while the model excels on specialized datasets like CUB, its performance on the 1000-class ImageNet suggests a need for higher capacity to capture such vast diversity.
- Overfitting in Video: The $O(T \log N)$ video model showed signs of overfitting to specific camera angles in the robot dataset, suggesting that better data augmentation or regularization is needed for robust video synthesis.
- Discrete vs. Continuous: While this work uses softmax outputs, the authors suggest that using discretized mixture of logistics could further reduce the number of network evaluations needed per group.
Summary updated