Encryption-Friendly LLM Architecture

## Abstract

Abstract Large language models (LLMs) offer personalized responses based on user interactions, but this use case raises serious privacy concerns. Homomorphic encryption (HE) is a cryptographic protocol supporting arithmetic computations in encrypted states and provides a potential solution for privacy-preserving machine learning (PPML). However, the computational intensity of transformers poses challenges for applying HE to LLMs. In this work, we propose a modified HE-friendly transformer architecture with an emphasis on inference following personalized (private) fine-tuning. Utilizing LoRA fine-tuning and Gaussian kernels, we achieve significant computational speedups—6.94 × \times × for fine-tuning and 2.3 × \times × for inference—while maintaining performance comparable to plaintext models. Our findings provide a viable proof of concept for offering privacy-preserving LLM services in areas where data protection is crucial.

## 1 Introduction

The advent of large language models (LLMs) such as the BERT series (Devlin et al., ; Liu et al., ; Sanh et al., ; Lan et al., ; Clark et al., ; He et al., ), the GPT series (Radford, ; Radford et al., ; Tom B. Brown et al., ; OpenAI, ), and ChatGPT (OpenAI, ) kick-started a new era of natural language processing (NLP) and artificial intelligence (AI). One of the many capabilities of LLMs that has received much attention is their ability to provide personalized responses based on user interactions, especially with the use of fine-tuning. However, this use case raises serious concerns about user privacy. In response, regulations such as the GDPR (European Union, ) and CCPA (State of California, ) have been amended. In Italy, ChatGPT was even temporarily banned (McCallum, ), and several major corporations, including Apple and Samsung, have restricted its use within their companies (Mok, ).

Privacy-preserving machine learning (PPML) refers to methods that use machine learning while protecting data privacy. Techniques for PPML include secure multi-party computation (MPC) (Yao, ), differential privacy (Dwork, ), and homomorphic encryption (HE) (Rivest et al., ; Gentry, ). Among these, only MPC and HE offer provable security based on cryptographic assumptions. MPC utilizes communications between parties, but these communications can make it challenging to accelerate and parallelize the heavy computation of neural networks. In contrast, HE supports arithmetic computations in encrypted states without requiring communications. Since the pioneering work of Gentry (), several HE schemes have been developed (Brakerski, ; Brakerski et al., ; Ducas & Micciancio, ; Chillotti et al., ; Cheon et al., ). Notably, the CKKS (Cheon et al., ) scheme is particularly efficient for evaluating large-scale real-valued (as opposed to integer-valued) data in parallel and is widely used in the PPML literature (Han et al., ; Lee et al., ; ; ; ).

In theory, homomorphic encryption (HE) presents an elegant solution to the privacy concerns associated with LLMs. However, despite the significant recent progress in the theory and implementation of HE operations, protecting LLMs with HE remains a challenge due to their computational scale. Transformer models (Vaswani et al., ) famously rely on numerous matrix multiplications and various non-polynomial operations, and directly adapting these operations to HE results in significant computation time and precision loss.

In this work, we propose a modified HE-friendly transformer architecture with an emphasis on inference following personalized (private) fine-tuning. We point out that prior work on homomorphically encrypted transformers often overlooked fine-tuning due to its complexity. Our approach has two main algorithmic components: LoRA (Hu et al., ) fine-tuning and the replacement of softmax in attention with Gaussian kernels (GK). We show that LoRA and GK significantly accelerate the encrypted transformer computation under HE while maintaining performance levels comparable to those of the plaintext model. Experimental results of our modified BERT model on encrypted data using the CKKS scheme demonstrate its ability to *securely* process natural language data. Our findings show promise for offering privacy-preserving LLM services in areas where data protection is crucial.

Figure: Figure 1: Proposed privacy-preserving LLM under homomorphic encryption (HE). HE cryptographically protects user’s fine-tuning and inference data. We resolve two computational bottlenecks. First, we reduce the size of ciphertext-ciphertext matrix multiplication (CCMM) using LoRA fine-tuning. Second, we avoid the softmax computation, which is notoriously challenging to compute under HE, and replace it with a much simpler Gaussian kernel (GK).
Refer to caption: extracted/5898698/figures/GKTF9.png

### 1.1 Prior work

##### Transformer-based language models and LoRA.

Since the advent of attention (Vaswani et al., ), the transformer has become the standard of language models. There are three types of transformer-based language models. Encoder-only models, including BERT series (Devlin et al., ; Liu et al., ; Sanh et al., ; Lan et al., ; Clark et al., ; He et al., ) output embeddings for inputs that can be used for downstream tasks. Encoder-decoder models, which use the original transformer architecture, such as MarianMT (Junczys-Dowmunt et al., ), T5 (Raffel et al., ), BART (Lewis et al., ), mBART (Liu et al., ), and mT5 (Xue et al., ), are used for translation, summarizing, etc. Decoder-only models, including GPT series (Radford, ; Radford et al., ; Tom B. Brown et al., ; OpenAI, ) and Llama series (Touvron et al., ; ; Dubey et al., ), generate sentences to the user’s query. These large language models (LLMs) follow the scaling law (Kaplan et al., ), so the scale of LLMs tends to increase more and more. Hence, these models require a huge amount of memory capacity for inference and fine-tuning. To overcome this issue, LoRA (Hu et al., ) is mainly used to fine-tune a pre-trained LLM. Freezing all other weights, LoRA adapters are added to important layers of the model, such as attention layers during fine-tuning. Using LoRA, one can fine-tune LLMs, updating only less than 1% of all of the parameters.

##### Privacy-preserving transformer using HE.

Many researchers have explored privacy-preserving algorithms leveraging HE for transformer models. There are two main scenarios: interactive, which combines secure MPC with HE, and non-interactive, which relies only on HE. In interactive scenarios, encrypted computation time can be reduced through communications between parties. THE-X (Chen et al., ) proposed the first protocol for BERT-tiny inference, introducing HE-friendly workflows and non-polynomial evaluations via communications. Subsequent research (Hao et al., ; Li et al., ; Akimoto et al., ; Dong et al., ; Pang et al., ) enhanced computation time and reduced communication costs.

However, interactive approaches may struggle with large-scale communication as model size increases, and they also require data owners to be online during computation. To address these, non-interactive research is being conducted on the other side. Zimerman et al. () introduced the first HE-friendly transformer model, replacing the original transformer with a HE-friendly structure, minimizing the approximation domain, and obtaining pre-trained weight with the changed structure. Using these weights, they performed inference with BERT non-interactively. NEXUS (Zhang et al., ) further proposed a non-interactive BERT inference method without re-training, using polynomial approximations for non-polynomial operations. More recently, Park et al. () proposed Powerformer, which, like our method, proposed replacing softmax in the attention with their BRP-max function for homomorphic inference.

Fine-tuning plays a crucial role in improving transformer models and providing more personalized responses. However, previous works have primarily focused on secure inference, largely avoiding the challenge of fine-tuning due to the significant computational complexity involved, especially in non-interactive settings. Only a few attempts, such as those by Lee et al. () and HETAL  (Lee et al., ), have explored fine-tuning, focusing exclusively on the classification head while leaving other key components like attention layers and feed-forward networks untouched.

### 1.2 Contributions

We propose a homomorphic encryption (HE) friendly transformer architecture with an emphasis on inference following personalized (private) fine-tuning. We resolve two computational bottlenecks of the HE transformer model: (i) using LoRA, we avoid large ciphertext-ciphertext matrix multiplications (CCMMs), and (ii) we use a simpler Gaussian kernel (GK) to replace the softmax layer, which is notoriously challenging to compute under HE. Experiments on an HE-encrypted BERT-style transformer demonstrate a speedup of $6.94\times$ for fine-tuning and $2.3\times$ for inference.

## 2 Server-client computation model and preliminaries

In this section, we first state the server-client computation model, referred to as the *threat model* in the cryptography community. We then quickly review the relevant basic concepts and introduce the notation for homomorphic encryption and large language models.

### 2.1 Server-client computation model

Our server-client computation model (threat model) involves a client with private data, outsourcing fine-tuning and inference to the server, an LLM service provider. See Figure 1. Specifically, the client sends encrypted token-embedded data to the server, and the server fine-tunes the model, generating customized encrypted LoRA weights. Subsequently, the server performs inference using encrypted inference data, plaintext pre-trained weights, and encrypted LoRA weights. The server returns the encrypted inference results to the client. The token embedding layer weights are not encrypted and are not updated throughout fine-tuning.

The user data used throughout fine-tuning and inference is cryptographically protected, even from the LLM service provider. Both the pre-trained weights of the LLM and the fine-tuned LoRA weights reside on the server and are not shared with the user. However, we clarify that this does not mean the LLM weights are protected in the strict cryptographic sense, and our proposed approach does not address the model weight stealing problem (Tramèr et al., ; Carlini et al., ).

### 2.2 Homomorphic encryption and CKKS

Homomorphic encryption (HE) is an encryption method that allows computations to be performed in an encrypted state without decryption. CKKS (Cheon et al., ) is one of the HE schemes that allows one to encrypt real or complex data as a polynomial and perform approximate arithmetic on the encrypted data. By packing multiple real or complex data into a ciphertext, CKKS supports single instruction multiple data (SIMD) operations in plain/ciphertexts. Plaintext denotes an unencrypted polynomial containing a message vector in the context related to HE. For a more detailed description, refer to Appendix B or the original reference Cheon et al. ().

