Fast BATLLNN: Fast Box Analysis of Two-Level Lattice Neural Networks

James Ferlez, Haitham Khedr, Yasser Shoukry

Abstract

Formal verification of neural networks is essential for safety-critical systems but often suffers from exponential computational complexity. Fast BATLLNN addresses this by specializing in Two-Level Lattice (TLL) architectures and "box-like" output constraints. By leveraging the unique geometric properties of TLLs and implementing a parallelized level-wise search of hyperplane arrangements, Fast BATLLNN achieves verification speeds 400x to 1900x faster than state-of-the-art general-purpose verifiers while maintaining expressive universality.

Introduction

The formal verification of neural networks (NNs) ensures that a model adheres to safety properties across its entire input space. However, most modern verifiers are designed for general-purpose deep ReLU networks, leading to a steep computational cost that scales poorly for real-time cyber-physical systems (CPS). Fast BATLLNN proposes a paradigm shift: trading architectural generality for massive performance gains. By targeting Two-Level Lattice (TLL) networks—a subset of ReLU networks that are expressively universal—the tool exploits specific geometric structures to accelerate verification.

The TLL Architecture

A TLL network implements min-max operations on a set of linear functions. Specifically, it computes the maximum of several minimums of affine functions. Despite this specific structure, TLLs can represent any continuous piecewise-affine function, making them a powerful alternative to standard deep ReLU stacks.

Architecture of a Two-Level Lattice (TLL) neural network showing the linear layer followed by min and max operations.

Methodology

The core innovation of Fast BATLLNN lies in its specialized treatment of TLL semantics and output properties.

Decoupled Output Analysis

By restricting safety properties to "box" constraints (independent bounds for each output dimension), the verification of a multi-output network is decomposed into simpler scalar tasks. This significantly reduces the dimensionality of the search space.

The verifier treats the local linear functions within the TLL as a hyperplane arrangement. Verifying a property involves searching for "witness" regions—parts of the input space where the property is violated. Fast BATLLNN introduces a "leveled adjacency poset" search to navigate these regions.

The relationship between hyperplane arrangement regions (top) and the leveled adjacency poset (bottom) used for memory-efficient parallel search.

As shown in the figure above, the search explores regions level-by-level based on the number of hyperplanes crossed. This approach, implemented using the charm4py library, allows for high-performance parallelization across CPU cores. Crucially, it is memory-efficient; once a level is fully explored, its data can be discarded, preventing the memory explosion typically associated with exhaustive region enumeration.

Complexity Reduction

Previous TLL verification approaches suffered from high polynomial complexity. Fast BATLLNN utilizes a greedy matching algorithm that effectively halves the crucial exponent in the big-O complexity, further contributing to its speed.

Experimental Results

The tool was evaluated against state-of-the-art verifiers including nnenum, Alpha-Beta-Crown, and PeregriNN using both synthetic benchmarks and an established TLL test suite of 240 networks.

  • Performance: Fast BATLLNN demonstrated speedups ranging from 400x to 1900x. On the 240-property test suite, it completed all tasks in just 17 seconds on a 4-core machine, whereas competitors frequently timed out.
  • Scalability: While general-purpose tools showed exponential growth in execution time relative to network size, Fast BATLLNN’s growth remained consistent with its improved polynomial complexity, handling networks with up to 16,384 neurons with ease.

Discussion and Limitations

While Fast BATLLNN offers unprecedented speed, it is constrained by its specialization. It is strictly limited to TLL architectures and box-type output properties. Converting standard ReLU networks to TLLs is possible but may impact parametric efficiency. Furthermore, the current implementation uses strict inequalities, which may differ slightly from the non-strict interpretations used by some general-purpose tools.

Future work aims to extend the tool to handle reachable set estimation (the "dual" problem) and to further optimize the search algorithms for higher-dimensional input spaces.

Summary updated

BibTeX
@inproceedings{ferlez2022fast,
  author = {James Ferlez and Haitham Khedr and Yasser Shoukry},
  title = {{Fast BATLLNN: Fast Box Analysis of Two-Level Lattice Neural Networks}},
  booktitle = {HSCC},
  year = {2022},
  doi = {10.1145/3501710.3519533},
}
Figure