NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Bridging Efficiency and Safety: Formal Verification of Neural Networks with Early Exits

Yizhak Yisrael Elboher, Avraham Raviv, Amihay Elboher, Zhouxing Shi, Omri Azencot, Hillel Kugler, Guy Katz · Submission to ICLR 2026 · Rejected

TL;DR

Early Exit (EE) networks reduce inference latency by terminating computation at intermediate layers when confidence is high, but their conditional execution paths complicate formal safety verification. This paper formalizes local robustness for multi-exit architectures and introduces an exact verification framework equipped with early-stopping heuristics that preserve soundness and completeness. Crucially, the authors show that adding early exits not only speeds up inference, but also makes networks significantly faster and easier to formally verify.

What Problem Does This Paper Address?

Formal verification guarantees that a neural network is robust against adversarial perturbations (e.g., within an $\epsilon$-ball around an input). However, existing verification tools typically assume a static architecture with a single, fixed output layer.

Dynamic inference architectures like Early Exits (EEs) break this assumption: if an intermediate layer’s prediction confidence crosses a threshold $T$, inference stops; otherwise, computation continues to deeper layers. Verifying such networks introduces two hurdles:

  1. Dynamic output locations: Different inputs in the same perturbation ball can exit at different layers.
  2. Conditional branching logic: To find a genuine counterexample at exit $e$, an adversary must ensure a runner-up class wins at exit $e$ and that the true class did not already trigger an earlier exit $e' < e$.

Methods

The authors build a verification framework compatible with off-the-shelf bound-propagation verifiers (specifically evaluating with $\alpha,\beta$-CROWN):

  • Revised Robustness Property ($P_{ee}$): Reformulates adversarial violation so that an input is counter-exemplary only if a runner-up exceeds the exit threshold (or the winning logit at the final layer) while the correct class fails to trigger any earlier exit threshold.
  • Theoretical Complexity (FPT): Under a trace stability condition—where all perturbed inputs in an $\epsilon$-ball exit at the same layer as the clean input—the verification complexity is Fixed-Parameter Tractable (FPT), scaling with the number of layers in the input’s trace rather than total network depth.
  • Algorithm 1 (Baseline): Nested loops over each exit and each runner-up class checking conjuncts sequentially.
  • Algorithm 2 (Optimized Heuristics): Adds two sound and complete pruning rules:
  • Break Optimization (Early Safe Termination): Checks if the true class confidence is guaranteed to exceed threshold $T$ at the current exit across the entire input ball. If so, verification stops immediately, returning SAFE.
  • Continue Optimization (Class Loop Pruning): Verifies whether the true class score always exceeds $1 - T$. If satisfied, no other class can reach $T$ (since SoftMax sums to 1), allowing the algorithm to skip checking individual runner-up classes.

Datasets

The authors evaluated standard benchmarks adapted with early-exit classifier heads:

  • MNIST: Evaluated on a 6-layer fully connected network (FC-6).
  • CIFAR-10: Evaluated on LeNet-5, ResNet-18, and VGG-16.
  • CIFAR-100: Evaluated on ResNet-18 across 100 classes.

Note: No new raw datasets were created; standard datasets were used to evaluate custom multi-exit architectures.

Key Insights and Ideas

  • Early exits improve formal verifiability: Conventional wisdom treats dynamic architectures as harder to verify. In practice, because many inputs are easily classified, their robustness can be certified entirely within the shallow prefix of the network, bypassing the combinatorial complexity of deeper layers.
  • Trace stability holds empirically: For SAFE inputs, the exit layer during verification strongly mirrors the exit layer during clean inference.
  • The 4-Way Trade-off: Tuning exit thresholds $T$ reveals a multi-objective balance among:
  • Accuracy (higher $T$ improves accuracy),
  • Inference Latency (lower $T$ speeds up runtime),
  • Certified Robustness (higher $T$ increases the fraction of certifiably safe inputs), and
  • Verification Cost (lower $T$ dramatically cuts verification time).
  • Exit placement matters: Placing an exit closer to the input (e.g., after block 1 instead of block 2 in ResNet-18) increases the verified safe rate and reduces verification time with negligible loss in predictive accuracy.

Key Results

  • Verification Speedups: For provably SAFE queries, the optimized algorithm (Alg. 2) runs up to 10× faster than the baseline (Alg. 1). On CIFAR-10 ResNet-18, mean SAFE verification time dropped from 409.4s to 42.6s.
  • Solving Previously Infeasible Cases: On CIFAR-10 VGG-16, Alg. 1 timed out on all SAFE queries, whereas Alg. 2 successfully verified them (mean 1532.4s) and reduced total UNKNOWN outcomes from 68 to 53.
  • CIFAR-100 ResNet-18: At $\epsilon = 0.001$, the baseline model without exits timed out at 2 hours, whereas the EE model verified 14 samples as SAFE in approximately 1 hour.
  • Hardware Invariance: Speedups replicated cleanly across both Apple Silicon (M3 GPU) and datacenter GPUs (NVIDIA A100), where EEs delivered a 4.63× speedup on SAFE ResNet-18 queries.

Limitations and Future Work

  • Solver Expressivity: The underlying verifier ($\alpha,\beta$-CROWN) did not natively support nested AND constraints, requiring queries to be split into separate subqueries.
  • Confidence Gating Function: The study strictly evaluated SoftMax probability gating with thresholds $T > 0.5$. Other dynamic exit mechanisms (e.g., entropy gating, dynamic thresholds) remain to be formally modeled.
  • Property Specificity: While the Break optimization generalizes to arbitrary safety constraints, the Continue optimization relies specifically on the simplex property of classification SoftMax outputs.
  • Parallelization: Exploiting distributed or parallel solving across branches remains open for future scaling.

Summary updated

BibTeX
@misc{elboher2025bridging,
  author = {Yizhak Yisrael Elboher and Avraham Raviv and Amihay Elboher and Zhouxing Shi and Omri Azencot and Hillel Kugler and Guy Katz},
  title = {{Bridging Efficiency and Safety: Formal Verification of Neural Networks with Early Exits}},
  year = {2025},
  eprint = {2512.20755},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2512.20755},
}
Figure