Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.Splitting on switches, not on space
A ReLU network is a large collection of switches: each hidden unit is either on (passing its input through) or off (outputting zero). Once you decide every switch, the network is just a straight-line formula, and checking a straight-line formula over a region is easy with linear programming. The hard part is the number of switch combinations. An SMT-style verifier guesses switches only where it has to: it first asks the linear solver with every undecided switch loosened, and only flips a switch when the answer depends on it. Cutting the input space into boxes instead gets slower with every extra input, even an input the network ignores.
Bars on a log scale. Two hidden layers of 8 ReLUs; inputs beyond the first two are irrelevant to the advice. The ReLU-splitting search stays at tens to a few hundred LP calls as inputs are added, while input splitting grows by orders of magnitude and runs out of its budget of about 20,000 boxes (grey). Where both finish they agree.
Reluplex (Katz and colleagues, 2017) verified properties of the ACAS Xu collision-avoidance networks, which no general-purpose SMT solver of the time could handle.
- 1. With every ReLU's phase fixed, the network is…
- 2. An SMT-style verifier splits on…
- 3. The answer 'unsat' for the negated property means…
Level 1: Beginner
★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.By hand
- SAT and SMT: satisfiability of Boolean formulas, and satisfiability modulo theories, where atoms belong to a theory such as linear real arithmetic (Barrett and Tinelli; Z3, CVC).
- DPLL(T): a SAT search over Boolean decisions, with a theory solver checking that the chosen atoms are consistent; conflicts prune the search.
- Verification query: the region and the negation of the property as constraints. Satisfiable (sat) gives a counterexample; unsatisfiable (unsat) proves the property.
- ReLU phase: active (y = z, z ≥ 0) or inactive (y = 0, z ≤ 0). A ReLU is stable on the region if interval bounds already fix its phase.
- Triangle (Planet) relaxation: for l < 0 < u, y ≥ 0, y ≥ z, y ≤ u(z − l)/(u − l); the convex hull of ReLU on [l, u] (Ehlers, 2017).
- Complete verifier: always answers sat or unsat given enough time; Reluplex, Marabou, Planet and MILP encodings (Tjeng and colleagues) are complete.
- Branching heuristic: which ReLU to split next; splitting the one the LP solution violates most is a simple and common choice.
- 1. An unsat answer to the negated property is…
- 2. A stable ReLU is one whose phase…
- 3. DPLL(T) combines a Boolean search with…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 25 minUndergraduate students and practising engineers.A small DPLL(T) verifier
Exercise 1.
- A dense-tableau phase-1 simplex method that decides whether A x ≤ b has a solution in a box (Dantzig’s rule with a fall-back to Bland’s rule against cycling).
- An encoding of a ReLU network over an input box: variables for inputs and each unit’s pre-activation z and output y; exact constraints for stable or fixed ReLUs, the triangle relaxation for the rest, and rows for the negated property.
- The search: solve the LP; if infeasible, the branch is closed; if its point satisfies every ReLU exactly, it is a counterexample; otherwise split on the most violated ReLU.
- Properties for the collision-avoidance network of topic M2-1: ‘never turn left’ (one clause) and ‘always clear of conflict’ (one clause per other advisory).
Practice.
- Use a mature verifier (Marabou, α,β-CROWN, NNV, or a MILP encoding with Gurobi) rather than writing one; they add bound tightening, conflict analysis and parallel search.
- Tighten bounds first: every ReLU made stable by better bounds halves the worst-case search.
- Confirm every counterexample by running the input through the real network in floating point; solvers work with tolerances.
- State the property precisely, including the input region, which outputs are forbidden or required, and how ties are treated.
- Report time-outs as unknown, never as safe.
def check(net, lo, hi, clauses):
for viol in clauses: # negated property: a disjunction of conjunctions
stack = [dict()] # each entry fixes some ReLU phases
while stack:
phases = stack.pop()
x = lp_feasible(encode(net, lo, hi, phases, viol))
if x is None: continue # branch infeasible: closed
j = most_violated_relu(x)
if j is None: return "sat", x # exact ReLUs: real counterexample
stack += [phases | inactive(j), phases | active(j)]
return "unsat" # property holds- 1. Before trusting a counterexample from a solver…
- 2. A time-out should be reported as…
- 3. Tighter bounds help because they…
Level 3: Advanced
★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.Theory
Why the relaxation gives sound pruning. For l < 0 < u, every point (z, ReLU(z)) with z in [l, u] satisfies y ≥ 0, y ≥ z and y ≤ u(z − l)/(u − l), so the relaxed constraints contain the exact graph of the network on the region. If the relaxed LP is infeasible, the exact problem is infeasible too, and the branch can be closed without further splitting.
Why an exact point is a real counterexample. If the LP solution satisfies y = ReLU(z) for every hidden unit, its values are exactly the network’s activations for its input, so its output variables are the true logits and they satisfy the negated property. Nothing is relaxed at that point, so it is a genuine violation (up to the solver’s tolerance, which is why it is checked on the network afterwards).
Termination and cost. Each split fixes the phase of one unstable ReLU, and a fixed ReLU is encoded exactly, so a branch is at most u splits deep for u unstable ReLUs and the search makes at most 2^(u+1) − 1 LP calls per clause. Checking a ReLU network against a linear property is NP-complete (Katz and colleagues, 2017), so no method avoids exponential cases in general. In practice, infeasible relaxations close large subtrees early: in Exercise 2 the search used at most 283 LP calls where the worst case ran to tens of thousands or more. Input splitting, in contrast, needs about 2^d times more boxes to halve the box width in d dimensions, so its cost grows with the number of inputs even when the network ignores them.
- 1. The triangle relaxation contains…
- 2. The worst-case number of LP calls per clause grows with…
- 3. Verifying ReLU networks against linear properties is…
Level 4: Expert
★★★★★ Expert⏱ 30 minResearchers: original papers and open problems.How does a ReLU-splitting search compare with input splitting on the same networks and properties as irrelevant inputs are added, and do the two methods agree?
History.
- M. Davis, G. Logemann and D. Loveland (1962) gave the DPLL procedure for SAT; R. Nieuwenhuis, A. Oliveras and C. Tinelli (2006) formalised DPLL(T) for SMT.
- L. de Moura and N. Bjørner (2008) released the Z3 solver; C. Barrett and colleagues developed CVC3, CVC4 and cvc5.
- L. Pulina and A. Tacchella (2010) first checked small networks with SMT by abstraction and refinement.
- G. Katz and colleagues (2017) introduced Reluplex, a simplex method extended with ReLU constraints, and verified ACAS Xu properties; R. Ehlers (2017) introduced the Planet solver with the triangle relaxation.
- V. Tjeng, K. Xiao and R. Tedrake (2019) verified networks with mixed-integer linear programming; G. Katz and colleagues (2019) released Marabou.
Exercise 2.
- Networks with two hidden layers of 8 ReLUs trained on 1000 points of the advisory task, with 2, 3, 4 and 6 inputs (inputs beyond the first two are irrelevant), weights rounded to 4 decimals.
- Properties: ‘an intruder with x in [−1, −0.1] never gets turn left’ and ‘an intruder with x in [0.9, 1] always gets clear of conflict’; the other inputs range over [−1, 1].
- Each property is checked by the ReLU-splitting search (LP calls) and by the input-splitting branch and bound of topic M2-1 (boxes, budget about 20,000).
Seed 0 (verdict and LP calls; verdict and boxes):
| inputs | never turn left: ReLU splitting | input splitting | always clear: ReLU splitting | input splitting |
|---|---|---|---|---|
| 2 | holds, 49 | holds, 59 | holds, 2 | holds, 11 |
| 3 | counterexample, 109 | counterexample, 4,731 | holds, 2 | holds, 405 |
| 4 | holds, 31 | holds, 10,255 | holds, 4 | holds, 1,345 |
| 6 | counterexample, 19 | unknown, 20,479 | holds, 4 | unknown, 20,445 |
Counterexamples (seed 0): (−0.1324, 0.677, 1.0) with 3 inputs and (−0.1015, 0.6392, 1, −1, 1, 1) with 6 inputs.
Seeds 1 and 2: both properties hold for every network. LP calls for ‘never turn left’ with 2, 3, 4 and 6 inputs were 3, 7, 117 and 283 (seed 1) and 69, 41, 195 and 113 (seed 2); boxes were 27, 97, 17,159 and unknown (seed 1) and 69, 807, unknown and unknown (seed 2). For ‘always clear’, at most 12 LP calls; input splitting ran out of budget at 6 inputs for seed 1 and finished after 16,579 boxes for seed 2.
Findings.
- The ReLU-splitting search always finished, using at most 283 LP calls over the 24 checks; input splitting ran out of budget in 2 of the 8 checks for each seed, all with 4 or more inputs.
- The two methods agreed whenever both finished, including the seed-0 counterexample with 3 inputs.
- Input splitting grew with the number of inputs although the extra inputs are irrelevant: for ‘never turn left’ at 4 inputs it needed 10,255 boxes against 31 LP calls (seed 0) and 17,159 against 117 (seed 1).
- Counterexamples sat at the edge of the region, x = −0.1324 and −0.1015 just inside x ≤ −0.1, at distances 0.69 and 0.65 from the origin, inside the conflict radius 0.7: the seed-0 network moves the turn-left region slightly across x = 0.
- An LP call costs far more than a box (the boxes are bounded 512 at a time), so the comparison is of search size, not time; the advantage of ReLU splitting is that its search size does not depend directly on the input dimension.
SMT and complete verification in practice
- Marabou (Reluplex’s successor) adds bound tightening, a divide-and-conquer mode and parallel search; α,β-CROWN combines GPU linear bounds with branching on ReLUs and has led VNN-COMP; MILP encodings with big-M constraints are solved by Gurobi or CPLEX.
- VNN-COMP and the VNN-LIB format standardise benchmarks and property files, including the ACAS Xu properties.
- Limits: complete methods handle networks with thousands to a few hundred thousand ReLUs for local properties; global properties and large models remain out of reach, which motivates monitoring at run time (topic M2-4).
References
- G. Katz, C. Barrett, D. Dill, K. Julian and M. Kochenderfer (2017). “Reluplex: an efficient SMT solver for verifying deep neural networks.” CAV.
- R. Ehlers (2017). “Formal verification of piece-wise linear feed-forward neural networks.” ATVA.
- G. Katz and colleagues (2019). “The Marabou framework for verification and analysis of deep neural networks.” CAV.
- V. Tjeng, K. Xiao and R. Tedrake (2019). “Evaluating robustness of neural networks with mixed integer programming.” ICLR.
- L. de Moura and N. Bjørner (2008). “Z3: an efficient SMT solver.” TACAS.
- L. Pulina and A. Tacchella (2010). “An abstraction-refinement approach to verification of artificial neural networks.” CAV.