Are Transformers universal approximators of sequence-to-sequence functions?
arXiv:1912.10077
Abstract
Despite the widespread adoption of Transformer models for NLP tasks, the expressive power of these models is not well-understood. In this paper, we establish that Transformer models are universal approximators of continuous permutation equivariant sequence-to-sequence functions with compact support, which is quite surprising given the amount of shared parameters in these models. Furthermore, using positional encodings, we circumvent the restriction of permutation equivariance, and show that Transformer models can universally approximate arbitrary continuous sequence-to-sequence functions on a compact domain. Interestingly, our proof techniques clearly highlight the different roles of the self-attention and the feed-forward layers in Transformers. In particular, we prove that fixed width self-attention layers can compute contextual mappings of the input sequences, playing a key role in the universal approximation property of Transformers. Based on this insight from our analysis, we consider other simpler alternatives to self-attention layers and empirically evaluate them.
23 pages, ICLR 2020 camera-ready version
References in corpus (5)
- Distributed Representations of Words and Phrases and their Compositionality
- XLNet: Generalized Autoregressive Pretraining for Language Understanding
- Depthwise Separable Convolutions for Neural Machine Translation
- Approximating Continuous Functions by ReLU Nets of Minimal Width
- Universal approximations of permutation invariant/equivariant functions by deep neural networks
Cited by in corpus (21)
- RoFormer: Enhanced Transformer with Rotary Position Embedding
- Qatten: A General Framework for Cooperative Multiagent Reinforcement Learning
- Rethinking Graph Transformers with Spectral Attention
- Choose a Transformer: Fourier or Galerkin
- Sinkformers: Transformers with Doubly Stochastic Attention
- TraDE: Transformers for Density Estimation
- Normalized Attention Without Probability Cage
- Connections are Expressive Enough: Universal Approximability of Sparse Transformers
- Can Vision Transformers Perform Convolution?
- Neural Machine Translation: A Review of Methods, Resources, and Tools
- On the Expressive Power of Self-Attention Matrices
- Eigen Analysis of Self-Attention and its Reconstruction from Partial Computation
- A Simple and Effective Positional Encoding for Transformers
- Self-Attention Networks Can Process Bounded Hierarchical Languages
- Semantic-Based Self-Critical Training For Question Generation
- Programming with Neural Surrogates of Programs
- UNIPoint: Universally Approximating Point Processes Intensities
- ROPE: Reading Order Equivariant Positional Encoding for Graph-based Document Information Extraction
- Abstraction, Reasoning and Deep Learning: A Study of the "Look and Say" Sequence
- CpT: Convolutional Point Transformer for 3D Point Cloud Processing
- MATE: Multi-view Attention for Table Transformer Efficiency