Transformer Meets Twicing: Harnessing Unattended Residual Information
Not on the map. Why?
Abstract (arXiv)
Transformer-based deep learning models have achieved state-of-the-art performance across numerous language and vision tasks. While the self-attention mechanism, a core component of transformers, has proven capable of handling complex data patterns, it has been observed that the representational capacity of the attention matrix degrades significantly across transformer layers, thereby hurting its overall performance. In this work, we leverage the connection between self-attention computations and low-pass non-local means (NLM) smoothing filters and propose the Twicing Attention, a novel attention mechanism that uses kernel twicing procedure in nonparametric regression to alleviate the low-pass behavior of associated NLM smoothing with compelling theoretical guarantees and enhanced adversarial robustness. This approach enables the extraction and reuse of meaningful information retained in the residuals following the imperfect smoothing operation at each layer. Our proposed method offers two key advantages over standard self-attention: 1) a provably slower decay of representational capacity and 2) improved robustness and accuracy across various data modalities and tasks. We empirically demonstrate the performance gains of our model over baseline transformers on multiple tasks and benchmarks, including image classification and language modeling, on both clean and corrupted data.
Key facts. Cited by 3 papers in the map (data through 14 Oct 2026). Builds on 60 of its 88 references that are in the map. First posted on arXiv 2 Mar 2025.
Builds on
60 of 88 references.
References · 60
- 2017Attention Is All You Needcited by 60,361
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2021Learning Transferable Visual Models From Natural Language Supervisioncited by 33,744
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
- 2021Swin Transformer: Hierarchical Vision Transformer using Shifted Windowscited by 12,139
- 2014ImageNet Large Scale Visual Recognition Challengecited by 8,498
- 2014Explaining and Harnessing Adversarial Examplescited by 7,364
- 2021Emerging Properties in Self-Supervised Vision Transformerscited by 6,968
- 2017Towards Deep Learning Models Resistant to Adversarial Attackscited by 6,415
- 2020Training data-efficient image transformers & distillation through attentioncited by 4,586
- 2014Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translationcited by 4,057
- 2016Pointer Sentinel Mixture Modelscited by 3,096
38 more
- 2021Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsitycited by 3,073
- 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 2,022
- 2019Transformer-XL: Attentive Language Models Beyond a Fixed-Length Contextcited by 1,850
- 2021Decision Transformer: Reinforcement Learning via Sequence Modelingcited by 1,546
- 2019Natural Adversarial Examplescited by 1,408
- 2016Semantic Understanding of Scenes through the ADE20K Datasetcited by 1,069
- 2019BERT Rediscovers the Classical NLP Pipelinecited by 1,059
- 2021Transformers in Vision: A Surveycited by 1,013
- 2023Vision Transformers Need Registerscited by 871
- 2021Segmenter: Transformer for Semantic Segmentationcited by 855
- 2020Efficient Transformers: A Surveycited by 790
- 2021Offline Reinforcement Learning as One Big Sequence Modeling Problemcited by 644
- 2021Rethinking Graph Transformers with Spectral Attentioncited by 473
- 2021Attention is Not All You Need: Pure Attention Loses Rank Doubly Exponentially with Depthcited by 419
- 2021A Survey of Transformerscited by 401
- 2017A Structured Self-attentive Sentence Embeddingcited by 318
- 2019Analyzing the Structure of Attention in a Transformer Language Modelcited by 243
- 2018Adaptive Input Representations for Neural Language Modelingcited by 226
- 2018Adversarial Risk and the Dangers of Evaluating Against Weak Attackscited by 221
- 2016A Decomposable Attention Model for Natural Language Inferencecited by 215
- 2019Transformer Dissection: A Unified Understanding of Transformer's Attention via the Lens of Kernelcited by 213
- 2021On the Robustness of Vision Transformers to Adversarial Examplescited by 167
- 2022Understanding The Robustness in Vision Transformerscited by 144
- 2018Character-Level Language Modeling with Deeper Self-Attentioncited by 138
- 2021Sinkformers: Transformers with Doubly Stochastic Attentioncited by 138
- 2021Towards Robust Vision Transformercited by 137
- 2022Anti-Oversmoothing in Deep Vision Transformers via the Fourier Domain Analysis: From Theory to Practicecited by 136
- 2019Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of Viewcited by 113
- 2022Revisiting Over-smoothing and Over-squashing Using Ollivier-Ricci Curvaturecited by 98
- 2023Transformers as Support Vector Machinescited by 74
- 2022Revisiting Over-smoothing in BERT from the Perspective of Graphcited by 72
- 2023Demystifying Oversmoothing in Attention-Based Graph Neural Networkscited by 49
- 2024Denoising: A Powerful Building-Block for Imaging, Inverse Problems, and Machine Learningcited by 35
- 2023Mitigating Over-smoothing in Transformers via Regularized Nonlocal Functionalscited by 32
- 2021Improving Transformers with Probabilistic Attention Keyscited by 28
- 2021FMMformer: Efficient and Flexible Transformer via Decomposed Near-field and Far-field Attentioncited by 26
- 2024Equivariant Neural Functional Networks for Transformerscited by 22
- 2021Modeling Concentrated Cross-Attention for Neural Machine Translation with Gaussian Mixture Modelcited by 18
50 most cited of 60 All 60 (JSON)
Built on by
Citing papers per year: 2025: 2; 2026: 1.
3 papers.