CAST: Clustering self-Attention using Surrogate Tokens for efficient transformers

The Transformer architecture has shown to be a powerful tool for a wide range of tasks. It is based on the self-attention mechanism, which is an inherently computationally expensive operation with quadratic computational complexity: memory usage and compute time increase quadratically with the length of the input sequences, thus limiting the application of Transformers. In this work, we propose a novel Clustering self-Attention mechanism using Surrogate Tokens (CAST), to optimize the attention computation and achieve efficient transformers. CAST utilizes learnable surrogate tokens to construct a cluster affinity matrix, used to cluster the input sequence and generate novel cluster summaries. The self-attention from within each cluster is then combined with the cluster summaries of other clusters, enabling information flow across the entire input sequence. CAST improves efficiency by reducing the complexity from O ( N 2 ) to O ( α N ) where N is the sequence length, and α is constant according to the number of clusters and samples per cluster. We show that CAST performs better than or comparable to the baseline Transformers on long-range sequence modeling tasks, while also achieving higher results on time and memory efficiency than other efficient transformers. • Computation of self-attention Transformers is limited by the input sequence length. • We propose CAST, an efficient self-attention mechanism with clustered attention. • We propose the use of surrogate tokens to optimize self-attention in transformers. • We observe that cluster summaries enhance training efficiency and results. • CAST reduces complexity of self-attention computation from O ( N 2 ) to O ( α N ) .

Authors

Institutions

Publication Details

Journal
Pattern Recognition Letters
Published
2024-09-06
DOI
https://doi.org/10.1016/j.patrec.2024.08.024
Citations
4
Primary Topic
Topic Modeling
Type
article
Field-Weighted Citation Impact
1.39
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

CAST: Clustering self-Attention using Surrogate Tokens for efficient transformers

Adjorn van Engelenhoven, Estefanía Talavera, Nicola Strisciuglio
4 citations
Pattern Recognition Letters
Topic Modeling
1.39
article

CAST: Clustering self-Attention using Surrogate Tokens for efficient transformers

Adjorn van Engelenhoven, Estefanía Talavera, Nicola Strisciuglio
article en
4 citations

Abstract

The Transformer architecture has shown to be a powerful tool for a wide range of tasks. It is based on the self-attention mechanism, which is an inherently computationally expensive operation with quadratic computational complexity: memory usage and compute time increase quadratically with the length of the input sequences, thus limiting the application of Transformers. In this work, we propose a novel Clustering self-Attention mechanism using Surrogate Tokens (CAST), to optimize the attention computation and achieve efficient transformers. CAST utilizes learnable surrogate tokens to construct a cluster affinity matrix, used to cluster the input sequence and generate novel cluster summaries. The self-attention from within each cluster is then combined with the cluster summaries of other clusters, enabling information flow across the entire input sequence. CAST improves efficiency by reducing the complexity from O ( N 2 ) to O ( α N ) where N is the sequence length, and α is constant according to the number of clusters and samples per cluster. We show that CAST performs better than or comparable to the baseline Transformers on long-range sequence modeling tasks, while also achieving higher results on time and memory efficiency than other efficient transformers. • Computation of self-attention Transformers is limited by the input sequence length. • We propose CAST, an efficient self-attention mechanism with clustered attention. • We propose the use of surrogate tokens to optimize self-attention in transformers. • We observe that cluster summaries enhance training efficiency and results. • CAST reduces complexity of self-attention computation from O ( N 2 ) to O ( α N ) .

Pattern Recognition LettersVol. 186
University of Twente (NL)
Openalex Percentile: Top 16%
Topic Modeling
1.39
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.