Skip to main content
QUICK REVIEW

[Paper Review] Dynamic Prompting: A Unified Framework for Prompt Tuning

Xianjun Yang, Wei Cheng|arXiv (Cornell University)|Mar 6, 2023
Topic ModelingComputer Science3 citations
TL;DR

This paper proposes DNA-GPT, a training-free, explainable detection framework for identifying GPT-generated text by analyzing divergences in n-grams between original and LLM-regenerated text segments. It achieves state-of-the-art zero-shot performance across multiple LLMs and datasets, outperforming OpenAI’s own classifier, while providing interpretable evidence and robustness to text revisions and model sourcing.

ABSTRACT

It has been demonstrated that the art of prompt tuning is highly effective in efficiently extracting knowledge from pretrained foundation models, encompassing pretrained language models (PLMs), vision pretrained models, and vision-language (V-L) models. However, the efficacy of employing fixed soft prompts with a predetermined position for concatenation with inputs for all instances, irrespective of their inherent disparities, remains uncertain. Variables such as the position, length, and representations of prompts across diverse instances and tasks can substantially influence the performance of prompt tuning. In this context, we provide a theoretical analysis, which reveals that optimizing the position of the prompt to encompass the input can capture additional semantic information that traditional prefix or postfix prompt tuning methods fail to capture. Building upon our analysis, we present a unified dynamic prompt (DP) tuning strategy that dynamically determines different factors of prompts based on specific tasks and instances. To accomplish this, we employ a lightweight learning network with Gumble-Softmax, allowing us to learn instance-dependent guidance. Experimental results underscore the significant performance improvement achieved by dynamic prompt tuning across a wide range of tasks, including NLP tasks, vision recognition tasks, and vision-language tasks. Furthermore, we establish the universal applicability of our approach under full-data, few-shot, and multitask scenarios. Codes are available at https://github.com/Xianjun-Yang/DPT.

Motivation & Objective

  • To address the growing challenge of detecting high-quality, GPT-generated text that evades traditional detection methods.
  • To develop a zero-shot detection method that works without retraining, enabling rapid adaptation to new models and domains.
  • To provide explainable detection by generating interpretable evidence through n-gram and probability divergence analysis.
  • To ensure robustness against text revision attacks and support model sourcing (identifying which LLM generated the text).
  • To offer a generalizable framework for both black-box and white-box detection scenarios.

Proposed method

  • Truncate a candidate text at a fixed ratio (e.g., 50%) to separate a prompt prefix and a remaining segment.
  • Feed the truncated prefix into a target LLM to regenerate K new continuation segments.
  • Compute a BScore (black-box) or WScore (white-box) by measuring n-gram divergence between the original remaining segment and the regenerated ones.
  • Use the BScore/WScore as a decision score: high divergence indicates AI-generated text, low divergence suggests human-written text.
  • Apply a learned threshold ε to balance true positive and false positive rates, enabling classification.
  • The method operates in zero-shot mode, requiring no fine-tuning or labeled data for detection.

Experimental results

Research questions

  • RQ1Can a training-free method achieve state-of-the-art performance in detecting GPT-generated text across diverse LLMs and datasets?
  • RQ2How effective is n-gram divergence in distinguishing between human-written and LLM-generated text?
  • RQ3Can the method provide interpretable evidence for its detection decisions, enhancing trust and usability in education and research?
  • RQ4How robust is the method against text revision attacks, such as paraphrasing or rephrasing?
  • RQ5Can the method also perform model sourcing, identifying which LLM generated a given text?

Key findings

  • DNA-GPT outperforms OpenAI’s own classifier—trained on millions of examples—on four English and one German dataset, demonstrating state-of-the-art zero-shot detection performance.
  • The method achieves high detection accuracy on GPT-3.5-turbo, GPT-4, text-davinci-003, GPT-NeoX-20B, and LLaMa-13B, confirming generalization across proprietary and open-source models.
  • The BScore and WScore metrics provide clear, interpretable evidence for detection decisions, with example outputs showing significant divergence in regenerated text.
  • The method remains robust under text revision attacks, maintaining high detection performance even when input text is paraphrased or edited.
  • DNA-GPT enables model sourcing by detecting which LLM generated a given text, based on characteristic regeneration patterns.
  • Theoretical analysis shows that detectability is not solely determined by AUROC but can be meaningfully evaluated via true positive and false positive rates.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.