Paper 2026/174

STIP: Efficient and Secure Non-Interactive Transformer Inference via Compact Packing

Zihao Wang, National University of Defense Technology
Rongmao Chen, National University of Defense Technology
Xinwen Gao, National University of Defense Technology
Yi Wang, National University of Defense Technology
Lin Liu, National University of Defense Technology
Zixin Lan, National University of Defense Technology
Zhaoyu Wang, Shanghai Jiao Tong University
Shaojing Fu, National University of Defense Technology
Qiong Wang, National University of Defense Technology
Xinyi Huang, Nanjing University of Aeronautics and Astronautics
Abstract

Secure TransFormer Inference (STFI) for LLMs aims to protect both user inputs and model parameters. Fully Homomorphic Encryption (FHE) offers a promising approach for STFI due to its non-interactivity, which eliminates communication overhead. However, FHE-based STFI incurs significant computational costs compared to plaintext inference. Recent advancements have accelerated inference by optimizing packing strategies and reducing the number of rotations. Despite these improvements, several challenges persist, including excessive rotations in ciphertext-ciphertext matrix multiplications (CCMMs), low input/output projection throughput, and expensive maximum/inverse operations, as well as wasted storage slots and inflated ciphertext counts due to sparse packing. To address these issues, we propose STIP, an efficient and secure non-interactive transformer inference framework that incorporates three novel packing strategies: (1) Real-Imaginary Hybrid Packing (RIHP) halves the rotation costs of CCMMs by enabling the simultaneous computation of two output results within the real and imaginary components; (2) Dual-Head Packing (DHP) maps adjacent heads to the real and imaginary components, doubling the throughput of attention projections; and (3) Adaptive Multi-Column Packing (AMCP) packs multiple heads into a single ciphertext, maximizing slot occupancy to reduce the total ciphertext count and thereby enhance computational parallelism. Moreover, for non-linear layers, we employ the Gaussian Kernel instead of Softmax, eliminating the need for maximum value searches and inverse operations, supported by a column-packed RIHP-based L2-norm algorithm. We reformulate LayerNorm into an inverse-free form by exploiting scale-invariance. Experimental results on a GPU show that STIP achieves approximately 1.6× speedup over the SOTA scheme Euston (S&P '26) on BERT-base, LLAMA-3-8B, and GPT-2-1.5B.

Metadata
Available format(s)
PDF
Category
Cryptographic protocols
Publication info
Preprint.
Keywords
Secure InferenceTransformer
Contact author(s)
wang_zihao @ nudt edu cn
chromao @ nudt edu cn
gaoxinwen17 @ nudt edu cn
wangyi14 @ nudt edu cn
liulin16 @ nudt edu cn
zixinlan @ nudt edu cn
zhihuizzz @ sjtu edu cn
fushaojing @ nudt edu cn
wangqiong @ nudt edu cn
xyhuang81 @ gmail com
History
2026-02-05: revised
2026-02-03: received
See all versions
Short URL
https://ia.cr/2026/174
License
Creative Commons Attribution
CC BY

BibTeX

@misc{cryptoeprint:2026/174,
      author = {Zihao Wang and Rongmao Chen and Xinwen Gao and Yi Wang and Lin Liu and Zixin Lan and Zhaoyu Wang and Shaojing Fu and Qiong Wang and Xinyi Huang},
      title = {{STIP}: Efficient and Secure Non-Interactive Transformer Inference via Compact Packing},
      howpublished = {Cryptology {ePrint} Archive, Paper 2026/174},
      year = {2026},
      url = {https://eprint.iacr.org/2026/174}
}
Note: In order to protect the privacy of readers, eprint.iacr.org does not use cookies or embedded third party content.