Detectors that tell human from machine-written text work almost perfectly on the kind of data they were trained on. They fail on text from a new language model or a new topic. One promising fix removes parts of the detector's internal representation that carry dataset-specific shortcuts, such as sentence length or syntactic depth, and reports out-of-distribution gains of up to 14%. Choosing which parts to remove is itself a search, though. In genomics and brain imaging, searches of this kind have repeatedly produced gains of 10 to 20 accuracy points that disappeared once the selection step was kept away from the evaluation data. This proposal asks whether representation pruning for AI-text detection has the same problem. It then builds a selection procedure that can only see the training generators and domains.
The two-sentence version is this. Treat "which embedding dimensions, attention heads, or linguistic concepts to delete" as feature selection, run it inside a nested loop whose held-out generator or domain is never seen during selection, and measure how much of the reported robustness survives. We also predict which pruning methods will lose the most: those that search over thousands of candidates should be inflated far more than those that pick among a handful. The reason is the "winner's curse", where the best of many noisy candidates looks good partly by chance.
Core Claim
Robust AI-Generated Text Detection by Restricted Embeddings is the closest work and the one we audit. It improves transfer of fine-tuned BERT and RoBERTa detectors by three methods: greedily zeroing embedding coordinates, pruning attention heads, and linearly erasing concepts such as syntactic tree depth with LEACE, a closed-form linear concept-erasure method. It reports mean out-of-distribution gains of up to 9% for RoBERTa and up to 14% for BERT on M4 and GPT-3D. The research file notes that the paper does not specify a selection protocol that is isolated from the evaluation distributions. We do not assume that it leaked. We claim three things that can each be tested.
First, target-informed selection of removed components inflates out-of-distribution scores, and the inflation is measurable. Second, the inflation grows with the size of the search space, ordered roughly coordinates (768) > heads (144) > concepts (about 10). This follows from the expected maximum of $K$ independent noisy estimates of a true gain $g$ with noise level $\sigma$:
$$\mathbb{E}\big[\max_{k\le K}\hat g_k\big] \approx g + \sigma\sqrt{2\ln K},$$
which is the standard extreme-value approximation for Gaussian noise. Third, a selection loop that holds out one source generator or domain at a time keeps most of the real gain for low-dimensional concept erasure but not for coordinate search.
If all three gains survive nesting intact, that is a useful positive result. It certifies the method.
Research Program
The method side draws on two lines of evidence from outside text detection. Supervised, Multivariate, Whole-Brain Reduction Did Not Help to Achieve High Classification Performance in Schizophrenia Research showed that selecting MRI features before cross-validation produced about 85% apparent accuracy against 65–70% under in-loop selection. Once selection was nested, supervised reduction lost its advantage over plain univariate tests and PCA. Predicting Gene Expression from Sequence: A Reexamination found a 10–15 point inflation from global motif discovery. It also found that the apparent "complex spatial logic" was overfit noise. Both papers supply the protocol (selection strictly inside the training fold) and a prior on effect sizes. Neither says anything about distribution shift. In detection, the relevant leak is information about the target generator or domain, not just about held-out samples.
The motivation comes from detection. M4 documents the cross-generator collapse that pruning tries to fix. The GenAI Content Detection Task 3 report concedes possible test leakage and formatting confounds in RAID, such as recipes written as narrative by humans but as numbered lists by ChatGPT. Removing those confounds lowered scores, so headline numbers in this area are already partly artifactual.
We build an outer loop over M4 and GPT-3D with two variants. In leave-one-generator-out, the target generator, for example BLOOMz, is untouched. In leave-one-domain-out, the target domain is untouched. Inside each outer fold, an inner loop rotates through the remaining source generators or domains, holding one out at a time. Every candidate removal is scored by its average gain on these held-out sources. Selection, the number of removed components, and classifier hyperparameters are all fixed inside this inner loop.
Nesting multiplies cost, which the leakage literature flags as the main practical barrier. To keep it affordable, the inner loop scores candidates with a logistic probe on frozen encoder features. Only the final configuration is fine-tuned once per outer fold. We separately check, on a subset, that the probe ranking agrees with fine-tuned ranking. Across outer folds we also record the overlap of the selected sets. The leakage literature identifies fold-unstable feature subsets as a sign that selection is fitting artifacts. If heads that help generalization are real, the same early-layer heads should recur.
Baselines
The naive reference is the unrestricted fine-tuned RoBERTa and BERT detector, trained on the same source folds with the same tuning budget. Every gain is measured against it. M4 shows this model near-perfect in distribution but collapsing on unseen generators, so it sets the floor that any pruning must beat.
The strongest existing method is the restricted-embedding approach of Kuznetsov et al., with its reported mean out-of-distribution improvements of up to 9% for RoBERTa and up to 14% for BERT. We run it under two protocols on identical splits, encoders, and search budgets. The first is a deliberately target-informed protocol, where candidates are scored on the outer target. It serves as a reconstruction of the most optimistic possible selection, not a claim about what the authors did. The second is our nested source-only protocol. The difference in target score between the two is the measured optimism bias. "Beating" this baseline here does not mean a higher number. It means showing that the nested version matches the target-informed gain (so the method is certified) or that it does not (so the reported gain is partly selection noise), with fold-level confidence intervals.
The ablation that isolates selection is random removal. We zero the same number of coordinates, or prune the same number of heads, chosen at random, under the same protocol. If random removal recovers most of the nested gain, the benefit comes from regularization by capacity reduction, not from finding shortcut-carrying components.
As an external reference that involves no selection at all, we report zero-shot detectors. These are Fast-DetectGPT, DetectLLM's LRR score (a training-free ratio of token log-likelihood to log-rank), and the intrinsic-dimension score of Tulchinskii et al., which measures how many dimensions the passage's embeddings effectively span. The file gives DetectGPT 0.95 AUROC on GPT-NeoX XSum generations, and 40% detection at 1% false-positive rate against GPT-3.5 for intrinsic dimension. No reported result was found on Lacuna for any of these on the M4 leave-one-generator-out splits, so we run them ourselves.
Why not just…?
Why not just hold out one validation domain and select on it? This is the real threat. A single held-out source domain may give nearly the same answer as the full nested loop at a fraction of the cost. We run it as its own protocol. If its target score and selected sets match the nested loop within fold noise, we will recommend it as the practical procedure and drop the claim that full nesting is needed. The extreme-value argument predicts a single split will do worse mainly for coordinate search, where $K$ is large. We expect it to hold up fine for concept erasure.
Why not just use zero-shot detectors and avoid selection entirely? Zero-shot scores have no training-set leakage to worry about. They have other weaknesses. RAID shows that a repetition penalty during decoding cuts detector accuracy by up to 32 points. DetectGPT-style scoring needs many forward passes and access to probabilities from the generating model or a surrogate. Since this is a question about whether supervised pruning is trustworthy, zero-shot detectors stay in the study as a reference line, not as a substitute.
Why not just train on more diverse data or clean the confounds? Diversity alone did not prevent M4's collapse on held-out generators. Cleaning helps, but the Task 3 report shows that cleaning changes scores without saying which internal shortcuts remain. We also run a version of every protocol on format-normalized text: list markers stripped, whitespace and lengths matched. This lets us separate inflation caused by formatting confounds from inflation caused by the selection step.
Decisive Checks
The main measurement is AUROC and true-positive rate at 5% false-positive rate on each held-out generator and domain of M4 and GPT-3D, under no restriction, target-informed, single-split, nested, and random-removal protocols. The 5% false-positive operating point is the metric used in the RAID shared task. As a secondary target, RAID's domain and decoding splits are held out in the same way.
The hypothesis is supported if three things hold. Target-informed minus nested gap is clearly positive for coordinate search. That gap is ordered coordinates > heads > concepts, consistent with $\sqrt{\ln K}$ growth. Nested concept erasure, especially syntactic-depth erasure, still beats both the unrestricted model and random removal. Coordinate sets that overlap little across folds while heads and concepts recur would independently confirm the winner's-curse explanation.
The hypothesis is refuted if the nested gains equal the target-informed gains for all three methods. That outcome would certify restricted embeddings as a sound fix for cross-generator transfer.
References
- Robust AI-Generated Text Detection by Restricted Embeddings
- Supervised, Multivariate, Whole-Brain Reduction Did Not Help to Achieve High Classification Performance in Schizophrenia Research
- Predicting Gene Expression from Sequence: A Reexamination
- M4: Multi-generator, Multi-domain, and Multi-lingual Black-Box Machine-Generated Text Detection
- GenAI Content Detection Task 3: Cross-Domain Machine Generated Text Detection Challenge
- Fast-DetectGPT: Efficient Zero-Shot Detection of Machine-Generated Text via Conditional Probability Curvature
- DetectLLM: Leveraging Log Rank Information for Zero-Shot Detection of Machine-Generated Text
- Intrinsic Dimension Estimation for Robust Detection of AI-Generated Texts
- RAID: A Shared Benchmark for Robust Evaluation of Machine-Generated Text Detectors
- DetectGPT: Zero-Shot Machine-Generated Text Detection using Probability Curvature