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

初探针对KV泄露的高效安全端侧LLM推理

A First Look At Efficient And Secure On-Device LLM Inference Against KV Leakage

Central South University(中南大学);Shanghai Transsion CO., LTD(上海传音控股有限公司);Tsinghua University(清华大学)

Huan Yang, Deyu Zhang, Yudong Zhao, Yuanchun Li, Yunxin Liu

AI总结:

针对端侧LLM推理中GPU泄露KV对并可重构用户对话的问题,本文提出基于TEE内矩阵置换与逆置换的KV-Shield,以较低开销保护原始KV并保证推理正确性。

摘要:

由于在隐私保护方面的优势,近期在终端设备上运行LLM受到了广泛关注。随着轻量级LLM模型和专门设计的GPU出现,端侧LLM推理已经达到了所需的准确率和性能指标。然而,我们发现GPU上的LLM推理可能泄露隐私敏感的中间信息,特别是KV对。攻击者可以利用这些KV对重构完整的用户对话,从而造成严重漏洞。现有解决方案,例如全同态加密(FHE)和可信执行环境(TEE),要么计算开销过高,要么受资源限制。为解决这些问题,我们设计了KV-Shield,其运行分为两个阶段。在初始化阶段,它对权重矩阵进行置换,使所有KV对也被相应置换。在运行时阶段,注意力向量被逆置换,以确保层输出的正确性。所有与置换相关的操作都在TEE内执行,确保不安全的GPU无法访问原始KV对,从而阻止对话重构。最后,我们从理论上分析了KV-Shield的正确性,以及其优势和开销。

英文摘要:

Running LLMs on end devices has garnered significant attention recently due to their advantages in privacy preservation. With the advent of lightweight LLM models and specially designed GPUs, on-device LLM inference has achieved the necessary accuracy and performance metrics. However, we have identified that LLM inference on GPUs can leak privacy-sensitive intermediate information, specifically the KV pairs. An attacker could exploit these KV pairs to reconstruct the entire user conversation, leading to significant vulnerabilities. Existing solutions, such as Fully Homomorphic Encryption (FHE) and Trusted Execution Environments (TEE), are either too computation-intensive or resource-limited. To address these issues, we designed KV-Shield, which operates in two phases. In the initialization phase, it permutes the weight matrices so that all KV pairs are correspondingly permuted. During the runtime phase, the attention vector is inversely permuted to ensure the correctness of the layer output. All permutation-related operations are executed within the TEE, ensuring that insecure GPUs cannot access the original KV pairs, thus preventing conversation reconstruction. Finally, we theoretically analyze the correctness of KV-Shield, along with its advantages and overhead.

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

↑