arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2501.01672cs.CR
收藏

基于全同态加密的面向微调大语言模型的实用安全推理算法

Practical Secure Inference Algorithm for Fine-tuned Large Language Model Based on Fully Homomorphic Encryption

Zhang Ruoyan, Zheng Zhongxiang, Bao Wankang

AI总结:

针对LoRA微调LLM的隐私泄露问题,提出结合FHE、PEFT与PLL的安全推理方案,可保护用户输入和LoRA权重,并在ChatGLM2-6B上达到1.61s/token。

摘要:

大语言模型(LLM)目前处于机器学习领域的前沿,展现出广阔的应用前景,但同时也暴露出一定的隐私泄露风险。我们将全同态加密(FHE)和可证明安全理论与参数高效微调(PEFT)相结合,提出了一种高效且安全的LLM推理方案。更具体地说,我们关注依赖开源基础模型、随后通过LoRA在私有数据集上进行微调的预训练LLM。这是LawGPT和BenTsao等垂直领域模型的一种流行路线。我们使用以下两项关键技术。首先,我们将整个模型划分为公开部分和私有部分。公开部分的权重可公开访问(例如开源基础模型),而私有部分需要受到保护(例如LoRA矩阵)。通过这种方式,可以大幅降低在私有数据上计算所带来的开销。其次,我们提出一种通用方法,将一个线性层转换为另一个能够抵御模型提取攻击并保留其原始功能的线性层,该层被记为Private Linear Layer(PLL,私有线性层)。随后,我们将该方法用于LoRA矩阵,以确保服务器在不限制用户输入的情况下保护其私有权重。我们还表明,对PLL实施模型提取攻击的难度可归约到著名的困难问题Learning with Errors(LWE,带错误学习)。将该方法与FHE相结合,我们还可以同时保护用户的输入。本文使用开源模型ChatGLM2-6B作为经LoRA微调的基础模型。实验结果表明,我们方案的推理效率达到1.61s/token,显示出该方案具有良好的实用性。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