[论文解读] Dynamic Prompting: A Unified Framework for Prompt Tuning
本文提出 DNA-GPT,一种无需训练、可解释的检测框架,通过分析原始文本与 LLM 重生成文本片段之间 n-gram 的差异来识别 GPT 生成的文本。该方法在多个 LLM 和数据集上实现了最先进的零样本性能,优于 OpenAI 自身的分类器,同时提供可解释的证据,并对文本修订和模型溯源具有鲁棒性。
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.
研究动机与目标
- 为应对传统检测方法难以识别高质量 GPT 生成文本的日益严峻挑战。
- 开发一种无需微调的零样本检测方法,实现对新模型和新领域的快速适应。
- 通过 n-gram 和概率差异分析,生成可解释的证据,实现可解释的检测。
- 确保对文本修订攻击(如改写或重述)的鲁棒性,并支持模型溯源(识别生成文本的 LLM)。
- 为黑箱和白箱检测场景提供可泛化的框架。
提出的方法
- 将候选文本按固定比例(例如 50%)截断,分离出提示前缀和剩余片段。
- 将截断后的前缀输入目标 LLM,以生成 K 个新的延续片段。
- 通过测量原始剩余片段与生成片段之间 n-gram 差异,计算 BScore(黑箱)或 WScore(白箱)。
- 将 BScore/WScore 作为决策分数:高差异表示 AI 生成的文本,低差异表示人工书写的文本。
- 应用学习得到的阈值 ε 以平衡真正例率与假正例率,实现分类。
- 该方法以零样本模式运行,检测过程无需微调或标注数据。
实验结果
研究问题
- RQ1无训练方法是否能在多种 LLM 和数据集上实现最先进的 GPT 生成文本检测性能?
- RQ2n-gram 差异在区分人工书写与 LLM 生成文本方面有多有效?
- RQ3该方法能否为检测决策提供可解释的证据,从而增强教育和研究场景中的信任度与可用性?
- RQ4该方法对文本修订攻击(如改写或重述)的鲁棒性如何?
- RQ5该方法是否还能实现模型溯源,识别出生成给定文本的 LLM?
主要发现
- DNA-GPT 在四个英文和一个德语文本数据集上优于 OpenAI 自身的分类器(后者基于数百万个样本进行训练),展现出最先进的零样本检测性能。
- 该方法在 GPT-3.5-turbo、GPT-4、text-davinci-003、GPT-NeoX-20B 和 LLaMa-13B 上均实现了高检测准确率,证实了其在专有模型与开源模型间的泛化能力。
- BScore 和 WScore 指标为检测决策提供了清晰且可解释的证据,示例输出显示重生成文本间存在显著差异。
- 该方法在文本修订攻击下依然保持鲁棒性,即使输入文本被改写或编辑,检测性能仍保持较高水平。
- DNA-GPT 可通过检测特征重生成模式,实现模型溯源,识别出生成给定文本的 LLM。
- 理论分析表明,可检测性并非仅由 AUROC 决定,而可通过对真正例率与假正例率的有意义评估来衡量。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。