Timezone: »
Transformers have been proven a successful model for a variety of tasks in sequence modeling. However, computing the attention matrix, which is their key component, has quadratic complexity with respect to the sequence length, thus making them prohibitively expensive for large sequences. To address this, we propose clustered attention, which instead of computing the attention for every query, groups queries into clusters and computes attention just for the centroids. To further improve this approximation, we use the computed clusters to identify the keys with the highest attention per query and compute the exact key/query dot products. This results in a model with linear complexity with respect to the sequence length for a fixed number of clusters. We evaluate our approach on two automatic speech recognition datasets and show that our model consistently outperforms vanilla transformers for a given computational budget. Finally, we demonstrate that our model can approximate arbitrarily complex attention distributions with a minimal number of clusters by approximating a pretrained BERT model on GLUE and SQuAD benchmarks with only 25 clusters and no loss in performance.
Author Information
Apoorv Vyas (Idiap Research Institute and EPFL)
Angelos Katharopoulos (Idiap & EPFL)
François Fleuret (University of Geneva)
François Fleuret got a PhD in Mathematics from INRIA and the University of Paris VI in 2000, and an Habilitation degree in Mathematics from the University of Paris XIII in 2006. He is Full Professor in the department of Computer Science at the University of Geneva, and Adjunct Professor in the School of Engineering of the École Polytechnique Fédérale de Lausanne. He has published more than 80 papers in peer-reviewed international conferences and journals. He is Associate Editor of the IEEE Transactions on Pattern Analysis and Machine Intelligence, serves as Area Chair for NeurIPS, AAAI, and ICCV, and in the program committee of many top-tier international conferences in machine learning and computer vision. He was or is expert for multiple funding agencies. He is the inventor of several patents in the field of machine learning, and co-founder of Neural Concept SA, a company specializing in the development and commercialization of deep learning solutions for engineering design. His main research interest is machine learning, with a particular focus on computational aspects and sample efficiency.
More from the Same Authors
-
2020 : Exact Preimages of Neural Network Aircraft Collision Avoidance Systems »
Kyle Matoba · François Fleuret -
2021 : Test time Adaptation through Perturbation Robustness »
Prabhu Teja Sivaprasad · François Fleuret -
2022 : Deformations of Boltzmann Distributions »
Bálint Máté · François Fleuret -
2022 : Diversity through Disagreement for Better Transferability »
Matteo Pagliardini · Martin Jaggi · François Fleuret · Sai Praneeth Karimireddy -
2023 Poster: Faster Causal Attention Over Large Sequences Through Sparse Flash Attention »
Matteo Pagliardini · Daniele Paliotta · Martin Jaggi · François Fleuret -
2023 Poster: SUPA: A Lightweight Diagnostic Simulator for Machine Learning in Particle Physics »
Atul Kumar Sinha · Daniele Paliotta · Bálint Máté · John Raine · Tobias Golling · François Fleuret -
2022 : Transformers are Sample-Efficient World Models »
Vincent Micheli · Eloi Alonso · François Fleuret -
2022 Poster: Flowification: Everything is a normalizing flow »
Bálint Máté · Samuel Klein · Tobias Golling · François Fleuret -
2022 Poster: Efficient Training of Low-Curvature Neural Networks »
Suraj Srinivas · Kyle Matoba · Himabindu Lakkaraju · François Fleuret -
2019 Poster: Reducing Noise in GAN Training with Variance Reduced Extragradient »
Tatjana Chavdarova · Gauthier Gidel · François Fleuret · Simon Lacoste-Julien -
2019 Demonstration: Real Time CFD simulations with 3D Mesh Convolutional Networks »
Pierre Baque · Pascal Fua · François Fleuret -
2019 Poster: Full-Gradient Representation for Neural Network Visualization »
Suraj Srinivas · François Fleuret -
2018 Poster: Practical Deep Stereo (PDS): Toward applications-friendly deep stereo matching »
Stepan Tulyakov · Anton Ivanov · François Fleuret -
2017 Poster: K-Medoids For K-Means Seeding »
James Newling · François Fleuret -
2017 Spotlight: K-Medoids For K-Means Seeding »
James Newling · François Fleuret -
2016 Poster: Nested Mini-Batch K-Means »
James Newling · François Fleuret -
2015 Poster: Kullback-Leibler Proximal Variational Inference »
Mohammad Emtiyaz Khan · Pierre Baque · François Fleuret · Pascal Fua -
2014 Demonstration: A 3D Simulator for Evaluating Reinforcement and Imitation Learning Algorithms on Complex Tasks »
Leonidas Lefakis · François Fleuret · Cijo Jose -
2013 Poster: Reservoir Boosting : Between Online and Offline Ensemble Learning »
Leonidas Lefakis · François Fleuret -
2011 Poster: Boosting with Maximum Adaptive Sampling »
Charles Dubout · François Fleuret -
2010 Demonstration: Platform to Share Feature Extraction Methods »
François Fleuret -
2010 Poster: Joint Cascade Optimization Using A Product Of Boosted Classifiers »
Leonidas Lefakis · François Fleuret