HyperAIHyperAI

Command Palette

Search for a command to run...

3 months ago

Synthesizer: Rethinking Self-Attention in Transformer Models

Yi Tay Dara Bahri Donald Metzler Da-Cheng Juan Zhe Zhao Che Zheng

Synthesizer: Rethinking Self-Attention in Transformer Models

Abstract

The dot product self-attention is known to be central and indispensable to state-of-the-art Transformer models. But is it really required? This paper investigates the true importance and contribution of the dot product-based self-attention mechanism on the performance of Transformer models. Via extensive experiments, we find that (1) random alignment matrices surprisingly perform quite competitively and (2) learning attention weights from token-token (query-key) interactions is useful but not that important after all. To this end, we propose \textsc{Synthesizer}, a model that learns synthetic attention weights without token-token interactions. In our experiments, we first show that simple Synthesizers achieve highly competitive performance when compared against vanilla Transformer models across a range of tasks, including machine translation, language modeling, text generation and GLUE/SuperGLUE benchmarks. When composed with dot product attention, we find that Synthesizers consistently outperform Transformers. Moreover, we conduct additional comparisons of Synthesizers against Dynamic Convolutions, showing that simple Random Synthesizer is not only $60\%$ faster but also improves perplexity by a relative $3.5\%$. Finally, we show that simple factorized Synthesizers can outperform Linformers on encoding only tasks.

Code Repositories

10-zin/Synthesizer
pytorch
Mentioned in GitHub

Benchmarks

BenchmarkMethodologyMetrics
dialogue-generation-on-persona-chat-1Synthesizer (R+V)
BLEU-1: 14.7
CIDr: 19.09
METEOR: 6.39
ROUGE-L: 14.79
document-summarization-on-cnn-daily-mailSynthesizer (R+V)
ROUGE-1: 38.57
ROUGE-2: 16.24
ROUGE-L: 35.95
linguistic-acceptability-on-cola-devSynthesizer (R+V)
Accuracy: 53.3
machine-translation-on-wmt2014-english-frenchSynthesizer (Random + Vanilla)
BLEU score: 41.85
Hardware Burden:
Operations per network pass:
machine-translation-on-wmt2014-english-germanSynthesizer (Random + Vanilla)
BLEU score: 28.47
Hardware Burden:
Operations per network pass:
semantic-textual-similarity-on-mrpc-devSynthesizer (R+V)
Accuracy: 91.2

Build AI with AI

From idea to launch — accelerate your AI development with free AI co-coding, out-of-the-box environment and best price of GPUs.

AI Co-coding
Ready-to-use GPUs
Best Pricing
Get Started

Hyper Newsletters

Subscribe to our latest updates
We will deliver the latest updates of the week to your inbox at nine o'clock every Monday morning
Powered by MailChimp
Synthesizer: Rethinking Self-Attention in Transformer Models | Papers | HyperAI