- •
Addition $({\mathsf{Add}})$: Given two ciphertexts or plaintext and ciphertext, evaluate component-wise addition.
- •
Multiplication $({\mathsf{Mult}})$: Given two ciphertexts or plaintext and ciphertext, evaluate component-wise multiplication. We express the plaintext-ciphertext component-wise multiplcation as $\mathsf{p}{\mathsf{Mult}}$.
- •
Rotation $({\mathsf{Rot}})$: Given a ciphertext $\mathsf{ct}$ encrypting message vector $(m_{0},m_{1},\dots,m_{N/2-1})$, return $\mathsf{ct}_{rot_{i}}$ encrypting message vector almost same with $(m_{i},\dots,m_{N/2-1},m_{0},\dots,m_{i-1})$. We denote ${\mathsf{Rot}}(\cdot,i)$ for $i$th left rotation. We express the same operation in plaintext as $\mathsf{p}{\mathsf{Rot}}$.

Note that ${\mathsf{Mult}}~{}\text{and}~{}{\mathsf{Rot}}$ require an additional key-switching operation. So, both take more computation time than other operations. For concrete time measurements, see Table 5 in Appendix E.

CKKS is one of the leveled HE schemes.
A CKKS ciphertext has a restricted number of $(\mathsf{p}){\mathsf{Mult}}$ operations, so-called level, which is determined at the beginning of encryption. The modulus $Q$, associated with the level, is reduced after these operations.
Once we exhaust the available level budget, we cannot proceed to the next $(\mathsf{p}){\mathsf{Mult}}$ operation. To recover the level budget, we can use bootstrapping $({\mathsf{BTS}})$ (Cheon et al., ). Since ${\mathsf{BTS}}$ is the most expensive HE operation, which is over $100\times$ slower than ${\mathsf{Mult}},{\mathsf{Rot}}$, it is crucial to minimize its usage through effective designing of the algorithm. In fact, the time accounted for ${\mathsf{BTS}}$ constitutes a large portion of the overall computation time (Lee et al., ; Zhang et al., ).

##### Matrix multiplications: PCMM and CCMM.

While evaluating the transformer model under HE, we use two kinds of homomorphic matrix multiplications: plaintext-ciphertext matrix multiplication (PCMM) and ciphertext-ciphertext matrix multiplication (CCMM). Homomprhic matrix multiplication requires numerous HE operations, such as $(\mathsf{p}){\mathsf{Mult}},(\mathsf{p}){\mathsf{Rot}}~{}\text{and}~{}{\mathsf
{Add}}$, for each matrix, which are slower when operating on ciphertext compared to plaintext as shown later in Table 5.
As a result, *PCMM is much faster than CCMM*.

There have been several studies (Jiang et al., ; Jang et al., ; Rizomiliotis & Triakosia, ; Zheng et al., ; Bae et al., ) to make homomorphic matrix multiplication more efficient. In this paper, we follow the JKLS (Jiang et al., ) algorithm, which provides the fastest known HE computation algorithm when the matrix elements can be packed in a ciphertext. They also propose parallel homomorphic matrix multiplication. We use this parallel computation to evaluate large-size matrix multiplication, where the size is more than available ciphertext space, by repeating block-wise matrix multiplcation. Thus, the computation time gap between PCMM and CCMM will be proportional to the number of block matrices. For more details, refer to Appendix C.

##### Polynomial approximations of non-polynomial functions.

Since HE can only support polynomial operations, all non-polynomial operations (such as division, max function, etc.) must be replaced by their polynomial approximations. The complexity of polynomial approximation highly depends on the input range and the nature of the function being approximated.

### 2.3 Large language models, attention layers, and LoRA fine-tuning

Standard large language models (LLMs), such as BERT (Devlin et al., ), GPT-4 (OpenAI, ), and Llama-3 (Dubey et al., ) are constructed by stacking many transformer layers. We explain the standard attention mechanism in a transformer (Vaswani et al., ) layer.
We do not explain the feed-forward network (FFN), another component of the transformer, as it has not been modified in our work. Suppose that $L$ and $n$ represent sequence length and embedding dimension, respectively. Given $Q,K,V\in\mathbb{R}^{L\times n}$, the standard attention is calculated as

$$ $\begin{aligned} \mathrm{Attention}(Q,K,V)=\mathrm{Softmax}\left(\frac{QK^{\top }}{\sqrt{n}}\right)V\in\mathbb{R}^{L\times n}\end{aligned}.$ (1) $$

The rows of $Q$, $K$, and $V$ are respectively referred to as query, key, and value vectors. Here, the softmax function (Bridle, ) is applied row-wise, normalizing the similarity scores between each query and key vectors into probability distributions, which serve to weigh the importance of each value vector. Later in Section 4, we specifically discuss why the softmax function is numerically challenging to compute under homomorphic encryption (HE).

Low-Rank Adaptation (LoRA) (Hu et al., ) of large language models has become the most widely used parameter-efficient fine-tuning scheme for LLMs. Given a weight matrix $W\in\mathbb{R}^{n\times n}$ of a linear layer, LoRA updates $W$ with an update $\Delta W=AB$, where $r\ll n$, $A\in\mathbb{R}^{n\times r}$, and $B\in\mathbb{R}^{r\times n}$, so that the linear layer’s action becomes $X\mapsto X(W+AB)$ for an input $X\in\mathbb{R}^{L\times n}$. In this LoRA fine-tuning, the pre-trained weight $W$ is frozen while only $A$ and $B$ are trained.

## 3 Speedup with LoRA: Avoiding large CCMM

##### Bottleneck 1: Full fine-tuning incurs large CCMM.

Personalized fine-tuning data is transmitted to the server encrypted, and the fine-tuning updates, which depend on the users’ private data, must also be stored encrypted. Subsequently, encrypted inference data is transmitted, and the transformer performs CCMM computations. Full fine-tuning updates all weights and, therefore, lead to many large CCMM calculations.

Specifically, consider a pre-trained linear layer with weight matrix $W\in\mathbb{R}^{n\times n}$ stored in plaintext. If we update $W$ to $W+\Delta W$ where $\Delta W\in\mathbb{R}^{n\times n}$, then evaluating the linear layer

$$ $X(W+\Delta W)=XW+X\Delta W,\qquad\text{ for }X\in\mathbb{R}^{L\times n}$ $$

costs $\mathcal{O}(n^{2})$ HE operations, where $\mathcal{O}(\cdot)$ only considers the dependence on $n$. However, while $XW$ can be evaluated with PCMM, $X\Delta W$ must be evaluated with the costly CCMM. This is because $W$ is not encrypted, but $\Delta W$ must be encrypted.

##### Accelerating homomorphic matrix-multiplication with LoRA.

LoRA (Hu et al., ) fine-tuning alleviates the cost of CCMM by reducing the size of CCMMs. We clarify that the primary benefit of LoRA in the usual plaintext application is the reduced memory footprint due to having fewer optimizer memory states. Under HE, however, the main benefit is also converting large CCMMs into large PCMMs and reducing the computational cost.

Again, consider a pre-trained linear layer with weight matrix $W\in\mathbb{R}^{n\times n}$ stored in plaintext. However, consider LoRA fine-tuning updating $W$ to $W+AB$, where $r\ll n$, $A\in\mathbb{R}^{n\times r}$, and $B\in\mathbb{R}^{r\times n}$. Then, evaluating the linear layer

$$ $X(W+AB)=XW+(XA)B,\qquad\text{ for }X\in\mathbb{R}^{L\times n}$ $$

requires an $\mathcal{O}(n^{2})$-cost PCMM to evaluate $XW$ and two $\mathcal{O}(nr)$-cost CCMMs to evaluate $(XA)B$, where $\mathcal{O}(\cdot)$ only considers the dependence on $n$ and $r$. See Appendix C for further details.
Since $A$ and $B$ are encrypted, evaluating $(XA)B$ still requires CCMMs, but the CCMMs are smaller than $X\Delta W$ by a factor of $n/r$. The difference in computational cost is significant, as shown in Table 1(a) and Appendix G.

Finally, we mention, but without describing the details, that an analogous consideration can be applied to backpropagation. (We remind the readers that we also perform fine-tuning under HE.)

##### Reducing optimizer states and inverse square root with LoRA.

We fine-tune the transformer under HE using a variant of AdamW optimizer. The precise version of AdamW that we implement under HE is described in Appendix 5.2. For training and fine-tuning transformers, it is well known that adaptive optimizers like AdamW significantly outperform non-adaptive optimizers such as SGD (Zhang et al., ).

However, the inverse square root function mapping is $x\mapsto 1/\sqrt{x}$. This is also a non-polynomial function that tends to be difficult to use under HE.
In general, due to wide input ranges for division, ${\mathsf{BTS}}$ is required for each ciphertext containing weights during evaluation. Given the large number of parameters in the transformer model, the optimizer step can create a computation time bottleneck. In fact, the optimizer’s computation time exceeds that of the transformer block evaluation in our target model under full fine-tuning, as presented in Section 5.1.

LoRA alleviates this computational cost by substantially reducing the number of parameters being fine-tuned, thereby reducing the number of inverse square root operations needed in the AdamW optimizer. In our target 2-layer $\mathrm{BERT}$ model, full fine-tuning requires 368 ciphertexts containing weights, whereas LoRA only needs 15, offering a clear advantage in optimizer computation time.

## 4 Speedup with Gaussian kernel: Poly-apx-friendly design

##### Bottleneck 2: Softmax is hard to evaluate under HE.

