mlsanityData to 14 Oct 2026

Sliceformer: Make Multi-head Attention as Simple as Sorting in Discriminative Tasks

arXiv 2310.17683 ↗First posted 26 Oct 2023cs.LGcited by 1

Not on the map. Why?

Abstract (arXiv)

As one of the most popular neural network modules, Transformer plays a central role in many fundamental deep learning models, e.g., the ViT in computer vision and the BERT and GPT in natural language processing. The effectiveness of the Transformer is often attributed to its multi-head attention (MHA) mechanism. In this study, we discuss the limitations of MHA, including the high computational complexity due to its ``query-key-value'' architecture and the numerical issue caused by its softmax operation. Considering the above problems and the recent development tendency of the attention layer, we propose an effective and efficient surrogate of the Transformer, called Sliceformer. Our Sliceformer replaces the classic MHA mechanism with an extremely simple ``slicing-sorting'' operation, i.e., projecting inputs linearly to a latent space and sorting them along different feature dimensions (or equivalently, called channels). For each feature dimension, the sorting operation implicitly generates an implicit attention map with sparse, full-rank, and doubly-stochastic structures. We consider different implementations of the slicing-sorting operation and analyze their impacts on the Sliceformer. We test the Sliceformer in the Long-Range Arena benchmark, image classification, text classification, and molecular property prediction, demonstrating its advantage in computational complexity and universal effectiveness in discriminative tasks. Our Sliceformer achieves comparable or better performance with lower memory cost and faster speed than the Transformer and its variants. Moreover, the experimental results reveal that applying our Sliceformer can empirically suppress the risk of mode collapse when representing data. The code is available at urlhttps://github.com/SDS-Lab/sliceformer.

Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Builds on 33 of its 43 references that are in the map. First posted on arXiv 26 Oct 2023.

Builds on

33 of 43 references.

References · 33

  1. 2017Attention Is All You Needcited by 60,361
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
  3. 2020Language Models are Few-Shot Learnerscited by 32,419
  4. 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 30,186
  5. 2021Swin Transformer: Hierarchical Vision Transformer using Shifted Windowscited by 12,139
  6. 2020Longformer: The Long-Document Transformercited by 3,413
  7. 2019XLNet: Generalized Autoregressive Pretraining for Language Understandingcited by 2,811
  8. 2021Efficiently Modeling Long Sequences with Structured State Spacescited by 2,465
  9. 2020Informer: Beyond Efficient Transformer for Long Sequence Time-Series Forecastingcited by 2,169
  10. 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 2,022
  11. 2019Transformer-XL: Attentive Language Models Beyond a Fixed-Length Contextcited by 1,850
  12. 2021ViViT: A Video Vision Transformercited by 1,620
21 more
  1. 2020Rethinking Attention with Performerscited by 1,601
  2. 2019Generating Long Sequences with Sparse Transformerscited by 1,546
  3. 2020Linformer: Self-Attention with Linear Complexitycited by 1,474
  4. 2020Point Transformercited by 1,470
  5. 2021MLP-Mixer: An all-MLP Architecture for Visioncited by 1,446
  6. 2022Simplified State Space Layers for Sequence Modelingcited by 788
  7. 2020Long Range Arena: A Benchmark for Efficient Transformerscited by 700
  8. 2021Attention is Not All You Need: Pure Attention Loses Rank Doubly Exponentially with Depthcited by 419
  9. 2021OGB-LSC: A Large-Scale Challenge for Machine Learning on Graphscited by 329
  10. 2021Do Transformers Really Perform Bad for Graph Representation?cited by 320
  11. 2021Mesh Graphormercited by 265
  12. 2020Sparse Sinkhorn Attentioncited by 251
  13. 2020Transformer Hawkes Processcited by 235
  14. 2019Transformer Dissection: A Unified Understanding of Transformer's Attention via the Lens of Kernelcited by 213
  15. 2022cosFormer: Rethinking Softmax in Attentioncited by 213
  16. 2020Synthesizer: Rethinking Self-Attention in Transformer Modelscited by 205
  17. 2022Mega: Moving Average Equipped Gated Attentioncited by 179
  18. 2021Sinkformers: Transformers with Doubly Stochastic Attentioncited by 138
  19. 2021Visformer: The Vision-friendly Transformercited by 137
  20. 2018ListOps: A Diagnostic Dataset for Latent Tree Learningcited by 129
  21. 2018Learning long-range spatial dependencies with horizontal gated-recurrent unitscited by 98

Built on by

Cited by year

Citing papers per year: 2025: 1.

1 paper.