Papers
Topics
Authors
Recent
Gemini 2.5 Flash
Gemini 2.5 Flash
80 tokens/sec
GPT-4o
59 tokens/sec
Gemini 2.5 Pro Pro
43 tokens/sec
o3 Pro
7 tokens/sec
GPT-4.1 Pro
50 tokens/sec
DeepSeek R1 via Azure Pro
28 tokens/sec
2000 character limit reached

Improving Transformers with Probabilistic Attention Keys (2110.08678v2)

Published 16 Oct 2021 in cs.LG, cs.CL, and stat.ML

Abstract: Multi-head attention is a driving force behind state-of-the-art transformers, which achieve remarkable performance across a variety of NLP and computer vision tasks. It has been observed that for many applications, those attention heads learn redundant embedding, and most of them can be removed without degrading the performance of the model. Inspired by this observation, we propose Transformer with a Mixture of Gaussian Keys (Transformer-MGK), a novel transformer architecture that replaces redundant heads in transformers with a mixture of keys at each head. These mixtures of keys follow a Gaussian mixture model and allow each attention head to focus on different parts of the input sequence efficiently. Compared to its conventional transformer counterpart, Transformer-MGK accelerates training and inference, has fewer parameters, and requires fewer FLOPs to compute while achieving comparable or better accuracy across tasks. Transformer-MGK can also be easily extended to use with linear attention. We empirically demonstrate the advantage of Transformer-MGK in a range of practical applications, including LLMing and tasks that involve very long sequences. On the Wikitext-103 and Long Range Arena benchmark, Transformer-MGKs with 4 heads attain comparable or better performance to the baseline transformers with 8 heads.

User Edit Pencil Streamline Icon: https://streamlinehq.com
Authors (8)
  1. Tam Nguyen (18 papers)
  2. Tan M. Nguyen (26 papers)
  3. Dung D. Le (20 papers)
  4. Duy Khuong Nguyen (4 papers)
  5. Viet-Anh Tran (15 papers)
  6. Richard G. Baraniuk (141 papers)
  7. Nhat Ho (126 papers)
  8. Stanley J. Osher (39 papers)
Citations (25)