mlsanityData to 14 Oct 2026

Attention Enables Zero Approximation Error

arXiv 2202.12166 ↗First posted 24 Feb 2022cs.LGcited by 4

Not on the map. Why?

Abstract (arXiv)

Deep learning models have been widely applied in various aspects of daily life. Many variant models based on deep learning structures have achieved even better performances. Attention-based architectures have become almost ubiquitous in deep learning structures. Especially, the transformer model has now defeated the convolutional neural network in image classification tasks to become the most widely used tool. However, the theoretical properties of attention-based models are seldom considered. In this work, we show that with suitable adaptations, the single-head self-attention transformer with a fixed number of transformer encoder blocks and free parameters is able to generate any desired polynomial of the input with no error. The number of transformer encoder blocks is the same as the degree of the target polynomial. Even more exciting, we find that these transformer encoder blocks in this model do not need to be trained. As a direct consequence, we show that the single-head self-attention transformer with increasing numbers of free parameters is universal. These surprising theoretical results clearly explain the outstanding performances of the transformer model and may shed light on future modifications in real applications. We also provide some experiments to verify our theoretical result.

Key facts. Cited by 4 papers in the map (data through 14 Oct 2026). Builds on 11 of its 16 references that are in the map. First posted on arXiv 24 Feb 2022.

Builds on

11 of 16 references.

References · 11

  1. 2017Attention Is All You Needcited by 60,361
  2. 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 30,186
  3. 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,548
  4. 2020Big Bird: Transformers for Longer Sequencescited by 1,684
  5. 2019Are Transformers universal approximators of sequence-to-sequence functions?cited by 406
  6. 2018Scaling Neural Machine Translationcited by 204
  7. 2018Universality of Deep Convolutional Neural Networkscited by 176
  8. 2020O(n) Connections are Expressive Enough: Universal Approximability of Sparse Transformerscited by 83
  9. 2021SparseBERT: Rethinking the Importance Analysis in Self-attentioncited by 46
  10. 2021Theory of Deep Convolutional Neural Networks III: Approximating Radial Functionscited by 22
  11. 2021On the rate of convergence of a classifier based on a Transformer encodercited by 16

Built on by

Cited by year

Citing papers per year: 2024: 2; 2025: 2.

4 papers.