Secure Transformer Inference Made Non-interactive

Jiawen Zhang, Xinpeng Yang, Lipeng He, Kejia Chen, Wen-jie Lu, Yinghao Wang, Xiaoyang Hou, Jian Liu, Kui Ren, Xiaohu Yang

Introduction

The proliferation of Large Language Models (LLMs) has intensified privacy concerns regarding user prompts and proprietary model weights. Secure inference—a cryptographic framework where the server learns nothing about the input and the user learns nothing about the model—offers a potential solution. However, existing state-of-the-art protocols, such as BOLT and Bumblebee, are heavily "interactive," requiring thousands of communication rounds to compute non-linear functions like Softmax or Argmax. This high degree of interactivity creates a massive bandwidth bottleneck and prevents the use of hardware accelerators like GPUs, which remain idle while waiting for network packets. Consequently, secure inference has remained prohibitively expensive, with costs reaching over $5.00 per token on standard cloud services.

Methodology

NEXUS is the first non-interactive protocol for secure transformer inference, built on RNS-CKKS Fully Homomorphic Encryption (FHE). By enabling mathematical operations directly on encrypted data without client intervention, NEXUS allows for a single round of communication. To make this approach efficient for the transformer architecture, the authors introduced three key innovations:

SIMD Innovations and Slot Folding

Standard FHE often underutilizes "slots" within a ciphertext during matrix operations. NEXUS employs a novel SIMD packing strategy where the client compresses multiple inputs into a single polynomial, which the server then decompresses into multiple SIMD ciphertexts. This drastically reduces the initial upload size.

For high-dimensional outputs like the 128k-token vocabulary of Llama-3, NEXUS introduces a "binary tree" approach to fold encrypted slots. This reduces the complexity of the Argmax function from linear $O(m)$ to logarithmic $O(\log m)$, ensuring that security overhead grows slowly even as models scale.

Logarithmic slot folding for secure Argmax computation using a binary tree structure.

Non-Linear Function Approximation

Functions such as GELU, Softmax, and Layer Normalization are approximated using high-precision piecewise polynomials. Because the protocol is non-interactive, the server can compute these sequences locally, eliminating the need for the client to remain online during the computation.

Performance and Key Results

The researchers evaluated NEXUS using BERT-base and Llama-3-8B models, verifying accuracy on the GLUE benchmark. The results show that NEXUS maintains accuracy within ~1% of standard plaintext models while delivering transformative performance gains.

Comparison of communication overhead, execution time, and financial cost across different secure inference protocols.

As illustrated in the performance comparison, the shift to non-interactivity allows the server to finally utilize GPU acceleration, leading to a 42.3x speedup compared to CPU-only execution. Key metrics include:

  • Bandwidth Efficiency: NEXUS reduces bandwidth by 372.5× compared to BOLT and 53.6× compared to Bumblebee. A BERT-base model requires only 164 MB of data transfer.
  • Speed: On a BERT-base model (128 tokens), NEXUS (GPU) completes inference in just 37.3 seconds.
  • Cost: Using AWS pricing, NEXUS reduces the financial cost of secure inference by 17.2×, bringing the cost down to approximately $0.05 per token.

Conclusion and Future Work

NEXUS demonstrates that non-interactivity is the critical factor for making secure LLM inference practical. By enabling GPU acceleration and reducing bandwidth by orders of magnitude, it bridges the gap between cryptographic theory and real-world utility. The primary remaining bottleneck is the FHE "bootstrapping" process, which accounted for 62.3% of the runtime in BERT-base evaluations. Future research will focus on optimizing FHE kernels and exploring hybrid cryptographic models to further reduce this computational overhead.

Summary updated

BibTeX
@inproceedings{zhang2025secure,
  author = {Jiawen Zhang and Xinpeng Yang and Lipeng He and Kejia Chen and Wen-jie Lu and Yinghao Wang and Xiaoyang Hou and Jian Liu and Kui Ren and Xiaohu Yang},
  title = {{Secure Transformer Inference Made Non-interactive}},
  booktitle = {NDSS},
  year = {2025},
}
Figure