Since HE only supports polynomial operations, non-polynomial functions must be approximated as polynomials. Traditionally, the softmax function is evaluated with

$$ $\mathrm{Softmax}\left(x_{1},x_{2},\cdots,x_{n}\right)_{i}=\frac{\exp\left(x_{i }-\alpha\right)}{\sum_{j}\exp\left(x_{j}-\alpha\right)},\quad\text{where}~{} \alpha=\max_{1\leq j\leq n}\left\{x_{j}\right\}.$ $$

Subtracting $\alpha$ is crucial to avoid taking the exponential of a large positive number, which would lead to numerical instabilities. Under HE, however, the exponential, division, and max functions are non-polynomial functions that must be approximated. To clarify, the max function is conventionally evaluated using comparisons and if-statements, but these are non-polynomial functions that require polynomial approximations under HE.

While there is some recent work on efficiently approximating softmax function as polynomials (Badawi et al., ; Jin et al., ; Hong et al., ; Lee et al., ; ), softmax is still considered numerically challenging to evaluate under HE. In this section, we resolve this issue by avoiding the softmax function altogether and introducing the Gaussian kernel (GK) as an alternative.

##### GK attention.

The standard attention layer (1) obtains the attention scores using the softmax function, which is difficult to approximate under HE. We can view the softmax as normalizing the outputs of a scaled exponential kernel, where “kernel” is used in the sense of RKHS kernel methods of classical machine learning (Berlinet & Thomas-Agnan, ). However, fundamentally, there is no requirement to use the exponential kernel, nor is there a necessity for normalizing the scores.

We propose the alternative *Gaussian kernel attention*:

$$ $\displaystyle\text{GK-Attention}(Q,K,V)$ $\displaystyle=S(Q,K)V$ (2) $\displaystyle S(Q,K)_{ij}$ $\displaystyle=\exp\Big{(}-\frac{1}{2\sqrt{n}}\left\|Q_{i,:}-K_{j,:}\right\|_{2 }^{2}\Big{)},\,\,i,j=1,\ldots,L,$ $$

where $\|\cdot\|_{2}$ is the $L_{2}$ norm, $n$ is the hidden dimension, and $Q_{i,:}$ and $K_{j,:}$ mean the $i$th and $j$th row of $Q$ and $K$.
Compared to the standard attention, the scaled exponential kernel is replaced with a Gaussian kernel and we do not perform normalization. The Gaussian kernel is much easier to evaluate than the softmax function for the following reasons. First, there is no need for division. (The factor $1/(2\sqrt{n})$ is fixed, so the reciprocal can be pre-computed and then multiplied.) Second, there is no need to compute the $\mathrm{max}$ function, which is difficult to approximate under HE. Third, $\exp(x)$ only needs to be approximated for $x\leq 0$, the region in which $\exp(x)$ does not blow up and therefore is much easier to approximate numerically.
Specifically, we use

$$ $\exp(x)\approx p_{k}(x)\coloneqq\left(1+\frac{x}{2^{k}}\right)^{2^{k}}\text{ for }k\in\mathbb{N},$ $$

which is very accurate for the range $\left[-2^{k},0\right]$. See Appendix F for further discussions on the polynomial approximation of $\exp(x)$.

Finally, we point out that in contexts unrelated to encryption or privacy, the prior work of Richter & Wattenhofer () made the observation that normalizations (divisions) are not necessary for the attention layers and that the prior work of Lu et al. () used Gaussian kernel in place of the softmax. Specifically, Richter & Wattenhofer () removed normalizations to improve the theoretical and practical characteristics of transformers, and Lu et al. () further used a low-rank approximation to the Gaussian kernel to present a linear-complexity attention layer accommodating long context lengths.

## 5 Experimental results

### 5.1 Experimental setup

In this subsection, we quickly describe some core aspects of the experimental setup. Some details, such as the penalty training trick and hyperparameters, are deferred to Appendix E.

##### Implementation of homomorphic encryption (HE).

Our implementation is based on the C++ HEaaN library (CryptoLab, ).
All of our experiments used 8 $\times$ Nvidia GeForce RTX 4090 24GB GPUs. We use the FGb parameter of the HEaaN library with the specific values in Table 5 (Appendix B). Overall, we can do $L=9~{}(\mathsf{p}){\mathsf{Mult}}$s before ${\mathsf{BTS}}$, which means the minimum required level for ${\mathsf{BTS}}$ is $3$. The input range of ${\mathsf{BTS}}$ is $\left[-1,1\right]$. If the input range exceeds it, we need another ${\mathsf{BTS}}$ algorithm;
${\mathsf{ExtBTS}}$ is an extended bootstrapping for having a wide input range $[-2^{20},2^{20}]$, which require at least $4$ levels to operate. We usually use ${\mathsf{ExtBTS}}$ in our HE model except when the input range is guaranteed. For the detailed parameter information and time measurement of HE operations, refer to Table 5 in Appendix B. Note that ${\mathsf{Mult}}$ is $6\times$ slower than $\mathsf{p}{\mathsf{Mult}}$ and ${\mathsf{Rot}}$ is $24\times$ slower than $\mathsf{p}{\mathsf{Rot}}$. These are the main reasons for CCMM is much slower than PCMM.

##### Architecture.

We use an encoder-only transformer in the style of BERT (Devlin et al., ) and largely follow the setup of (Geiping & Goldstein, ). We remove all bias terms in the linear layers of transformer blocks and use the same tokenization as in (Geiping & Goldstein, ). The hidden dimensions of embedding, attention layers, and FFNs are $768$. The number of attention heads is $12$. In FFNs, we enlarge the hidden dimension into $3072$ with a dense layer and reduce that to $768$ using a gated linear unit (GLU) (Dauphin et al., ) and ReLU. In contrast to (Geiping & Goldstein, ), we modify the dense layer of the shape $(768,1024)$ in the classification head attached to the BERT into the two dense blocks of the shapes $(768,32)$ and $(32,1024)$, which allows us to use more optimized CCMMs (see Appendix D.2). We set the number of transformer layers as $2$ for the practical computation time. We apply LoRA only to the query, value, and key layers as applying LoRA to other layers (e.g.,  FFN) did not give a noticeable performance gain in our experiments. LoRA rank is 2 for all LoRA layers.

##### Non-polynomial approximation.

Our transformer implementation under HE requires the polynomial approximation of several non-polynomial functions.
We use the following methods for the approximation: Remez approximation (Remez, ), Newton’s method (Nocedal & Wright, ), iterative method, and composition of minimax functions. Remez algorithm is computed using the Sollya tool (Chevillard et al., ). For inverse square root functions, we combine Remez approximation with a few Newton’s steps.
For each non-polynomial approximation method and its precision based on input range and degree, refer to Table 13 in Appendix F. We also classify polynomials used for each downstream task through the HE experiment in the same section.

### 5.2 Time measurments

We now present the speedups provided by our proposed methods. We use an input token length of $128$. For further details on the optimizations of homomorphic matrix multiplication and LoRA-friendly CCMM, refer to Appendix D.1 and D.2.

##### CCMM vs. PCMM.

As explained in Appendix C and shown by the time differences between ciphertext and plaintext operations in Table 5 (Appendix E), CCMM is approximately 10$\times$ slower than PCMM for the same matrix sizes evaluation (Table 1(a)).

**Table 1: Computation time comparison for homomorphic matrix multiplication and Softmax with GK. For matrix multiplication, we assume the evaluation of matrices for $128\times 768$ by $768\times 768$ where $128\times 768$ is in ciphertext, and $768\times 768$ is either in ciphertext or plaintext. PCMM and GK are much faster than their respective comparison group.**
|  | Time (s) | Factor |
| --- | --- | --- |
| CCMM | 1.095 | 1 |
| PCMM | 0.103 | 10.63 |

##### Softmax vs. GK.

In Table 1(b), we compare the computation time of Softmax and GK under HE, where the input range is $[-2^{10},0]$ and we evaluate 12 pairs of $128\times 128$ matrices row-wise for softmax and on matrices of the same size for GK. For the softmax function, we utilize the method of HETAL (Lee et al., ), which approximates the maximum function, the exponential function, and the inverse function homomorphically. GK is much faster than the softmax function evaluation using the HETAL (Lee et al., ) approach under the same experimental setting.

##### Optimizer.

In the experiments, we use $\mathrm{AdamW\text{-}HE}$, a modified version of $\mathrm{AdamW}$ (Loshchilov & Hutter, ) is stated in the following as Algorithm 1.

Figure: Algorithm 1 $\mathrm{AdamW\text{-}HE}$

In the original version of AdamW, the Step 8 has the form $\theta_{t}\leftarrow\theta_{t}-\gamma\widehat{m_{t}}/(\sqrt{\widehat{v_{t}}}+\varepsilon)$, and this is numerically challenging to evaluate for the following two reasons:

- •
To calculate $1/\left(\sqrt{\widehat{v_{t}}}+\varepsilon\right)$, we have to approximate $\sqrt{x}$ and $1/x$, which are delicate.
- •
Conventionally, $\varepsilon>0$ is set to a sufficiently small value, such as $10^{-12}$.
However, approximating $1/x$ on the large range $[\varepsilon,1]$ is challenging if $\varepsilon$ is small.

Therefore, we change Step 8 in the Algorithm 1 into

$$ $\theta_{t}\leftarrow\theta_{t}-\gamma\widehat{m_{t}}/\sqrt{\widehat{v_{t}}+ \varepsilon},$ $$

