# General Linear-Layer Algorithms for Privacy-Preserving Transformer Inference

DevFeed: [General Linear-Layer Algorithms for Privacy-Preserving Transformer Inference](<https://devfeed.tech/articles/general-linear-layer-algorithms-for-privacy-preserving-transformer-inference-113998.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2606.25349>)

Author: Wenshao Yang, Zhenhua Liu, Dongdong Yao

Published: 2026-11-03T05:00:00Z

Content type: article

Language: en

Sources: [arXiv: Cryptography and Security](<https://devfeed.tech/sources/arxiv-cryptography-and-security.md>)

Topics: [FHE](<https://devfeed.tech/topics/fhe.md>), [homomorphic encryption](<https://devfeed.tech/topics/homomorphic-encryption.md>), [Algorithms](<https://devfeed.tech/topics/algorithms.md>), [Security, Privacy and Abuse Prevention](<https://devfeed.tech/topics/security-privacy-and-abuse-prevention.md>)

Tags: [algorithms](<https://devfeed.tech/tags/algorithms.md>), [ckks](<https://devfeed.tech/tags/ckks.md>), [cs-cr](<https://devfeed.tech/tags/cs-cr.md>), [fhe](<https://devfeed.tech/tags/fhe.md>), [homomorphic-encryption](<https://devfeed.tech/tags/homomorphic-encryption.md>), [hybrid](<https://devfeed.tech/tags/hybrid.md>), [inference](<https://devfeed.tech/tags/inference.md>), [layer](<https://devfeed.tech/tags/layer.md>), [linear](<https://devfeed.tech/tags/linear.md>), [mpc](<https://devfeed.tech/tags/mpc.md>), [online](<https://devfeed.tech/tags/online.md>), [pipelines](<https://devfeed.tech/tags/pipelines.md>), [privacy](<https://devfeed.tech/tags/privacy.md>), [ring](<https://devfeed.tech/tags/ring.md>), [rlwe](<https://devfeed.tech/tags/rlwe.md>), [rotation](<https://devfeed.tech/tags/rotation.md>), [secret-sharing](<https://devfeed.tech/tags/secret-sharing.md>), [security](<https://devfeed.tech/tags/security.md>), [transformer](<https://devfeed.tech/tags/transformer.md>)

## AI overview

The paper proposes general linear-layer algorithms for two-party privacy-preserving Transformer inference using FHE and additive secret sharing. The authors say the algorithms work with compatible RLWE-based schemes and integrate with both non-interactive FHE and hybrid FHE-MPC pipelines, with output interfaces designed for composition with different nonlinear layers. Compared with existing linear-layer schemes, they remove online key switching, ciphertext transmission, and ring-field conversion. A fused RNS-CKKS technique also reduces the computational cost of multiplication followed by rotation. The authors prove correctness and semi-honest security and quantify savings analytically; the supplied excerpt does not provide numerical results.

## Source excerpt

arXiv:2606.25349v3 Announce Type: replace Abstract: Two-party privacy-preserving Transformer inference today mainly follows one of two paradigms: non-interactive computation over fully homomorphic encryption (FHE), or a hybrid of FHE and secure multi-party computation (MPC). Either way, linear layers account for a large share of the compute and communication budget. Most existing systems attack this cost by designing bespoke plaintext encodings and ciphertext matrix algorithms that minimize the expensive key-switching operations. The price is tight coupling: each scheme only works with its own packing/encoding strategy, and moving data between linear and nonlinear layers still triggers online ciphertext transmission and ring-field conversion. We take a different route. Instead of optimizing within a chosen encoding, we design a series of general algorithms for linear layers that can be readily integrated into existing inference systems, based on FHE and additive secret sharing. Our algorithms work with any compatible RLWE-based scheme and plug into both non-interactive FHE and hybrid FHE-MPC pipelines. Output interfaces in proposed algorithms allow them to be composed with different downstream nonlinear layers. Relative to existing linear layer schemes, our construction removes online key switching, ciphertext transmission, and online ring-field conversion. As a complement, we further propose a fused RNS-CKKS technique that reduces the computational cost of multiplication followed by rotation. We prove correctness and semi-honest security of the proposed algorithms and quantify the resulting savings analytically.