[Paper Review] Centroid Transformers: Learning to Abstract with Attention
This paper introduces centroid attention, a novel transformer mechanism that compresses N input tokens into M < N representative centroids via amortized gradient descent on a clustering objective, enabling efficient, information-preserving abstraction. The resulting centroid transformers achieve state-of-the-art performance in text summarization, 3D vision, and image classification with up to 50% lower computational cost than standard transformers.
Self-attention, as the key block of transformers, is a powerful mechanism for extracting features from the inputs. In essence, what self-attention does is to infer the pairwise relations between the elements of the inputs, and modify the inputs by propagating information between input pairs. As a result, it maps inputs to N outputs and casts a quadratic $O(N^2)$ memory and time complexity. We propose centroid attention, a generalization of self-attention that maps N inputs to M outputs $(M\leq N)$, such that the key information in the inputs are summarized in the smaller number of outputs (called centroids). We design centroid attention by amortizing the gradient descent update rule of a clustering objective function on the inputs, which reveals an underlying connection between attention and clustering. By compressing the inputs to the centroids, we extract the key information useful for prediction and also reduce the computation of the attention module and the subsequent layers. We apply our method to various applications, including abstractive text summarization, 3D vision, and image processing. Empirical results demonstrate the effectiveness of our method over the standard transformers.
Motivation & Objective
- To address the quadratic O(N²) memory and computation cost of standard self-attention in transformers.
- To enable information abstraction by summarizing N input tokens into M < N representative centroids.
- To establish a differentiable, trainable connection between attention mechanisms and clustering algorithms.
- To reduce computational and memory overhead in transformer architectures without sacrificing model performance.
- To provide a general-purpose, adaptive down-sampling module for transformers across diverse domains.
Proposed method
- Centroid attention is derived by amortizing the gradient descent update rule of a differentiable clustering objective function over input embeddings.
- The method learns a trainable similarity metric and assigns each input to the nearest centroid via gradient-based optimization.
- The output is a set of M centroids that summarize the key information from N inputs, reducing dimensionality and computational cost to O(NM).
- The centroid attention module is inserted between standard self-attention layers to form a centroid transformer architecture.
- The approach is end-to-end differentiable and compatible with existing transformer components, including skip connections.
- The method avoids storing pairwise assignment matrices, reducing memory usage compared to routing-based methods like capsule networks.
Experimental results
Research questions
- RQ1Can a differentiable attention mechanism be derived from clustering optimization to enable efficient, information-preserving abstraction in transformers?
- RQ2How does replacing standard self-attention with centroid attention affect model performance and computational efficiency across diverse tasks?
- RQ3Can centroid attention serve as a general-purpose, adaptive down-sampling mechanism in transformer-based models?
- RQ4Does the connection between gradient-based clustering and attention lead to more semantically meaningful representations than standard attention?
- RQ5How does the centroid transformer compare to state-of-the-art efficient transformer variants in terms of accuracy and inference cost?
Key findings
- In abstractive text summarization, the centroid transformer achieves performance comparable to standard transformers while reducing computational cost by approximately 50%.
- On 3D point cloud classification, the centroid transformer outperforms state-of-the-art transformer models in both accuracy and efficiency.
- For image classification, the centroid transformer achieves higher accuracy than existing transformer networks with reduced FLOPs and memory usage.
- When replacing the dynamic routing module in 3D capsule networks, centroid attention yields lower reconstruction error, reduced storage consumption, and more semantically meaningful latent representations.
- The method establishes a novel, trainable connection between attention and clustering, enabling effective information summarization without relying on hand-designed routing or pooling strategies.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.