and we choose a value of $\varepsilon>0$ that is not too small by considering both the performance and the approximation accuracy. Also, we use the maximum-dividing trick as in (3). These modifications allow $\mathrm{AdamW\text{-}HE}$ to be run stably under HE. Refer to Table 11 in Appendix E for hyperparameters used in $\mathrm{AdamW\text{-}HE}$ for each task.

##### Computation time for our model and downstream tasks.

Table 2 presents the execution times of each setup. We observe a speedup of 6.94$\times$ for fine-tuning and 2.3$\times$ for inference. Table 3 compares the execution time for each downstream task with the Full+SM model. Our model consistently achieves a $4\times$ improvement across each downstream task. For the detailed end-to-end time measurement for each block operation of our target model, see Table 12 in Appendix E.

**Table 2: Comparison of fine-tuning and inference times for full fine-tuning with Softmax (Full+SM), LoRA fine-tuning with Softmax (LoRA+SM), and LoRA fine-tuning with GK (LoRA+GK, Ours) approaches under a single GPU. Our model achieves speedup in both fine-tuning and inference.**
|  | Fine-tuning | Inference |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- |
| Time (s) | Full+SM | LoRA+SM | LoRA+GK (Ours) | Full+SM | LoRA+SM | LoRA+GK (Ours) |
| 2 layers | 169.2 | 65.16 | 49.22 | 61.12 | 41.72 | 25.78 |
| Class. head | 1.52 | 1.5 | 1.5 | 0.72 | 0.72 | 0.72 |
| Optimizer | 252.83 | 10.31 | 10.31 | - | - | - |
| Total | 423.55 | 76.97 | 61.03 | 61.84 | 42.44 | 26.5 |
| Factor | 1 | 5.5 | 6.94 | 1 | 1.46 | 2.33 |

**Table 3: Execution time analysis of fine-tuning for each downstream task, comparing our method with Full+SM. Our model shows the consistent $4\times$ improvement for each downstream task.**
|  |  | Task | RTE | MRPC | STS-B | COLA | SST-2 | QNLI |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Time per epoch (h) |  | Ours | 4.8 | 7.1 | 11.1 | 16.5 | 130 | 202 |
|  | Full+SM | 19.5 | 28.8 | 45.1 | 67.1 | 529 | 822 |  |

### 5.3 Downstream task performance on encrypted language models

We evaluate our model on the GLUE benchmark (Wang et al., ).
However, we exclude WMNI (Devlin et al., ) as in Geiping & Goldstein (), and MNLI (Williams et al., ) and QQP (Wang et al., ) due to their size and our computational constraints. We fine-tune using the cross-entropy loss for tasks including CoLA (Warstadt et al., ), MRPC (Dolan & Brockett, ), RTE (Giampiccolo et al., ), QNLI (Wang et al., ), and SST-2 (Socher et al., ), and MSE loss for STSB (Cer et al., ). We fine-tune SST-2 and QNLI only for $1$ epoch and $5$ epochs for others since the former are more computationally heavy. One can see the scores for Full+SM, LoRA+GK under plaintext, and LoRA+GK under HE (ours) in Table 4. We set $\varepsilon=10^{-12}$ in the optimizer for all plaintext settings. For plaintext experiments, we repeat 10 times for each task and choose the best score. For experiments under HE, different $\varepsilon$ values are chosen for each task. The results in Table 4 indicate that using LoRA, Gaussian kernel, and homomorphic encryption results in only a minimal reduction in model accuracy compared to using full fine-tuning, softmax, and
no encryption.

**Table 4: GLUE results on our homomorphically encrypted language model. “Matthews corr.” means Matthews correlation. “Full+GK” denotes full fine-tuning with GK. For all metrics, higher values mean better performance. Our model performs comparably to plaintext models.**
| Task | Plaintext Fine-tuning | LoRA+GK under HE (Ours) |  |  |  |
| --- | --- | --- | --- | --- | --- |
| Full+SM | Full+GK | LoRA+GK | Eval under Plaintext | Eval under HE |  |
| CoLA<br>(Matthews corr. $\uparrow$) | 0.2688 | 0.2640 | 0.1883 | 0.1512 | 0.1575 |
| MRPC<br>(F1 $\uparrow$) | 0.8304 | 0.8431 | 0.8258 | 0.8147 | 0.8147 |
| RTE<br>(Accuracy $\uparrow$) | 0.5884 | 0.6101 | 0.5776 | 0.5957 | 0.5993 |
| STSB<br>(Pearson $\uparrow$) | 0.8164 | 0.8215 | 0.8107 | 0.8002 | 0.7997 |
| SST-2<br>(Accuracy $\uparrow$) | 0.8991 | 0.8911 | 0.8567 | 0.8188 | 0.8188 |
| QNLI<br>(Accuracy $\uparrow$) | 0.8375 | 0.8287 | 0.8040 | 0.7827 | 0.7827 |
| Average | 0.7068 | 0.7098 | 0.6772 | 0.6606 | 0.6621 |

## 6 Conclusion

In this work, we present a homomorphic encryption (HE) friendly transformer architecture and experimentally demonstrate that an encrypted BERT-style transformer exhibits significant speedups in both fine-tuning and inference under HE. Our architecture specifically resolves two computational bottlenecks using LoRA and Gaussian kernel (GK).

The field of privacy-preserving machine learning using large neural networks will advance through research on (i) training small, efficient language models with considerations unrelated to encryption, (ii) improving the computational efficiency of fundamental computational primitives under HE with considerations unrelated to machine learning, and (iii) developing machine learning models tailored toward the encrypted usage. This work represents the first steps of progress in the direction (iii).

## Appendix A Diagram: Full fine-tuning vs. LoRA fine-tuning in BERT

Figure 3, 3 illustrate the complete diagram of our target model with respect to full fine-tuning and LoRA fine-tuning, respectively. Orange boxes indicate where updates occur during fine-tuning, and $c$ in the classification head layer denotes the number of classes. In full fine-tuning, large-size weight matrices are updated and transformed from plaintexts to ciphertexts, which means the large-size CCMMs must be processed during both fine-tuning and inference. In contrast, only small-size weight matrices are transformed into ciphertexts in LoRA fine-tuning.

Figure: Figure 2: Full fine-tuning.
Refer to caption: extracted/5898698/figures/full_fine-tuning7.png

## Appendix B CKKS functionalites

The CKKS (Cheon et al., ) is a homomorphic encryption scheme that allows one to encrypt real or complex data as a message polynomial and perform approximate arithmetic on the encrypted message. More precisely, CKKS scheme supports a single-instruction-multiple-data (SIMD) property from encoding $({\mathsf{Ecd}})$/decoding $({\mathsf{Dcd}})$ map: given a power-of-two positive integer ring degree $N$, encoding map is defined as ${\mathsf{Ecd}}:\mathbb{C}^{N/2}\rightarrow\mathcal{R}_{Q}=\mathbb{Z}_{Q}[x]/(x
^{N}+1)$, where $Q$ is a positive integer. The decoding map ${\mathsf{Dcd}}$ can be interpreted as an inverse process of ${\mathsf{Ecd}}$. ${\mathsf{Ecd}}/{\mathsf{Dcd}}$ represents a conversion between $(\mathbb{C}^{N/2},\oplus,\odot)$ and $(\mathcal{R}_{Q},+,\cdot)$, where $\oplus~{}\text{and}~{}\odot$ are component-wise addition and multiplication, respectively. In the CKKS scheme, each of ${\mathsf{Ecd}}$ and ${\mathsf{Dcd}}$ is processed before encryption or after decryption, respectively. Encryption (${\mathsf{Enc}}_{{\mathsf{pk}}}$) and Decryption (${\mathsf{Dec}}_{{\mathsf{sk}}}$) are a ring learning with errors (RLWE) (Stehlé et al., ; Lyubashevsky et al., ) encryption and decryption, respectively.
We can operate addition/multiplication on those vectors via polynomial operations from the ring isomorphism. Here, we use $\approx$ notation to indicate approximate equality, as the CKKS scheme evaluates approximately (for more details, refer to Cheon et al. ());

