Research Article

Dual-Model Aggregation for High-Accuracy Secret Prompt Recovery in LLMs

Qiyue Zhang1,*, Yunhan Zheng2, Tong Zhang3, Chengxi Yang4, Jun Zheng5
1. Department of Computer Science, Rice University, Houston, 77005, United States
2. Computer Science and Technology, Ocean University of China, Qingdao, 266100, China
3. Tianjin Experimental High School, Tianjin, 300074, China
4. Shenzhen Foreign Languages School, Shenzhen, 518028, China
5. Department of Electrical Engineering, ZJU-UIUC INSTITUTE, 350000, China

* Corresponding author: [email protected]

Abstract

Prompt recovery in large language models (LLMs) is critical for understanding their underlying mechanisms and addressing concerns regarding privacy and copyright. Contemporary LLMs typically provide only inference results, making the process of recovering prompts exceedingly challenging and the accuracy of recovery uncertain. To address this issue, the focus is on extracting information related to prompt recovery from a limited amount of output text and maximizing its utility. LLMs use prompts to generate text, with the prompts often containing background information referred to as secret prompts, which are usually not disclosed to users. However, prompt attacks can be employed to uncover these secret prompts by crafting specific input prompts to exploit the LLMs. This study aims to improve the accuracy of recovering secret prompts by designing a method that combines secret prompts obtained through different models, including the Deliberative Prompt Recovery (DORY) model and the Prompt Attack Extraction System. This combined framework demonstrates superior performance in maintaining high accuracy under lower similarity thresholds. The paper highlights the state-of-the-art capabilities of these two recovery approaches, providing an insightful overview of advancements in prompt recovery. Additionally, it proposes a methodology for integrating an ordinary prompt recovery model with a prompt attack extraction system through a combination algorithm to enhance accuracy in prompt recovery. The study concludes by identifying current challenges and outlining future research and development directions in this domain.

Keywords: Prompt Recovery; Large Language Models (LLMs); Secret Prompts; Prompt Attack Extraction
Published: November 5, 2025
DOI: 10.54254/2755-2721/2025.28971
Volume: ACE Vol.199
pp. 37-50
Download PDF

References

  1. Tom, B., Benjamin, M., Nick, R., Melanie, S., D, K., Jared, Prafulla, D., Arvind, N., Pranav, S., Girish, S., Amanda, A., Sandhini, A., Ariel, H.-V., Gretchen, K., Tom, H., Rewon, C., Aditya, R., Daniel, Z., Jeffrey, W., Clemens, W. and Chris, H. (2020). Language Models are Few-Shot Learners.  Advances in Neural Information Processing Systems, [online] 33. Available at: https: //proceedings.neurips.cc/paper/2020/hash/1457c0d6bfcb4967418bfb8ac142f64a-Abstract.html.
  2. Openai, A., Openai, K., Openai, T. and Openai, I. (2018).  Improving Language Understanding by Generative Pre-Training. [online] Available at: https: //www.mikecaptain.com/resources/pdf/GPT-1.pdf.
  3. Carlini, N., Tramèr, F., Wallace, E., Jagielski, M., Herbert-Voss, A., Lee, K., Roberts, A., Brown, T., Song, D., Erlingsson, Ú., Oprea, A. and Raffel, C. (2021).  Extracting Training Data from Large Language Models. [online] www.usenix.org. Available at: https: //www.usenix.org/conference/usenixsecurity21/presentation/carlini-extracting.
  4. Rahman, M.A., Wu, F., Cuzzocrea, A. and Ahamed, S.I. (2024).  Fine-tuned Large Language Models (LLMs): Improved Prompt Injection Attacks Detection. [online] arXiv.org. Available at: https: //arxiv.org/abs/2410.21337 [Accessed 1 Jan. 2025].
  5. Bommasani, R., Hudson, D.A., Adeli, E., Altman, R., Arora, S., von Arx, S., Bernstein, M.S., Bohg, J., Bosselut, A., Brunskill, E., Brynjolfsson, E., Buch, S., Card, D., Castellon, R., Chatterji, N., Chen, A., Creel, K., Davis, J.Q., Demszky, D. and Donahue, C. (2021). On the Opportunities and Risks of Foundation Models.  arXiv: 2108.07258 [cs]. [online] Available at: https: //arxiv.org/abs/2108.07258.
  6. Liu, P., Yuan, W., Fu, J., Jiang, Z., Hayashi, H. and Neubig, G. (2022). Pre-train, Prompt, and Predict: A Systematic Survey of Prompting Methods in Natural Language Processing.  ACM Computing Surveys, [online] 55(9). doi: https: //doi.org/10.1145/3560815.
  7. Neel, S. and Chang, P. (2023).  Privacy Issues in Large Language Models: A Survey. [online] arXiv.org. Available at: https: //arxiv.org/abs/2312.06717 [Accessed 1 Jan. 2025].
  8. Zhang, Y., Carlini, N. and Ippolito, D. (2023).  Effective Prompt Extraction from Language Models. [online] arXiv.org. Available at: https: //arxiv.org/abs/2307.06865 [Accessed 1 Jan. 2025].
  9. Gao, L., Peng, R., Zhang, Y. and Zhao, J. (2024). DORY: Deliberative Prompt Recovery for LLM.  Findings of the Association for Computational Linguistics: ACL 2022, [online] pp.10614–10632. doi: https: //doi.org/10.18653/v1/2024.findings-acl.631.
  10. Derner, E., Batistič, K., Zahálka, J. and Babuška, R. (2024). A Security Risk Taxonomy for Prompt-Based Interaction with Large Language Models.  IEEE Access, 12, pp.126176–126187. doi: https: //doi.org/10.1109/access.2024.3450388.