What is the computational model behind a Transformer? Where recurrent neural networks have direct parallels in finite state machines, allowing clear discussion and thought around architecture variants or trained models, Transformers have no such familiar parallel. In this paper we aim to change that, proposing a computational model for the transformer-encoder in the form of a programming language. We map the basic components of a transformer-encoder -- attention and feed-forward computation -- into simple primitives, around which we form a programming language: the Restricted Access Sequence Processing Language (RASP). We show how RASP can be used to program solutions to tasks that could conceivably be learned by a Transformer, and how a Transformer can be trained to mimic a RASP solution. In particular, we provide RASP programs for histograms, sorting, and Dyck-languages. We further use our model to relate their difficulty in terms of the number of required layers and attention heads: analyzing a RASP program implies a maximum number of heads and layers necessary to encode a task in a transformer. Finally, we see how insights gained from our abstraction might be used to explain phenomena seen in recent works.
Deep Thinking by Markov Chain of Continuous Thoughts
State Key Laboratory of Cognitive Intelligence, University of Science and Technology of China(认知智能国家重点实验室,中国科学技术大学);Department of Statistics, University of Oxford(牛津大学统计系);Department of Data Science, City University of Hong Kong(香港城市大学数据科学系);Hong Kong Institute of AI for Science, City University of Hong Kong(香港人工智能科学研究院,香港城市大学)
Combining Fast and Slow Thinking for Human-like and Efficient Navigation in Constrained Environments
Union College(联合学院);IBM Research(IBM研究院);University of Udine(乌迪内大学);University of Brescia(布雷西亚大学);Tulane University(杜兰大学);University of West Florida(西佛罗里达大学);Univ. of South Carolina(南卡罗来纳大学);Institute for Human and Machine Cognition(人机认知研究所)
Thinking like a CHEMIST: Combined Heterogeneous Embedding Model Integrating Structure and Tokens
Moscow Institute of Physics and Technology(莫斯科物理技术学院);A. N. Nesmeyanov Institute of Organoelement compounds Russian Academy of Sciences(有机元素化合物A.N.涅斯梅亚诺夫研究所俄罗斯科学院);Mohamed bin Zayed University of Artificial Intelligence(穆罕默德·本·扎耶德人工智能大学);HSE University(高等经济大学)