DPIC: Decoupling Prompt and Intrinsic Characteristics for LLM Generated Text Detection

Xiao Yu, Yuang Qi, Kejiang Chen, Guoqiang Chen, Xi Yang, Pengyuan Zhu, Xiuwei Shang, Weiming Zhang, Nenghai Yu

TL;DR

DPIC (Decoupling Prompt and Intrinsic Characteristics) is a novel framework that detects text generated by black-box LLMs without needing access to their internal probabilities. By using an auxiliary LLM to reverse-engineer the prompt from a candidate text and then regenerating a benchmark text, DPIC isolates the model's stylistic "fingerprint" from the topic itself, achieving state-of-the-art detection accuracy and robust out-of-domain generalization.

What Problem Does This Paper Address?

Detecting whether a piece of text was written by a human or an LLM is a high-stakes game of cat-and-mouse. Existing high-quality detectors typically fall into two camps: supervised classifiers and zero-shot detectors.

However, both face severe bottlenecks when dealing with modern, commercial black-box models (like GPT-4 or Claude 3):

  1. Supervised detectors easily overfit to the topics and domains present in their training data, failing miserably when tested on unfamiliar subjects.
  2. Zero-shot detectors usually require access to the model's internal token probabilities (white-box setting). When forced to use open-source "surrogate" models to guess these probabilities for black-box text, their performance drops significantly.

The fundamental challenge is that an LLM's output is a coupled mixture of the prompt (the topic/semantics) and its intrinsic characteristics (the structural and stylistic artifacts of the generator). The authors address a key question: How can we isolate and extract these deep intrinsic characteristics from text alone, without knowing the original prompt or accessing model internals?

Figure 1: The distinctions between DPIC and previous detection methods. DPIC extracts the deep intrinsic characteristics of the black-box model generated texts by decoupling the prompt and the intrinsic characteristics of the generative model.

Methods

The authors propose DPIC, a supervised detection framework consisting of three main modules:

  1. The Decoupling Process: Given an unknown candidate text, DPIC leverages an auxiliary LLM (like ChatGPT or Vicuna) to perform a Question Generation (QG) task. The auxiliary LLM reconstructs a plausible prompt based on the candidate text. Then, the same auxiliary LLM uses this reconstructed prompt to generate a brand-new piece of text. This ensures that both the candidate text and the regenerated text are semantically aligned to the exact same prompt.
  2. Feature Extraction: Both the candidate text and the regenerated text are passed through a frozen Siamese Network encoder (gte-Qwen1.5-7B-instruct) to generate dense vector embeddings. Crucially, these two embeddings are concatenated together rather than subtracted or dot-multiplied.
  3. Classification: The concatenated embeddings are fed into a 3-layer Multi-Layer Perceptron (MLP) classifier trained with binary cross-entropy loss to output the final verdict: human-created or LLM-generated.
Figure 2: An overview of DPIC. Given a candidate text, we utilize an auxiliary LLM to reconstruct the prompt based on the candidate text. The reconstructed prompt is then used for the auxiliary LLM to obtain the regenerated text. This process aims to make the candidate and regenerated texts align with their prompts, respectively. Then, by comparing the similarity between the candidate text and the regenerated text, we can determine whether the candidate text is generated by LLMs or created by humans.

Datasets

  • Training Dataset: The open-source Human-ChatGPT Comparison Corpus (HC3), which contains human and ChatGPT responses to identical prompts.
  • Evaluation Datasets (Out-of-Domain): To test generalization, the authors evaluated DPIC on three datasets completely distinct from HC3:
  • Xsum: News articles.
  • WritingPrompts: Creative story writing.
  • PubMedQA: Biomedical research question answering.
  • Additional Generalization Benchmarks: Wikipedia (Wiki), CovidQA Community, and SUMMAC Abstract.
  • Target Source Models: Text to be detected was generated using ChatGPT, GPT-4, and Claude 3.

