Source-linked AI summary
Linear Probing Provides Robust and Efficient Detection of Machine-Generated Text
Gerrit Quaremba, Hanqi Yan, Elizabeth Black, Denny Vrandecic, Elena Simperl
TL;DR
Machine-generated text detectors often lose performance OOD and require large training sets. This paper studies latent representations and trains simple linear probes on frozen LLM activations; across benchmarks, the probes improve OOD detection and reach near-peak performance with fewer than 100 samples, while their direction tracks AI-editing strength.
Problem
Existing supervised MGT detectors often generalize poorly out-of-domain and require large, diverse training corpora.
Method
The paper analyzes HWT and MGT latent geometry and trains layer-wise or concatenated-layer linear probes on frozen LLM hidden states.
Results
+11 AUC in OOD detection, with probes achieving strong performance using only 10–100 training samples.
Takeaways & Limitations
The findings suggest that “machineness” is encoded as a stable, continuous, and linearly accessible activation-space direction for robust detection and fine-grained AI-editing estimation.
Takeaways & Limitations
The results do not establish a universal latent MGT direction across models and data distributions.
Abstract
from arXiv · showhide
Distinguishing machine-generated text (MGT) from human-written text (HWT) becomes increasingly important due to potential misuse. However, most supervised detectors often degrade out-of-domain (OOD) and require large, diverse training sets. In this work, we analyze the linearity and quality of MGT representations and show that simple linear probes outperform a wide range of detectors while being substantially more sample-efficient. We first show that MGT and HWT latent representations are linearly separable in low-dimensional space, and provide a plausible explanation for this separability through systematic differences in their representation quality. Motivated by these insights, we train two variants of simple linear probes and evaluate them across 4 benchmarks against 16 baselines. Probes consistently improve OOD detection (+11 AUC), requiring solely ${<}100$ samples to reach near-peak performance. We show that this transferability arises because probes recover a shared latent MGT direction that generalizes across diverse settings. Finally, we demonstrate that probing vectors capture a continuous spectrum of ``machineness'', highlighting their potential for fine-grained estimation of AI-edited text. Overall, our work provides insights into latent-space differences between MGT and HWT and demonstrates the potential of linear probes as as robust and sample-efficient MGT detectors. We release our code on~\href{https://github.com/gerritq/mgt_probes}{github}.
1 Introduction
Machine-generated text detection is important because LLM outputs can spread misuse, while existing supervised detectors often generalize poorly OOD and require large training corpora. This work studies latent-space separability and develops simple probes that improve robustness and sample efficiency.
- Supervised detectors often generalize poorly to out-of-domain settings and require large, diverse training corpora.
- The paper asks whether machine- and human-written text are linearly separable in latent space and how that structure can improve detection.
- MGT and HWT representations are analyzed as largely linearly separable in low-dimensional space, with increased nonlinear probe complexity reducing detection performance.
- MGT representations collapse into a compressed, more anisotropic, and lower-dimensional subspace than HWT representations, plausibly explaining linear separation.
- The proposed probes use frozen LM representations, PCA-reduced features, and two variants: layer-wise probes and concatenated-layer probes.
- Probes recover a shared latent MGT direction, achieve strong performance with only 10–100 training samples, and exhibit lower sampling uncertainty than training-based baselines.
- The probing direction correlates with edit-strength metrics, indicating a continuous spectrum of “machineness” for estimating AI-editing strength.
2 Related Work
Prior MGT detectors include zero-shot and supervised approaches, but supervised methods face OOD and data requirements while rewrite-based methods add overhead. Related representation studies motivate examining linear latent directions for detection.
- MGT detectors are broadly categorized as zero-shot methods and supervised classifiers.
- Figure 1 projects hidden states onto the first two principal components across layers to examine representation separation.
- Figure 2 compares in-domain and OOD AUC for MLP probes with increasing nonlinearity, showing reduced performance as complexity increases.
3 On the Separability and Quality of MGT Representations
The paper finds that HWT and MGT representations become linearly separable in low-dimensional latent space and remain separated across layers and domains. MGT representations are more compressed and geometrically narrow, offering a plausible explanation for this separation.
- 3.1 Linear Separability: HWT and MGT representations become clearly linearly separable as early as layer 6 and remain stable through later layers.Distinct local subspaces also preserve separability across domains and generators.
- 3.1 Linear Separability: Increasing MLP nonlinearity deteriorates detection performance in both in-domain and OOD settings, supporting a predominantly linear decision boundary.
- 3.2 Representation Quality: MGT representations are more compressed, while HWT representations contain richer and more diverse features.
- 3.2 Representation Quality: MGT occupies a narrower and lower-dimensional activation geometry than HWT.
4 Methodology
The method trains linear probes on frozen LLM hidden states to detect MGT, using either layer-wise or concatenated-layer representations. PCA reduces features to 100 dimensions, and inference projects test activations onto learned MGT directions.
- MGT probes are linear classifiers trained on frozen hidden-state activations, implemented as layer-wise or concatenated-layer variants.
- The layer-averaged probe trains one logistic regression classifier per layer and averages the resulting predictions.
- For each input, the LLM produces hidden states across transformer layers, and the probing dataset uses last-token activations with binary MGT labels.
- PCA retains the top 100 components per layer, reducing Llama-3-8B representations to 100/4096 ≈2.4% of their original dimensionality.
- At inference, test hidden states are projected onto probing directions, with higher scores indicating stronger alignment with the MGT direction.
- The concatenated-layer probe trains one classifier on hidden states concatenated across layers, jointly identifying informative layers and within-layer directions.
5 Experiments
Across four benchmarks, the experiments show that linear MGT probes outperform baselines in-domain and transfer robustly out-of-domain, while requiring few training samples. Probe vectors are aligned across datasets, and their projection scores track degrees of AI editing.
- Experimental Setup: The evaluation covers four benchmarks with four subsets each, spanning domains, languages, generators, and generation tasks, plus 16 baseline detectors.Each subset uses randomly sampled training and test instances.
- In-domain Detection: MGT probes consistently outperform baselines across 16 in-domain settings by 0.04–18.85 AUC.Both LLP and CLP variants show this pattern; their near-identical performance suggests concatenated-layer probing is sufficient for in-domain detection.
- Out-of-domain Detection: MGT probes outperform training-based detectors by 0.39–11.37 AUC in out-of-domain transfer.The largest gains occur in cross-task transfer, reaching 5.76–11.89 AUC, while both probes maintain AUC >0.80 in difficult settings.
- Probing Vector Similarity: Probing vectors are highly aligned within benchmarks and moderately aligned across benchmarks, suggesting a relatively stable latent MGT direction.Broad alignment helps explain the strong OOD transfer, although directions are not perfectly aligned because subsets differ in confounding dimensions.
- Sample-efficiency Analysis: Probes reach near-peak performance with only 10–100 training samples, corresponding to 3.3–6.7% of the training data.They also exhibit substantially lower sampling uncertainty than RepreGuard and RoBERTa.
- Detecting varying degrees of AI-editing: Probe projection scores strongly correlate with AI-editing degree, with stronger editing projected closer to the machine-text region.LLP shows strong correlations across similarity metrics, whereas CLP shows moderate correlations; this behavior emerges from binary-label training.
6 Conclusion
The paper concludes that MGT and HWT occupy linearly separable latent regions and that simple probes provide robust detection with fewer samples. The probing direction also captures fine-grained degrees of AI editing.
- 6 Conclusion: MGT and HWT occupy linearly separable regions in latent space, with representation-quality analyses offering a potential explanation.The paper links this structure to stronger OOD robustness and lower sample requirements for simple probes.
- 6 Conclusion: A stable, continuous, linearly accessible “machineness” direction supports robust detection and fine-grained estimation of AI-edited text.Future work could examine alternative probes, adversarial attacks, and AI-edited text detection.
Limitations
The paper identifies several boundaries on its analysis and claims: incomplete representation characterization, limited model and probe comparisons, unestablished universality, unevaluated fine-grained detection, and dependence on accessible model internals.
- Non-Exhaustive Analysis of Representational Differences: The four representation-quality metrics provide only a non-exhaustive view of HWT and MGT distributional differences.Other representational properties may also contribute to their separation.
- Model Selection: The study does not systematically assess how detection performance scales with model size or architectural design choices.The authors leave the influence of these factors on MGT signal emergence and transferability for future work.
- Linear Probing Variants: The experiments focus on logistic-regression probes rather than more expressive attention-based or learned-pooling alternatives.Such variants may recover richer MGT signals, but their effectiveness is not evaluated here.
- Universality of the Latent MGT Direction: The results do not establish a universal latent MGT direction across models and data distributions.The authors note potential confounding factors and call for further study of direction stability, causality, and universality.
- Fine-Grained Detection of AI-Edited Text: The paper does not evaluate probes as dedicated fine-grained detectors or compare them with specialized multiclass and regression-based approaches.It establishes meaningful variation in AI involvement but leaves continuous-prediction competitiveness for future benchmarking.
- Limited applicability to accessible models: Linear probes apply only to open-source models whose hidden states are accessible because they require access to model internals.This limits applicability to models exposing the relevant internal representations.
Ethical Considerations
The paper reports no identified risks and describes using ChatGPT only for proofreading and formatting assistance. It also introduces representation-quality metrics used to analyze MGT and HWT latent representations.
- The authors report no risks arising from the work.
- ChatGPT was used for proofreading and assistance with formatting tables and figures.
- The analysis focuses on information-theoretic and geometric metrics characterizing representation complexity, dimensionality, and geometry.
- Entropy measures representation information content, with higher values indicating more diverse and information-rich features.
- Effective rank measures dimensional complexity, while lower values indicate stronger compression and more compact representations.
- Intrinsic dimensionality estimates the minimum dimensions needed to describe local representation structure without substantial information loss.
A.2 Extended Analysis
Extended analyses across domains and datasets show that human- and machine-written texts occupy distinct latent-space regions and retain linear separability across layers. Representation-quality metrics display the same qualitative differences beyond Wikipedia.
- Across Reddit, PeerRead, and ArXiv, human- and machine-written texts occupy distinct latent regions and remain linearly separable through middle and later layers.
- t-SNE projections show domain- or generator-specific regions that further separate into human- and machine-written clusters.
- Although t-SNE does not preserve linear structure, its clustering is consistent with within-domain and within-generator linear separability.
- Across M4GT, DetectRL, RAID, MultiSocial, and TSM subsets, MGT representations show the same qualitative representation-quality pattern observed for Wikipedia.
B.1 Benchmarks
The paper evaluates detectors on challenging benchmarks spanning adversarial attacks, social media, diverse languages, generators, domains, and AI-edited text. It compares 16 detectors and reports broad advantages and transferability for MGT probes.
- The detection experiments use more challenging benchmarks because M4GT domain subsets produced saturated results with several near-perfect baselines.
- Benchmarks: DetectRL includes prompt-based and paraphrase attacks, with domain splits combining different LLMs and attack strategies.
- Benchmarks: MultiSocial covers 22 languages across five social-media platforms with varied text lengths, styles, and platforms.
- Benchmarks: RAID contains over 10 million samples spanning models, domains, decoding strategies, and adversarial attacks.
- Detector comparison: The study tests 16 detectors covering zero-shot and supervised methods, using Llama-3-8B when not otherwise specified.
- Detector comparison: MGT probes consistently outperform related methods, using supervised regularization, all-layer information, and linear rather than unnecessary nonlinear classifiers.
C.9 Calibration Analysis
The calibration analysis compares MGT probes with RoBERTa on DetectRL subsets using Expected Calibration Error. Both probes are reported as well calibrated, sometimes outperforming the fine-tuned baseline.
- Both probes are well calibrated across DetectRL subsets and outperform fully fine-tuned RoBERTa in calibration in several settings.
- Table 6 compares MGT probes against RoBERTa using Expected Calibration Error on DetectRL subsets.
- The calibration analysis uses projection scores produced by the linear probes and supports their potential use for fine-grained AI-edit detection.
D.1.1 Model Size and Architecture Ablations
Ablations show that probe performance depends more on token and layer aggregation choices than on regularization, while architecture and dimensionality also influence results. Across LLP and CLP, 100 PCA components provide a strong performance–dimensionality trade-off without PCA driving separability.
- Final-token probing consistently outperforms mean pooling, likely because causal attention aggregates information from the entire sequence.
- Aggregating projection scores across layers outperforms using only the first or last layer.This finding aligns with the reported advantage of probe ensembles over single-layer probes.
- Qwen-8B consistently improves over LLaMA-8B, while Qwen-4B slightly exceeds LLaMA-8B despite having fewer parameters.Within the LLaMA family, reducing model size causes only modest performance degradation, suggesting architecture may matter more than parameter count.
- L2 regularization strength has virtually no effect on performance, suggesting the learned MGT direction is stable and readily recoverable.
- Beyond k = 100 principal components, improvements are marginal and inconsistent, supporting a relatively low-dimensional encoding of MGT signals.
- CLP exhibits the same main ablation trends as LLP, with 100 PCA components offering the best trade-off and no meaningful gains from additional components.PCA and no-PCA performance are nearly identical for CLP, as they are for LLP, indicating PCA does not meaningfully affect linear separability.