AtPatch: Debugging Transformers via Hot-Fixing Over-Attention
On the map: LLM safety and security → Backdoor and data poisoning attacks
Abstract (arXiv)
Transformer-based deep neural networks (DNNs) affected by backdoor attacks and unfairness typically exhibit anomalous attention patterns, leading to over-attend to backdoor triggers or protected attributes. Existing neuron-editing mitigation strategies often struggle to handle such situation and most of them lack flexibility and tend to distort feature representations. Motivated by such over-attention phenomenon and software engineering paradigms such as delta debugging and hot patching, we propose AtPatch, a hot-fix method that dynamically redistributes attention maps during model inference. Specifically, for a given input, AtPatch first extracts the attention map from the model's inference process. Then, it uses a pre-trained detector to identify anomalous columns and replace them with unified benign attention. Then, AtPatch rescales other columns to mitigate the impact of over-attention. Finally, AtPatch returns the redistributed attention map to the model for continued inference. Notably, if the detector does not report any anomalous columns, AtPatch directly returns the original attention map to the model. Unlike existing techniques, AtPatch selectively redistributes the attention map, making it better at preserving the model's original functionality. Furthermore, AtPatch's on-the-fly nature allows it to work without modifying model parameters or retraining, making it better suited for deployed models. We conducted extensive experiments to validate AtPatch. Experimental results show that, compared to existing methods, AtPatch can more effectively mitigate backdoor attacks and unfairness while better preserving the model's original functionality.
Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Placed in Backdoor and data poisoning attacks, one of 12 directions in LLM safety and security. Builds on 28 of its 62 references that are in the map. First posted on arXiv 29 Jan 2026.
Builds on
28 of 62 references.
Closest ancestors · 1
Same direction, newest first
- 2022Causality-based Neural Network Repair20 Apr
Other references · 27
- 2017Attention Is All You Needcited by 60,361
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 30,186
- 2021Swin Transformer: Hierarchical Vision Transformer using Shifted Windowscited by 12,139
- 2020A Simple Framework for Contrastive Learning of Visual Representationscited by 12,049
- 2017Fashion-MNIST: a Novel Image Dataset for Benchmarking Machine Learning Algorithmscited by 4,349
- 2017CARLA: An Open Urban Driving Simulatorcited by 2,449
- 2021Tokens-to-Token ViT: Training Vision Transformers from Scratch on ImageNetcited by 1,101
- 2019What Does BERT Look At? An Analysis of BERT's Attentioncited by 1,003
- 2020A Primer in BERTology: What we know about how BERT workscited by 815
- 2021Revisiting Deep Learning Models for Tabular Datacited by 740
- 2021Knowledge Neurons in Pretrained Transformerscited by 601
15 more
- 2019STRIP: A Defence Against Trojan Attacks on Deep Neural Networkscited by 459
- 2020TabTransformer: Tabular Data Modeling Using Contextual Embeddingscited by 409
- 2020TaBERT: Pretraining for Joint Understanding of Textual and Tabular Datacited by 398
- 2019Hidden Trigger Backdoor Attackscited by 371
- 2017DeepXplore: Automated Whitebox Testing of Deep Learning Systemscited by 311
- 2017DeepTest: Automated Testing of Deep-Neural-Network-driven Autonomous Carscited by 251
- 2019Analyzing the Structure of Attention in a Transformer Language Modelcited by 243
- 2021Adversarial Neuron Pruning Purifies Backdoored Deep Modelscited by 235
- 2020BadNL: Backdoor Attacks against NLP Models with Semantic-preserving Improvementscited by 211
- 2018DeepGauge: Multi-Granularity Testing Criteria for Deep Learning Systemscited by 147
- 2017Fairness Testing: Testing Software for Discriminationcited by 126
- 2019Do Attention Heads in BERT Track Syntactic Dependencies?cited by 88
- 2018DeepMutation: Mutation Testing of Deep Learning Systemscited by 67
- 2019NeuronInspect: Detecting Backdoors in Neural Networks via Output Explanationscited by 50
- 2024NeuFair: Neural Network Fairness Repair with Dropoutcited by 11
Built on by
Citing papers per year: 2026: 1.
1 paper.
Similar, not cited
Close in wording, no citation either way
- 2021Neural Attention Distillation: Erasing Backdoor Triggers from Deep Neural Networks
- 2026When Attention Betrays: Erasing Backdoor Attacks in Robotic Policies by Reconstructing Visual Tokens
- 2026EntropyScan: Towards Model-level Backdoor Detection in LVLMs via Visual Attention Entropy
- 2026Corrupting Attention: Evasion-Based Adversarial Attacks on Encoder Attention in Detection Transformers
- 2026Test-Time Attention Purification for Backdoored Large Vision Language Models
- 2025Vision Transformers Don't Need Trained Registers
- 2023AttMEMO : Accelerating Transformers with Memoization on Big Memory Systems
- 2025Value-State Gated Attention for Mitigating Extreme-Token Phenomena in Transformers