LPDetective: Dusting the LLM Chats for Prompt Template Abusers

LPDetective: Dusting the LLM Chats for Prompt Template Abusers

Yang Luo, Qingni Shen, Zhonghai Wu

Proceedings of the Thirty-Fourth International Joint Conference on Artificial Intelligence
Main Track. Pages 7616-7624. https://doi.org/10.24963/ijcai.2025/847

The abuse of LLM Chatbot interfaces by web robots leads to a significant waste of GPU and server resources, posing a serious security challenge. To address this issue, we propose LPDetective, an unsupervised method for detecting robot prompt templates. This method is based on the assumption that robot-generated text repeatedly uses the same or highly similar phrases and sentence structures across multiple sessions, differing from human natural conversations. We design a multi-stage workflow, including message grouping, text similarity measurement, hierarchical clustering analysis, and regular expression extraction, to automatically extract potential robot behavior patterns from chat logs. LPDetective does not require predefined templates or rely on training data, enabling it to adaptively discover new, unknown patterns. We conduct systematic experiments on three large-scale real-world datasets: Bing Copilot, Wildchat, and ChatLog. The results show that LPDetective can efficiently and accurately detect robot prompt templates in various scenarios, achieving a 7.5% improvement in F1 score compared to the state-of-the-art XLNet method and reducing detection latency by 178 times on the Bing Copilot dataset.
Keywords:
Multidisciplinary Topics and Applications: MTA: Security and privacy
Machine Learning: ML: Multi-modal learning
Machine Learning: ML: Unsupervised learning
Natural Language Processing: NLP: Language models