Paper 2025/2271
ARION: Attention-Optimized Transformer Inference on Encrypted Data
Abstract
Privacy-preserving Transformer inference (PPTI) is essential for deploying large language models (LLMs) such as BERT and LLaMA in sensitive domains. In these models, the attention mechanism is both the main source of expressiveness and the dominant performance bottleneck under fully homomorphic encryption (FHE), due to large ciphertext matrix multiplications and the softmax nonlinearity. This paper presents Arion, a non-interactive FHE-based PPTI protocol that specifically optimizes the computation of encrypted attention. First, for the three consecutive ciphertext matrix multiplications in multi-head attention, we introduce the double Baby-Step Giant-Step algorithm, which significantly reduces the number of ciphertext rotations. On BERT-Base, Arion achieves an 82.5% reduction in rotations over the state-of-the-art PPTI protocol MOAI (2025), corresponding to a 5.7x reduction in rotation cost. Second, we propose a linear–nonlinear fusion technique tailored to the softmax evaluation in attention. By decomposing softmax into shift-by-maximum, exponentiation, and reciprocal sub-steps and fusing them with the surrounding encrypted matrix operations, Arion enables efficient attention evaluation while remaining compatible with diverse ciphertext packing formats. We implement Arion using Lattigo and first evaluate attention kernels on popular LLMs including BERT-Tiny, BERT-Base, and LLaMA, confirming the practicality and scalability of the proposed optimizations for encrypted attention computation. For end-to-end applications, on classification tasks for several benchmark datasets, Arion attains accuracy comparable to plaintext inference and yields up to 2.5x end-to-end speedups over MOAI for BERT-Base.
Metadata
- Available format(s)
-
PDF
- Category
- Applications
- Publication info
- Preprint.
- Keywords
- Privacy-preserving inferencehomomorphic encryptionSecure computation
- Contact author(s)
-
yanglh36 @ mail2 sysu edu cn
chenjingwei @ cigit ac cn
daiwch @ mail sysu edu cn
shuaiwang @ mails cqjtu edu cn
wuwenyuan @ cigit ac cn
yongfeng @ cigit ac cn - History
- 2025-12-18: approved
- 2025-12-18: received
- See all versions
- Short URL
- https://ia.cr/2025/2271
- License
-
CC BY
BibTeX
@misc{cryptoeprint:2025/2271,
author = {Linhan Yang and Jingwei Chen and Wangchen Dai and Shuai Wang and Wenyuan Wu and Yong Feng},
title = {{ARION}: Attention-Optimized Transformer Inference on Encrypted Data},
howpublished = {Cryptology {ePrint} Archive, Paper 2025/2271},
year = {2025},
url = {https://eprint.iacr.org/2025/2271}
}