ENSI: Efficient Non-Interactive Secure Inference for Large Language Models

Zhiyu He, Maojiang Wang, Xinwen Gao, Yuchuan Luo, Lin Liu +1 more
9/11/2025
cs.CRcs.AI

No confident code implementation found for this paper.

Abstract

Secure inference enables privacy-preserving machine learning by leveraging cryptographic protocols that support computations on sensitive user data without exposing it. However, integrating cryptographic protocols with large language models (LLMs) presents significant challenges, as the inherent complexity of these protocols, together with LLMs' massive parameter scale and sophisticated architectures, severely limits practical usability. In this work, we propose ENSI, a novel non-interactive secure inference framework for LLMs, based on the principle of co-designing the cryptographic protocols and LLM architecture. ENSI employs an optimized encoding strategy that seamlessly integrates CKKS scheme with a lightweight LLM variant, BitNet, significantly reducing the computational complexity of encrypted matrix multiplications. In response to the prohibitive computational demands of softmax under homomorphic encryption (HE), we pioneer the integration of the sigmoid attention mechanism with HE as a seamless, retraining-free alternative. Furthermore, by embedding the Bootstrapping operation within the RMSNorm process, we efficiently refresh ciphertexts while markedly decreasing the frequency of costly bootstrapping invocations. Experimental evaluations demonstrate that ENSI achieves approximately an 8x acceleration in matrix multiplications and a 2.6x speedup in softmax inference on CPU compared to state-of-the-art method, with the proportion of bootstrapping is reduced to just 1%.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Cite this paper

@article{he2025ensi,
  title  = {ENSI: Efficient Non-Interactive Secure Inference for Large Language Models},
  author = {Zhiyu He and Maojiang Wang and Xinwen Gao and Yuchuan Luo and Lin Liu and Shaojing Fu},
  year   = {2025},
  eprint = {2509.09424},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2509.09424v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2509.09424.svg)](https://codeofpaper.com/paper/2509.09424)

Discussion