TECHNOLOGY

Suffix-array text deduplication: byte ranges and document boundaries

In this article
THE QUICK TAKE

Repeated substring ranges describe a serialized corpus; reconstructing safe document edits requires its original boundary mapping.

The indexed object is a serialized corpus

The archived Google Research deduplicate-text-datasets project provides suffix-array tools for finding repeated substrings. Its input is a byte sequence rather than an abstract collection of independently addressable documents. That distinction matters when interpreting offsets and rebuilding a dataset after exclusions.

The supplied loader concatenates records with separators and records cumulative sizes. Preserve that mapping with the exact serialized input. An offset discovered against an earlier extraction cannot safely be applied to a later file whose encoding, separators or document order has changed.

Threshold units follow the representation

The command interface describes a byte-length threshold. The repository’s tokenized loader serializes token identifiers into a fixed-width representation. A threshold interpreted as ordinary text bytes therefore does not automatically describe the same amount of tokenized content.

Inspect the actual loader and its tokenizer assumptions before choosing a length. Record whether the index contains raw text or serialized token identifiers. Avoid converting a paper’s token-length setting into a command parameter without accounting for how this particular artifact was written.

Collected ranges can unite overlapping matches

The repository explains that collected removal ranges combine overlapping repeated substrings. Every byte in a merged range can belong to a repeated match without the entire merged range appearing elsewhere as one identical sequence. Counting the complete merged range can therefore give a misleading sanity check.

Review the matching unit and range-merging logic together. A long interval is evidence of covered repeated fragments under the configured rule, not automatically proof of an equally long duplicate paragraph. This difference affects both removal statistics and explanations to dataset reviewers.

Corpus coordinates must become document edits

Map candidate ranges back through the saved boundary information. Inspect intervals near separators, document starts and document ends before applying any transformation. Byte offsets also need care when rendering decoded text because character positions and byte positions are different coordinate systems.

A proposed review should retain before-and-after records and the reason for each removed span. Partial deletion can create broken sentences or remove a necessary definition. Depending on the dataset’s purpose, excluding a whole record may be easier to audit than silently stitching its remaining fragments together.

Treat the released pipeline as a research artifact

The accompanying paper studies deduplication under particular data and training conditions. It does not establish the quality effect of an untested removal policy on every corpus. The archived implementation also warrants a pinned environment and explicit input-format checks before reuse.

Keep the input digest, boundary map, index parameters and retained identifiers in one provenance chain. This makes a changed corpus explainable while avoiding a claim that substring overlap alone determines which document is safe or useful to keep.

Primary references

Google Research text deduplication repository.

Corpus serialization loader.

Deduplicating Training Data Makes Language Models Better.

Related explanations: Duplicates and memorization; Preprocessing memory.

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles