Skip to content

Practical secure inference algorithm for a fine-tuned large language model based on fully homomorphic encryption

Authors: Zhang Ruoyan; Zheng Zhongxiang; Bao Wankang
Year: 2025
Venue: arXiv 2025

type: system collection: catalogue, sok-references status: auto

Links: arXiv:2501.01672

Summary

Auto-extracted summary (unreviewed)

Proposes a secure inference scheme for LoRA-fine-tuned LLMs that splits the model into a public part (the open-source base model, run on the client) and a private part (the LoRA matrices, kept on the server), so only the low-rank part is computed privately. A Private Linear Layer (PLL) transformation protects the server's weights against model extraction with a reduction to LWE, and leveled FHE (ciphertext-plaintext multiplications and rotations) on the LoRA matrices keeps the user's input encrypted. With ChatGLM2-6B as the base model, inference runs at 1.61 s per token once more than 1000 tokens are processed.

Abstract

Large language models(LLMs) are currently at the forefront of the machine learning field, which show a broad application prospect but at the same time expose some risks of privacy leakage. We combined Fully Homomorphic Encryption(FHE) and provable security theory with Parameter-Efficient Fine-Tuning(PEFT) to propose an efficient and secure inference scheme for LLMs. More specially, we focus on pre-trained LLMs which rely on open-sourced base model and then fine-tuned with the private datasets by LoRA. This is a popular road-map for Vertical Domain Models such as LawGPT and BenTsao. We use two key technologies below. Firstly, we divide the whole model into the public part and the private part. The weights of public part are publicly accessible(e.g. the open-sourced base model) while the private part needs to be protected(e.g. the LoRA matrices). In this way, the overhead brought by computing on private data can be greatly reduced. Secondly, we propose a general method to transform a linear layer into another one which provides security against model extraction attacks and preserves its original functionality, which denoted as Private Linear Layer(PLL). Then we use this method on the LoRA matrices to make sure that the server protects their private weights without restricting the user's input. We also show that the difficulty of performing model extraction attacks for PLL can be reduced to the well-known hard problem Learning with Errors(LWE). Combing this method with FHE, we can protect user's input at the same time. In this paper, we use the open-source model ChatGLM2-6B as the base model which is fine-tuned by LoRA. Experimental results show the inference efficiency of our scheme reaches 1.61s/token which displays that the scheme has good practicality.
Source: arxiv

Extracted details

Field Value Source Confidence
contribution Public/private model split for LoRA fine-tuned LLMs with private computation only on the LoRA matrices llm 0.75
contribution Private Linear Layer (PLL): linear-layer transformation secure against model extraction with hardness reduced to LWE llm 0.75
contribution FHE implementation of the LoRA low-rank matrix computation protecting user input llm 0.75
contribution 1.61 s/token secure inference on ChatGLM2-6B llm 0.75
schemes leveled FHE (SEAL, CKKS-style rescaling) llm 0.75
schemes LWE llm 0.75
schemes Private Linear Layer (PLL) llm 0.75
libraries SEAL llm 0.75
models ChatGLM2-6B (LoRA fine-tuned) llm 0.75
tasks private LLM inference llm 0.75
tasks inference on LoRA fine-tuned domain models llm 0.75
threat model client-server; protects user input via FHE and server's private LoRA weights against model extraction; base model public on client llm 0.75
interaction interactive (HE+MPC) llm 0.75
code url https://github.com/Microsoft/SEAL (URL found in the full text) regex 0.50
llm relevance high llm 0.75
key result inference latency: 1.61 s per token (ChatGLM2-6B with LoRA, more than 1000 tokens) llm 0.75

System card: RZW (encrypted LoRA split model)

Group 0. CKKS LLM frameworks surveyed in the SoK
Family CKKS · Hybrid model partitioning
Arithmetic Approximate real (CKKS)
Interaction non-interactive FHE on LoRA modules only
Model scale fine-tuned LLM (LoRA adapters)
Library (see paper)
Hardware (see paper)
Packing n/a
Latency 1.61 s/token (reported)
Open source no
Status Niche
Relation to the SoK Only encrypted LoRA adapters are evaluated server-side; base model runs at client in the clear.
Note Protects proprietary fine-tuning rather than full prompt privacy.
Systems page RZW (encrypted LoRA split model)

SoK reference [90]

R. Zhang, Z. Zheng, and W. Bao, “Practical secure inference algorithm for a fine-tuned large language model based on fully homomorphic encryption,” IEEE Transactions on Information Forensics and Security, vol. 21, pp. 17–29, 2026.

Listed on the reference page of the site.

Keyword mentions

Counts of vocabulary terms in the full text (first page of occurrence in brackets).

  • scheme: CKKS 8 [p.7], MPC 3 [p.2], Partially homomorphic encryption 3 [p.7], Leveled / somewhat HE 3 [p.7]
  • library: Microsoft SEAL 6 [p.7], SecretFlow-SPU 2 [p.2]
  • model: LoRA 34 [p.1], GPT 8 [p.2], CNN 7 [p.2], RNN / LSTM 7 [p.4], Transformer 5 [p.4], LLaMA 3 [p.14], MLP 3 [p.6]
  • hardware: NVIDIA RTX 2 [p.14], Intel Xeon 2 [p.13], GPU 1 [p.5]
  • technique: Fine-tuning 43 [p.1], Attention 17 [p.2], Model extraction / stealing 9 [p.1], Rescaling 7 [p.4], Softmax 3 [p.2], Two-party computation 3 [p.2], GELU 2 [p.2], LayerNorm 2 [p.2], SIMD packing 2 [p.15]
  • assumption: LWE 19 [p.1], Lattice-based 4 [p.7]
  • topic: Large language models 43 [p.1], Homomorphic encryption 27 [p.1], Private / secure inference 8 [p.1], Open source 8 [p.1]

Files

Path (under papers/) Collection Pages Size SHA-256 Note
references/catalogue/0-020_practical-secure-inference-algorithm-for-a-fine-tuned-large.pdf catalogue 19 563.6 KB 2232b2212227
references/sok-references/090_practical-secure-inference-algorithm-for-a-fine-tuned-large.pdf sok-references 19 563.6 KB 2232b2212227 byte-identical to references/catalogue/0-020_practical-secure-inference-algorithm-for-a-fine-tuned-large.pdf

Database key: practical-secure-inference-algorithm-for-a-fine-tuned-large-language · created 2026-11-05 · updated 2026-11-05 · edit with python3 tools/paperdb.py set practical-secure-inference-algorithm-for-a-fine-tuned-large-language COLUMN VALUE