Transformers are Expressive, But Are They Expressive Enough for Regression?

Swaroop Nath, Harshad Khadilkar, Pushpak Bhattacharyya
2/23/2024
cs.LGstat.ML

No confident code implementation found for this paper.

Abstract

Transformers have become pivotal in Natural Language Processing, demonstrating remarkable success in applications like Machine Translation and Summarization. Given their widespread adoption, several works have attempted to analyze the expressivity of Transformers. Expressivity of a neural network is the class of functions it can approximate. A neural network is fully expressive if it can act as a universal function approximator. We attempt to analyze the same for Transformers. Contrary to existing claims, our findings reveal that Transformers struggle to reliably approximate smooth functions, relying on piecewise constant approximations with sizable intervals. The central question emerges as: ''Are Transformers truly Universal Function Approximators?'' To address this, we conduct a thorough investigation, providing theoretical insights and supporting evidence through experiments. Theoretically, we prove that Transformer Encoders cannot approximate smooth functions. Experimentally, we complement our theory and show that the full Transformer architecture cannot approximate smooth functions. By shedding light on these challenges, we advocate a refined understanding of Transformers' capabilities. Code Link: https://github.com/swaroop-nath/transformer-expressivity.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{nath2024transformers,
  title  = {Transformers are Expressive, But Are They Expressive Enough for Regression?},
  author = {Swaroop Nath and Harshad Khadilkar and Pushpak Bhattacharyya},
  year   = {2024},
  eprint = {2402.15478},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2402.15478v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2402.15478.svg)](https://codeofpaper.com/paper/2402.15478)

Discussion