[Paper Review] Few-Shot Detection of Machine-Generated Text using Style Representations
The paper introduces a few-shot detection method for machine-generated text using style representations trained on human-authored data, enabling detection of unseen LLMs and even identification of the generating model with only a few examples.
The advent of instruction-tuned language models that convincingly mimic human writing poses a significant risk of abuse. However, such abuse may be counteracted with the ability to detect whether a piece of text was composed by a language model rather than a human author. Some previous approaches to this problem have relied on supervised methods by training on corpora of confirmed human- and machine- written documents. Unfortunately, model under-specification poses an unavoidable challenge for neural network-based detectors, making them brittle in the face of data shifts, such as the release of newer language models producing still more fluent text than the models used to train the detectors. Other approaches require access to the models that may have generated a document in question, which is often impractical. In light of these challenges, we pursue a fundamentally different approach not relying on samples from language models of concern at training time. Instead, we propose to leverage representations of writing style estimated from human-authored text. Indeed, we find that features effective at distinguishing among human authors are also effective at distinguishing human from machine authors, including state-of-the-art large language models like Llama-2, ChatGPT, and GPT-4. Furthermore, given a handful of examples composed by each of several specific language models of interest, our approach affords the ability to predict which model generated a given document. The code and data to reproduce our experiments are available at https://github.com/LLNL/LUAR/tree/main/fewshot_iclr2024.
Motivation & Objective
- Motivate robust detection of machine-generated text despite distribution shifts and unseen models.
- Propose style-based representations that capture writing style invariant to topic or domain.
- Develop a few-shot detection framework that uses small samples from target LLMs to detect and attribute generated text.
- Evaluate across single-target and multi-target settings and compare with zero-shot and other few-shot baselines.
Proposed method
- Define style representations f that map a small set of documents to a fixed-dimensional vector.
- Train f with contrastive objectives on large human-authored corpora to capture time-invariant writing style.
- Use cosine similarity of aggregated style representations to score new samples against target models.
- Apply to few-shot detection by evaluating similarity between a target-model support set and query samples.
- Experiment with variations of the style model (UAR, CISR) and domain/LLM combinations.
- Compare against zero-shot detectors and other few-shot baselines (ProtoNet, MAML, SBERT).

Experimental results
Research questions
- RQ1Can style representations learned from human writing generalize to distinguish human vs. machine authors across unseen LLMs?
- RQ2How few examples are needed to reliably detect machine-generated text in few-shot settings?
- RQ3Do multi-domain and multi-LLM training of style representations improve detection and model attribution?
- RQ4How robust are style-based detectors to paraphrasing attacks and to multiple target LLMs?
Key findings
- Style representations enable reliable detection of text from unseen LLMs with few examples.
- UAR style representations trained on Reddit (and extended with multi-domain data) outperform baselines including ProtoNet, CISR, SBERT, and zero-shot detectors in pAUC across low-FPR regimes.
- Including additional LLM-generated data (AAC) and multi-LLM training improves robustness to paraphrasing attacks.
- ProtoNet and other metric-based detectors may be less effective in multi-LLM detection settings, while style-based methods maintain strong performance.
- The best single-target and multi-target results show pAUC values around 0.90+ in favorable settings, with robustness demonstrated under paraphrase augmentation when using multi-LLM style training.
- The authors release datasets and report reproducibility details, indicating practical deployment feasibility.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.