Anti-adversarial Learning: Desensitizing Prompts for Large Language Models
Li, Xuan, Yin, Zhe, Gu, Xiaodong, Shen, Beijun
–arXiv.org Artificial Intelligence
With the widespread use of LLMs, preserving privacy in user prompts has become crucial, as prompts risk exposing privacy and sensitive data to the cloud LLMs. Traditional techniques like homomorphic encryption, secure multi-party computation, and federated learning face challenges due to heavy computational costs and user participation requirements, limiting their applicability in LLM scenarios. In this paper, we propose PromptObfus, a novel method for desensitizing LLM prompts. The core idea of PromptObfus is "anti-adversarial" learning, which perturbs privacy words in the prompt to obscure sensitive information while retaining the stability of model predictions. Specifically, PromptObfus frames prompt desensitization as a masked language modeling task, replacing privacy-sensitive terms with a [MASK] token. A desensitization model is trained to generate candidate replacements for each masked position. These candidates are subsequently selected based on gradient feedback from a surrogate model, ensuring minimal disruption to the task output. We demonstrate the effectiveness of our approach on three NLP tasks. Results show that PromptObfus effectively prevents privacy inference from remote LLMs while preserving task performance.
arXiv.org Artificial Intelligence
Nov-19-2025
- Country:
- Asia
- China
- Shanghai > Shanghai (0.04)
- Tianjin Province > Tianjin (0.04)
- Middle East > UAE
- Abu Dhabi Emirate > Abu Dhabi (0.04)
- Singapore (0.04)
- China
- Europe
- Austria > Vienna (0.14)
- Belgium > Brussels-Capital Region
- Brussels (0.04)
- United Kingdom > England
- Greater London > London (0.04)
- North America
- Canada > Ontario
- Toronto (0.05)
- Dominican Republic (0.04)
- United States
- California > Santa Clara County
- Stanford (0.04)
- Massachusetts > Middlesex County
- Cambridge (0.04)
- Washington > King County
- Seattle (0.04)
- California > Santa Clara County
- Canada > Ontario
- Asia
- Genre:
- Research Report
- New Finding (0.66)
- Promising Solution (0.66)
- Research Report
- Industry:
- Technology: