Paper 2025/1111 Original: eprint.iacr.org/2025/1111 ↗

SEAF: Secure Evaluation on Activation Functions with Dynamic Precision for Secure Two-Party Inference

Hao Guo
Zhaoqian Liu
Ximing Fu
Zhusen Liu
Abstract

Secure evaluation of non-linear functions is one of the most expensive operations in secure two-party computation, particularly for activation functions in privacy preserving machine learning (PPML). This work introduces SEAF, a novel framework for efficient Secure Evaluation on Activation Functions. SEAF is based on the linear approximation approach, but enhances it by introducing two key innovations: Trun-Eq based interval test protocols and linear approximation with dynamic precision, which have the potential for broader applicability. Furthermore, we classify common activation functions into several categories, and present specialized methods to evaluate them using our enhanced techniques. Our implementation of SEAF demonstrates $3.5 \times$ to $5.9 \times$ speedup on activation functions $\mathsf{Tanh}$ and $\mathsf{Sigmoid}$ compared to SirNN (S\&P'21). When applied on $\mathsf{GELU}$, SEAF outperforms Iron (NeurIPS'22) by more than $10 \times$ and Bolt (S\&P'24) by up to $3.4 \times$. For end-to-end secure inference on BERT, the original $\mathsf{GELU}$ accounts for $31.3 \%$ and $22.5 \%$ of the total runtime in Iron and Bolt, respectively. In contrast, our optimized $\mathsf{GELU}$ reduces these proportions to $4.3 \%$ and $9.8 \%$, eliminating $\mathsf{GELU}$ as a bottleneck in secure inference.

Metadata
Available format(s)
PDF
Category
Cryptographic protocols
Publication info
Preprint.
History
2025-06-13: last updated
2025-06-13: published
Short URL
https://ia.cr/2025/1111
License
https://creativecommons.org/licenses/by-nc/4.0/

BibTeX

@misc{cryptoeprint:2025/1111,
      author = {Hao Guo and Zhaoqian Liu and Ximing Fu and Zhusen Liu},
      title = {SEAF: Secure Evaluation on Activation Functions with Dynamic Precision for Secure Two-Party Inference},
      howpublished = {Cryptology {ePrint} Archive, Paper 2025/1111},
      year = {2025},
      url = {https://eprint.iacr.org/2025/1111}
}
Note: In order to protect the privacy of readers, this archive does not use cookies or embedded third party content.