Abstract
Over the past decade, neural network (NN)-based controllers have demonstrated remarkable efficacy in a variety of decision-making tasks. However, their black-box nature and the risk of unexpected behaviors pose a challenge to their deployment in real-world systems requiring strong guarantees of correctness and safety. We address these limitations by investigating the transformation of NN-based controllers into equivalent soft decision tree (SDT)-based controllers and its impact on verifiability. In contrast to existing work, we focus on discrete-output NN controllers including rectified linear unit (ReLU) activation functions as well as argmax operations. We then devise an exact yet efficient transformation algorithm which automatically prunes redundant branches. Our results indicate that the SDT transformation can benefit formal verification, showing runtime improvements of up to $21 \times$ and $2 \times$ for MountainCar-v0 and CartPole-v1, respectively.
Introduction
Neural networks are increasingly used as the primary controllers for autonomous systems, ranging from drones to self-driving cars. Despite their high performance, they remain "black boxes," making it difficult to provide formal guarantees that a controller will not perform dangerous actions in safety-critical applications.
Formal verification—the mathematical proof that a system meets specific safety requirements—is exceptionally challenging for NNs. The combination of multiple layers, non-linear ReLU activation functions, and final argmax operations creates a massive search space for verification tools. While "distillation" methods exist to simplify NNs, they often rely on approximations that may lose critical safety properties. This research introduces an exact, systematic transformation method that bridges the gap between high-performance NNs and rigorous safety requirements.
Methodology: The NN2SDT Algorithm
The researchers developed NN2SDT, an algorithm that performs a lossless, constructive transformation of a ReLU-based NN into a mathematically equivalent Soft Decision Tree (SDT).
Key technical features of the algorithm include:
- Lossless Mapping: Unlike standard distillation, this procedure mathematically maps the network's logic into tree nodes, preserving exact behavior.
- Polynomial Scaling: The number of nodes in the resulting SDT scales polynomially with the width of the NN hidden layers. This is achieved by only generating "essential" splits—partitioning the input space based on where ReLU activations change or where the argmax choice shifts.
- Activation Tracking: The algorithm recursively defines affine functions representing the network state at each layer, determining exactly when a branch in the decision tree is required.
Key Insights and Verification Efficiency
A primary question is why a tree is faster to verify than a mathematically identical network. SMT (Satisfiability Modulo Theories) solvers struggle with the intertwined nature of NNs, where every input affects every output through a complex web of weights. In an SDT, the logic is "unrolled" into disjoint paths.
As shown in the input space partitioning, a solver can discard irrelevant branches of the tree much faster than it can prune the search space of a dense neural network. Beyond verification speed, the resulting SDTs are inherently more interpretable, allowing developers to trace the "if-then-else" logic leading to specific control actions. The algorithm also automatically prunes "dead" neurons or activation patterns that can never occur, leading to a more compact representation.
Experimental Results
The approach was evaluated using three benchmarks from the OpenAI Gym library: MountainCar-v0, CartPole-v1, and CarRacing-v2.
- Verification Speedup: For the MountainCar environment, verifying the SDT was 21 times faster than verifying the original NN. For CartPole, the speedup was 2×.
- Transformation Efficiency: The transformation process is highly efficient. Even for complex models, the algorithm produced the equivalent SDT in under 15 minutes, and under 60 seconds for smaller benchmarks.
- Size Efficiency: The SDT representation showed significant size reduction compared to naive transformation methods, confirming the theoretical polynomial complexity relative to network width.
Conclusion and Future Work
While the NN2SDT algorithm offers significant improvements in verifiability, complexity still grows with input dimension and network depth. Future research will focus on testing the approach in more sophisticated Reinforcement Learning environments and integrating the SDT representation with a wider variety of state-of-the-art formal verification tools. Additionally, exploring how this exact transformation could be combined with approximate compression techniques may offer an optimal balance between fidelity and verifiability for high-dimensional systems.
Summary updated