Abstract
Neural networks in real-world applications have to satisfy critical properties such as safety and reliability. The analysis of such properties typically requires extracting information through computing pre-images of the network transformations, but it is well-known that explicit computation of pre-images is intractable. We introduce new methods for computing compact symbolic abstractions of pre-images by computing their overapproximations and underapproximations through all layers. The abstraction of pre-images enables formal analysis and knowledge extraction without affecting standard learning algorithms. We use inverse abstractions to automatically extract simple control laws and compact representations for pre-images corresponding to unsafe outputs. We illustrate that the extracted abstractions are interpretable and can be used for analyzing complex properties.
Introduction
Neural networks are increasingly deployed in safety-critical domains, yet they remain "black boxes" whose internal logic is difficult to verify. A fundamental challenge in ensuring their reliability is understanding the pre-image: the set of all possible inputs that map to a specific output or behavior. For instance, in autonomous driving, one might ask: "What specific sensor configurations lead the network to command an emergency brake?"
Computing exact pre-images for piecewise-linear networks (e.g., those using ReLU activations) is computationally intractable, as the number of geometric regions can grow exponentially with the network's size. This paper addresses the challenge by computing symbolic abstractions—simplified, human-readable approximations—that are tight enough for formal verification while remaining computationally efficient.
Methodology: Layer-wise Symbolic Interpolation
The core of the proposed approach is a layer-wise backward propagation of input sets. Rather than analyzing the entire network monolithically, the algorithm computes over- and under-approximations of the pre-image at each layer.
Key techniques include:
- Symbolic Interpolation: Utilizing Craig Interpolants to derive simple symbolic constraints (e.g., linear inequalities) that separate sets of "safe" and "unsafe" inputs.
- Farkas’ Lemma: This mathematical principle is used to ensure the generated interpolants have a simple structure, preventing the abstraction from becoming as complex as the network itself.
- Counterexample Guided Abstraction Refinement (CEGAR): If an initial abstraction is too coarse to verify a property, the system automatically identifies counterexamples to refine the boundaries.
Experimental Evaluation
The method was evaluated across three environments of increasing complexity:
- 2D Toy Example: A classification task used to verify the tightness of the computed over- and under-approximations.
- Cart-pole Control (OpenAI Gym): A classic reinforcement learning task. The method successfully extracted a symbolic policy consisting of just two linear inequalities that achieved a perfect score, demonstrating that the network had learned a simple underlying control law.
- Swimmer-robot Control (OpenAI Gym): An 8-dimensional state space task. The researchers developed a real-time safety monitor capable of checking torque limits in approximately 0.14 seconds.
Results and Scalability
The experiments demonstrate that simple symbolic representations are often sufficient to capture the essential logic of complex neural networks. In the cart-pole environment, the distilled symbolic policy performed identically to the original model.
A critical finding is the scalability of the approach. While the runtime grows exponentially with the width (number of nodes per layer) of the network—a phenomenon known as the "curse of dimensionality"—it scales linearly with the depth (number of layers). This makes the method particularly suitable for deep networks with relatively narrow layers.
Conclusion and Future Work
Inverse abstraction provides a powerful tool for making neural networks interpretable and verifiable without modifying the training process. By translating weights into symbolic logic, we can extract compact control laws and perform real-time safety monitoring.
Future research will focus on overcoming the width-related scalability bottleneck and extending the framework to handle smooth nonlinearities like Sigmoid or Tanh activations. Additionally, "training for abstractability" could lead to models that are inherently easier to verify by incorporating symbolic constraints into the learning process.
Summary updated