paper-with-me

Papers

Attention-Only Transformers and Implementing MLPs with Attention Heads

2023-09-15 · Robert Huben, Valerie Morris

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.

📄 PDF Abstract BibTeX arXiv:2309.08593

Code (0)

등록된 구현이 없습니다.

Methods 이 논문이 사용한 방법론

SiLU Sigmoid Linear Units, or SiLUs, are activation functions for neural networks. The activation of the SiLU is computed by the sigmoid function multiplied by its input, or…

Similar Papers 제목 키워드 기반

MLPs Learn In-Context on Regression and Classification Tasks

2024-05-24 · William L. Tong, Cengiz Pehlevan

In-context learning (ICL), the remarkable ability to solve a task from only input exemplars, is often assumed to be a unique hallmark of Transformer models. By examining commonly employed synthetic ICL tasks, we demonstr…

In-Context LearningInductive BiasregressionRelational Reasoning

Why Attention Fails: The Degeneration of Transformers into MLPs in Time Series Forecasting

2025-09-25 · Zida Liang, Jiayi Zhu, Weiqiang Sun arxiv

Transformer-based architectures achieved high performance in natural language processing and computer vision, yet many studies have shown that they have not demonstrated a clear advantage in time series forecasting and e…

Time Series Forecasting

Transformers Generalize DeepSets and Can be Extended to Graphs & Hypergraphs

2021-05-21 · NeurIPS 2021 12 · Jinwoo Kim, Saeyoon Oh, Seunghoon Hong

We present a generalization of Transformers to any-order permutation invariant data (sets, graphs, and hypergraphs). We begin by observing that Transformers generalize DeepSets, or first-order (set-input) permutation inv…

2kGraph Regression

Transformers Generalize DeepSets and Can be Extended to Graphs and Hypergraphs

2021-10-27 · NeurIPS 2021 12 · Jinwoo Kim, Saeyoon Oh, Seunghoon Hong

We present a generalization of Transformers to any-order permutation invariant data (sets, graphs, and hypergraphs). We begin by observing that Transformers generalize DeepSets, or first-order (set-input) permutation inv…

2kGraph RegressionHyperedge PredictionSet-to-Graph Prediction

Pay Attention to MLPs

2021-05-17 · NeurIPS 2021 12 · Hanxiao Liu, Zihang Dai, David R. So, Quoc V. Le

Transformers have become one of the most important architectural innovations in deep learning and have enabled many breakthroughs over the past few years. Here we propose a simple network architecture, gMLP, based on MLP…

Image ClassificationNatural Language InferenceQuestion AnsweringSentiment Analysis