Oral
in
Workshop: 3rd Workshop on High-dimensional Learning Dynamics (HiLD)
When Do Transformers Outperform Feedforward and Recurrent Networks? A Statistical Perspective
Alireza Mousavi-Hosseini · Clayton Sanford · Denny Wu · Murat Erdogdu
[
Abstract
]
[ Project Page ]
presentation:
3rd Workshop on High-dimensional Learning Dynamics (HiLD)
Fri 18 Jul 9 a.m. PDT — 5:30 p.m. PDT
[
OpenReview]
Fri 18 Jul 9 a.m. PDT — 5:30 p.m. PDT
Abstract:
Theoretical efforts to prove advantages of Transformers in comparison with classical architectures such as feedforward and recurrent neural networks have mostly focused on representational power. In this work, we take an alternative perspective and prove that even with infinite compute, feedforward and recurrent networks may suffer from larger sample complexity compared to Transformers, as the latter can adapt to a form of dynamic sparsity. Specifically, we consider a sequence-to-sequence data generating model on sequences of length $N$, where the output at each position only depends on $q \ll N$ relevant tokens, and the positions of these tokens are described in the input prompt. We prove that a single-layer Transformer can learn this model if and only if its number of attention heads is at least $q$, in which case it achieves a sample complexity almost independent of $N$, while recurrent networks require $N^{\Omega(1)}$ samples on the same problem. If we simplify this model, recurrent networks may achieve a complexity almost independent of $N$, while feedforward networks still require $N$ samples. Our proposed sparse retrieval model illustrates a natural hierarchy in sample complexity across these architectures.
Chat is not available.