Machine-Generated Text (MGT) detection, a task that discriminates MGT from Human-Written Text (HWT), plays a crucial role in preventing misuse of text generative models, which excel in mimicking human writing style recently. Latest proposed detectors usually take coarse text sequences as input and fine-tune pretrained models with standard cross-entropy loss. However, these methods fail to consider the linguistic structure of texts. Moreover, they lack the ability to handle the low-resource problem which could often happen in practice considering the enormous amount of textual data online. In this paper, we present a coherence-based contrastive learning model named CoCo to detect the possible MGT under low-resource scenario. To exploit the linguistic feature, we encode coherence information in form of graph into text representation. To tackle the challenges of low data resource, we employ a contrastive learning framework and propose an improved contrastive loss for preventing performance degradation brought by simple samples. The experiment results on two public datasets and two self-constructed datasets prove our approach outperforms the state-of-art methods significantly. Also, we surprisingly find that MGTs originated from up-to-date language models could be easier to detect than these from previous models, in our experiments. And we propose some preliminary explanations for this counter-intuitive phenomena. All the codes and datasets are open-sourced.
翻译:机器生成文本检测任务旨在区分机器生成文本与人类撰写文本,对于防止滥用当前能够出色模仿人类写作风格的文本生成模型具有关键作用。最新提出的检测方法通常以粗粒度文本序列为输入,采用标准交叉熵损失微调预训练模型。然而,这些方法未能考虑文本的 linguistic 结构,且难以应对实际中因海量在线文本数据而常发的低资源问题。本文提出基于一致性的对比学习模型 CoCo,用于在低资源场景下检测潜在的机器生成文本。为充分利用语言学特征,我们将以图结构表征的一致性信息编码至文本表示中;针对低数据资源挑战,采用对比学习框架并提出改进对比损失函数,以抑制简单样本导致的性能退化。在两个公开数据集及两个自建数据集上的实验结果表明,本方法显著优于现有最优方法。值得注意的是,实验发现源自最新语言模型的机器生成文本反而比早期模型生成的文本更易检测,我们对此反直觉现象提出了初步解释。所有代码与数据集均已开源。