Threads of Subtlety: Detecting Machine-Generated Texts Through Discourse Motifs

Zae Myung Kim, Kwang Hee Lee, Preston Zhu, Vipul Raheja, Dongyeop Kang

TL;DR

This paper introduces a novel approach to identifying machine-generated text by looking past surface-level words and into the hierarchical "discourse motifs" of a document. By representing text as recursive hypergraphs, the authors demonstrate that human writing possesses unique structural signatures—specifically higher structural variability and more complex branching—that make detectors significantly more robust against paraphrasing attacks and out-of-distribution data.

What Problem Does This Paper Address?

As Large Language Models (LLMs) become increasingly fluent, the "surface-level" differences between human and machine writing are vanishing. Traditional detection methods often rely on n-gram distributions or part-of-speech tags. However, these methods struggle with two major issues:

  1. Out-of-Distribution (OOD) Failure: Detectors trained on one domain (e.g., news) often fail miserably when tested on another (e.g., creative writing).
  2. Paraphrasing Attacks: Simply asking an LLM to paraphrase a generated text can easily fool detectors that rely on lexical or syntactic patterns.

The authors argue that while LLMs are masters of sequential next-token prediction, they may not yet capture the complex, hierarchical planning that humans use to organize ideas. The core challenge is finding a way to mathematically represent and compare these deep "threads of subtlety" in discourse.

Figure 1: Human writers often employ hierarchical lin- guistic structures in writing whereas LLMs primarily operate by the sequential next token prediction task.

Methods

The researchers propose a pipeline that moves from raw text to abstract structural motifs:

  1. Discourse Parsing: They use Rhetorical Structure Theory (RST) to break text into Elementary Discourse Units (EDUs) and identify how they relate (e.g., Elaboration, Contrast, Condition).
  2. Recursive Hypergraphs: To capture the hierarchical nature of these relations (where a relation can exist between a single sentence and a whole paragraph), they convert RST trees into recursive hypergraphs.
  3. Motif Analysis: They identify "discourse motifs"—recurring subgraph patterns like "triads" (3-node structures). They use a new metric, MF-IDF (Motif Frequency-Inverse Document Frequency), to prioritize motifs that are most characteristic of a specific authorship or domain.
  4. Model Integration: These motif features (frequency and weighted average depth) are fed into three types of classifiers: Random Forest (RF), Graph Attention Networks (GAT), and Longformers (LF).
Figure 3: A quote from Steve Jobs and its RST tree converted into a hypergraph form. A hexagonal node represents the “nucleus” node, while a circular one denotes the “satellite” node. Each node is labeled with a span of EDU indices that it covers. The star-shaped node is the root node of the graph, encompassing all subgraphs and EDUs.

Datasets

The study utilizes two established benchmarks and introduces a new one:

  • HC3-English: A dataset comparing human answers to ChatGPT across five domains (QA style).
  • DeepfakeTextDetect: A massive collection of human and machine-generated texts from 27 different LLMs.
  • TenPageStories (New): The authors created this dataset to address the lack of long-form benchmarks. It contains fictional stories up to 8,000 tokens long, allowing for the analysis of long-term discourse relations that shorter snippets miss.

Key Insights and Ideas

  • Structural Variability: Human-written texts exhibit much higher structural variability across different domains compared to LLMs. Machines tend to follow more rigid, predictable discourse patterns.
  • Branching vs. Chaining: Humans tend to use more "Joint" relations, leading to "branched" document structures where multiple ideas carry equal weight. In contrast, LLMs often produce more "chain-like" or sequential structures.
  • The Paraphrase Shield: This is perhaps the most significant finding. While paraphrasing drastically changes a sentence's words (the "lower segments" of a discourse tree), it often leaves the high-level rhetorical goals and structure (the "upper segments") intact. By focusing on these upper segments, discourse-based detectors remain effective even when the text has been heavily rewritten.
Figure 6: We posit that sentence-level paraphrasing typically leads to greater variability in lower segments of discourse structures compared to higher segments near the root node.

Key Results

  • Performance Boost: Adding discourse motifs consistently improved F1 scores across all models. For example, the GAT model's performance on the HC3 dataset jumped from 0.67 to 0.73.
  • Robustness to Attacks: On the "OOD-Para" test set (unseen domains that were also paraphrased), the Longformer augmented with motifs achieved an F1 of 0.62, compared to 0.60 for the baseline.
  • Long-form Success: On the new TenPageStories dataset, adding a small discourse vector significantly improved detection, especially in "fill-in-the-gap" scenarios where the model had to distinguish machine-generated continuations of human stories.

Limitations and Future Work

  • Parser Dependency: The method's success relies heavily on the accuracy of the underlying RST parser. Current parsers can be suboptimal, especially on very long or complex documents.
  • Computational Complexity: Motif counting is computationally expensive (NP-intermediate). The authors currently limit their analysis to small motifs (triads); capturing longer, more complex patterns remains a challenge.
  • Formality Bias: The authors noted a correlation between discourse structure and formality in human writing that wasn't present in machine text, suggesting that LLMs might struggle to match the "structural formality" humans naturally adopt in certain contexts.

Future work aims to scale this to even longer documents by merging multiple document graphs and exploring more robust, LLM-based discourse parsers.

Summary updated

BibTeX
@inproceedings{kim2024threads,
  author = {Zae Myung Kim and Kwang Hee Lee and Preston Zhu and Vipul Raheja and Dongyeop Kang},
  title = {{Threads of Subtlety: Detecting Machine-Generated Texts Through Discourse Motifs}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.acl-long.298},
}
Figure