CCMatrix: Mining Billions of High-Quality Parallel Sentences on the WEB.

Holger Schwenk, Guillaume Wenzek, Sergey Edunov, Edouard Grave, Armand Joulin

TL;DR

CCMatrix scales global, margin-based parallel sentence mining to a massive web corpus of 32.7 billion sentences across 38 languages. By decoupling distance calculations and leveraging optimized vector quantization, the authors extracted 4.5 billion high-quality parallel sentences. Neural Machine Translation (NMT) systems trained solely on this mined data achieved new state-of-the-art results on competitive benchmarks like WMT'19, proving that raw web data can surpass traditional human-translated parallel corpora.

What Problem Does This Paper Address?

Training high-performing Neural Machine Translation (NMT) systems requires massive amounts of parallel text (bitexts)—sentences in two languages that are direct translations of each other. Historically, these datasets come from international organizations (like the UN or European Parliament) or volunteer crowdsourcing (like TED talks). Consequently, they are limited in volume, domain variety, and heavily biased toward English pairings.

While massive monolingual text is easily scraped from the web, finding parallel sentences within it is a needle-in-a-haystack problem. Existing large-scale mining techniques rely on a hierarchical approach: they first align documents, and then look for parallel sentences only within those pre-selected documents. This "local mining" misses millions of parallel sentences scattered across unaligned documents. "Global mining"—comparing every single sentence in a source language against every sentence in a target language—avoids this limitation but introduces a staggering computational bottleneck when scaled to billions of sentences.

Methods

The authors tackled the computational challenge of global mining by combining multilingual sentence embeddings, an optimized margin criterion, and a highly parallelized engineering pipeline.

  1. Multilingual Embeddings: They utilized the LASER toolkit to encode sentences into a shared 1024-dimensional space where semantically similar sentences sit close together, regardless of language.
  2. Margin Criterion: Instead of using an absolute cosine similarity threshold (which performs poorly globally), they used a distance metric that scales by the average similarity of a sentence's $k$-nearest neighbors in both directions. Because billions of sentences increase the likelihood of multiple valid translations, they increased the neighborhood size $k$ from 4 to 16 to avoid penalizing valid alternative translations.
  3. Scalable Engineering Pipeline: Storing 32.7 billion 1024-dimensional vectors would require ~130 TB. To fit this into memory, they used FAISS to apply aggressive 64-bit product quantization compression. They decoupled the forward and backward $k$-nearest neighbor searches to run them completely in parallel across shards of GPUs.
Figure 3: Parallelized processing flow to mine parallel sentences. Left: forward distances; Right: backward distances. Middle: both distances are combined according to Equation 1 and the bitexts extracted.

For English, which contained an overwhelming 8.7 billion sentences, they optimized further by using a asymmetric forward-only distance approach against three partitioned English indexes.

Datasets

  • CCNet: The source corpus, consisting of 10 snapshots of curated Common Crawl data, totaling 32.7 billion unique sentences across 38 languages after deduplication and language identification.
  • TED Corpus: Used to train and evaluate 702 distinct NMT systems across 28 languages to broadly assess data quality.
  • WMT'19 & Newstest'18: High-resource translation benchmarks (English-German, English-Russian, English-Chinese, German-French) used to compare against top-tier translation systems.
  • WAT'19: An Asian translation benchmark used specifically to evaluate the low-resource, distant language pair of Russian-Japanese.

Key Insights and Ideas

  • Global Mining Scales: The paper proves that making no assumptions about document structure and globally comparing billions of sentences is not only computationally feasible with smart engineering but yields incredibly rich datasets.
  • The Neighborhood Effect ($k$): As text corpora grow to the scale of billions, the probability of finding multiple valid translations for a single sentence skyrockets. Tuning the margin criterion's neighborhood size ($k=16$) is essential to prevent the algorithm from discarding valid data.
  • Cultural and Geographic Proximity Matters: The density of mined parallel sentences isn't just a function of corpus size. For example, mining yields significantly more Dutch-German parallel sentences than Dutch-Polish sentences, reflecting real-world cultural alignment and shared internet content between neighboring regions.

Key Results

  • 4.5 Billion Sentences Mined: The pipeline successfully extracted 4.5 billion parallel sentences, including 661 million aligned with English.
  • WMT'19 Breakthroughs: NMT systems trained exclusively on CCMatrix data outperformed single systems trained on official WMT human-translated bitexts. The English-German system outperformed the best single WMT baseline by nearly 4 BLEU points.
  • Conquering Distant Pairs: For the challenging Russian-Japanese pair at WAT'19, the CCMatrix-trained system achieved a BLEU score of 18.20, outperforming the workshop's best submission.

Limitations and Future Work

While highly successful, the approach is extremely resource-intensive, requiring massive GPU clusters to run FAISS indexing and distance calculations over terabytes of vector data. Additionally, the massive volume of English data forced the authors to compromise on an asymmetric forward-only search strategy rather than the full bidirectional "max-strategy" used for other languages.

For future work, the authors plan to scale the pipeline to even more Common Crawl snapshots, focus heavily on expanding coverage for low-resource languages, and explore using the mined parallel data to iteratively train and improve the underlying LASER sentence embeddings.

Summary updated

BibTeX
@inproceedings{schwenk2021ccmatrix,
  author = {Holger Schwenk and Guillaume Wenzek and Sergey Edunov and Edouard Grave and Armand Joulin},
  title = {{CCMatrix: Mining Billions of High-Quality Parallel Sentences on the WEB.}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2021},
  doi = {10.18653/v1/2021.acl-long.507},
}
Figure