Key Insights and Ideas

  • Topic Alignment Eliminates Bias: By forcing an auxiliary LLM to regenerate text from an induced prompt, the detector no longer needs to perform "topic recognition." The semantic bias introduced by diverse topics is cancelled out, allowing the classifier to focus purely on stylistic discrepancies.
  • Reconstructed Prompts Beat Original Prompts: Surprisingly, the authors found that text regenerated using the reconstructed prompt shared a higher semantic similarity with the candidate text than text generated using the original prompt. This is because user prompts are often vague, causing LLM outputs to drift. A prompt reverse-engineered directly from the text is inherently tighter and more semantically consistent.
  • Concatenation Preserves Intrinsic Details: In the Siamese network ablation studies, combining feature vectors via concatenation yielded significantly higher accuracy than absolute difference or dot products. Concatenation preserves the rich, raw structural nuances of both texts rather than compressing them into a distance metric.

Key Results

DPIC consistently outperformed state-of-the-art zero-shot and supervised baselines (such as Fast-DetectGPT and RADAR) across multiple domains:

  • Superior Accuracy: When using ChatGPT as the auxiliary LLM, DPIC achieved an average AUROC of 96.34% on ChatGPT, 97.34% on GPT-4, and 98.78% on Claude 3. This represents an average improvement of 6.76% for GPT-4 and 2.91% for Claude 3 over the best baselines.
  • Cross-Model Generalization: Even when trained only on ChatGPT data, DPIC successfully detected text from Claude 3 and GPT-4 without needing prior knowledge of the source model.
  • Exceptional Robustness: The authors subjected the text to adversarial attacks, including DIPPER paraphrasing and back-translation (English $\rightarrow$ Chinese $\rightarrow$ English). While baseline models suffered sharp performance declines, DPIC maintained near-perfect detection capabilities (e.g., 100% AUROC against DIPPER on the Xsum dataset).

Limitations and Future Work

  • Prompt Recovery Imperfection: While the Question Generation approach works exceptionally well in practice, achieving a 100% perfect, literal recovery of the user's original prompt remains theoretically and practically impossible.
  • Computational Overhead: DPIC relies on querying an auxiliary LLM twice (once for prompt reconstruction, once for text regeneration) for every candidate text. This introduces latency and potential API costs, which could limit its use in high-throughput, real-time moderation pipelines. Future work could explore optimizing smaller, specialized local models to serve as the auxiliary LLM.

Summary updated

Abstract

Large language models (LLMs) have the potential to generate texts that pose risks of misuse, such as plagiarism, planting fake reviews on e-commerce platforms, or creating inflammatory false tweets. Consequently, detecting whether a text is generated by LLMs has become increasingly important. Existing high-quality detection methods usually require access to the interior of the model to extract the intrinsic characteristics. However, since we do not have access to the interior of the black-box model, we must resort to surrogate models, which impacts detection quality. In order to achieve high-quality detection of black-box models, we would like to extract deep intrinsic characteristics of the black-box model generated texts. We view the generation process as a coupled process of prompt and intrinsic characteristics of the generative model. Based on this insight, we propose to decouple prompt and intrinsic characteristics (DPIC) for LLM-generated text detection method. Specifically, given a candidate text, DPIC employs an auxiliary LLM to reconstruct the prompt corresponding to the candidate text, then uses the prompt to regenerate text by the auxiliary LLM, which makes the candidate text and the regenerated text align with their prompts, respectively. Then, the similarity between the candidate text and the regenerated text is used as a detection feature, thus eliminating the prompt in the detection process, which allows the detector to focus on the intrinsic characteristics of the generative model. Compared to the baselines, DPIC has achieved an average improvement of 6.76\% and 2.91\% in detecting texts from different domains generated by GPT4 and Claude3, respectively.
BibTeX
@inproceedings{yu2024dpic,
  author = {Xiao Yu and Yuang Qi and Kejiang Chen and Guoqiang Chen and Xi Yang and Pengyuan Zhu and Xiuwei Shang and Weiming Zhang and Nenghai Yu},
  title = {{DPIC: Decoupling Prompt and Intrinsic Characteristics for LLM Generated Text Detection}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=BZh05P2EoN},
}
Figure