arXiv(opens in a new tab)cs.LGSep 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2609.35352

Fiona: Accelerating FHE Inference with Packing-Aware Ternary Weights

Yiteng Peng, Zhibo Liu, Dongwei Xiao, Shuai Wang

ABSTRACT

Fully homomorphic encryption (FHE) enables neural network inference directly on encrypted inputs, but it remains orders of magnitude slower than plaintext inference. Applying the server's plaintext weights to encrypted activations involves plaintext–ciphertext multiplications (PMult) and accounts for more than half of inference time in recent systems. Ternary quantization can replace these multiplications with additions and subtractions, but the savings rarely materialize under packed execution. A single PMult applies a weight group fixed by the packing layout and can be avoided only when all its weights share the same ternary value. Ternarizing all groups, however, largely degrades accuracy.

We present FIONA, an offline optimizer that selectively ternarizes weights within a given packing layout based on the estimated effect of ternary conversion on the model's performance. FIONA encourages a shared ternary value within each weight group and retains full-precision weights for sensitive groups, so ternarized and full-precision paths coexist within a layer. It then compiles these hybrid operators exactly, applying common scaling factors once to accumulated inputs and reusing sums across outputs. Weight ternarization can also narrow the input ranges of downstream polynomials. FIONA fits lower-degree replacements under a cumulative accuracy budget, reducing multiplicative depth and bootstrapping. On VGG11, ViT, and BERT, FIONA reduces PMult operations by 53.4–79.5% and accelerates end-to-end encrypted inference by 2.38×2.38\times, 1.68×1.68\times, and 1.84×1.84\times, respectively, with less than 1% accuracy loss across all three models.

1 INTRODUCTION

Cloud-hosted deep learning (DL) services support applications involving sensitive data, such as medical images and private text. Fully homomorphic encryption (FHE) enables these services by letting the server compute directly on encrypted inputs (Gentry, 2009; Cheon et al., 2017; Zhang et al., 2025). The client encrypts its input and sends the ciphertext to the server, which evaluates the model on it using weights that it holds in plaintext and returns an encrypted prediction that only the client can decrypt (Gilad-Bachrach et al., 2016). Despite these benefits, the computational cost of FHE remains a major barrier to deployment. To reduce computational cost, existing FHE-DL systems optimize ciphertext packing and execution flows through convolution packing (Ebel et al., 2025), column and diagonal packing (Zhang et al., 2026), or column-wise input encoding (He et al., 2025); other approaches approximate nonlinear activation operators with polynomials (Ao & Boddeti, 2024; Xie et al., 2026)

However, a major source of this cost is linear computation with plaintext weights, which involves plaintext–ciphertext multiplication (PMult). A recent GPU profile of FHE-protected LLaMA-3-8B attributes up to 68% of its runtime to such plaintext–ciphertext matrix multiplication (Zhang et al., 2026). Unlike the activations, the weights are plaintext and fixed before any query arrives, so their representation can be optimized offline, and every encrypted operation removed in this way is saved on each later inference. A few approaches do optimize weight computation, yet their designs are tailored to particular encodings or model architectures, through sub-block pruning for

CNNs in SpENCNN (Ran et al., 2023) and block-circulant weights with a matching encoding in PrivCirNet (Xu et al., 2024), so their savings do not automatically carry over to different packing layouts. We therefore study how to reduce weight multiplications by changing weight values under a backend's existing packing layout.

A ternary weight of +1, -1, or 0 needs no multiplication in a weighted sum, because the server can add the encrypted input to the output, subtract it, or skip it. In our measurement, a weighted sum of 64 ciphertexts is 14.8×14.8 \times faster than the same sum computed with PMult (Table 1). Ternary quantization (Wang et al., 2023; Ma et al., 2024), which restricts each weight to one of these three values times a scaling factor, is therefore a natural starting point for reducing weight multiplications.

However, ternary weights alone do not remove PMult operations, because a backend does not always apply weights one at a time. CKKS (Cheon et al., 2017), the FHE scheme that most encrypted inference systems adopt, packs a vector of values into each ciphertext, and one PMult applies a vector of weights to it. The backend's packing layout determines which weights share one such vector, and we call each such set of weights an execution group. An addition or a subtraction also acts on a whole ciphertext, so the server can avoid the PMult only when all weights in the group have the same ternary value. We call such a group pure. A group that holds different values, such as +1 and 0, still requires the PMult.

Standard ternary quantization does not account for this structure, and it is ineffective in two respects. Scalar ternary quantization of ResNet-8 leaves only 4.06% of the execution groups pure, so the remaining 95.94% still require a full PMult, and it also reduces CIFAR-10 accuracy from 87.53% to 82.43% (Sec. 3). These observations yield two requirements that are in tension. (1) Group-level uniformity. A reduction in cost is obtained per execution group rather than per weight, so the ternary weights of a converted group must share a single value. (2) Selective conversion. Conversion reduces accuracy, so it must be restricted to the groups whose conversion the task can tolerate, and the remaining groups must retain their original full-precision weights.

We present FIONA, an offline optimizer that makes this decision group by group and then compiles the result. FIONA takes a network, its polynomial approximations, and the backend's packing layout, and produces an execution plan that the server replays on every query. It first trains the weights to encourage each group to adopt a shared ternary value, applying stronger pressure to groups that are less sensitive to ternary conversion and leaving the most sensitive groups unconverted. The measure it uses is a group's task sensitivity, an estimate of how much the model's loss would rise if that group were converted. Every group therefore takes one of two routes, a cheap signed route or an ordinary multiplication route, and both coexist within a layer. In addition, weight ternarization can narrow the input ranges of the polynomials used for nonlinear operators. FIONA fits lower-degree replacements and selects those that reduce multiplicative depth, further accelerating encrypted inference.

In summary, this paper makes the following contributions:

• A hybrid weight representation that aligns ternary structure with packed execution. Task sensitivity guides ternarizations in fixed packing groups and retention of full-precision weights to balance encrypted cost and accuracy.

• An exact compilation step that applies one reconstruction factor per signed sum and shares recurring sums across outputs, followed by lower-degree polynomial refitting on the routed model under a cumulative accuracy budget.

• An implementation evaluated on CNN and Transformer models for image and text classification. On VGG11, ViT, and BERT, FIONA removes 53.4% to 79.5% of PMult operations and 37.0% to 57.1% of ciphertext refreshes, making encrypted inference 2.38×2.38\times, 1.68×1.68\times, and 1.84×1.84\times faster than full-precision baselines, with less than 1% accuracy loss.

References (37)