Publication Type
Conference Proceeding Article
Version
publishedVersion
Publication Date
9-2026
Abstract
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.
Keywords
Transformer, Model Debugging, Over-Attention
Discipline
Software Engineering
Research Areas
Data Science and Engineering
Areas of Excellence
Digital transformation
Publication
ICSE-NIER '26: Proceedings of the IEEE/ACM 48th International Conference on Software Engineering, Rio de Janeiro, Brazil, April 12-18
First Page
2811
Last Page
2833
ISBN
979-8-4007-2025-3
Identifier
10.1145/3744916.376455
Publisher
Association for Computing Machinery
City or Country
New York, NY, United States
Citation
WENG, Shihao; FENG, Yang; LI, Jincheng; YIN, Yining; XIE, Xiaofei; and LIU, Jia.
AtPatch: debugging transformers via hot-fixing over-attention. (2026). ICSE-NIER '26: Proceedings of the IEEE/ACM 48th International Conference on Software Engineering, Rio de Janeiro, Brazil, April 12-18. 2811-2833.
Available at: https://ink.library.smu.edu.sg/sis_research/11438
Creative Commons License

This work is licensed under a Creative Commons Attribution-NonCommercial-No Derivative Works 4.0 International License.