Verified-Intelligence/auto_LiRPA

auto_LiRPA: An Automatic Linear Relaxation based Perturbation Analysis Library for Neural Networks and General Computational Graphs

What it solves

auto_LiRPA provides a way to formally verify the robustness of neural networks. It solves the problem of determining guaranteed output ranges (bounds) for a model when the input data or model weights are subject to perturbations, ensuring that a network's predictions remain stable and predictable under specific constraints.

How it works

The library generalizes Linear Relaxation based Perturbation Analysis (LiRPA) algorithms into a graph algorithm that operates on PyTorch computational graphs. Users define their model as a standard nn.Module, and the library traverses the graph to automatically derive and compute bounds for any node. Because the implementation is differentiable, it can be used to optimize network parameters to create "certified defenses" (models that are provably robust).

Who it’s for

It is designed for researchers and developers who need to prove the formal robustness of AI models, particularly those working with vision models (ResNet, DenseNet), sequence models (LSTM, Transformers), and neural controllers for Lyapunov stability.

Highlights

  • Broad Algorithm Support: Implements a wide range of techniques including CROWN, DeepPoly, $\alpha$-CROWN, $\beta$-CROWN, IBP, and hybrid approaches.
  • Automatic Derivation: Eliminates the need for users to manually derive complex LiRPA bounds by treating them similarly to how gradients are handled in autodiff.
  • Versatile Model Support: Works with various activation functions (ReLU, sigmoid, tanh, maxpool) and complex architectures like Transformers and LSTMs.
  • High Performance: Includes memory-efficient GPU implementations and multi-GPU support for scaling to large datasets like ImageNet.
  • Crowned Success: Serves as the core library for $\alpha, \beta$-CROWN, which has consistently won the VNN-COMP competition from 2021 to 2025.

Related

  • Project
  • Project
  • Project
  • Project
  • Project