S eq XGPT : Sentence-Level AI -Generated Text Detection (2023)

Abstract: Widely applied large language models (LLMs) can generate human-like content, raising concerns about the abuse of LLMs. Therefore, it is important to build strong AI-generated text (AIGT) detectors. Current works only consider document-level AIGT detection, therefore, in this paper, we first introduce a sentence-level detection challenge by synthesizing a dataset that contains documents that are polished with LLMs, that is, the documents contain sentences written by humans and sentences modified by LLMs. Then we propose Seq uence X (Check) GPT , a novel method that utilizes log probability lists from white-box LLMs as features for sentence-level AIGT detection. These features are composed like waves in speech processing and cannot be studied by LLMs. Therefore, we build SeqXGPT based on convolution and self-attention networks. We test it in both sentence and document-level detection challenges. Experimental results show that previous methods struggle in solving sentence-level AIGT detection, while our method not only significantly surpasses baseline methods in both sentence and document-level detection challenges but also exhibits strong generalization capabilities.

## introduction with the rapid growth of large language models (llms) exemplified by palm, chatgpt and gpt-4 @xcite @xcite , which are derived from pre-trained models (ptms) @xcite @xcite , ai-generated texts (aigt) can be seen almost everywhere. therefore, avoiding the abuse of aigt is a significant challenge that require great effort from nlp researchers. one effective solution is aigt detection, which discriminates whether a given text is written or modified by an ai system @xcite . current aigt detection strategies, such as supervised-learned discriminator foot_0 , perplexitybased methods @xcite , etc., focus on discriminating whether a whole document is generated by an ai. however, users often modify partial texts with llms rather than put full trust in llms to generate a whole document. therefore, it is important to explore fine-grained (e.g. sentence-level) aigt detection. building methods that solve the sentence-level aigt detection challenge is not an incremental modification over document-level aigt detection. on the one hand, model-wise methods like detectgpt and sniffer require a rather long document as input (over 100 tokens), making them less effective at recognizing short sentences. on the other hand, supervised methods such as roberta fine-tuning, are prone to overfitting on the training data, as highlighted by @xcite ; @xcite . therefore, it is necessary to build sentence-level detectors considering the limitation of current aigt methods. in this paper, we study the sentence-level aigt detection challenge: we first build a sentence-level aigt detection dataset that contains documents with both humanwritten sentences and ai-generated sentences, which are more likely to occur in real-world aiassisted writings. further, we introduce seqxgpt, a strong approach to solve the proposed challenge. since previous works @xcite @xcite show that perplexity is a significant feature to be used for aigt detection, we extract word-wise log probability lists from white-box models as our foundational features, as seen in figure 1 . these temporal features are composed like waves in speech processing where convolution networks are often used @xcite . therefore, we also use convolution network, followed by self-attention @xcite layers, to process the wave-like features. we employ a sequence labeling approach to train seqxgpt, and select the most frequent word-wise category as the sentence category. in this way, we are able to analyze the fine-grained sentence-level text provenance. we conduct experiments based on the synthesized dataset and test modified existing methods as well as our proposed seqxgpt accordingly. experimental results show that existing methods, such as detectgpt and sniffer, fail to solve sentence-level aigt detection. our proposed seqxgpt not only obtains promising results in both sentence and document-level aigt detection challenges, but also exhibits excellent generalization on out-of-distribution datasets. ## background the proliferation of large language models (llms) such as gpt-4 has given rise to increased concerns about the potential misuse of aigenerated texts (aigt) @xcite @xcite . this emphasizes the necessity for robust detection mechanisms to ensure security and trustworthiness of llm applications. ## seqxgpt to solve the sentence-level detection challenge, we introduce a strong method seqxgpt: ## conclusion in this paper, we first introduce the challenge of sentence-level aigt detection and propose three tasks based on existing research in aigt detection. further, we introduce a strong approach, seqxgpt, as well as a benchmark to solve this challenge. through extensive experiments, our proposed seqxgpt can obtain promising results in both sentence and document-level aigt detection. on the ood testset, seqxgpt also exhibits strong generalization. we hope that seqxgpt will inspire future research in aigt detection, and may also provide insightful references for the detection of content generated by models in other fields.