Table of Contents
Fetching ...

Machine-Generated Text Localization

Zhongping Zhang, Wenda Qin, Bryan A. Plummer

TL;DR

This work tackles the gap in machine-generated text detection by localizing AI-generated sentences within articles rather than labeling entire documents. It introduces AdaLoc, a lightweight RoBERTa-based adaptor that predicts multiple sentences per chunk, enabling dense per-sentence labels with contextual information. The authors also propose a data-generation pipeline that blends machine-generated segments into human-written articles across five datasets, achieving robust improvements (4–13 percentage points in mAP) over strong baselines. The approach demonstrates notable generalization across domains and moderate zero-shot transfer, offering a practical tool to defend against misinformation at the sentence level.

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.

Machine-Generated Text Localization

TL;DR

This work tackles the gap in machine-generated text detection by localizing AI-generated sentences within articles rather than labeling entire documents. It introduces AdaLoc, a lightweight RoBERTa-based adaptor that predicts multiple sentences per chunk, enabling dense per-sentence labels with contextual information. The authors also propose a data-generation pipeline that blends machine-generated segments into human-written articles across five datasets, achieving robust improvements (4–13 percentage points in mAP) over strong baselines. The approach demonstrates notable generalization across domains and moderate zero-shot transfer, offering a practical tool to defend against misinformation at the sentence level.

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.
Paper Structure (20 sections, 6 figures, 8 tables)

This paper contains 20 sections, 6 figures, 8 tables.

Figures (6)

  • Figure 1: Prior work in machine-generated text detection mitchell2023detectgptsu2023detectllmguo2023close, shown in (A), predicts a binary label indicating if an entire document or paragraph was machine or human generated. However, real-world articles may contain a mix of human-written and machine-generated sentences, which are challenging to detect when only a small part of the document was changed. To address this, we explore machine-generated text localization, shown in (B), where we introduce a lightweight localization adaptor to perform sentence-level predictions within a text document. Our method predicts multiple sentences at once to address challenges caused by the text's short length.
  • Figure 2: Roberta+AdaLoc Overview. Our method first divides an article into several chunks, each containing $m$ sentences. We then employ existing MGT detection methods (e.g., solaiman2019release or guo2023close) to extract chunk features. The model parameters in this phase are fixed, eliminating the need for further training. To assign a specific label to each sentence, we introduce a lightweight localization adaptor, AdaLoc. AdaLoc consists of two fully connected layers, with the output from the final layer being an $m\times1$ vector. This vector's elements represent the predicted labels for the sentences within the chunk. See \ref{['sec:MGTL_methods']} for detailed information.
  • Figure 3: A Qualitative Example on GoodNews. We omit several human-written sections to fit the figure size. The machine-generated sentences are highlighted in light yellow and their original human-written sentences are highlighted in gray. Sentences localized by AdaLoc are marked by red color. We see that Roberta+AdaLoc effectively captures the manipulated segments in the article. See \ref{['sec:experiments_goodnews']} for detailed discussion.
  • Figure 4: A synthesized article consists of both human-written and machine-generated texts. (A): presents the original human-written article from VisualNews liu2020visualnews; (B): an synthesized article manipulated by GPT-J gpt-j. In this example, we replaced two paragraphs of the original article with machine-generated content, highlighted in yellow and pink. See \ref{['sec:appendix_visualization']} for discussion.
  • Figure 5: Comparison to SeqXGPT. (A): A sample from SeqXGPT wang2023seqxgpt; (B): A sample generated for our MGT localization task. We observe that SeqXGPT primarily focuses on scenarios where the first part of an article is human-authored, and all subsequent sections are generated by LLMs. In contrast, our approach handles a more realistic and complex scenario, where multiple segments in an article are generated by LLMs. Additionally, our synthetic data provides more fine-grained annotations, including sentence-level labels, LLM sampling strategy, number of machine-generated segments, among others. See \ref{['sec:appendix_seqxgpt']} for discussion.
  • ...and 1 more figures