Transformers, parallel computation, and logarithmic depth

Clayton Sanford, Daniel Hsu, Matus Telgarsky
Proceedings of the 41st International Conference on Machine Learning, PMLR 235:43276-43327, 2024.

Abstract

We show that a constant number of self-attention layers can efficiently simulate—and be simulated by—a constant number of communication rounds of Massively Parallel Computation. As a consequence, we show that logarithmic-depth is sufficient for transformers to solve basic computational tasks that cannot be efficiently solved by several other neural sequence models and sub-quadratic transformer approximations. We thus establish parallelism as a key distinguishing property of transformers.

Cite this Paper


BibTeX
@InProceedings{pmlr-v235-sanford24a, title = {Transformers, parallel computation, and logarithmic depth}, author = {Sanford, Clayton and Hsu, Daniel and Telgarsky, Matus}, booktitle = {Proceedings of the 41st International Conference on Machine Learning}, pages = {43276--43327}, year = {2024}, editor = {Salakhutdinov, Ruslan and Kolter, Zico and Heller, Katherine and Weller, Adrian and Oliver, Nuria and Scarlett, Jonathan and Berkenkamp, Felix}, volume = {235}, series = {Proceedings of Machine Learning Research}, month = {21--27 Jul}, publisher = {PMLR}, pdf = {https://raw.githubusercontent.com/mlresearch/v235/main/assets/sanford24a/sanford24a.pdf}, url = {https://proceedings.mlr.press/v235/sanford24a.html}, abstract = {We show that a constant number of self-attention layers can efficiently simulate—and be simulated by—a constant number of communication rounds of Massively Parallel Computation. As a consequence, we show that logarithmic-depth is sufficient for transformers to solve basic computational tasks that cannot be efficiently solved by several other neural sequence models and sub-quadratic transformer approximations. We thus establish parallelism as a key distinguishing property of transformers.} }
Endnote
%0 Conference Paper %T Transformers, parallel computation, and logarithmic depth %A Clayton Sanford %A Daniel Hsu %A Matus Telgarsky %B Proceedings of the 41st International Conference on Machine Learning %C Proceedings of Machine Learning Research %D 2024 %E Ruslan Salakhutdinov %E Zico Kolter %E Katherine Heller %E Adrian Weller %E Nuria Oliver %E Jonathan Scarlett %E Felix Berkenkamp %F pmlr-v235-sanford24a %I PMLR %P 43276--43327 %U https://proceedings.mlr.press/v235/sanford24a.html %V 235 %X We show that a constant number of self-attention layers can efficiently simulate—and be simulated by—a constant number of communication rounds of Massively Parallel Computation. As a consequence, we show that logarithmic-depth is sufficient for transformers to solve basic computational tasks that cannot be efficiently solved by several other neural sequence models and sub-quadratic transformer approximations. We thus establish parallelism as a key distinguishing property of transformers.
APA
Sanford, C., Hsu, D. & Telgarsky, M.. (2024). Transformers, parallel computation, and logarithmic depth. Proceedings of the 41st International Conference on Machine Learning, in Proceedings of Machine Learning Research 235:43276-43327 Available from https://proceedings.mlr.press/v235/sanford24a.html.

Related Material