Datasets:

Languages:
English
Size:
n>1T
ArXiv:
License:

Detecting synthetic / template content in web corpora β€” what signals work at scale?

#56
by Optitransfer - opened

As more AI-generated and template-heavy content ends up in web crawls, identifying and filtering it becomes a real challenge for large pretraining corpora.

Curious how others have approached this, particularly:

1. Feature combination β€” Single signals (n-gram repetition, vocabulary diversity, sentence length variance) tend to have too many false positives on their own. Did Dolma's pipeline combine multiple signals? How were they weighted or thresholded?

2. Machine-translated content β€” Pages translated by MT systems often pass fluency and language identification checks. They tend to show phrase-boundary artifacts and low syntactic variety, but these are subtle. Was there anything in Dolma's pipeline specifically targeting translated content, or was it caught by general quality filters?

3. Calibration across data sources β€” Common Crawl, Wikipedia, and books have very different baseline characteristics. Did you calibrate slop detection separately per source, or apply a single cross-source threshold?

In our work on a Swiss multilingual web corpus (.ch domains, DE/FR/EN/IT), we ended up computing a composite score from four signals: vocabulary diversity, sentence length variance, n-gram repetition rate, and capitalization pattern deviation. Documents above threshold were tiered separately rather than hard-discarded β€” the signal was too noisy for binary filtering, and some template-heavy documents still contained useful factual content.

The harder problem was cross-language calibration. German text has structurally lower vocabulary diversity than French due to compound words and inflection, so thresholds calibrated on English or French consistently over-flagged German content until we separated them.

For context on our approach: https://huggingface.co/datasets/OptiTransferData/swiss-web-premium-ch

Interested in what others have found, particularly at the scale Dolma operates at.

Great questions, and the Swiss multilingual corpus framing is a useful concrete example.

Coming at this from the other side of the problem β€” we build synthetic datasets intentionally, so we can say something about what signals actually distinguish template-generated content from organic text.

What makes fill-slot synthetic content distinctive (from the generator's perspective)

The most exploitable signal isn't n-gram repetition or vocabulary diversity β€” it's inter-document structural variance collapse. When you generate via templates, the non-slot tokens are byte-for-byte identical across instances. A sliding window over structural position (sentence 1 token distribution, sentence 2 token distribution, ...) will show extremely low variance across documents from the same template, but that variance pattern is invisible to document-level scorers.

In practice, the best discriminator we found was conditional token surprise: given the first 20 tokens of a sentence, how predictable is the rest? For organic web text, even within-document repetition is imperfect. For template-generated text, the non-slot positions have conditional perplexity near 1.0 β€” they're completely predictable. This generalizes better across languages than vocabulary diversity because it's measuring structure, not lexical variety.

On feature combination and weighting

Your four-signal composite is reasonable but I'd push back on equal weighting. In our experience the signals are not independent β€” n-gram repetition and sentence-length variance are correlated (templates produce repetitive structure which also creates uniform sentence length). A PCA over the signal space before thresholding reduces the effective dimensionality to ~2 and avoids double-counting.

On MT content specifically

Phrase-boundary artifacts are real but subtle. The more reliable MT signal is discourse connector distribution: MT systems tend to preserve logical connectors (however, therefore, moreover) from source-language frequency rather than target-language frequency. German academic text uses "jedoch" where English text would more often just start a new sentence β€” MT tends to carry over the over-explicit connector pattern.

On cross-source calibration

Tiering rather than hard-discarding is the right call. We use a similar approach for our datasets: a document flagged as "likely synthetic" at 0.8 confidence that still contains structured factual content (e.g. a product spec table) is more valuable than an organic document that's paraphrase soup. The flag becomes a metadata field, not a filter.

The German compound-word vocabulary diversity problem you describe is well-documented. One approach: compute diversity over morphological stems (using a morphological analyzer like spaCy's German pipeline or CAB) rather than surface forms. Reduces the German/French calibration gap significantly.

For reference: we've published several synthetic datasets at https://huggingface.co/SalutefaceAAC β€” the generation methodology section in each dataset card describes what makes the synthetic patterns distinguishable, which might be useful as a signal source if you're building classifiers.

Sign up or log in to comment