CCNet: Extracting High Quality Monolingual Datasets from Web Crawl Data
Written for the Research library (claude-opus-5-5) from the paper text. Original — aclanthology.org/2020.lrec-1.494.pdf
Summary
Pretrained language models improve as their training corpora grow, but only if data quality is maintained. Curated sources such as Wikipedia are small for many languages, especially low-resource ones. The authors present CCNet, an open-source pipeline that converts raw Common Crawl snapshots (WET text) into large monolingual corpora and keeps whole documents intact. The pipeline has three stages:
- It removes duplicated paragraphs using hashes of normalized text.
- It assigns each document a language with the fastText identifier.
- It scores each document by its perplexity under a 5-gram Kneser-Ney model (KenLM, with a SentencePiece tokenizer) trained on Wikipedia. Each language is then split into head, middle and tail thirds.
Deduplicating before language identification strips English boilerplate and recovers many documents in smaller languages. On the February 2019 snapshot, the pipeline produced roughly 1.5 billion documents in 174 languages. Models trained on the low-perplexity portion outperform Wikipedia-trained counterparts. fastText embeddings improve steadily from tail to head, and BERT-BASE improves on XNLI, with the largest gain for Urdu. This makes web-scale pretraining practical for languages without big curated corpora.
Key points
- The Feb. 2019 snapshot (about 24TB of text, 1600 shards of 5GB) yielded about 1.5B documents in 174 languages. English alone contributes about 700M filtered documents, or 532B tokens, around 120 times the BERT training data. Processing takes about 8.5 hours per snapshot on 5000 CPU cores.
- Duplicated paragraphs make up about 70% of the text. Paragraphs are hashed with the first 64 bits of SHA-1. Comparing hashes across 50 shards was chosen as a practical trade-off, needing about 40GB of RAM.
- Language identification uses the fastText classifier, which covers 176 languages and discards pages with a top score of 0.5 or lower. Running deduplication first noticeably increases document counts for low-resource languages. Ukrainian (uk) appears among the 25 largest languages in the reported statistics.
- SentencePiece and KenLM models trained on Wikipedia were released for 48 languages. The release also includes code to train custom filters and a tool that rebuilds the dataset from URL lists. Everything is available at github.com/facebookresearch/cc_net.
- In evaluation, English fastText analogy accuracy rose from 62.0 (tail) to 77.9 (head). BERT-BASE XNLI dev accuracy averaged 75.9 with CommonCrawl data versus 72.6 with Wikipedia data. For Urdu, accuracy rose from 57.3 to 64.3.
Cited by
- Do All Languages Cost the Same? Tokenization in the Era of Commercial Language Models
- Yi: Open Foundation Models by 01.AI
- The Falcon Series of Open Language Models
- Tower: An Open Multilingual Large Language Model for Translation-Related Tasks
- XLS-R: Self-supervised Cross-lingual Speech Representation Learning at Scale
- German's Next Language Model
- 8-bit Optimizers via Block-wise Quantization
- TinyStories: How Small Can Language Models Be and Still Speak Coherent English?
- IndicTrans2: Towards High-Quality and Accessible Machine Translation Models for all 22 Scheduled Indian Languages
- Applying Occam's Razor to Transformer-Based Dependency Parsing: What Works, What Doesn't, and What is Really Necessary
- Unsupervised Dense Information Retrieval with Contrastive Learning
- GlotLID: Language Identification for Low-Resource Languages
- Internet-Augmented Dialogue Generation
- From Zero to Hero: On the Limitations of Zero-Shot Language Transfer with Multilingual Transformers
- Towards General Text Embeddings with Multi-stage Contrastive Learning
- DataComp-LM: In search of the next generation of training sets for language models
- XGLUE: A New Benchmark Dataset for Cross-lingual Pre-training, Understanding and Generation
- Few-shot Learning with Multilingual Language Models
- CamemBERT: a Tasty French Language Model
- EuroLLM: Multilingual Language Models for Europe
- CulturaX: A Cleaned, Enormous, and Multilingual Dataset for Large Language Models in 167 Languages
- DINOv2: Learning Robust Visual Features without Supervision
- OpenWebMath: An Open Dataset of High-Quality Mathematical Web Text
- MAD-X: An Adapter-Based Framework for Multi-Task Cross-Lingual Transfer
- Toolformer: Language Models Can Teach Themselves to Use Tools
- CCMatrix: Mining Billions of High-Quality Parallel Sentences on the WEB
- mGPT: Few-Shot Learners Go Multilingual
- A Monolingual Approach to Contextualized Word Embeddings for Mid-Resource Languages
- Aya Model: An Instruction Finetuned Open-Access Multilingual Language Model
- Text Embeddings by Weakly-Supervised Contrastive Pre-training
- RedPajama: an Open Dataset for Training Large Language Models
- Benchmarking Retrieval-Augmented Generation for Medicine
- A Survey on Large Language Model (LLM) Security and Privacy: The Good, the Bad, and the Ugly
- MIRACL: A Multilingual Retrieval Dataset Covering 18 Diverse Languages
- A Survey of Large Language Models
Cite
@inproceedings{wenzek2020ccnet,
title = {{CCNet: Extracting High Quality Monolingual Datasets from Web Crawl Data}},
author = {Wenzek, Guillaume and Lachaux, Marie-Anne and Conneau, Alexis and Chaudhary, Vishrav and Guzmán, Francisco and Joulin, Armand and Grave, Edouard},
booktitle = {Proceedings of the Twelfth Language Resources and Evaluation Conference},
year = {2020},
eprint = {1911.00359},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/1911.00359}
}References
- Baevski, A., Edunov, S., Liu, Y., Zettlemoyer, L., and Auli, M. (2019). Cloze-driven pretraining of self-attention networks. arXiv preprint arXiv:1903.07785. find
- Buck, C., Heafield, K., and Van Ooyen, B. (2014). Ngram counts and language models from the common crawl. In LREC, volume 2, page 4. find
- Citeseer. Conneau, A., Rinott, R., Lample, G., Williams, A., Bowman, S. R., Schwenk, H., and Stoyanov, V. (2018). Xnli: Evaluating cross-lingual sentence representations. In Proc. find
- EMNLP. Devlin, J., Chang, M.-W., Lee, K., and Toutanova, K. (2018). Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805. find
- Grave, E., Bojanowski, P., Gupta, P., Joulin, A., and Mikolov, T. (2018). Learning word vectors for 157 languages. arXiv preprint arXiv:1802.06893. find our card
- Heafield, K. (2011). KenLM: faster and smaller language model queries. In Proceedings of the EMNLP 2011 Sixth Workshop on Statistical Machine Translation. find our card
- Joulin, A., Grave, E., Bojanowski, P., Douze, M., Jégou, H., and Mikolov, T. (2016a). Fasttext.zip: Compressing text classification models. arXiv preprint arXiv:1612.03651. find our card
- Joulin, A., Grave, E., Bojanowski, P., and Mikolov, T. (2016b). Bag of tricks for efficient text classification. arXiv preprint arXiv:1607.01759. find
- Kudo, T. (2018). Subword regularization: Improving neural network translation models with multiple subword candidates. arXiv preprint arXiv:1804.10959. find
- Lample, G. and Conneau, A. (2019). Cross-lingual language model pretraining. arXiv preprint arXiv:1901.07291. find
- Lan, Z., Chen, M., Goodman, S., Gimpel, K., Sharma, P., and Soricut, R. (2019). Albert: A lite bert for self-supervised learning of language representations. arXiv preprint arXiv:1909.11942. find
- Liu, Y., Ott, M., Goyal, N., Du, J., Joshi, M., Chen, D., Levy, O., Lewis, M., Zettlemoyer, L., and Stoyanov, V. (2019). Roberta: A robustly optimized bert pretraining approach. arXiv preprint arXiv:1907.11692. find
- Mikolov, T., Sutskever, I., Chen, K., Corrado, G. S., and Dean, J. (2013). Distributed representations of words and phrases and their compositionality. In Adv. find
- NIPS. Mikolov, T., Grave, E., Bojanowski, P., Puhrsch, C., and Joulin, A. (2017). Advances in pre-training distributed word representations. arXiv preprint arXiv:1712.09405. find our card
- Ortiz Suárez, P. J., Sagot, B., and Romary, L. (2019). Asynchronous pipeline for processing huge corpora on medium to low resource infrastructures. find
- CMLC. Pennington, J., Socher, R., and Manning, C. (2014). Glove: Global vectors for word representation. In Proc. find
- EMNLP. Peters, M. E., Neumann, M., Iyyer, M., Gardner, M., Clark, C., Lee, K., and Zettlemoyer, L. (2018). Deep contextualized word representations. arXiv preprint arXiv:1802.05365. find
- Radford, A., Wu, J., Child, R., Luan, D., Amodei, D., and Sutskever, I. (2019). Language models are unsupervised multitask learners. OpenAI Blog, 1(8). find
- Raffel, C., Shazeer, N., Roberts, A., Lee, K., Narang, S., Matena, M., Zhou, Y., Li, W., and Liu, P. J. (2019). Exploring the limits of transfer learning with a unified text-to-text transformer. arXiv preprint arXiv:1910.10683. find
- Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, Ł., and Polosukhin, I. (2017). Attention is all you need. In Adv. find
- NIPS. Yang, Z., Dai, Z., Yang, Y., Carbonell, J., Salakhutdinov, R., and Le, Q. V. (2019). Xlnet: Generalized autoregressive pretraining for language understanding. arXiv preprint arXiv:1906.08237. find our card