mlsanityData to 7 Oct 2026

Attention-Only Transformers and Implementing MLPs with Attention Heads

arXiv 2309.08593 ↗First posted 15 Sep 2023cs.LGcited by 1

Not on the map. Why?

Abstract (arXiv)

The transformer architecture is widely used in machine learning models and consists of two alternating sublayers: attention heads and MLPs. We prove that an MLP neuron can be implemented by a masked attention head with internal dimension 1 so long as the MLP's activation function comes from a restricted class including SiLU and close approximations of ReLU and GeLU. This allows one to convert an MLP-and-attention transformer into an attention-only transformer at the cost of greatly increasing the number of attention heads. We also prove that attention heads can perform the components of an MLP (linear transformations and activation functions) separately. Finally, we prove that attention heads can encode arbitrary masking patterns in their weight matrices to within arbitrarily small error.

Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Builds on 10 of its 17 references that are in the map. First posted on arXiv 15 Sep 2023.

Builds on

10 of 17 references.

References · 10

  1. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  2. 2020Language Models are Few-Shot Learnerscited by 32,199
  3. 2022Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 smallcited by 1,130
  4. 2021Transformers in Vision: A Surveycited by 1,009
  5. 2018Image Transformercited by 770
  6. 2023Towards Automated Circuit Discovery for Mechanistic Interpretabilitycited by 700
  7. 2021Attention is Not All You Need: Pure Attention Loses Rank Doubly Exponentially with Depthcited by 411
  8. 2019Meshed-Memory Transformer for Image Captioningcited by 343
  9. 2018Generating Wikipedia by Summarizing Long Sequencescited by 333
  10. 2019Augmenting Self-attention with Persistent Memorycited by 92

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2026: 1.

1 paper.