Skip to main content
QUICK REVIEW

[Paper Review] Fast Generation for Convolutional Autoregressive Models

Prajit Ramachandran, Tom Le Paine|arXiv (Cornell University)|Apr 20, 2017
Neural Networks and Reservoir ComputingComputer Science8 references24 citations
TL;DR

This paper proposes a caching-based method to accelerate inference in convolutional autoregressive models like Wavenet and PixelCNN++, reducing redundant computation by reusing previously calculated hidden states. The approach achieves up to 21× and 183× speedups over naïve generation, respectively, by maintaining layer-wise caches that are updated efficiently across layers with dilated and strided convolutions.

ABSTRACT

Convolutional autoregressive models have recently demonstrated state-of-the-art performance on a number of generation tasks. While fast, parallel training methods have been crucial for their success, generation is typically implemented in a naïve fashion where redundant computations are unnecessarily repeated. This results in slow generation, making such models infeasible for production environments. In this work, we describe a method to speed up generation in convolutional autoregressive models. The key idea is to cache hidden states to avoid redundant computation. We apply our fast generation method to the Wavenet and PixelCNN++ models and achieve up to $21 imes$ and $183 imes$ speedups respectively.

Motivation & Objective

  • To address the slow inference speed of convolutional autoregressive models, which hinders deployment in real-time production systems.
  • To reduce redundant computation during autoregressive generation by reusing previously computed hidden states across layers.
  • To develop a generalizable caching mechanism applicable to both dilated and strided convolutional layers in autoregressive architectures.
  • To demonstrate significant speedups on standard models like Wavenet and PixelCNN++ without altering model architecture or performance.
  • To release open-source implementations compatible with existing training codebases for Wavenet and PixelCNN++.

Proposed method

  • Caching hidden states from previous generation steps to avoid recomputing the full receptive field at each timestep.
  • Using a queue-based cache per layer where the oldest hidden state is popped and the newest is pushed, maintaining temporal locality.
  • Applying the caching mechanism to dilated convolutions by aligning cache size with dilation factor, ensuring correct input alignment.
  • Extending the method to strided convolutions by introducing a 'cache_every' parameter that adjusts cache update frequency based on downsampling/upscaling factors.
  • Optimizing inference in PixelCNN++ by processing the vertical stream row-by-row and reusing cached vertical features for all horizontal stream computations.
  • Implementing the method in TensorFlow with minimal changes to existing model architectures, enabling compatibility with open-source training code.

Experimental results

Research questions

  • RQ1Can hidden state caching significantly reduce computation time in autoregressive models with large receptive fields?
  • RQ2How does the caching mechanism scale across different types of convolutional layers, including dilated and strided convolutions?
  • RQ3To what extent can caching improve inference speed in models like Wavenet and PixelCNN++ without affecting generation quality?
  • RQ4How does the method perform under varying batch sizes, particularly in high-throughput production settings?
  • RQ5Can the caching approach be implemented efficiently in practice with minimal code changes and full compatibility with existing training pipelines?

Key findings

  • The proposed caching method achieves up to 21× speedup in inference time for Wavenet compared to a naïve implementation.
  • For PixelCNN++, the method delivers up to 183× speedup, especially pronounced at larger batch sizes (e.g., 128 and 256).
  • The speedup increases with batch size due to reduced redundant computation, with the method outperforming naïve inference by two orders of magnitude at high batch sizes.
  • The method maintains linear time and space complexity per generation step, in contrast to the exponential complexity of naïve autoregressive generation.
  • The caching mechanism is effective across both 1D (Wavenet) and 2D (PixelCNN++) architectures with minimal architectural modifications.
  • The open-source implementations are compatible with existing training codebases, enabling seamless integration into production workflows.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.