# SPA: Structure-Preserving Approximation of Gated Activations under FHE

DevFeed: [SPA: Structure-Preserving Approximation of Gated Activations under FHE](<https://devfeed.tech/articles/spa-structure-preserving-approximation-of-gated-activations-under-fhe-100276.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2610.32065>)

Author: Rui Li, Wenyuan Wu, Weijie Miao

Published: 2026-10-26T04:00:00Z

Content type: article

Language: en

Sources: [arXiv: Cryptography and Security](<https://devfeed.tech/sources/arxiv-cryptography-and-security.md>)

Topics: [FHE](<https://devfeed.tech/topics/fhe.md>), [homomorphic encryption](<https://devfeed.tech/topics/homomorphic-encryption.md>), [mlp](<https://devfeed.tech/topics/mlp.md>)

Tags: [activation](<https://devfeed.tech/tags/activation.md>), [addition](<https://devfeed.tech/tags/addition.md>), [approximation](<https://devfeed.tech/tags/approximation.md>), [arithmetic](<https://devfeed.tech/tags/arithmetic.md>), [benchmarks](<https://devfeed.tech/tags/benchmarks.md>), [ckks](<https://devfeed.tech/tags/ckks.md>), [cs-cr](<https://devfeed.tech/tags/cs-cr.md>), [encryption](<https://devfeed.tech/tags/encryption.md>), [error](<https://devfeed.tech/tags/error.md>), [evaluation](<https://devfeed.tech/tags/evaluation.md>), [experiments](<https://devfeed.tech/tags/experiments.md>), [fhe](<https://devfeed.tech/tags/fhe.md>), [gemma](<https://devfeed.tech/tags/gemma.md>), [gemma-4](<https://devfeed.tech/tags/gemma-4.md>), [homomorphic-encryption](<https://devfeed.tech/tags/homomorphic-encryption.md>), [inference](<https://devfeed.tech/tags/inference.md>), [kernel](<https://devfeed.tech/tags/kernel.md>), [latency](<https://devfeed.tech/tags/latency.md>), [llama](<https://devfeed.tech/tags/llama.md>), [spa](<https://devfeed.tech/tags/spa.md>), [structure](<https://devfeed.tech/tags/structure.md>)

## AI overview

SPA reduces the cost of evaluating gated activations under FHE by keeping the exact odd component x/2 and approximating the even residual with a polynomial in x², avoiding comparisons and reducing redundant polynomial terms. The method applies to GELU, SiLU, fixed-parameter Swish, and scalar nonlinear branches of GEGLU/SwiGLU. Plaintext experiments with Gemma-4-E2B and Llama-3.2-3B largely preserve downstream performance without weight updates. In fixed-interval CKKS benchmarks on [-5,5], SPA-balanced was 3.25x faster than MOAI for erf-GELU at comparable error. SPA-accurate had 79.22% lower RMSE and was 10.40x faster than Euston for QuickGELU, and had 19.02% lower RMSE and was 2.06x faster than THOR for SiLU. These are reported benchmark results, not evidence about other intervals or settings.

## Source excerpt

arXiv:2610.32065v1 Announce Type: new Abstract: Nonlinear activation evaluation remains a major bottleneck in neural inference under fully homomorphic encryption (FHE). FHE supports efficient addition and multiplication, but lacks native operations for exponential functions, reciprocals, and value-dependent selection. High-degree polynomial approximations on fixed intervals are therefore commonly used to replace nonlinear activations. They can achieve small errors but often incur substantial multiplicative depth and latency. We observe that several widely used nonlinear activations share the algebraic structure $A(x)=xg(x)$ with $g(-x)=1-g(x)$. This class includes GELU, SiLU, fixed-parameter Swish, and the scalar nonlinear branches of GEGLU/SwiGLU. We propose \SPA{} (\emph{Structure-Preserving Approximation}) to exploit this shared structure. \SPA{} retains the exact odd component $x/2$ and approximates only the even residual as a polynomial in $x^2$, yielding a comparison-free arithmetic kernel. This construction removes redundant odd degrees of freedom and enables lower-cost polynomial evaluation at a given error target. Plaintext experiments with Gemma-4-E2B and Llama-3.2-3B show that SPA largely preserves downstream task performance without weight updates. Fixed-interval CKKS benchmarks show favorable error--latency trade-offs. On $[-5,5]$, \SPA{}-balanced achieves a $3.25\times$ speedup over MOAI (ICLR'~26) for erf-GELU with comparable error. On the same interval, \SPA{}-accurate achieves $79.22\%$ lower root mean squared error (RMSE) and a $10.40\times$ speedup over Euston (S\&P'~26) for QuickGELU. For SiLU, \SPA{}-accurate achieves $19.02\%$ lower RMSE and a $2.06\times$ speedup over THOR (CCS'~25).