Certified Activation Ranges for Encrypted Inference with 1-Lipschitz Networks

Running a neural network on encrypted data with fully homomorphic encryption (FHE) means the server can only add and multiply. Every nonlinearity, such as ReLU, has to be replaced by a polynomial, and a polynomial only approximates ReLU well on a fixed interval chosen in advance. If some neuron's input falls outside that interval, the approximation blows up and the encrypted result comes back as garbage. The server cannot see this happen, and the client cannot tell. Current systems pick these intervals from activations observed on training data and nudge the network with a soft loss penalty to stay inside them. Nothing guarantees that a new input will stay inside.

We propose making the interval a proven property of the architecture. The construction has two parts. The client normalizes its input to unit length before encrypting, which costs nothing because it happens in plaintext. The network is built from layers whose weight matrices provably cannot stretch vectors, which makes them "1-Lipschitz" (output distances never exceed input distances). Together these give every neuron a worst-case input interval of known width for all possible inputs. A layer-by-layer error recursion then turns those intervals into the smallest polynomial degree per layer that guarantees a target output error. The result is a network whose multiplicative depth, and so its bootstrapping cost, comes from a certificate rather than from trial and error. Those certified ranges are provably never exceeded.

Core Claim

The claim is that a certified range can do the job that empirical calibration and soft range penalties do today, and do it with guaranteed correctness on every input, at a multiplicative depth close to what empirical calibration needs. The mechanism is simple. Suppose each layer $f_l$ is 1-Lipschitz and every row of its weight matrix has norm at most one, and suppose the input satisfies $\|x\|_2 = 1$. Then each pre-activation coordinate satisfies $|h_{l,i}(x) - h_{l,i}(0)| \le 1$. The interval is therefore centered at a value the server knows, $h_{l,i}(0)$, and has width 2 regardless of network width. Working with row norms is what keeps the interval narrow. A naive bound through the full-vector norm would be loose by roughly the square root of the dimension.

Replacing exact activations with degree-$d_l$ polynomials adds an approximation error $\varepsilon_l(B, d_l)$ on an interval of half-width $B$, and it can also slightly inflate each layer's Lipschitz constant to $L_l \ge 1$. The accumulated deviation $e_l$ between the encrypted-polynomial network and the exact network then obeys

$$e_l \le L_l\, e_{l-1} + \varepsilon_l\!\left(1 + e_{l-1},\, d_l\right), \qquad e_0 = \delta_{\text{enc}},$$

where $\delta_{\text{enc}}$ is the encoding noise of the approximate-arithmetic FHE scheme. The interval widens by the error already accumulated, which is why $e_{l-1}$ appears inside $\varepsilon_l$. The recursion is just the triangle inequality applied layer by layer. We choose degrees to minimize total depth $\sum_l \lceil \log_2 d_l \rceil$ subject to $e_L$ staying below a margin $\tau$. Because the output layer is 1-Lipschitz, a deviation below half the logit margin cannot change the predicted class. Every quantity in the recursion is computable before deployment. This is the gap-3 connection in the file made concrete: a certified Lipschitz constant yields a certified depth budget.

Why this matters, and how it relates to prior work

The failure mode we target has the same shape as the one the control literature describes for unknown Lipschitz constants. A Control Lyapunov Perspective on Episodic Learning via Projection to State Stability analyzes how guessing $L$ too low breaks safety and guessing it too high makes the controller uselessly conservative. That work motivates our framing. In FHE the parallel is exact. An interval that is too narrow corrupts ciphertexts, and one that is too wide forces high-degree polynomials and extra bootstrapping. Uniform Error Bounds for Gaussian Process Regression with Application to Safe Control shows that uniform guarantees over a continuous domain require knowing the Lipschitz constant. We take the same stance, but instead of estimating an unknown constant we build it into the model.

On the encryption side, two papers motivate the proposal by exhibiting the gap. HEAT learns how many Newton-Raphson iterations to spend and adds a "Range Penalty" so that activations stay where shallow solvers converge. PowerSoftmax replaces exponentials with even powers and uses a range-minimization loss. It invokes Lipschitz continuity only locally, to bound the attention denominator. Both enforce ranges softly, and both leave open what happens on inputs that violate the calibrated domain. We replace the soft penalty with a structural guarantee.

The architectural toolkit comes from the Lipschitz-network literature, which supplies the method. Almost-Orthogonal Layers builds weight matrices $W = PD$ whose spectral norm is at most one, using a closed-form diagonal rescaling that is folded into the weights and adds no inference cost. That property matters under FHE, where any extra operation adds depth. Data-Efficient System Identification via Lipschitz Neural Networks shows that hard Lipschitz construction beats soft regularization. It reports a test MSE of 5.44 versus 8.03 on a 2D linear system with 25% of the data, and a Lipschitz bound 85.84% tighter. Neither paper touches encryption, and both rely on non-polynomial activations. Our adaptation is to pair these layers with polynomial activations whose Lipschitz constant on the certified interval is itself bounded.

Two lines of work constrain the design. Fully polynomial backbones such as PolyNeXt reach 82.7% ImageNet accuracy with no activations at all. Their Hadamard-product modules, however, have local Lipschitz constants that grow with input norm, so they cannot be certified this way. We therefore avoid products of two data-dependent branches and use single-input polynomial activations. Second, AOL documents a clean-accuracy "robustness tax" for 1-Lipschitz networks. That tax is the main cost our proposal must pay, and we measure it directly.

