paperbot · PL 论文追踪

全部论文 待读 收藏

P2 AtPatch: Debugging Transformers via Hot-Fixing Over-Attention

AtPatch:通过热修复过度注意力调试 Transformer
ICSE Proceedings of the 2026 IEEE/ACM 48th International Conference on Software Engineering2026匹配度 2/10 · 该论文研究的是 Transformer 注意力图的推理时热修复,用于缓解后门与不公平,属于机器学习模型调试/修复,并非用户关注的在 ML/Agentic 程序上做静态分析、用 LLM/Agent 改进静态分析、浮点程序分析或贝叶斯程序分析。虽然标签含“程序语言”和调试修复,但方法核心不涉及程序分析或 LLM/Agent 与 PL 的交叉。引用 0 inbox
Shihao Weng, Yang Feng, Jincheng Li, Yining Yin, Xiaofei Xie, Jia Liu
crossref: 2026-09-12

AI 速览

一句话:提出 AtPatch,在推理时动态重分布注意力图,热修复 Transformer 的过度注意力,缓解后门与不公平。

受后门攻击和不公平影响的 Transformer 常出现异常注意力模式,表现为过度关注后门触发器或受保护属性。现有神经元编辑缓解方法难以处理该问题,且缺乏灵活性并容易扭曲特征表示。受增量调试与热补丁等软件工程范式启发,AtPatch 在模型推理过程中动态重分布注意力图:先提取注意力图,用预训练检测器识别异常列并替换为统一的良性注意力,再重缩放其他列以减轻过度注意力,最后将重分布后的注意力图返回模型继续推理;若未检测到异常列,则直接返回原始注意力图。该方法无需修改模型参数或重新训练,更适合已部署模型。实验表明,与现有方法相比,AtPatch 能更有效缓解后门攻击和不公平,同时更好保留模型原有功能。

问题
Transformer 受到后门攻击或存在不公平性时,常会过度关注后门触发器或受保护属性,而现有神经元编辑方法灵活性不足,且容易破坏原始特征表示。
方法
AtPatch 在推理时提取注意力图,用预训练检测器识别异常列,将其替换为统一的良性注意力并重缩放其他列,然后返回重分布后的注意力图继续推理;无异常时保持原图不变。
评估
通过大量实验与现有方法对比,验证 AtPatch 在缓解后门攻击和不公平性方面的效果,并评估其对模型原有功能的保留程度。
原文摘要(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.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@inproceedings{paperbot11925,
  title = {AtPatch: Debugging Transformers via Hot-Fixing Over-Attention},
  author = {Shihao Weng and Yang Feng and Jincheng Li and Yining Yin and Xiaofei Xie and Jia Liu},
  booktitle = {ICSE},
  year = {2026},
  doi = {10.1145/3744916.3764559}
}