Abstract: Linear relaxation based perturbation analysis (LiRPA) for neural networks, which computes provable linear bounds of output neurons given a certain amount of input perturbation, has become a core component in robustness verification and certified defense. The majority of LiRPA-based methods only consider simple feed-forward networks and it needs particular manual derivations and implementations when extended to other architectures. In this paper, we develop an automatic framework to enable perturbation analysis on any neural network structures, by generalizing exiting LiRPA algorithms such as CROWN to operate on general computational graphs. The flexibility, differentiability and ease of use of our framework allow us to obtain state-of-the-art results on LiRPA based certified defense on fairly complicated networks like DenseNet, ResNeXt and Transformer that are not supported by prior work. Our framework also enables loss fusion, a technique that significantly reduces the computational complexity of LiRPA for certified defense. For the first time, we demonstrate LiRPA based certified defense on Tiny ImageNet and Downscaled ImageNet where previous approaches cannot scale to due to the relatively large number of classes. Our work also yields an open-source library for the community to apply LiRPA to areas beyond certified defense without much LiRPA expertise, e.g., we create a neural network with a provably flat optimization landscape.
Introduction
Deep neural networks are notoriously vulnerable to adversarial attacks—small, calculated perturbations to input data that cause incorrect classifications. Certified defense aims to provide a mathematical guarantee that a model's output will remain constant within a certain "perturbation budget" (e.g., an $\ell_p$ ball around the input).
The state-of-the-art method for this is LiRPA, which computes linear upper and lower bounds for output neurons. However, LiRPA has historically suffered from two major bottlenecks: manual complexity and scalability. Implementing LiRPA for new architectures (like ResNets or Transformers) required tedious manual derivations and custom code, effectively keeping robustness research in a "pre-automatic differentiation" era. Furthermore, existing LiRPA methods scale linearly with the number of output classes ($K$), making datasets like ImageNet ($K=1000$) computationally prohibitive.
Automatic Bound Propagation
The authors introduce auto_LiRPA, an automatic framework that treats the neural network as a Directed Acyclic Graph (DAG). Similar to how modern deep learning frameworks handle backpropagation, this framework automatically "glues" together linear relaxations of individual nodes.
It supports both Forward Mode (propagating bounds from input to output) and Backward Mode (propagating coefficients from output back to input). By automating the derivation of bounds, the authors lower the barrier to entry for certified robustness, allowing researchers to obtain bounds for any model with minimal code changes.
Scalability through Loss Fusion
The paper's most significant algorithmic contribution is Loss Fusion. Instead of bounding each of the $K$ output logits separately, the framework treats the entire loss function as the final node in the computational graph. By bounding the loss directly, the output dimension effectively becomes 1, reducing the complexity from $O(Kr)$ to $O(r)$.
This paradigm shift allows LiRPA to achieve the same asymptotic complexity as standard forward passes and Interval Bound Propagation (IBP), but with much tighter bounds. This efficiency is what enables certified defense on ImageNet-scale datasets for the first time.
Key Results and Efficiency
The framework enabled certified defense on complex architectures like DenseNet and ResNeXt. On CIFAR-10, the authors achieved a verified error of 66.62%, outperforming previous IBP-based results. More importantly, the resource efficiency gains were dramatic. As shown in the performance evaluation, LiRPA with loss fusion is only 3-5 times slower than natural training, whereas without it, many large models simply run out of memory (OOM).
Using loss fusion, the authors achieved a two-magnitude improvement in training efficiency on large datasets, successfully training the first LiRPA-based certified models on Tiny ImageNet and ImageNet ($64 \times 64$).
Beyond Adversarial Robustness
The authors show that LiRPA is a general tool for understanding DNN behavior. They use it to create a "provably flat" optimization landscape, providing empirical evidence for the hypothesis that flatter minima lead to better generalization. This demonstrates that the framework's utility extends to general machine learning properties beyond just security.
Conclusion
By generalizing perturbation analysis to arbitrary computational graphs and introducing loss fusion, the authors have provided the community with a powerful, scalable, and automatic tool for robustness. The open-source library is available at: https://github.com/KaidiXu/auto_LiRPA.
Summary updated