arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2604.00938cs.LGcs.AI
收藏

WARP:NLP Transformer 内层修复的保证性方法

WARP: Guaranteed Inner-Layer Repair of NLP Transformers

National Chengchi University(国立政治大学)

Hsin-Ling Hsu, Min-Yu Chen, Nai-Chia Chen, Yan-Ru Chen, Yi-Ling Chang, Fang Yu

AI总结:

WARP 提出一种基于约束的修复框架,通过凸二次规划在 Transformer 模型的内层进行修复,提供正确分类、保留集约束和鲁棒半径保证,提升对抗鲁棒性。

摘要:

基于 Transformer 的 NLP 模型仍易受对抗扰动影响,现有修复方法面临根本性权衡:基于梯度的方法灵活但不可验证且易过拟合;提供修复保证的方法受限于最后一层或小网络,显著限制了参数搜索空间。本文提出 WARP(Weight-Adjusted Repair with Provability),一种基于约束的修复框架,将修复扩展到 Transformer 模型的内层。WARP 将修复建模为从 logit 间隙的一阶线性化导出的凸二次规划,从而在高维参数空间上实现可解优化。在第一阶近似成立的条件下,该方法诱导出三个每样本保证:(i)正边距约束确保修复输入的正确分类,(ii)在指定保留集上的保留约束,以及(iii)源自 Lipschitz 连续的认证鲁棒半径。为确保在不同模型架构下的可行性,我们引入基于敏感度的预处理步骤,以相应调整优化景观。我们进一步表明,在温和假设下,迭代优化过程收敛于满足所有修复约束的解。在 encoder-only Transformers 上的实验证明,这些保证在实践中成立并提升了对抗输入的鲁棒性。我们的结果表明,通过原理化的约束优化方法,可以实现保证的、可推广的 Transformer 修复。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