- •
Key generation: Given a security parameter $\lambda$ and a subset $S\subset\{1,2,\cdots,N/2\}$, return a public key ${\mathsf{pk}}$, a secret key ${\mathsf{sk}}$, a relinearization key ${\mathsf{rlk}}$, and rotation keys $\{{\mathsf{rk}}_{i}\}_{i\in S}$.
- •
Encryption: Given ${\mathsf{pk}}$ and a message $\bf{m}$, return a ciphertext $\mathrm{ct}={\mathsf{Enc}}_{\mathsf{pk}}(\bf{m})={\mathsf{Enc}}({\mathsf{Ecd}}
(\bf{m}),{\mathsf{pk}})$.
- •
Decryption: Given ${\mathsf{sk}}$ and a ciphertext $\mathrm{ct}$, return a message $\bf{m^{\prime}}={\mathsf{Dec}}_{\mathsf{sk}}(\mathrm{ct})={\mathsf{Dcd}}({
\mathsf{Dec}}(\mathrm{ct},{\mathsf{sk}}))$, where $\bf{m^{\prime}}\approx\bf{m}$.
- •
Addition: Given two ciphertexts $\mathrm{ct}_{1}$ and $\mathrm{ct}_{2}$, return $\mathrm{ct}_{add}={\mathsf{Add}}(\mathrm{ct}_{1},\mathrm{ct}_{2})$, satisfying ${\mathsf{Dec}}_{\mathsf{sk}}(\mathrm{ct}_{add})\approx{\mathsf{Dec}}_{\mathsf{
sk}}(\mathrm{ct}_{1})\oplus{\mathsf{Dec}}_{\mathsf{sk}}(\mathrm{ct}_{2})$. Addition also can be evaluated between plaintext and ciphertext.
- •
Multiplication: Given two ciphertexts $\mathrm{ct}_{1}$ and $\mathrm{ct}_{2}$ and a linearization key ${\mathsf{rlk}}$, return $\mathrm{ct}_{mult}={\mathsf{Mult}}(\mathrm{ct}_{1},\mathrm{ct}_{2})$, satisfying ${\mathsf{Dec}}_{\mathsf{sk}}(\mathrm{ct}_{mult})\approx{\mathsf{Dec}}_{\mathsf
{sk}}(\mathrm{ct}_{1})\odot{\mathsf{Dec}}_{\mathsf{sk}}(\mathrm{ct}_{2})$.
- •
Multiplication by Plaintext: Given a plaintext $\mathrm{pt}$ and a ciphertext $\mathrm{ct}$, return $\mathrm{ct}_{pmult}={\mathsf{pMult}}(\mathrm{pt},\mathrm{ct})$, satisfying ${\mathsf{Dec}}_{\mathsf{sk}}(\mathrm{ct}_{pmult})\approx{\mathsf{Dcd}}(\mathrm
{pt})\odot{\mathsf{Dec}}_{\mathsf{sk}}(\mathrm{ct}_{pmult})$.
- •
Rotation: Given a rotation key ${\mathsf{rk}}_{i}$ for $i\in S$ and a ciphertext $\mathrm{ct}$ with ${\mathsf{Dec}}_{{\mathsf{sk}}}(\mathrm{ct})\approx(m_{0},m_{1},\dots,m_{N/2-1})$, return a ciphertext $\mathrm{ct}_{rot_{i}}={\mathsf{Rot}}(\mathrm{ct},i)$ satisfying ${\mathsf{Dec}}_{{\mathsf{sk}}}(\mathrm{ct}_{rot_{i}})\approx(m_{i},\dots,m_{N/
2-1},m_{0},\dots,m_{i-1})$. The rotation index $i$ acts modulo $N/2$, so ${\mathsf{Rot}}(\cdot,-i)$ = ${\mathsf{Rot}}(\cdot,N/2-i)$. ${\mathsf{pRot}}$ is the same operation on the plaintext side.

##### HE parameter and its time measurement.

During HE implementation, we use the FGb parameter, one of the HEaaN-providing parameters. For the detailed value of the FGb parameter, refer to Table 5. We also list the time measurement of HE operations under a single GPU. We know that ${\mathsf{Mult}}$ and ${\mathsf{Rot}}$, operated in ciphertext, are slower than $\mathsf{p}{\mathsf{Mult}}$ and $\mathsf{p}{\mathsf{Rot}}$, which are related to plaintext operations, respectively.

**Table 5: The FGb parameter and time measurement for each HE operation under the single GPU. The terms $\log(QP),N,L,\lambda$ denote the bit lengths of the largest modulus, ring degree, multiplicative depth, and security parameter.**
| FGb parameter | Time measurement of each homomorphic operation (ms) |  |  |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| $\log(QP)$ | $N$ | $L$ | $h$ | $\lambda$ | ${\mathsf{Add}}$ | ${\mathsf{pRot}}$ | ${\mathsf{Rot}}$ | ${\mathsf{BTS}}$ | ${\mathsf{ExtBTS}}$ | ${\mathsf{pMult}}$ | ${\mathsf{Mult}}$ |
| 1555 | $2^{16}$ | 9 | 192 | 128 | 0.02 | 0.02 | 0.49 | 60 | 137 | 0.1 | 0.6 |

## Appendix C Homomorphic matrix multiplication algorithm

Consider $d\times d$ homomorphic matrix multiplication.
JKLS (Jiang et al., ) suggests the fastest known HE square matrix multiplication algorithm with $\mathcal{O}(d)$ HE computational complexity (for more precise number of each operation, refer to Table 6) when the matrix elements can be packed in a ciphertext, specifically when $d^{2}\leq N/2$.
The required HE operations include ${\mathsf{Add}},(\mathsf{p}){\mathsf{Rot}},\text{and}~{}(\mathsf{p}){\mathsf{
Mult}}$.
The computation time of ${\mathsf{Rot}}~{}\mathrm{and}~{}{\mathsf{Mult}}$ operations differ between plaintext and ciphertext (see Table 5), with operations in ciphertext being significantly slower. Consequently, CCMM is much slower than PCMM; the number of different message space operations is exactly $d+2\sqrt{d}$ for one homomorphic matrix multiplication. For precise time difference between two kinds of homomorphic matrix multiplication, see Section 5.2.

When $d^{2}>N/2$, where we cannot encrypt the matrix into one ciphertext, we can also utilize the JKLS algorithm by computing block-wise matrix multiplication. For example, if we take $N=2^{16}$ for the base ring degree, we can pack two $128\times 128$ matrices into one ciphertext. When $d=768$, we require 18 ciphertexts to pack $d\times d$ matrix. After packing each block matrices into ciphertexts, we repeat the corresponding block-wise matrix multiplication to all the weights. Thus, for large-size matrix multiplications, the computation time gap between CCMM and PCMM will be proportional to the number of ciphertexts required for packing.

In addition, JKLS introduced a homomorphic rectangular matrix multiplcation of size $\ell\times d$ by $d\times d$ or vice-versa, with $\ell<d$ and $\ell d\leq N/2$. We can use this method to evaluate LoRA CCMMs, where we need to evaluate the homomorphic rectangular matrix multiplication sequentially. For more detailed HE operations numbers, see Table  7.

**Table 6: The number of each HE operation for one $d\times d$ homomorphic matrix multiplication required by JKLS (Jiang et al., ) algorithm.**
| Operations | ${\mathsf{Add}}$ | $\mathsf{p}{\mathsf{Mult}}$ | ${\mathsf{Rot}}$ | ${\mathsf{Mult}}$ | Depth |
| --- | --- | --- | --- | --- | --- |
| JKLS (Jiang et al., ) | $6d$ | $4d$ | $3d+5\sqrt{d}$ | $d$ | 3 |

**Table 7: The number of each HE operation for rectangular homomorphic matrix multiplication $\ell\times d$ by $d\times d$ required by JKLS (Jiang et al., ) rectangular matrix algorithm.**
| Operations | ${\mathsf{Add}}$ | $\mathsf{p}{\mathsf{Mult}}$ | ${\mathsf{Rot}}$ | ${\mathsf{Mult}}$ | Depth |
| --- | --- | --- | --- | --- | --- |
| JKLS (Jiang et al., ) | $3d+2\ell+\log(d/\ell)$ | $3d+2\ell$ | $3\ell+5\sqrt{d}+\log(d/\ell)$ | $\ell$ | 3 |

## Appendix D Optimizations for homomorphic matrix multiplication

The CKKS scheme packs all input data into a polynomial from encoding (${\mathsf{Ecd}}$). The packed data are assigned to fixed positions within the polynomial, and to change these positions, we have to use the $(\mathsf{p}){\mathsf{Rot}}$ operation. In the homomorphic matrix multiplication algorithm, several $(\mathsf{p}){\mathsf{Rot}}$ operations are required. Our target model has sequential matrix multiplications, so it is more efficient to fix the packing structure. Among various packing methods, we use row-wise packing (see Figure 4a) for all packed data except for LoRA weights, which will be explained in the next subsection. Because using the FGb parameter can pack a total $2^{15}$ data in one message space, we consider one plain/ciphertext having $2^{15}$ data, which corresponds to the size either $128\times 256~{}\text{or}~{}256\times 128$ in our implementation. Thus, during our model computation, we will assume one plain/ciphertext is packed $128\times 256$ matrix row-wise.

### D.1 Homomorphic matrix multiplication

Here, we introduce the optimization techniques used in our homomorphic matrix multiplication implementation. We adopt three optimization techniques to improve the speed of homomorphic matrix multiplication:

- •
Evalation in lower level: Because homomorphic matrix multiplication contains numerous HE operations and its speed depends on the current level, the ciphertexts containing matrix values are brought down to the minimum required level before performing the evaluation (Bae et al., ; Park et al., ), even if ${\mathsf{BTS}}$ may be needed for the next block evaluation. We adhere to this strategy in our homomorphic matrix multiplication by taking the JLKS (Jiang et al., ) algorithm, which requires 3 levels. Consequently, evaluating the bottom-level (7 level) PCMM is $2.35\times$ faster than the top-level (12 level) PCMM (refer to Table 8) of size $128\times 256~{}\text{by}~{}256\times 128$. This difference is even more pronounced in CCMM.
- •
Pre-computation and reuse for left-matrix: When we perform homomorphic matrix multiplication of size $128\times 768$ by $768\times 768$, we need to split the matrices as three and eighteen block matrices (see Figure 4c), respectively. And we go through each block matrix multiplication to get a corresponding result. From the property of block matrix multiplication, we know the same left matrices are used several times to multiply by the right block matrices. Thus, we do pre-computation using JKLS (Jiang et al., ) and save these objects for left-matrices. Using this strategy, we can reduce the total number of JKLS algorithm calls, which require numerous HE operations (as shown in Table 6), from 36 to 21. This is a trade-off between memory and computation time.
- •
Lazy key-switching/rescaling: When a ciphertext is evaluated by an automorphism, we need to do a key-switching operation. This is an expensive process.
If the result ciphertext is made from several ciphertexts resulting in the same automorphism, we are used to take lazy key-switching (hoisting) (Halevi & Shoup, ); that is, we go through only one key-switching after collecting all results instead of doing key-switching for each automorphism. By taking lazy key-switching, we can speed up the required computation time. Lazy rescaling is also a similar strategy for reducing computation time and added errors when doing a rescaling operation, which is an operation contained in ${\mathsf{Mult}}$.

