Conference item icon

Conference item

Separations in the representational capabilities of transformers and recurrent architectures

Abstract:
Transformer architectures have been widely adopted in foundation models. Due to their high inference costs, there is renewed interest in exploring the potential of efficient recurrent architectures (RNNs). In this paper, we analyze the differences in the representational capabilities of Transformers and RNNs across several tasks of practical relevance, including index lookup, nearest neighbor, recognizing bounded Dyck languages, and string equality. For the tasks considered, our results show separations based on the size of the model required for different architectures. For example, we show that a one-layer Transformer of logarithmic width can perform index lookup, whereas an RNN requires a hidden state of linear size. Conversely, while constant-size RNNs can recognize bounded Dyck languages, we show that one-layer Transformers require a linear size for this task. Furthermore, we show that two-layer Transformers of logarithmic size can perform decision tasks such as string equality or disjointness, whereas both one-layer Transformers and recurrent models require linear size for these tasks. We also show that a log-size two-layer Transformer can implement the nearest neighbor algorithm in its forward pass; on the other hand recurrent models require linear size. Our constructions are based on the existence of N nearly orthogonal vectors in O(logN) dimensional space and our lower bounds are based on reductions from communication complexity problems. We supplement our theoretical results with experiments that highlight the differences in the performance of these architectures on practical-size sequences.
Publication status:
Published
Peer review status:
Peer reviewed

Actions

Access Document

Files:
Publisher copy:
10.52202/079017-1135

Authors

More by this author
Institution:
University of Oxford
Division:
MPLS
Department:
Computer Science
Role:
Author
More by this author
Institution:
University of Oxford
Division:
MPLS
Department:
Computer Science
Role:
Author
More by this author
Institution:
University of Oxford
Division:
MPLS
Department:
Computer Science
Role:
Author
ORCID:
0000-0002-2300-4819


Publisher:
Curran Associates
Host title:
Advances in Neural Information Processing Systems 37
Pages:
36002-36045
Publication date:
2025-02-01
Acceptance date:
2024-09-24
Event title:
38th Annual Conference on Neural Information Processing Systems (NeurIPS 2024)
Event location:
Vancouver, Canada
Event website:
https://neurips.cc/Conferences/2024
Event start date:
2024-12-10
Event end date:
2024-12-15
DOI:
EISBN:
9798331314385


Language:
English
Pubs id:
2092622
UUID:
uuid_b09a2b5e-2d1e-472d-b72f-f4d8e52dee6a
Local pid:
pubs:2092622
Deposit date:
2025-11-09
ARK identifier:

Terms of use


Views and Downloads






If you are the owner of this record, you can report an update to it here: Report update to this record

TO TOP