arXiv:2605.14294cs.AIcs.LG2026-05中稿 · CAV 2026

用ReLU特性提升Transformer验证精度,减少误报。

Precise Verification of Transformers through ReLU-Catalyzed Abstraction Refinement

论文配图:Precise Verification of Transformers through ReLU-Catalyzed Abstraction Refinement
图 1 · 摘自论文原文
  • 利用ReLU构建点积的精确非线性边界
  • 在多个模型和情感分析数据集上精度显著优于基线
  • 适合需要高可信度验证的安全关键场景

由于Transformer在安全关键应用中的广泛应用,其形式化验证变得愈发重要。与传统神经网络相比,Transformer推理涉及高度复杂的计算(如自注意力层中的点积),导致验证极为困难。现有方法通过构建凸约束进行过度近似,虽效率高但牺牲了精度,常引发大量误报。本文提出一种新方法,通过创新使用ReLU,对点积构建精确但非线性的边界,并进一步利用已有ReLU凸松弛文献推导出更精确的输出范围。我们扩展了两种经典方法——基于规则与基于优化的方法,分别形成适用于Transformer的新验证框架。在多个模型架构及源自情感分析数据集的鲁棒性属性上评估,结果表明:相比最先进基线,本方法在多数验证任务中实现显著精度提升,且效率损失可接受,验证了方法的有效性。

原文摘要 · Abstract (English)

Formal verification of transformers has become increasingly important due to their widespread deployment in safety-critical applications. Compared to classic neural networks, the inferences of transformers involve highly complex computations, such as dot products in self-attention layers, rendering their verification extremely difficult. Existing approaches explored over-approximation methods by constructing convex constraints to bound the output ranges of transformers, which can achieve high efficiency. However, they may sacrifice verification precision, and consequently introduce significant approximation error that leads to frequent occurrences of false alarms. In this paper, we propose a transformer verification approach that can achieve improved precision. At the core of our approach is a novel usage of ReLU, by which we represent a precise but non-linear bound for dot products such that we can further exploit the rich body of literature for convex relaxation of ReLU to derive precise bounds. We extend two classic approaches to the context of transformers, a rule-based one and an optimization-based one, resulting in two new frameworks for efficient and precise verification. We evaluate our approaches on different model architectures and robustness properties derived from two datasets about sentiment analysis, and compare with the state-of-the-art baseline approach. Compared to the baseline, our approach can achieve significant precision improvement for most of the verification tasks with acceptable compromise of efficiency, which demonstrates the effectiveness of our approach.

Transformer形式验证深度学习

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。