Transformer-based NLP models remain vulnerable to adversarial perturbations, yet existing repair methods face a fundamental trade-off: gradient-based approaches offer flexibility but lack verifiability and often overfit; methods that do provide repair guarantees are restricted to the final layer or small networks, significantly limiting the parameter search space available for repair. We present WARP (Weight-Adjusted Repair with Provability), a constraint-based repair framework that extends repair beyond the last layer of Transformer models. WARP formulates repair as a convex quadratic program derived from a first-order linearization of the logit gap, enabling tractable optimization over a high-dimensional parameter space. Under the condition that the first-order approximation holds, this formulation induces three per-sample guarantees: (i) a positive margin constraint ensuring correct classification on repaired inputs, (ii) preservation constraints over a designated remain set, and (iii) a certified robustness radius derived from Lipschitz continuity. To ensure feasibility across varying model architectures, we introduce a sensitivity-based preprocessing step that conditions the optimization landscape accordingly. We further show that the iterative optimization procedure converges to solutions satisfying all repair constraints under mild assumptions. Empirical evaluation on encoder-only Transformers with varying layer architectures validates that these guarantees hold in practice while improving robustness to adversarial inputs. Our results demonstrate that guaranteed, generalizable Transformer repair is achievable through principled constraint-based optimization.


翻译:基于Transformer的NLP模型仍然容易受到对抗性扰动的影响,而现有修复方法面临一个根本性权衡:基于梯度的方案虽灵活但缺乏可验证性且易过拟合;提供修复保证的方法则局限于最后一层或小规模网络,显著限制了修复可用的参数搜索空间。我们提出WARP(可证明的权重调整修复),一种基于约束的修复框架,将修复范围扩展至Transformer模型的最后一层之外。WARP将修复形式化为源自对数几率差一阶线性化的凸二次规划,从而实现对高维参数空间的可处理优化。在一阶近似成立条件下,该公式产生三种每样本保证:(i)确保修复输入正确分类的正边界约束,(ii)指定保留集上的保持约束,以及(iii)基于Lipschitz连续性推导的认证鲁棒半径。为确保跨不同模型架构的可行性,我们引入基于灵敏度的预处理步骤,据此优化优化问题的求解环境。我们进一步证明,在温和假设下,迭代优化过程收敛至满足所有修复约束的解。对具有不同层架构的编码器-only Transformer进行的实验验证表明,这些保证在实践中成立,同时提升了对抗性输入的鲁棒性。我们的结果表明,通过基于原则的约束优化,可实现有保证且可泛化的Transformer修复。

0
下载
关闭预览

相关内容

【ICML2022】XAI for Transformers:通过保守传播更好的解释
专知会员服务
16+阅读 · 2022年7月19日
【AAAI2022】基于分层随机注意的Transformer 不确定性估计
专知会员服务
29+阅读 · 2021年12月29日
专知会员服务
16+阅读 · 2020年7月27日
深度学习的下一步:Transformer和注意力机制
云头条
56+阅读 · 2019年9月14日
【学界】DeepMind论文:深度压缩感知,新框架提升GAN性能
GAN生成式对抗网络
14+阅读 · 2019年5月23日
NLP通用模型诞生?一个模型搞定十大自然语言常见任务
人工智能头条
10+阅读 · 2018年6月29日
自然语言处理(二)机器翻译 篇 (NLP: machine translation)
DeepLearning中文论坛
12+阅读 · 2015年7月1日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
VIP会员
最新内容
《特种部队在透明战场中的生存力》最新报告
专知会员服务
0+阅读 · 22分钟前
《人工智能生成的零日漏洞:对未来作战的影响》
综述 | 3D场景图:开放挑战与未来方向
专知会员服务
7+阅读 · 6月22日
21世纪的无人机战争
专知会员服务
4+阅读 · 6月22日
《量子技术的军事任务技术适配与利用》
专知会员服务
5+阅读 · 6月22日
美国从乌克兰无人机战争中学习经验
专知会员服务
7+阅读 · 6月21日
ICML 2026 | 面向视觉语言模型的语义鲁棒性认证
专知会员服务
5+阅读 · 6月21日
相关VIP内容
【ICML2022】XAI for Transformers:通过保守传播更好的解释
专知会员服务
16+阅读 · 2022年7月19日
【AAAI2022】基于分层随机注意的Transformer 不确定性估计
专知会员服务
29+阅读 · 2021年12月29日
专知会员服务
16+阅读 · 2020年7月27日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员