Optimized Piecewise Affine Abstractions of Neural Networks with Learnable Activation Functions

Noah Schwartz, Chandra Kanth Nagesh, Sriram Sankaranarayanan, Ramneet Kaur, Tuhin Sahai, Susmit JhaarXiv 2026

TL;DR

This paper introduces a novel framework for verifying neural networks with complex, learnable activation functions (like those in Kolmogorov-Arnold Networks) by abstracting them into optimized piecewise affine (PWA) functions. By framing the distribution of linear segments across the network as a multi-choice knapsack problem, the method minimizes global approximation error under a strict computational complexity budget. This bridge allows cutting-edge, non-linear network architectures to be rigorously verified using standard mixed-integer linear programming (MILP) tools.

What Problem Does This Paper Address?

Safety-critical applications—like autonomous driving, robotics, and medical devices—require formal guarantees that a neural network will behave safely under perturbations (range verification). While verification tools are highly mature for standard networks with fixed, simple activations like ReLU, they struggle with emerging architectures like Kolmogorov-Arnold Networks (KANs) and deep spline networks.

KANs replace fixed activation functions with learnable, free-form univariate functions (such as B-splines or radial basis functions) that vary at every single node. Because these functions are highly non-linear and unique to each neuron, traditional verification methods fail or produce overly conservative, uselessly loose output bounds. Approximating these functions with piecewise affine (PWA) segments is a viable path forward, but it introduces a difficult trade-off: using too few segments makes the approximation inaccurate, while using too many makes the downstream verification problem computationally intractable.

Methods

The authors propose a structured pipeline to systematically balance approximation accuracy and verification complexity:

  1. Local Dynamic Programming (DP): For each unique activation function, the framework uses a classic DP algorithm (adapted from Bellman and Roth) to find the optimal PWA approximation for a given number of segments ($k$). This generates a "trade-off table" mapping the number of pieces to the local approximation error.
  2. Global Error Propagation: The authors mathematically prove that the network's total output error is bounded by a weighted linear combination of the local errors at each node. These "sensitivity weights" reflect how much an error at a specific neuron impacts the final output.
  3. Multi-Choice Knapsack Formulation: Given a global "budget" for the total number of linear pieces allowed across the entire network, the problem of allocating pieces to individual neurons is mapped to a Multi-Choice Knapsack Problem (MCKP). Neurons that heavily influence the output error are automatically allocated more pieces, while less critical neurons receive fewer.
  4. ReLU Transformation & MILP Solving: Crucially, the authors prove that any continuous PWA function can be represented as a linear combination of standard ReLU units. This allows the optimized abstraction to be directly encoded into existing, highly efficient Mixed-Integer Linear Programming (MILP) solvers like Gurobi.

The complete workflow is illustrated below:

Fig. 1: An illustration of the key steps of our approach. 1. We consider multiple possible choices for each unit/activation function; 2. We upper bound the overall network-wide approximation error as a linear combination of individual errors; 3. We solve a knapsack problem to choose an optimized approximation that minimizes the error bound; and 4. We connect our PWA abstraction to existing NN verification solvers, especially the mixed integer approach.

Datasets

The method was evaluated on a benchmark suite of 14 KAN architectures representing varying scales and tasks, detailed in the paper's benchmark table:

TABLE I: Benchmark suite: KAN architectures and trainable parameter counts. Architecture is given as [n, m1, . . . , m] where n is the input dimension, m1, . . . are hidden layer sizes, and m is the output dimension.

These benchmarks span:

  • Synthetic Functions: Highly oscillatory or multi-variable interactions designed to challenge uniform PWA allocation (e.g., fbessel, fexp4, fxy).
  • Physics-Informed Models: Networks trained to solve differential equations, such as the 2D Poisson/heat equation (pinnheat).
  • Real-World Datasets: Practical regression tasks including power flow optimization (acopf_14), short-term weather forecasting (weather), and biomechanical prosthetic sensor data (prosthetic).

Key Insights and Ideas

  • Verification as Resource Allocation: The core "aha moment" is treating network abstraction as a resource allocation problem. Instead of uniformly distributing linear pieces across all neurons, the framework dynamically shifts computational budget to where it matters most.
  • The ReLU Bridge: Proving that any PWA function equals a weighted sum of ReLUs means researchers don't need to write new verification engines from scratch; they can plug these complex learnable networks directly into existing, highly optimized ReLU verification pipelines.
  • Amortized Overhead: Although solving the knapsack problem adds an upfront computational cost, this abstraction only needs to be computed once per network. It can then be reused across thousands of different verification queries (e.g., testing different input ranges or safety properties).

Key Results

  • Tighter Bounds: Across the vast majority of benchmarks, the Optimized knapsack allocation yielded significantly tighter (narrower) output bounds than a "Vanilla" uniform allocation baseline at the exact same segment budget.
  • Pronounced Gains at Scale: The benefits of the optimized approach became more distinct as the size and complexity of the benchmarks grew (e.g., on the 22.2K parameter weather model).
  • Negligible Overhead: For larger networks, the time spent running the dynamic program to optimize the abstraction was completely dwarced by the downstream MILP solving time, making the optimization practically "free" in terms of total runtime.

Limitations and Future Work

  • Worst-Case Slack: The global error bound relies on a worst-case sensitivity analysis (using global Lipschitz constants), which can introduce slack compared to the actual errors encountered during evaluation.
  • Small Network Overhead: For very small networks, the upfront DP allocation time can occasionally exceed the time it takes to simply solve the verification problem directly.

Future research directions suggested by the authors include developing lazy or incremental DP algorithms to reduce overhead, validating the surrogate error bounds against sampling-based estimates, and directly integrating MILP complexity metrics into the knapsack allocation objective.

Summary updated

BibTeX
@misc{schwartz2026optimized,
  author = {Noah Schwartz and Chandra Kanth Nagesh and Sriram Sankaranarayanan and Ramneet Kaur and Tuhin Sahai and Susmit Jha},
  title = {{Optimized Piecewise Affine Abstractions of Neural Networks with Learnable Activation Functions}},
  year = {2026},
  eprint = {2602.06737},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2602.06737},
}
Figure