**Table 8: Computation time comparison between PCMMs according to the different levels. The lower-level homomorphic matrix multiplcation is faster than the top-level evaluation.**
| PCMM | Time (s) | Factor |
| --- | --- | --- |
| 12 level | 0.242 | 1 |
| 7 level | 0.103 | 2.35 |

Figure: Figure 4: Row-wise packing method for matrix representation, utilizing zero-padding for non-square matrices, followed by block-wise matrix multiplication for efficient processing of large matrices.

### D.2 LoRA style CCMM

LoRA fine-tuning consists of two CCMMs. Because the LoRA weights are rectangular matrices, we need to do zero-padding (see Figure 4b) for the second weight to make it a square matrix. After that, we can follow the optimized homomorphic rectangular matrix multiplication algorithm sequentially, which we call the Rectangular MM algorithm in the following. However, when we consider that our target LoRA rank(=2) is quite small, this Rectangular MM approach generates an inefficiency since there are many non-usable spaces in the ciphertext from zero-padding. Thus, we make a more efficient algorithm for LoRA CCMMs than following the Rectangular MM. Our optimized algorithm can be applied in cases similar to LoRA CCMMs, which involve sequential matrix multiplication where one dimension is significantly smaller than the other. In our model, we also use these optimized CCMMs during classification head layer evaluation, where we have to perform homomorphic rectangular matrix multiplications of size $1\times 768$ by $768\times 32$ and $1\times 32$ by $32\times 1024$. For convenience, this subsection will describe the case regarding LoRA CCMMs with rank 2: $128\times 768~{}\text{by}~{}768\times 2$ and $128\times 2~{}\text{by}~{}2\times 768$, sequentially.

Figure: Figure 5: LoRA-friendly packing is used when the given matrix has one long and one short size. Split & repeat row-wise divides and copies each row into ciphertexts, which is used during LoRA CCMMs and $a_{i}$ denotes $i$-th row of matrix $a$. The shaded block matrices represent zero-padded blocks.

#### D.2.1 LoRA-friendly packing

In our target model, the LoRA weights are either $768\times\text{rank}$ or $\text{rank}\times 768$. Both weights have one long and one short dimension. Instead of directly following row-wise packing used in entire message packing, we pack LoRA weights with another approach. Figure 5a represents the packing method, called LoRA-friendly packing, used in LoRA weights. Even if $768\times\text{rank}$ is a column rectangular matrix shape, we follow the LoRA-friendly packing by considering the transposed column rectangular matrix. This does not mean we evaluate homomorphic transposition, where we use an algorithm in JKLS (Jiang et al., ) that also has numerous HE operations. But treat its column rectangular matrix with the corresponding order in a row-wise packed structure:

$$ $\displaystyle\{A_{ij}\}_{1\leq i\leq 768,1\leq j\leq\text{rank}}\mapsto\{B_{k} \}_{1\leq k\leq N/2}=\begin{cases}A_{ij}&\text{if}~{}k=i+768*(j-1)\\ 0&\text{otherwise}\end{cases}$ $$

By following this, we can remove the required evaluations of transposition during backpropagation computation.

#### D.2.2 Optimized homomorphic LoRA matrix multiplication algorithm

We optimize the sequential LoRA CCMMs in Algorithm 5. This algorithm consists of several HE operations and three operation blocks: (i) Split & repeat row-wise (Algorithm 2) for weights, (ii) repeat column-wise (Algorithm 3), and (iii) collect into the first column (Algorithm 4).

Figure: Algorithm 2 Split & repeat row-wise (Figure 5b)

Figure: Algorithm 3 Repeat column-wise

Figure: Algorithm 4 Collect into the first column

Figure: Algorithm 5 LoRA CCMMs

#### D.2.3 Comparison Rectangular MM and optimized LoRA CCMMs

We compare two approaches, Rectangular MM and our optimized LoRA CCMMs (Algorithm 5). We list up the required number of each HE operation for each method (Table 9) based on the given number of JKLS (Jiang et al., ) algorithm (Table 7) and the computation time comparison in implementation (Table 10). Our optimized LoRA CCMMs are $4.45\times$ faster than Rectangular MM. In addition, using LoRA-friendly packing, we can reduce the required number of homomorphic transposition evaluations.

**Table 9: The total required number of HE operations for $128\times d$ by $d\times r$ and $128\times r$ by $r\times d$ homomorphic matrix multiplications where $r$ denotes the LoRA rank. Rectangular MM denote a method that takes homomorphic rectangular matrix multiplication sequentially. Algorithm 5 requires much smaller HE operations than following Rectangular MM algorithms.**
| Operations | ${\mathsf{Add}}$ | $\mathsf{p}{\mathsf{Mult}}$ | ${\mathsf{Rot}}$ | ${\mathsf{Mult}}$ | Depth |
| --- | --- | --- | --- | --- | --- |
| Rectangular MM | $18d+12r+6\log(d/r)$ | $18d+12r$ | $18r+30\sqrt{d}+6\log(d/r)$ | $6r$ | 6 |
| Algorithm 5 | $42r-3$ | $4r$ | $40r-1$ | $6r$ | 3 |

**Table 10: Comparison of execution times between Rectangular MM and Algorithm 5. In the figure, MM denotes implementing our homomorphic matrix multiplication, and Tr denotes homomorphic transpose. Algorithm 5 is about $4.45\times$ faster than Rectangular MM.**
|  | Forward eval. | Backprop. |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- |
| MM | ${\mathsf{BTS}}$ | MM | ${\mathsf{BTS}}$ | Tr | Total | Factor |  |
| Rectangular MM (s) | 0.65 | 1.3 | 2.84 | 0.42 | 0.71 | 5.92 | 1 |
| Algorithm 5 (s) | 0.12 | 0.76 | 0.29 | 0 | 0.16 | 1.33 | 4.45 |

## Appendix E Experimental details under HE

In this section, we provide experimental details used in our experiments under HE.

##### Penalty training

In the experiments, we approximate non-polynomials such as inverse square root in $\mathrm{LayerNorm}$ (Ba et al., ). However, we cannot assure that the inputs of each non-polynomial lie in the approximation domain. To address this, we charge a penalty as in Baruch et al. () in the pre-training stage.
For example, when we approximate $\mathrm{ReLU}$ in the $i$th transformer layer on ${\color[rgb]{0,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}
\pgfsys@color@gray@stroke{0}\pgfsys@color@gray@fill{0}[-50,50]}$, for an input $X$ of our model, let the input of this $\mathrm{ReLU}$ be $X_{i,\text{$\mathrm{ReLU}$}}$. Then we add the term $\displaystyle\mathbf{1}_{\left\{\left\|X_{i,\text{$\mathrm{ReLU}$}}\right\|_{
\infty}>50\right\}}$ to the pre-training loss $L_{\text{pre}}$ where $\lambda>0$. If we let

$$ $\mathcal{F}=\left\{\left(f,L_{f}\right)\big{|}\text{ The approximation range of $f$ is $\left[-L_{f},L_{f}\right]$}\right\}$ $$

be the set of all non-polynomials and their approximation domains in our model, then the original loss function is modified into

$$ $L_{\text{penalty}}(X;\theta)=L_{\text{pre}}(X;\theta)+\lambda\!\!\!\sum_{(f,L_ {f})\in\mathcal{F}}\mathbf{1}_{\left\{\left\|X_{f}\right\|_{\infty}>L_{f} \right\}}(X)$ $$

where $X$ is the input of the model, $\theta$ is the parameters of the model, and $X_{f}$ is the input of $f\in\mathcal{F}$ for the initial input $X$. We change the original $L_{\text{pre}}$ to $L_{\text{penalty}}$ in the last $k$ (100 in our setting) steps of the pre-training. In this way, we can narrow the input range of non-polynomial functions and are able to approximate them.

##### Hyperparameters.

We summarize the hyperparameters used in HE experiments. We first experimented on the plaintext and chose the best hyperparameters for HE experiments.

**Table 11: Hyperparameters used for HE experiments. Epsilon means $\varepsilon$ of $\mathrm{AdamW\text{-}HE}$ in section 5.1. Warmup steps, Number of cycles are used in transformers (Wolf et al., ) cosine scheduler, and betas are used in $\mathrm{AdamW\text{-}HE}$.**
|  | Learning Rate | Epsilon | Warmup Steps | Number of Cycles | Betas |
| --- | --- | --- | --- | --- | --- |
| CoLA | $4.0e-3$ | $8.0e-3$ | 0 | 0.5 | $[0.9,0.999]$ |
| MRPC | $5.0e-4$ | $6.0e-4$ |  |  |  |
| RTE | $2.0e-4$ | $2.0e-4$ |  |  |  |
| STSB | $2.5e-2$ | $4.0e-1$ |  |  |  |
| SST-2 | $8.5e-3$ | $8.0e-4$ |  |  |  |
| QNLI | $6.5e-3$ | $8.0e-4$ |  |  |  |

