[Paper Review] Axial Attention in Multidimensional Transformers
The paper introduces Axial Transformers, an autoregressive self-attention model for high-dimensional data using axial attention to compute context along single tensor axes, achieving state-of-the-art results on ImageNet-32/64 and BAIR Robot Pushing without custom kernels.
We propose Axial Transformers, a self-attention-based autoregressive model for images and other data organized as high dimensional tensors. Existing autoregressive models either suffer from excessively large computational resource requirements for high dimensional data, or make compromises in terms of distribution expressiveness or ease of implementation in order to decrease resource requirements. Our architecture, by contrast, maintains both full expressiveness over joint distributions over data and ease of implementation with standard deep learning frameworks, while requiring reasonable memory and computation and achieving state-of-the-art results on standard generative modeling benchmarks. Our models are based on axial attention, a simple generalization of self-attention that naturally aligns with the multiple dimensions of the tensors in both the encoding and the decoding settings. Notably the proposed structure of the layers allows for the vast majority of the context to be computed in parallel during decoding without introducing any independence assumptions. This semi-parallel structure goes a long way to making decoding from even a very large Axial Transformer broadly applicable. We demonstrate state-of-the-art results for the Axial Transformer on the ImageNet-32 and ImageNet-64 image benchmarks as well as on the BAIR Robotic Pushing video benchmark. We open source the implementation of Axial Transformers.
Motivation & Objective
- Develop a self-attention-based autoregressive model for high-dimensional data tensors without prohibitive compute or memory costs.
- Introduce axial attention to scale attention along tensor axes without flattening the data.
- Enable full-context modeling with a semi-parallel sampling procedure.
- Demonstrate state-of-the-art results on image and video benchmarks.
- Provide an open-source implementation for easy adoption.
Proposed method
- Define axial attention as attention along a single axis of a multidimensional tensor, preserving other axes, to reduce computation from O(N^2) to O(N^{(d-1)/d}).
- Stack masked/unmasked axial attention blocks to build full autoregressive context without independence assumptions.
- Use a row-wise inner decoder for efficient sampling and an outer decoder to incorporate information from previous rows and channels.
- Model multi-channel data by conditioning on previous channels using additional unmasked row/column attention layers.
- Train on random channel slices to obtain an unbiased estimate of the log-likelihood for the full data tensor.
- Provide an open-source implementation of Axial Transformers.
Experimental results
Research questions
- RQ1How can attention mechanisms be generalized to multidimensional tensors to reduce computational demands while preserving full joint expressiveness?
- RQ2Can axial attention enable efficient autoregressive modeling for images and videos without custom kernels or heavy data copying?
- RQ3What are the impacts of combining masked/unmasked axial attention on modeling capacity and sampling speed?
- RQ4How does Axial Transformer perform on standard image and video benchmarks compared to prior autoregressive models?
- RQ5Can the model effectively handle multi-channel data and video by conditioning on previous channels/frames?
Key findings
- Axial attention reduces computation and memory from standard self-attention by a factor of O(N^{(d-1)/d}) for a d-dimensional input tensor.
- The Axial Transformer achieves state-of-the-art bits-per-dimension on ImageNet-32 and ImageNet-64 compared to several baselines.
- The model significantly improves BAIR Robotic Pushing video modeling over prior autoregressive methods.
- Semi-parallel sampling computes most context in parallel, yielding practical decoding for large tensors.
- An ablation shows that replacing the inner decoder with an LSTM slows training but can match some performance, while the full four-layer inner decoder improves both performance and training speed.
- The channel-conditional extension effectively models multi-channel images and videos without heavy architectural changes.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.