Research Program

The first component is the architecture. It is an AOL convolutional network with residual connections of the form $x + f(x)$ scaled by one half, so that each block stays 1-Lipschitz. Its activations are polynomial approximations to a 1-Lipschitz target such as absolute value or ReLU, fitted by minimax fitting on the certified interval. We add a constraint that the polynomial's derivative magnitude on the interval stays at most $1+\eta$, which bounds $L_l$ in the recursion.

The second component is the certifier. It computes the reference activations $h_{l,i}(0)$ and the per-neuron row-norm bounds, runs the error recursion, and solves the small integer program that allocates degrees to layers under a fixed output margin.

The third component is training. We train with the chosen polynomials in the loop, so that the weights can co-adapt to approximation error in the spirit of HEAT, while the certificate continues to hold by construction.

The fourth component is deployment. We compile the model to a leveled approximate-arithmetic FHE scheme, of the kind HEAT evaluates with FIDESlib, and measure depth, bootstrap count, latency, and ciphertext size.

A secondary question is how conservative the certificate is. We compare the certified interval half-width, which is 1 plus accumulated error, with the largest activation reached by adversarial search over the unit sphere. The gap between the two tells us how much depth the guarantee costs.

Baselines

The naive reference is a standard unconstrained CNN of matched size. Its polynomial activations use intervals set to the maximum activation seen on the training set, without margin. This is the "do nothing" practice. We expect it to be shallow, and we expect it to fail on shifted inputs.

The strongest existing approach is a soft range penalty in the style of HEAT, applied to the same unconstrained CNN. Its intervals are calibrated on held-out data and then widened by a safety factor. We sweep that factor, choose the smallest one that yields zero violations on the validation set, and give it the same training budget, the same data, and the same polynomial-fitting procedure as our method. HEAT reports a 1.6× reduction in bootstraps and a 1.4× end-to-end speedup, from about 54 to about 37.6 seconds per token, but on GPT-2 rather than CNNs. No reported result was found on Lacuna for a range-penalty CNN on CIFAR-10 under pure FHE, so we reproduce it ourselves.

The key ablation uses the same AOL architecture with empirically calibrated rather than certified intervals. It separates two effects: what comes from Lipschitz layers merely shrinking activations, and what comes from the certificate itself.

For accuracy context we cite the hybrid systems while noting that they are not like-for-like. AESPA reports 92.4% CIFAR-10 accuracy for VGG16 under a two-party protocol. The file lists no clean-accuracy figure for AOL, only a certified robust accuracy of 64.0% at radius 36/255. For pure FHE latency, CryptoNets reports 99% on MNIST at 250 seconds per prediction with a 5-layer network.

Beating the strongest baseline means one of two outcomes at matched accuracy within about two points. The first is zero certified and zero observed range violations where the calibrated baseline shows nonzero violations under shift. The second is equal violation rates at no more than one extra multiplicative level.

Why not just…?

Why not just use a soft range penalty with a generous margin? This is the real threat. Empirically, a wide enough margin may never be violated on any test set we can construct, and it might need less depth than our certificate. Evidence from system identification (Lipschitz Neural Networks) shows soft Lipschitz control giving high-variance, loose bounds, but that evidence comes from regression, not encryption. Our experiments settle the question directly. If adversarial activation-maximization on unit-norm inputs never breaks the calibrated baseline and the baseline is shallower, then the honest contribution shrinks to an auditable guarantee, and we will say so.

Why not just use search to pick per-layer degrees, as Delphi and SAFENet do? SAFENet spends about 7 GPU hours of population-based search per configuration, and Delphi uses a search-based planner. Both rely on garbled-circuit fallbacks for ReLUs that matter, which requires an online client. Our degree allocation is a closed-form recursion solved in seconds. We will run a search baseline over the same degree space to check whether the certified allocation lands near the empirical optimum.

Why not just keep exact ReLUs through interactive protocols like Circa? Circa is fast, at 2.6–3.1× over Delphi. It also tolerates bit faults, since a 10% fault rate often costs under 1% accuracy. But it needs two-party interaction and deliberately injects random faults, and both are incompatible with a non-interactive setting where the client sends a ciphertext and goes offline. This is a different deployment regime, not a competitor on our question.

Why not just normalize the input and use an ordinary network? Normalizing the input bounds only the first layer. Unconstrained weight matrices can amplify activations layer after layer, so interior intervals remain unknown. The ablation that pairs input normalization with an unconstrained CNN measures exactly this.

Proposed Experiments

We train on MNIST and CIFAR-10, with CIFAR-100 as a harder check, and deploy the models under leveled FHE.

The first decisive check is certificate validity. We run gradient-based search for unit-norm inputs that maximize any neuron's excursion outside its interval, and we also feed Tiny ImageNet images to CIFAR models as natural shift. We count violations and catastrophic decryption errors for every method.

The second is cost. We report multiplicative depth, bootstrap count, per-image latency, and ciphertext size, alongside clean accuracy, so the Lipschitz robustness tax is visible in the same table as the depth savings.

The third is certificate tightness. We compare the certified output error bound with the observed maximum deviation between the encrypted and plaintext models, and the certified interval width with the adversarially found maximum.

The proposal succeeds if the certified models show zero violations where calibrated baselines fail under shift, while staying within one multiplicative level and roughly two accuracy points of the calibrated AOL ablation. It fails informatively if the certificate forces substantially more depth than calibration. That result would quantify the price of worst-case correctness in encrypted inference.