PrivacyRestore: Privacy-Preserving Inference in Large Language Models via Privacy Removal and Restoration

Ziqian Zeng, Jianwei Wang, Junyao Yang, Zhengdong Lu, Haoran Li +2 more
6/3/2024
52 citations
cs.CRcs.AI

No official code found. Best implementation: ZeroNLP/PrivacyRestore (11 stars, Python, last commit 2025-05-30). 1 more below.

Abstract

The widespread usage of online Large Language Models (LLMs) inference services has raised significant privacy concerns about the potential exposure of private information in user inputs to malicious eavesdroppers. Existing privacy protection methods for LLMs suffer from either insufficient privacy protection, performance degradation, or large inference time overhead.

Show full abstract

To address these limitations, we propose PrivacyRestore, a plug-and-play method to protect the privacy of user inputs during LLM inference. The server first trains restoration vectors for each privacy span and then release to clients. Privacy span is defined as a contiguous sequence of tokens within a text that contain private information. The client then aggregate restoration vectors of all privacy spans in the input into a single meta restoration vector which is later sent to the server side along with the input without privacy spans.The private information is restored via activation steering during inference. Furthermore, we prove that PrivacyRestore inherently prevents the linear growth of the privacy budget.We create three datasets, covering medical and legal domains, to evaluate the effectiveness of privacy preserving methods. The experimental results show that PrivacyRestore effectively protects private information and maintain acceptable levels of performance and inference overhead.

View on arXivView PDF

Code Implementations(2)

Code implementations of this paper
RepositoryTypeStarsLanguageLicenseLast commit
ZeroNLP/PrivacyRestoreCommunity11Python–2025-05-30
wjw136/PrivacyRestoreCommunity6Python–2025-12-10

[ACL2025]: Official Code of "PrivacyRestore: Privacy-Preserving Inference in Large Language Models via Privacy Removal and Restoration"

60Python, ShellDec 16, 202411 months ago

Official Code of ACL2025 "PrivacyRestore: Privacy-Preserving Inference in Large Language Models via Privacy Removal and Restoration"

111Python, ShellMay 30, 20251 years ago

Similar Papers

Cite this paper

@article{zeng2024privacyrestore,
  title  = {PrivacyRestore: Privacy-Preserving Inference in Large Language Models via Privacy Removal and Restoration},
  author = {Ziqian Zeng and Jianwei Wang and Junyao Yang and Zhengdong Lu and Haoran Li and Huiping Zhuang and Cen Chen},
  year   = {2024},
  eprint = {2406.01394},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2406.01394v5}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2406.01394.svg)](https://codeofpaper.com/paper/2406.01394)

Discussion