##### End-to-end runtime of 1 layer forward evaluation and backpropagation.

Here, we list all the required block operations runtime in 1 layer case with respect to forward evaluation and backpropagation of LoAR fine-tuning in Table 12.
In forward evaluation, the softmax function evaluation is the most time-consuming part in LoRA with Softmax, on the other hand, ${\mathsf{BTS}}$ is the part in LoRA with GK. In both cases of backpropagation, the matrix multiplication time is the most time-consuming part.
Thus, replacing the softmax function efficiently and reducing the required number of CCMM are key factors, so we adopt LoRA fine-tuning and the Gaussian Kernel.

**Table 12: Lists the end-to-end runtime for each individual operation using single GPU. Tr denotes transposition, and Save is the saving time for backpropagation or optimizer. Softmax evaluation occupies $43\%$, which is the most time-consuming in forward evaluation; however, GK is just $8\%$.**
| Forward eval. | Time (s) | Ratio (%) |
| --- | --- | --- |
| PCMM | 1.35 | 6.47 |
| CCMM | 1.87 | 8.96 |
| LayerNorm | 0.48 | 2.3 |
| BTS | 5.74 | 27.53 |
| Softmax | 8.99 | 43.1 |
| ReLU | 1.35 | 6.47 |
| LoRA | 0.85 | 4.07 |
| Tr & Save | 0.23 | 1.1 |
| Total | 20.86 | 100 |

##### Multi-GPU implementation that simulates a batch scenario.

For the LoRA fine-tuning for the downstream tasks, we use 8 GPUs. We follow the same plain model parameters (refer to Appendix E), where the batch size is 16. Because packing multiple datasets to mimic the batch scenario itself has some restrictions (such as large-size weights, long token lengths, and restricted message spaces), we get to use multiple GPUs to make our algorithm keep following batch scenarios. Here, we assign one datum to one GPU. When the weights are updated, the communications between GPUs are raised, and an average of each gradient can be obtained. This speeds up the runtime per epoch, even with a slight communication delay, which is negligible compared to the overall runtime.

## Appendix F Utilized polynomials for each downstream task

### F.1 Overview of polynomial approximations used in our target model.

Table 13 shows the overview of polynomial approximation utilized in our target model experiments. According to the input range, the optimized approximation method is different. For the inverse square root, we additionally employ a few iterations of Newton’s method for the following reason. While minimax approximation optimizes multiplicative depth in polynomial evaluation, it requires numerous multiplications. To mitigate this, we integrate a few Newton iterations, which provide a faster approximation of the inverse square root, though at the cost of additional multiplicative depth.

**Table 13: Overview of polynomial approximation methods for various non-polynomial functions with specific usages. “Worst prec.” refers to the maximum value of $\lVert f(x)-poly(x)\rVert_{\infty}$ across the input range, while “Avg prec.” denotes the average (mean) value. Although we replace the softmax with the Gaussian kernel in attention layers, the softmax function is still used once in computing the cross-entropy loss. Non-polynomials require different polynomial approximations according to the input range.**
|  | $1/\sqrt{x}$ | $1/x$ | tanh | exp | $\mathrm{ReLU}$ |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Input range | [0.0005, 1] | [0.04,1] | [0.8,3.0] | [-5,5] | [-16,16] | [-2,2] | [-13,1] | [$-2^{14}$,0] | [-1,1] |
| Degree | 127 | 63 | 15 | 63 | 127 | 15 | 15 | - | 15/15/27 |
| Worst prec. (bits) | 11.1 | 19.8 | 23.7 | 24.7 | 18.6 | 21.2 | 21.2 | 15 | 10 |
| Avg prec. (bits) | 24.6 | 24.6 | 26.5 | 26.6 | 19.6 | 25.8 | 22.9 | 17.4 | 16.4 |
| Method | Remez + Newton | Remez | Remez | Remez | Iter. | Minimax composition<br>(Lee et al., ) |  |  |  |
| Usage | LayerNorm,<br>AdamW-HE | Loss (Softmax) | Classification<br>head | Loss (Softmax) | GK | FFN |  |  |  |

### F.2 Polynomials for each downstream task

In the previous subsection F.1, we give our polynomial approximation of each non-polynomial.
Since the input ranges for non-polynomial functions vary across downstream tasks, appropriate polynomial approximations are required for each task. Below, we list the polynomials used for each task, with Table 14 categorizing them based on their input domains.

- •
Inverse square root with additional three Netwon steps: sqrtInv ([0.0005, 1])
- •
Inverse: inv1 ([0.04, 1]), inv2 ([0.8, 3.0])
- •
Exponential: exp1 ([-2, 2]), exp2 ([-13, 1])
- •
Exponential with iterative algorithm: expIter ([$-2^{14}$,0]) ($p_{14}$ in section 4)
- •
ReLU: relu ([-50, 50])
- •
Tanh: tanh1 ([-5, 5]), tanh2 ([-16, 16])

**Table 14: Types of polynomials used in the block operations for each task.**
|  | LayerNorm | Attn | FFN | Class. head | Loss (Softmax) | AdamW-HE |
| --- | --- | --- | --- | --- | --- | --- |
| CoLA | sqrtInv | expIter | relu | tanh1 | exp1, inv1 | sqrtInv |
| MRPC |  |  |  |  |  |  |
| RTE |  |  |  |  |  |  |
| STSB | tanh2 | exp2, inv2 |  |  |  |  |
| SST-2 |  |  |  |  |  |  |
| QNLI |  |  |  |  |  |  |

We plot some core polynomial functions used in our work: expIter, sqrtInv, and relu. See Figure 6 and 7. For $\mathrm{ReLU}$ and $1/\sqrt{x}$, we slightly modify to use approximations of these functions in the fixed input range. When we approximate
$1/\sqrt{x}$,
if the input range lies outside the interval $[0.0005,~{}1]$,
we divide a predetermined number $M$ for the inputs to belong in $[0.0005,1]$; for an input $x$, we calculate as

$$ $\displaystyle\frac{1}{\sqrt{x}}=\frac{1}{\sqrt{x/M}}\times\frac{1}{\sqrt{M}}.$ (3) $$

For $\mathrm{ReLU}$, we set $K>0$ and for an input $x$ calculate as

$$ $\text{$\mathrm{ReLU}$}(x)=K\text{$\mathrm{ReLU}$}\left(\frac{x}{K}\right).$ $$

using the homogeneity of $\mathrm{ReLU}$. In the experiments, we set $K=50$. You can see in Figure 7 the comparison of these functions and their approximations.

Figure: Figure 6: The graph of approximation $p_{14}(=\text{expIter})$ on $\left[-2^{14},~{}0\right]$ of the exponential.
Refer to caption: extracted/5898698/figures/exp_approx2.png

Figure: Figure 7: The graphs of approximated inverse square root and $\mathrm{ReLU}$ on $[0.0005,~{}1]$ and $[-1,~{}1]$, respectively.
Refer to caption: extracted/5898698/figures/sqrt_inverse_relu2.png

## Appendix G Computation advantage of LoRA and Gaussian kernel for larger models

In section 5.2, we saw that CCMM is approximately 10.63 $\times$ slower than PCMM when performing matrix multiplication with dimensions 128$\times$768 and 768$\times$768, where 768 is the embedding size. Also, calculating attention scores using softmax is approximately 6.24 $\times$ slower than using GK. However, when the embedding dimension and sequence length become larger, as in GPT-4 (OpenAI, ), the gain in computational time by LoRA and GK is amplified. In this section, we calculate the time required to perform PCMM and CCMM and to obtain attention score through softmax and GK as the embedding dimension and the sequence length increase. See the Table 15 for the results.

**Table 15: Computation times for performing PCMM and CCMM with $128\times n$ by $n\times n$ matrices, and evaluating Softmax and GK on a $n$-dimensional input. Factor in each table represents the ratio of computation times between two operations. As the dimension $n$ increases, the performance gains become larger.**
| Dim. ($n$) | 256 | 512 | 768 |
| --- | --- | --- | --- |
| PCMM (s) | 0.138 | 0.139 | 0.275 |
| CCMM (s) | 0.297 | 0.463 | 1.259 |
| Factor | 2.15 | 3.33 | 4.58 |

Figure: Figure 8: Computation time comparison between PCMM with CCMM for $128\times n$ matrix by $n\times n$ matrix multiplications according to input dimension $n$. As the input dimension increases, CCMM becomes progressively slower compared to PCMM.
Refer to caption: extracted/5898698/figures/pcmm_vs_ccmm.png

Figure: Figure 9: Computation time comparison between Softmax and GK according to input dimension $n$. As the input dimension increases, Softmax becomes progressively slower compared to GK.
Refer to caption: extracted/5898698/figures/sm_vs_gk.png

## Appendix H Classification accuracy and precision

Here, we present the classification accuracy and average precision of our HE model during inference with fine-tuned weights, comparing the results with evaluation under plaintext. Based on these figures, we can conclude that the inference results under HE are closely aligned with those in plaintext.

**Table 16: Classification accuracy and average precision, compared with plaintext inference results. Since STSB is not a classification task, we could not calculate the precision. Acc indicates how closely the class obtained from HE evaluation matches the class predicted in plaintext evaluation. HE inference results are similar to the results in plaintext inference.**
|  | COLA | RTE | MRPC | STSB | SST2 | QNLI |
| --- | --- | --- | --- | --- | --- | --- |
| Acc | 0.99 | 0.99 | 1.00 | - | 1.00 | 0.99 |
| Avg prec. (bits) | -9.32 | -13.48 | -10.97 | -8.03 | -11.15 | -9.59 |

