Abstract
As neural networks make their way into safety-critical systems, where misbehavior can lead to catastrophes, there is a growing interest in certifying the equivalence of two structurally similar neural networks. For example, compression techniques are often used in practice for deploying trained neural networks on computationally- and energy-constrained devices, which raises the question of how faithfully the compressed network mimics the original network. Unfortunately, existing methods either focus on verifying a single network or rely on loose approximations to prove the equivalence of two networks. Due to overly conservative approximation, differential verification lacks scalability in terms of both accuracy and computational cost. To overcome these problems, we propose NeuroDiff, a symbolic and fine-grained approximation technique that drastically increases the accuracy of differential verification while achieving many orders-of-magnitude speedup. NeuroDiff has two key contributions: new convex approximations that more accurately bound the difference neurons of two networks, and the judicious use of symbolic variables to represent neurons whose difference bounds have accumulated significant error. Our results show that NeuroDiff is up to 1000X faster and 5X more accurate than the state-of-the-art tool.
Introduction
As neural networks are increasingly deployed in safety-critical domains like autonomous driving and aircraft collision avoidance, formal guarantees of their behavior become essential. A common challenge arises during model compression—such as quantization or pruning—where a large model is reduced to a smaller version for edge deployment. Differential verification aims to formally prove that the compressed version behaves nearly identically to the original within a small tolerance ($\epsilon$).
Existing tools often suffer from "error explosion," where loose approximations cause errors to compound across layers, leading to undetermined results or prohibitive computational costs. NeuroDiff addresses these scalability issues through fine-grained symbolic approximation.
System Architecture
The NeuroDiff framework takes two networks ($f$ and $f'$), an input range $X$, and a tolerance $\epsilon$ as inputs. It performs a symbolic forward analysis using convex approximations and intermediate variables to check if the difference remains within $\epsilon$. If the property cannot be proven, the input space is partitioned into smaller regions for refined analysis.
Methodology
NeuroDiff introduces two primary innovations to mitigate error propagation:
Fine-Grained Convex Approximations
Previous state-of-the-art tools like ReluDiff approximated the difference between two neurons using simple 2D bounding planes. NeuroDiff elevates this to a 3D space, accounting for the input $n$, the difference $\Delta$, and the output difference $z$. By using "tilted" bounding planes, it creates much tighter bounds that preserve critical symbolic information about the relationship between the two networks.
Intermediate Symbolic Variables
To prevent error compounding in deep networks, NeuroDiff strategically introduces new symbolic variables at "unstable" neurons (those that can be either active or inactive). This effectively resets error tracking at key points. The authors found that errors in the earliest layers are most prone to exploding, so their heuristic prioritizes these layers for symbolic variable insertion.
Experimental Evaluation
NeuroDiff was evaluated against 49 feed-forward ReLU networks across three applications: ACAS Xu (aircraft collision avoidance), MNIST (image classification), and Human Activity Recognition (HAR).
Key Results
- Speed: NeuroDiff is up to 1000x faster than the previous state-of-the-art, ReluDiff. Tasks that previously took 30 minutes are now solved in seconds.
- Accuracy: It is approximately 5x more accurate. On MNIST, NeuroDiff handled input perturbations 138 orders of magnitude larger than previous methods.
- Precision: At a strict tolerance of $\epsilon = 0.01$, NeuroDiff successfully verified 53 more tasks on ACAS Xu benchmarks than its predecessor.
Conclusion
NeuroDiff demonstrates that combining 3D geometric approximations with strategic symbolic variable introduction provides a synergistic effect, significantly outperforming existing differential verification methods. While currently optimized for ReLU-based feed-forward networks, future work aims to extend these techniques to other activation functions and complex architectures like CNNs.
Summary updated