Why Are My Prompts Leaked? Unraveling Prompt Extraction Threats in Customized Large Language Models
Not on the map. Why?
Abstract (arXiv)
The drastic increase of large language models' (LLMs) parameters has led to a new research direction of fine-tuning-free downstream customization by prompts, i.e., task descriptions. While these prompt-based services (e.g. OpenAI's GPTs) play an important role in many businesses, there has emerged growing concerns about the prompt leakage, which undermines the intellectual properties of these services and causes downstream attacks. In this paper, we analyze the underlying mechanism of prompt leakage, which we refer to as prompt memorization, and develop corresponding defending strategies. By exploring the scaling laws in prompt extraction, we analyze key attributes that influence prompt extraction, including model sizes, prompt lengths, as well as the types of prompts. Then we propose two hypotheses that explain how LLMs expose their prompts. The first is attributed to the perplexity, i.e. the familiarity of LLMs to texts, whereas the second is based on the straightforward token translation path in attention matrices. To defend against such threats, we investigate whether alignments can undermine the extraction of prompts. We find that current LLMs, even those with safety alignments like GPT-4, are highly vulnerable to prompt extraction attacks, even under the most straightforward user attacks. Therefore, we put forward several defense strategies with the inspiration of our findings, which achieve 83.8% and 71.0% drop in the prompt extraction rate for Llama2-7B and GPT-3.5, respectively. Source code is avaliable at https://github.com/liangzid/PromptExtractionEval.
Key facts. Cited by 8 papers in the map (data through 7 Oct 2026). Builds on 35 of its 55 references that are in the map. First posted on arXiv 5 Aug 2024.
Builds on
35 of 55 references.
References · 35
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2023GPT-4 Technical Reportcited by 18,132
- 2022Training language models to follow instructions with human feedbackcited by 15,712
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
- 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,084
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
- 2018GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understandingcited by 4,854
- 2021Prefix-Tuning: Optimizing Continuous Prompts for Generationcited by 3,878
- 2022Training a Helpful and Harmless Assistant with Reinforcement Learning from Human Feedbackcited by 3,634
- 2023Qwen Technical Reportcited by 3,273
- 2023Mistral 7Bcited by 3,065
23 more
- 2022Constitutional AI: Harmlessness from AI Feedbackcited by 2,950
- 2023Universal and Transferable Adversarial Attacks on Aligned Language Modelscited by 2,914
- 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,346
- 2021Pre-train, Prompt, and Predict: A Systematic Survey of Prompting Methods in Natural Language Processingcited by 2,222
- 2023Pythia: A Suite for Analyzing Large Language Models Across Training and Scalingcited by 1,734
- 2023Jailbreaking Black Box Large Language Models in Twenty Queriescited by 1,326
- 2018Neural Network Acceptability Judgmentscited by 952
- 2022Discovering Language Model Behaviors with Model-Written Evaluationscited by 805
- 2023Quantifying Language Models' Sensitivity to Spurious Features in Prompt Design or: How I learned to start worrying about prompt formattingcited by 778
- 2022A Survey on In-context Learningcited by 717
- 2021GPT Understands, Toocited by 715
- 2021P-Tuning v2: Prompt Tuning Can Be Comparable to Fine-tuning Universally Across Scales and Taskscited by 686
- 2023Instruction Tuning with GPT-4cited by 676
- 2023Textbooks Are All You Need II: phi-1.5 technical reportcited by 559
- 2022Improving alignment of dialogue agents via targeted human judgementscited by 527
- 2023DeepInception: Hypnotize Large Language Model to Be Jailbreakercited by 337
- 2023Exploiting Programmatic Behavior of LLMs: Dual-Use Through Standard Security Attackscited by 268
- 2023SafetyBench: Evaluating the Safety of Large Language Modelscited by 189
- 2023QA-LoRA: Quantization-Aware Low-Rank Adaptation of Large Language Modelscited by 154
- 2023Effective Prompt Extraction from Language Modelscited by 83
- 2019Natural Language Understanding with the Quora Question Pairs Datasetcited by 51
- 2023Assessing Prompt Injection Risks in 200+ Custom GPTscited by 49
- 2024Prompt Stealing Attacks Against Large Language Modelscited by 39
Built on by
Citing papers per year: 2024: 3; 2025: 5.
8 papers.
- 2025Advances and Challenges in Foundation Agents: From Brain-Inspired Intelligence to Evolutionary, Collaborative, and Safe Systemscited by 125
- 2024Navigating the Risks: A Survey of Security, Privacy, and Ethics Threats in LLM-Based Agentscited by 63
- 2024Recent advancements in LLM Red-Teaming: Techniques, Defenses, and Ethical Considerationscited by 8
- 2025Bleeding Pathways: Vanishing Discriminability in LLM Hidden States Fuels Jailbreak Attackscited by 5
- 2024Towards Action Hijacking of Large Language Model-based Agentcited by 4
- 2025Virus Infection Attack on LLMs: Your Poisoning Can Spread "VIA" Synthetic Datacited by 2
- 2025Enhancing Security in LLM Applications: A Performance Evaluation of Early Detection Systemscited by 1
- 2025Prompt Mechanisms in Medical Imaging: A Comprehensive Surveycited by 0
- 2025Virus Infection Attack on LLMs: Your Poisoning Can Spread "VIA" Synthetic Data27 Sep 2025
- 2025Prompt Mechanisms in Medical Imaging: A Comprehensive Survey28 Jun 2025
- 2025Enhancing Security in LLM Applications: A Performance Evaluation of Early Detection Systems23 Jun 2025
- 2025Advances and Challenges in Foundation Agents: From Brain-Inspired Intelligence to Evolutionary, Collaborative, and Safe Systems31 Mar 2025
- 2025Bleeding Pathways: Vanishing Discriminability in LLM Hidden States Fuels Jailbreak Attacks14 Mar 2025
- 2024Towards Action Hijacking of Large Language Model-based Agent14 Dec 2024
- 2024Navigating the Risks: A Survey of Security, Privacy, and Ethics Threats in LLM-Based Agents14 Nov 2024
- 2024Recent advancements in LLM Red-Teaming: Techniques, Defenses, and Ethical Considerations9 Oct 2024
Similar, not cited
Close in wording, no citation either way
- 2025Breaking to Build: A Threat Model of Prompt-Based Attacks for Securing LLMs
- 2024Undesirable Memorization in Large Language Models: A Survey
- 2026An Empirical Evaluation of Prompt Injection Vulnerabilities in Large Language Models Across Multilingual and Obfuscated Attack Scenarios
- 2023Unleashing the potential of prompt engineering for large language models
- 2025System Prompt Poisoning: Persistent Attacks on Large Language Models Beyond User Injection
- 2024Prompt-SAW: Leveraging Relation-Aware Graphs for Textual Prompt Compression
- 2026Beyond Prompt Engineering: A Systematic Analysis of Prompt Lexical Sensitivity and Its Impacts on Quality
- 2024Does Prompt Formatting Have Any Impact on LLM Performance?