Machine-Generated Text Localization (2024)

Abstract: Machine-Generated Text (MGT) detection aims to identify a piece of text as machine or human written. Prior work has primarily formulated MGT detection as a binary classification task over an entire document, with limited work exploring cases where only part of a document is machine generated. This paper provides the first in-depth study of MGT that localizes the portions of a document that were machine generated. Thus, if a bad actor were to change a key portion of a news article to spread misinformation, whole document MGT detection may fail since the vast majority is human written, but our approach can succeed due to its granular approach. A key challenge in our MGT localization task is that short spans of text, *e.g.*, a single sentence, provides little information indicating if it is machine generated due to its short length. To address this, we leverage contextual information, where we predict whether multiple sentences are machine or human written at once. This enables our approach to identify changes in style or content to boost performance. A gain of 4-13% mean Average Precision (mAP) over prior work demonstrates the effectiveness of approach on five diverse datasets: GoodNews, VisualNews, WikiText, Essay, and WP. We release our implementation at https://github.com/Zhongping-Zhang/MGT_Localization.

## introduction large language models (llms) @xcite @xcite @xcite have led to significant advancements in many domains like conversational systems @xcite , social media data mining @xcite , and medical image analysis @xcite , among others. many ethical or factual problems can arise in text generation such as hallucination @xcite or misuse for monetization (ad revenue through clicks) or propaganda (zellers nottingham has a real connection with a number of the iconic british sporting figures and the new statue will be a great way to mark this. …… ## related work the importance of detecting machine-generated text has risen due to the risk of producing factual inaccuracies @xcite and the potential for its use in misinformation, such as propaganda or monetization @xcite . existing detection methods can primarily be categorized into two types: metric-based methods and modelbased methods. metrics-base methods @xcite @xcite @xcite rely on extracting distinguishable features from text using the target language model. specifically, @xcite apply log probability to identify whether a document is generated by llms or humans. @xcite employ the absolute rank of each token as the evaluation metrics. recent studies @xcite @xcite have shown that minor modifications to machine-generated text usually result in lower log probability under the model than the original text, a pattern not observed with humanwritten text. thus, these methods introduce perturbations to the input text, measuring the discrepancy between the original and perturbed texts. model-based methods @xcite @xcite involve training specific classifiers on annotated corpora to classify input text directly. this kind of method is particular useful for detecting text generated by black-box or unknown models. for example, @xcite finetuned a roberta @xcite model based on outputs from gpt-series models. @xcite developed their approach using the hc3 @xcite dataset. to improve the generalization capabilities of these detectors, @xcite extracted features from text using a series of language models and trained a classifier to categorize these features. however, all the methods we have discussed explored generated text detection at coarse scales (i.e., the whole document or paragraph level). in contrast, our paper broadens the discussion to incorporate articles comprising both human-written and machine-generated content at a granular (sentence) level where prior work underperforms. ## machine-generated text localization given an article x containing sentences @xmath0, ..., s n }, machine-generated text (mgt) localization aims at identifying specific sentences produced by llms. unlike the mgt detection task that assigns a single label y for the whole document, our task predicts a sequence of labels {y 1 , ..., y n }, where each label y i corresponds to an individual sentence s i , providing a more precise indicator of machine-generated content in x. a straightforward baseline to adapt existing methods @xcite @xcite to the localization task is predicting labels sentence by sentence foot_2 (sliding window). the major challenge here is that a single sentence often provides insufficient information to determine whether it is machine-generated due to its short length. to address this, we leverage the contextual information to improve performance, where our method predicts multiple sentences at once so that changes in style or content can be identified. specifically, section 3.1 introduces our method for constructing manipulated articles, which serve as the training and evaluation data for our experiments. section 3.2 present our methods to adapt established detectors to the mgt localization task. we first discuss a majority vote algorithm that predicts multiple sentences simultaneously to improve the single-sentence prediction. given that this method assigns the same label to all sentences within a window, it requires a trade-off between the window size and the granularity of localization. in order to enhance performance without sacrificing granularity, we propose a lightweight adaptor designed to predict multiple sentence at once and allocate a unique label to each. figure 2 provides an overview of this method. ## conclusion in this paper, we conduct a comprehensive study of mgt localization, aiming at recognizing aigenerated sentences within a document. we identify a major challenge in mgt localization as the short spans of text at the sentence level, i.e., single sentence may not provide sufficient information for distinguishing machine-generated content. to address this, we propose our methods, vote and adaloc, to predict multiple sentences together, allowing changes in style or content to boost performance. our methods are evaluated on five diverse datasets (goodnews, visualnews, wikitext, essay, and wp), achieving a gain of 4∼13% map over baselines. the improvements across various datasets and detectors demonstrate the effectiveness and generalization of our method in mgt localization.