## Peer Reviews

confidence: 3
contribution: 3
initial_rating: 6
presentation: 4
questions: For reproducibility, can the authors comment on the source code? Whether they intend to make it public for validation?

Also for reproducibility (and in lack of code), I am interested in understanding better the polynomial approximations used. In Section E the authors talk about penalizing the model in a "pre-training stage". I am not sure I understand how this would work, especially in the context of secure inference (no fine-tuning). What do the authors mean exactly? The model owner retrains the model using this new loss function? Most prior works take a pre-trained model, changing only its non-linearities by polynomial while keeping its weights. What are the authors proposing to do here? Does this require changing the model's weights? Re-training?
soundness: 4
strengths: The problem statement is well motivated. Several works are currently exploring evaluation of LLMs under FHE, and the potential applications are also quite compelling. This is an extremely difficult task in terms of achieving viable efficiency, and any method that advances the state-of-the-art in this direction is welcome. The results achieved here show that several optimizations in other domains, that is, LoRA and the use of Gaussian Kernels, turn out to be useful for the evaluation of LLMs in FHE. I am not aware of this observation being made and explored in this depth in other papers (it is worth mentioning https://arxiv.org/pdf/2410.00433, which appeared after the submission deadline).
summary: This paper presents optimizations to LLM architectures to make them more friendly towards Homomorphic Encryption evaluation. Concretely, first they propose to use LoRA for fine-tuning, where the data used for fine-tuning is given in encrypted form. This is useful to avoid re-training a lot of parameters, since LoRA focuses on updating only a few weights. This minimizes the amount of homomorphic operations w.r.t. plain fine-tuning. They also observe that LoRA is useful for reducing the dimension of homomorphic matrix multiplications. Secondly, they replace Softmax-based with Gaussian Kernel attention. They show that this is a simpler function to evaluate in HE, leading to significant savings with little impact in accuracy.
weaknesses: I am not particularly impressed by the novelty of this paper. It uses existing FHE tools with existing ML optimizations. This may not be a weakness on its own given the positive results of combining these techniques, but I still think the improvement factors may not be big enough for these techniques to become "enablers" of private LLM applications in practice. Put differently, I am not convinced that the gains here are a significant enough to overcome the blockers that prevent LLMs + FHE from becoming more widely spread.

---

confidence: 4
contribution: 3
initial_rating: 6
presentation: 4
questions: N/A
soundness: 3
strengths: 1. Compared to MPC approaches, n on-interactive property helps HE to be feasible to compute over large-scale LLMs without including considerable communication overhead among computing parties.
2. This work has a great focus on the fine-tuning stage to make LLMs secure for users, which also concentrates on the key components like attention layers in the transformer, and it is also combined with SoTA techniques like LoRA to make the process more efficient.
3. Writing with bottleneck-improvement pattern for LoRA and GK looks good for readers to figure out key ideas.
summary: As LLMs surge, privacy issue becomes important considering government-level regulations. Among methods in privacy-preserving machine learning, homomorphic encryption (HE) can provide cryptographic security by computing over encrypted data directly without extra communication like MPC. However, HE is not efficient to compute matmul or non-poly operations in the transformer-level scale. This work focus on fine-tuning stage with LoRA and softmax variant to create HE-friendly transformer architecture.
weaknesses: 1. When you mentioned SoTA LLMs, you should notice that decoder-based models have been proved very powerful in generative tasks. After iteration of the recent few years, BERT series is not as useful and prevalent as decoder models. Hence, the significance to protect BERT-based model is less essential in the current LLMs.
2. Although this work introduces how HE and CKKS work in the secure way, this work does not specify adversary model, such ability of adversaries, type of adversaries (e.g., semi-honest or malicious) and kind of attacks (e.g., member inference attack) this architecture counters with.
3. In the conclusion, this work is too vague on the future work. For example, how cryptographic community develops helps the improvement of this work (e.g., any change on HE). Also, how LLMs itself evolve may change security issue based on this work.

---

confidence: 3
contribution: 2
initial_rating: 5
presentation: 3
questions: 1.	One core idea of this paper to solve the difficulty of evaluating Softmax under HE is to replace it with Gaussian kernel, however, this method is very similar to that in the literature “Chen, Yifan, et al. Skyformer: Remodel self-attention with gaussian kernel and nystr\" om method. Advances in Neural Information Processing Systems 34 (2021): 2122-2135”. However, this paper does not describe the difference with this paper or even cite this literature. Is there a difference in the performance of the two? Furthermore, the polynomial approximation method of this paper seems to be very common way.
2.	In Section 3, is the author's approach in solving Bottleneck 1 just an application of some existing methods? If not, please clarify the differences and improvements.
3.	Does the use of LoRA and Gaussian Kernel affect the interpretability of the model? How does the author balance efficiency and explainability?
soundness: 3
strengths: This paper is oriented to the problem of inefficiency of transformer architecture under HE, although the existing research has produced richer results. The main contribution of this paper is to enhance the speed of transformer architecture under HE, and the authors have carried out many experiments to verify the rationality and advantages of the scheme. I think the experiments in this paper are full, and the advantages of this paper are elaborated in terms of speed and model performance, which speed is emphasized in this paper. The experimental results are thorough and well-analyzed. Overall, this paper seems to incorporate some of the SOTA approaches in the current field and apply them to a widely researched topic.
summary: This paper starts from the poor performance problem of homomorphic encryption (HE) in transformer architecture and focuses on optimizing the speed of HE in it. Specifically, the scheme tries to avoid CCMM computations to solve the poor performance brought by full fine-tuning. In addition, this paper aims to address the difficulty of evaluating under HE with Softmax, the core idea of which is to replace Softmax with a Gaussian kernel. Finally, this paper carried out many experiments, and the results show that their scheme is comparable to existing schemes in terms of modeling performance, while at the same time, the computational speed has been significantly improved. The overall narrative of the paper is clear, and has good logic.
weaknesses: 1. Insufficient innovation. First, the topic chosen for this paper is a more widely studied one. Second, the solutions in this paper seem to be a direct combination and application of existing advanced schemes, and it is not intuitively obvious in the paper that the authors have improved on existing methods.
2. The description in 2.1 does not seem to be consistent with Figure 1. Furthermore, why does the statement “LLM weights are protected in the strict cryptographic sense (line 149)” hold?
3. Although the paper proposes a privacy-protecting LLM architecture, the security considerations of the model, especially against attacks and model theft, is insufficient.

Meta-review: All reviewers except one (EsSP) argued for accepting the paper. For this reviewer their main conerns were on #1 a lack of novelty, #2 incorrect descriptions, #3 insufficient model security considerations. Specifically for #1 the reviewer argued that (a) the topic is widely studied, (b) the solutions are a direct combination of existing methods, and (c) it is not clear that the authors have improved on existing methods. I disregard (a), as topic popularity alone should not count against a paper so long as (b) and (c) are dealt with. For (b) the authors argue that even though LoRA and the Gaussian kernel have been applied to LLM architectures, they have been used for very different purposes: LoRA to reduce memory, and the Gaussian kernel to handle long sequence lengths. They are using each in different, unintended ways: LoRA to avoid large ciphertext-ciphertext matrix multiplications, and the Gaussian kernel to find a better polynomial approximation, compared to prior work which directly tried to approximate the softmax function. The reviewer had not response to this. I am convinced by the authors’ arguments on both points. It is clear that LoRA would be useful for HE-friendly fine-tuning. And the observations that one need only approximate part of the Gaussian kernel and that this is well-approximated by an easy-to-compute polynomial approximation is brilliant. For (c), the reviewer did not elaborate what baselines should be compared against. In the paper the authors say “Only a few attempts, such as those by Lee et al. (2022b) and HETAL (Lee et al., 2023b), have explored fine-tuning, focusing exclusively on the classification head while leaving other key components like attention layers and feed-forward networks untouched. P3EFT (Li et al., 2024) also addresses fine-tuning of foundation models, but it concentrates more on energy consumption during fine-tuning.” The authors compare against HETAL and P3EFT was released the day of the ICLR deadline so a comparison against this, while I’d like to see it in the future, is out of scope for this submission. Concern #1 is resolved. For #2 the reviewer argued that Section 2.1 was not consistent with Figure 1. The authors revised both of these things but asked for further clarification to understand the inconsistency. The reviewer did not respond. I found no inconsistencies, so concern #2 is resolved. For #3 the reviewer argues that model security is not addressed. The authors agree and stated that their focus is on user security and that model security is separate. I agree and would further argue that one could apply recent developments in model security (e.g., differential privacy for LLMs) to achieve this. Including a new method for model security would create a very confusing conference submission for which most details would have to go into the appendix. This resolves concern #3. Overall the paper demonstrates an impressive new capability: fine-tuning an LLM (beyond just the heads) with HE, which outperforms recent work. The authors have agreed to release their code which will have a big impact on the community.  Given these things, I vote to accept. Authors: you’ve already made improvements to respond to reviewer changes, if you could double check their comments for any recommendation you may have missed on accident that would be great! The only additional request I would like to make is for you to run an experiment where you vary the approximation levels of LoRA and the Gaussian kernel to show the trade-off between computation speed and model performance. I would really recommend highlighting this aspect of your approach as it allows for much more varied use-cases beyond methods without such tunable knobs. After incorporating these changes the paper will make a nice contribution to the conference!

Decision: Accept (Poster)