Marabou and Reluplex: Extended Simplex for Verification¶
SMT solvers provide complete verification but treat neural networks as generic constraint satisfaction problems. What if you designed a solver specifically for neural networks—one that exploits their structure? Reluplex and its successor Marabou do exactly this: they extend the simplex algorithm from linear programming to handle piecewise-linear functions with ReLU constraints directly.
This specialized approach achieves complete verification more efficiently than general-purpose SMT or MILP solvers for networks with ReLU activations. This guide explores how Reluplex and Marabou work, why they’re effective, and when to use them.
The Simplex Algorithm Foundation¶
The simplex algorithm solves linear programs: optimization problems with linear objectives and linear constraints. For a network without ReLU activations—just linear layers—verification reduces to checking if a linear program is feasible.
Linear program:
The simplex algorithm walks along the edges of the feasible polytope, moving from vertex to vertex until finding an optimal solution or determining infeasibility.
Why this matters: Neural networks with only linear layers define linear transformations. Verification of such networks is just linear programming—tractable and efficient. The challenge comes from non-linearities like ReLU.
ReLU Creates Piecewise Linearity¶
ReLU activations introduce piecewise-linear behavior:
Each ReLU partitions input space into two regions: where it’s active (\(z \geq 0\)) and inactive (\(z < 0\)). A network with \(k\) ReLU activations creates up to \(2^k\) linear regions.
Key insight: Within each region, the network is purely linear. The challenge is determining which ReLUs are active/inactive and solving the corresponding linear program.
Standard SMT approach: Encode each ReLU as a disjunction [Katz et al., 2017]:
This creates \(2^k\) potential combinations—exponential complexity.
Reluplex innovation: Instead of enumerating all combinations, extend simplex to handle ReLU constraints directly within the algorithm.
The Reluplex Algorithm¶
Reluplex [Katz et al., 2017] modifies the simplex algorithm to reason about ReLU constraints natively:
Core Idea¶
Treat ReLU pairs as relaxed linear constraints: For ReLU relating \(z\) (input) and \(y\) (output):
If \(z \geq 0\), require \(y = z\)
If \(z < 0\), require \(y = 0\)
Rather than branching immediately on all ReLU states, run simplex on a relaxed problem that ignores some ReLU constraints. When simplex finds a solution, check if it satisfies all ReLU constraints. If not, fix violated ReLUs and continue.
Algorithm Steps¶
Relax ReLU constraints: Replace each ReLU constraint with bounds: \(y \geq 0\), \(y \geq z\), \(y \leq z \text{ if } z > 0\)
Run simplex: Solve the relaxed linear program using standard simplex
Check ReLU constraints: For each ReLU pair \((z, y)\):
If \(z \geq 0\) and \(y = z\): satisfied (active)
If \(z < 0\) and \(y = 0\): satisfied (inactive)
Otherwise: violated
Fix violations: Select a violated ReLU, fix its state (active or inactive), add corresponding constraint
Repeat: Run simplex on updated constraints, check again
Backtrack if infeasible: If fixing a ReLU leads to infeasibility, try the opposite state. If both infeasible, backtrack.
Reluplex Advantage
Instead of exploring all \(2^k\) ReLU activation patterns upfront, Reluplex:
Solves relaxed LPs efficiently
Fixes violated ReLUs incrementally
Backtracks only when necessary
This lazy approach avoids exploring exponentially many states, focusing effort on promising regions.
Theoretical Properties¶
Soundness: Reluplex is sound—if it returns a solution, it satisfies all constraints including ReLU constraints.
Completeness: Reluplex is complete—if a solution exists, it will eventually find it (given sufficient time/memory).
Complexity: Worst-case exponential (inherent to NP-complete problem [Katz et al., 2017, Weng et al., 2018]), but often much faster than brute-force enumeration.
Marabou: Production-Ready Reluplex¶
Marabou [Katz et al., 2019] extends Reluplex with practical optimizations and additional features:
Key Improvements¶
Preprocessing: Before running Reluplex, Marabou:
Simplifies constraints (remove redundant inequalities)
Bounds propagation to tighten variable bounds
Detects infeasibilities early
Conflict analysis: When a branch leads to infeasibility, Marabou analyzes the conflict to learn why. It adds learned constraints (similar to DPLL conflict clauses) to prevent similar failures.
Heuristics: Smart ReLU selection—which violated ReLU to fix first matters. Marabou uses heuristics (most constrained, most violated) to guide search.
Parallel decomposition: Partition the problem into subproblems, solve in parallel. For networks with independent components, this provides speedup.
Abstraction refinement: Start with coarse abstractions of the network, refine only where needed. This reduces initial problem size.
Supported Networks and Properties¶
Marabou handles:
Feedforward networks with ReLU activations
Piecewise-linear activations (ReLU, Leaky ReLU, max-pooling with modifications)
Linear specifications on inputs and outputs
Arbitrary linear constraints relating any variables
Marabou is particularly strong on:
Networks with a few thousand neurons
Properties involving linear relationships between outputs
Finding counterexamples (adversarial examples)
Feature |
Support |
Notes |
|---|---|---|
ReLU networks |
Full |
Core strength |
Max-pooling |
Partial |
Requires reformulation |
Sigmoid/Tanh |
No |
Requires approximation |
Convolutional layers |
Full |
Handled as dense operations |
Residual connections |
Full |
Supported natively |
Batch normalization |
Full |
Folded into linear layers |
Practical Usage¶
Using Marabou¶
Marabou provides:
Python API: Programmatic interface for constructing networks and properties
ONNX import: Load networks from standard format
Property specification: Define input constraints and output properties
Result interpretation: Returns SAT/UNSAT with counterexamples if SAT
Example workflow:
Export network to ONNX format
Load in Marabou
Specify input region (e.g., \(\ell_\infty\) ball)
Specify output property (e.g., robustness)
Run verifier
Interpret results (verified or counterexample)
Performance Considerations¶
Network size: Marabou handles thousands of neurons. For networks with tens of thousands or more, expect long runtimes or timeouts.
Property complexity: Simple properties (single output comparison) are easier than complex logical combinations.
Timeout strategy: Set reasonable timeouts (hours). If Marabou times out, the problem is likely too large for complete methods—fall back to incomplete verification [Gowal et al., 2019, Singh et al., 2019, Weng et al., 2018, Zhang et al., 2018].
Preprocessing with bounds: Use incomplete methods to compute activation bounds before running Marabou. Tighter bounds significantly improve performance.
Hint
Preprocessing is crucial. Running bound propagation [Weng et al., 2018, Zhang et al., 2018] first to compute tight bounds on each ReLU can reduce Marabou runtime by orders of magnitude.
Case Study: ACAS Xu Verification¶
The ACAS Xu collision avoidance benchmark [Katz et al., 2017] demonstrates Marabou’s effectiveness:
Problem: Verify 45 neural network controllers for aircraft collision avoidance. Each network has ~300 neurons, 6 layers, ReLU activations.
Properties: 10 safety properties like “if intruder is far and approaching from the left, the system advises ‘weak left’ or ‘strong left’.”
Results: Marabou (and Reluplex before it) successfully verified most properties, found counterexamples for others. This established ACAS Xu as a standard verification benchmark.
Key insight: Even small networks (300 neurons) require sophisticated solvers. ACAS Xu shows that complete verification is practical for safety-critical systems when networks are appropriately sized.
Limitations and When Not to Use¶
Not for large networks: Marabou doesn’t scale to millions of parameters. Modern vision models (ResNet-50, transformers) are far too large.
ReLU-specific: Marabou specializes in ReLU networks. Sigmoid, tanh, or complex activations require approximations or aren’t supported.
Exponential worst-case: Like all complete methods, Marabou faces exponential complexity [Katz et al., 2017, Weng et al., 2018]. Some problems will timeout regardless of optimizations.
When to use instead:
For very large networks: Incomplete methods [Gowal et al., 2019, Singh et al., 2019, Weng et al., 2018, Zhang et al., 2018]
For rapid iteration: Fast incomplete verifiers
For probabilistic guarantees: Randomized smoothing [Cohen et al., 2019]
Comparison with Other Complete Methods¶
vs SMT solvers [De Moura and Bjørner, 2008]: Marabou exploits ReLU structure better than general SMT. For ReLU networks, Marabou is faster. For complex logical properties beyond ReLU, SMT might be needed.
vs MILP [Tjeng et al., 2019]: MILP requires encoding ReLUs with binary variables and big-M constraints. Marabou handles ReLUs natively. Empirically, Marabou often outperforms MILP for pure verification.
vs Branch-and-Bound [Wang et al., 2021]: Branch-and-bound methods partition input space and use incomplete methods for bound computation. They’re often faster for larger networks but might return “unknown.” Marabou provides definitive answers for smaller networks.
Method |
Specialization |
Scalability |
Best Use Case |
|---|---|---|---|
Marabou/Reluplex |
ReLU networks |
Thousands of neurons |
Safety-critical ReLU networks |
SMT (Z3) |
General constraints |
Hundreds of neurons |
Complex logical properties |
MILP |
Optimization objectives |
Hundreds to thousands |
Finding minimum perturbations |
Branch-and-Bound |
Hybrid (incomplete + complete) |
Larger networks |
When some “unknown” acceptable |
Research and Future Directions¶
Active research extends Marabou’s capabilities:
Tighter abstractions: Better preprocessing and abstraction reduce the effective problem size.
Parallel and distributed solving: Decompose the verification problem, solve subproblems in parallel.
Integration with incomplete methods: Use incomplete verifiers to guide Marabou’s search, focusing on uncertain regions.
Non-ReLU activations: Approximating or handling sigmoid, tanh, or other activations while maintaining soundness.
Larger networks: Algorithmic improvements and hardware advances gradually push the boundary of tractable complete verification.
Final Thoughts¶
Marabou and Reluplex represent specialized engineering for neural network verification: they recognize that ReLU networks are piecewise-linear and exploit this structure rather than treating them as generic constraint problems.
For small to medium ReLU networks where complete verification is essential—safety-critical systems, regulatory compliance, finding counterexamples—Marabou is the state-of-the-art tool. It won’t handle production-scale vision models, but it’s exactly what you need for collision avoidance networks, control systems, or other critical applications.
Understanding Marabou clarifies what complete verification can and cannot achieve. It’s not magic—it’s clever exploitation of network structure combined with mature optimization algorithms. When you need absolute certainty and your network is appropriately sized, Marabou delivers.
Further Reading
This guide provides comprehensive coverage of Reluplex and Marabou for neural network verification. For readers interested in diving deeper, we recommend the following resources organized by topic:
Reluplex Algorithm:
The Reluplex algorithm [Katz et al., 2017] extended the simplex method to handle ReLU constraints directly, providing the first specialized complete verifier for ReLU neural networks. This foundational work also proved NP-completeness of ReLU network verification, establishing both the algorithm’s necessity and its fundamental computational limits.
Marabou Verifier:
Marabou [Katz et al., 2019] extends Reluplex with practical optimizations: preprocessing, conflict analysis, heuristics, and parallel decomposition. These improvements make complete verification practical for networks with thousands of neurons, representing the current state-of-the-art in SMT-based neural network verification.
ACAS Xu Benchmark:
The ACAS Xu collision avoidance benchmark [Katz et al., 2017] established rigorous safety specifications for neural network controllers in aviation. Marabou’s successful verification of ACAS Xu networks demonstrated that complete verification is achievable for safety-critical systems when networks are appropriately sized. This benchmark remains a standard for evaluating complete verification methods.
Complexity Foundations:
Understanding the NP-completeness result [Katz et al., 2017, Weng et al., 2018] is essential for setting realistic expectations. Complete methods like Marabou face exponential worst-case complexity—this isn’t an implementation limitation but a fundamental mathematical barrier. The challenge is managing this complexity through clever algorithms and heuristics.
Alternative Complete Methods:
For comparison, SMT solvers [De Moura and Bjørner, 2008] provide general-purpose constraint solving, while MILP [Tjeng et al., 2019, Cheng et al., 2017] formulates verification as mixed-integer programming. Marabou specializes in ReLU networks, often outperforming these general approaches for its target domain.
Incomplete Methods for Preprocessing:
Marabou’s performance improves dramatically when preprocessed with incomplete methods. Bound propagation [Gowal et al., 2019, Weng et al., 2018, Zhang et al., 2018] computes activation bounds that tighten Marabou’s search space. Abstract interpretation [Singh et al., 2019] provides complementary bounds. This preprocessing-then-complete-verification workflow represents best practice.
Hybrid Approaches:
Modern verification combines complete and incomplete methods. Branch-and-bound verification [Wang et al., 2021, Zhang et al., 2022] uses incomplete methods for initial bounds, applying complete methods selectively. This hybrid strategy often outperforms pure complete methods by focusing expensive computation where it matters most.
Related Topics:
For understanding SMT and MILP approaches that Marabou compares against, see SMT and MILP Solvers for Verification. For the mathematical foundations of complete verification, see The Verification Problem: Mathematical Formulation. For hybrid methods combining complete and incomplete verification, see Branch-and-Bound Verification. For understanding what guarantees complete verification provides, see Soundness and Completeness.
Next Guide
Continue to Branch-and-Bound Verification to learn about hybrid verification approaches that combine incomplete and complete methods for better scalability.
Chih-Hong Cheng, Georg Nührenberg, and Harald Ruess. Maximum resilience of artificial neural networks. In International Symposium on Automated Technology for Verification and Analysis, 251–268. Springer, 2017.
Jeremy Cohen, Elan Rosenfeld, and Zico Kolter. Certified adversarial robustness via randomized smoothing. In International Conference on Machine Learning. 2019.
Leonardo De Moura and Nikolaj Bjørner. Z3: an efficient smt solver. In International conference on Tools and Algorithms for the Construction and Analysis of Systems, 337–340. Springer, 2008.
Sven Gowal, Krishnamurthy Dj Dvijotham, Robert Stanforth, Rudy Bunel, Chongli Qin, Jonathan Uesato, Relja Arandjelovic, Timothy Mann, and Pushmeet Kohli. Scalable verified training for provably robust image classification. In Proceedings of the IEEE International Conference on Computer Vision, 4842–4851. 2019.
Guy Katz, Clark Barrett, David L Dill, Kyle Julian, and Mykel J Kochenderfer. Reluplex: an efficient smt solver for verifying deep neural networks. In International Conference on Computer Aided Verification, 97–117. Springer, 2017.
Guy Katz, Derek A Huang, Duligur Ibeling, Kyle Julian, Christopher Lazarus, Rachel Lim, Parth Shah, Shantanu Thakoor, Haoze Wu, Aleksandar Zeljić, and others. The marabou framework for verification and analysis of deep neural networks. In International Conference on Computer Aided Verification, 443–452. Springer, 2019.
Gagandeep Singh, Rupanshu Ganvir, Markus Püschel, and Martin Vechev. Beyond the single neuron convex barrier for neural network certification. In Advances in Neural Information Processing Systems, 15072–15083. 2019.
Vincent Tjeng, Kai Y. Xiao, and Russ Tedrake. Evaluating robustness of neural networks with mixed integer programming. In International Conference on Learning Representations. 2019.
Shiqi Wang, Huan Zhang, Kaidi Xu, Xue Lin, Suman Jana, Cho-Jui Hsieh, and J Zico Kolter. Beta-crown: efficient bound propagation with per-neuron split constraints for neural network robustness verification. Advances in Neural Information Processing Systems, 2021.
Lily Weng, Huan Zhang, Hongge Chen, Zhao Song, Cho-Jui Hsieh, Luca Daniel, Duane Boning, and Inderjit Dhillon. Towards fast computation of certified robustness for relu networks. In International Conference on Machine Learning, 5276–5285. 2018.
Huan Zhang, Shiqi Wang, Kaidi Xu, Linyi Li, Bo Li, Suman Jana, Cho-Jui Hsieh, and J. Zico Kolter. General cutting planes for bound-propagation-based neural network verification. arXiv preprint arXiv:2208.05740, 2022.
Comments & Discussion