# Enhancing Privacy in Large Language Model with Homomorphic Encryption and Sparse Attention
## 4 Results and Discussion  
### Comparison Results  
The design of this experiment aims to assess the impact of various models on the performance of natural language processing tasks while maintaining privacy protection. Through the evaluation of four key metrics--precision, recall, accuracy, and latency--a comprehensive understanding of the advantages and disadvantages of each technology in terms of data security and processing efficiency is ascertained. The experimental results are presented in Table 1.  
The transformer model, serving as a baseline, exhibits the best performance metrics, yet lacks privacy protection capabilities. The FHE model, while imppeccable in terms of security, incurs a significant increase in latency due to high computational complexity, affecting its practicality. The proposed method retains the performance of the transformer while achieving comparable security to FHE with minimal latency, indicating the adoption of efficient encryption techniques. SOTER and TEE, while providing secure computation, experience performance constraints due to communication and hardware limitations. DP, although capable of protecting privacy to a certain extent, compromises a portion of performance.  
From a mathematical perspective, the transformer model leverages parallel computation and multi-head attention mechanisms to optimize processing speed and performance in an unencrypted state. FHE ensures data remain encrypted throughout the computation process but introduces increased latency due to its complex mathematical operations. The proposed method likely integrates lightweight homomorphic encryption and model optimization, effectively balancing security and efficiency. SOTER and TEE, in ensuring secure computation, must contend with additional communication and hardware overhead. Differential privacy protects privacy by adding noise to the data but this approach can compromise the accuracy of the data and the performance of the model. The design of each  
\begin{table}
\begin{tabular}{l c c c c c} \hline \hline
**Model** & **Security** & **Precision** & **Recall** & **Accuracy** & **Latency (ms)** \\ \hline Transformer [4] (baseline) & \(\bigstar\) & 0.92 & 0.91 & 0.92 & 0.13 \\ FHE (baseline) [32] & \(\bigstar\) & 0.92 & 0.91 & 0.92 & 127.33 \\ Proposed Method & \(\bigstar\) & 0.92 & 0.91 & 0.92 & 0.15 \\ SOTER [33] & \(\bigstar\) & 0.91 & 0.91 & 0.90 & 0.27 \\ TEE [34] & \(\bigstar\) & 0.92 & 0.91 & 0.92 & 0.33 \\ DP [35] & \(\bigcirc\) * & 0.83 & 0.81 & 0.82 & 0.18 \\ \hline \hline \end{tabular}  
* DP can only protect partial privacy while training. DP can be adjusted by tuning parameters for the proportion of Gaussian noise, but it is still possible to restore the original data through methods such as denoising.  
\end{table}
Table 1: Model performance comparison.  
model reflects a trade-off between security, performance, and efficiency. The transformer model excels in performance but falls short in privacy protection; FHE ensures security at the cost of increased latency; the proposed method finds a mathematical balance point, achieving efficient privacy protection and high-performance processing.