Lune

NeurIPS2023Top-tier venue

Designing Robust Transformers using Robust Kernel Density Estimation

Xing Han, Tongzheng Ren, Tan Nguyen, Khai Nguyen, Joydeep Ghosh, Nhat Ho

Abstract

Transformer-based architectures have recently exhibited remarkable successes across different domains beyond just powering large language models. However, existing approaches typically focus on predictive accuracy and computational cost, largely ignoring certain other practical issues such as robustness to contaminated samples. In this paper, by re-interpreting the self-attention mechanism as a non-parametric kernel density estimator, we adapt classical robust kernel density estimation methods to develop novel classes of transformers that are resistant to adversarial attacks and data contamination. We first propose methods that down-weight outliers in RKHS when computing the self-attention operations. We empirically show that these methods produce improved performance over existing state-of-the-art methods, particularly on image data under adversarial attacks. Then we leverage the median-of-means principle to obtain another efficient approach that results in noticeably enhanced performance and robustness on language modeling and time series classification tasks. Our methods can be combined with existing transformers to augment their robust properties, thus promising to impact a wide variety of applications.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

10 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • AdanCA: Neural Cellular Automata As Adaptors For More Robust Vision Transformer cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • AdanCA: Neural Cellular Automata As Adaptors For More Robust Vision Transformer cites Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
  • AdanCA: Neural Cellular Automata As Adaptors For More Robust Vision Transformer cites Training data-efficient image transformers & distillation through attention
  • Elliptical Attention cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Elliptical Attention cites Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
  • Elliptical Attention cites Learning Transferable Visual Models From Natural Language Supervision
  • Elliptical Attention cites Training data-efficient image transformers & distillation through attention
  • Elliptical Attention cites Unveiling the Hidden Structure of Self-Attention via Kernel Principal Component Analysis
  • Unveiling the Hidden Structure of Self-Attention via Kernel Principal Component Analysis cites Elliptical Attention
  • ProTransformer: Robustify Transformers via Plug-and-Play Paradigm cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • ProTransformer: Robustify Transformers via Plug-and-Play Paradigm cites Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
  • ProTransformer: Robustify Transformers via Plug-and-Play Paradigm cites Training data-efficient image transformers & distillation through attention
  • An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale cites Language Models are Few-Shot Learners
  • Swin Transformer: Hierarchical Vision Transformer using Shifted Windows cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Swin Transformer: Hierarchical Vision Transformer using Shifted Windows cites Learning Transferable Visual Models From Natural Language Supervision
  • Swin Transformer: Hierarchical Vision Transformer using Shifted Windows cites Training data-efficient image transformers & distillation through attention
  • In-Context Learning with Transformers: Softmax Attention Adapts to Function Lipschitzness cites Language Models are Few-Shot Learners
  • Learning Transferable Visual Models From Natural Language Supervision cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Learning Transferable Visual Models From Natural Language Supervision cites Language Models are Few-Shot Learners
  • Training data-efficient image transformers & distillation through attention cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Unveiling the Hidden Structure of Self-Attention via Kernel Principal Component Analysis cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Unveiling the Hidden Structure of Self-Attention via Kernel Principal Component Analysis cites Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
  • Unveiling the Hidden Structure of Self-Attention via Kernel Principal Component Analysis cites Language Models are Few-Shot Learners
  • Unveiling the Hidden Structure of Self-Attention via Kernel Principal Component Analysis cites Learning Transferable Visual Models From Natural Language Supervision
  • Unveiling the Hidden Structure of Self-Attention via Kernel Principal Component Analysis cites Training data-efficient image transformers & distillation through attention
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers10

  1. In-Context Learning with Transformers: Softmax Attention Adapts to Function LipschitznessLiam Collins, Advait Parulekar, Aryan Mokhtari, Sujay Sanghavi et al.NeurIPS 2024 · 33 citations
  2. Elliptical AttentionStefan K. Nielsen, Laziz U. Abdullaev, Rachel S. Y. Teo, Tan NguyenNeurIPS 2024 · 12 citations
  3. Unveiling the Hidden Structure of Self-Attention via Kernel Principal Component AnalysisRachel S. Y. Teo, Tan M. NguyenNeurIPS 2024 · 11 citations
  4. ProTransformer: Robustify Transformers via Plug-and-Play ParadigmZhichao Hou, Weizhi Gao, Yuchen Shen, Feiyi Wang et al.NeurIPS 2024 · 9 citations
  5. AdanCA: Neural Cellular Automata As Adaptors For More Robust Vision TransformerYitao Xu, Tong Zhang, Sabine SüsstrunkNeurIPS 2024 · 5 citations

Builds on32

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. Learning Transferable Visual Models From Natural Language SupervisionAlec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh et al.ICML 2021 · 47,906 citations
  3. Swin Transformer: Hierarchical Vision Transformer using Shifted WindowsZe Liu, Yutong Lin, Yue Cao, Han Hu et al.ICCV 2021 · 31,683 citations
  4. An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn et al.ICLR 2021 · 21,477 citations
  5. Training data-efficient image transformers & distillation through attentionHugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa et al.ICML 2021 · 8,974 citations

Related papers

  1. Robust Kernel Density Estimation with Median-of-Means principlePierre Humbert, Batiste Le Bars, Ludovic MinvielleICML 2022 · 19 citations
  2. Transformer Meets Twicing: Harnessing Unattended Residual InformationLaziz U. Abdullaev, Tan Minh NguyenICLR 2025
  3. On the Optimality of the Median-of-Means Estimator under Adversarial ContaminationXabier de Juan, Santiago MazuelasNeurIPS 2025
  4. Adversarial Self-Attention for Language UnderstandingHongqiu Wu, Ruixue Ding, Hai Zhao, Pengjun Xie et al.AAAI 2023 · 19 citations
  5. Can CNNs Be More Robust Than Transformers?Zeyu Wang, Yutong Bai, Yuyin Zhou, Cihang XieICLR 2023 · 14 citations
Dusk over the sea between two cliffs drawn in fine vertical lines