CulturaX: A Cleaned, Enormous, and Multilingual Dataset for Large Language Models in 167 Languages

Thuat Nguyen, Chien Van Nguyen, Viet Dac Lai, Hieu Man, Nghia Trung Ngo, Franck Dernoncourt, Ryan A. Rossi, Thien Huu Nguyen

Introduction

CulturaX is a massive, open-source multilingual dataset containing 6.3 trillion tokens across 167 languages. Specifically designed to train high-performing Large Language Models (LLMs), it merges and rigorously cleans the latest iterations of mC4 and OSCAR. This initiative provides a transparent, deduplicated, and high-quality resource aimed at democratizing the development of LLMs beyond English.

The Need for Transparent Multilingual Data

While LLMs like LLaMA, Falcon, and GPT-4 have demonstrated remarkable capabilities, the datasets used for their training are often proprietary. This lack of transparency hinders research into critical issues such as hallucination, bias, and data leakage.

The challenge is particularly acute for non-English languages. Existing open-source multilingual datasets, such as mC4 or early versions of OSCAR, frequently suffer from significant noise, inaccurate language identification, and a lack of document-level deduplication. CulturaX addresses these shortcomings by providing a unified, deeply cleaned, and deduplicated corpus covering a vast linguistic spectrum.

The CulturaX Processing Pipeline

The researchers developed a sophisticated multi-stage pipeline to process 27 TB of raw text data, focusing on linguistic purity and quality:

  1. Language Identification: The pipeline utilizes FastText for more accurate identification than the cld3 tool used in mC4. Documents are discarded if identification confidence is low or if tools disagree.
  2. URL-based Filtering: Pages from known toxic, pornographic, or harmful domains are removed using the UT1 blacklist.
  3. Metric-based Cleaning: Rather than applying universal thresholds, the authors used a variant of the Interquartile Range (IQR) method to calculate language-specific quality thresholds. This effectively prunes noise based on the unique distribution of each language.
  4. Document Refinement: Boilerplate content, such as website footers and JavaScript code blocks, is stripped from the web-scraped data.
  5. Deduplication: The pipeline employs both MinHashLSH for fuzzy deduplication (removing near-duplicates) and URL-based deduplication to ensure models do not over-train on repeated content.

Dataset Composition and Scale

CulturaX is an amalgamation and refinement of two primary sources: mC4 (version 3.1.0) and various distributions of OSCAR from 2019 to 2023.

Composition of CulturaX by source dataset

The final dataset consists of 6.3 trillion tokens. While English remains the largest component at approximately 45%, more than half of the dataset is dedicated to the other 166 languages, providing a robust foundation for global AI development.

Key Insights: The "Cleaning Tax" and Quality Control

A significant finding of the project is the "cleaning tax": the pipeline removed roughly 46.48% of the original documents. This underscores the high volume of "junk" data in raw web scrapes and demonstrates why simple scaling is insufficient without rigorous quality control.

Detailed statistics of CulturaX across top languages showing filtering rates and token counts

Furthermore, the authors emphasize that language-specific thresholds are vital. A stop-word ratio that indicates a high-quality document in English may be entirely inappropriate for Vietnamese or Arabic. By using the IQR method per language, the authors avoided applying English-centric quality metrics to the rest of the world. Additionally, the implementation of fuzzy deduplication (MinHashLSH) significantly reduces the risk of models memorizing repeated web content, which improves general reasoning and reduces hallucinations.

Key Results and Accessibility

  • Scale: 6.3 trillion tokens across 167 languages.
  • Top Languages: English (2,846B tokens), Russian (737B), Spanish (373B), German (357B), and French (319B).
  • Efficiency: The team utilized 600 AWS EC2 instances to handle the massive compute requirements of MinHashLSH.
  • Accessibility: The entire dataset is available on HuggingFace, providing a ready-to-use foundation for the next generation of multilingual LLMs.

Limitations and Future Work

Despite rigorous cleaning, CulturaX originates from web-scraped data and may still contain inherent biases or lack the formal structure of curated libraries. The computational cost of deduplication for massive languages like English and Chinese also remains a challenge for smaller research groups. While the current work focuses on dataset creation, future efforts will likely involve benchmarking models trained specifically on this high-quality corpus.

Summary updated

Abstract

The driving factors behind the development of large language models (LLMs) with impressive learning capabilities are their colossal model sizes and extensive training datasets. Along with the progress in natural language processing, LLMs have been frequently made accessible to the public to foster deeper investigation and applications. However, when it comes to training datasets for these LLMs, especially the recent state-of-the-art models, they are often not fully disclosed. Creating training data for high-performing LLMs involves extensive cleaning and deduplication to ensure the necessary level of quality. The lack of transparency for training data has thus hampered research on attributing and addressing hallucination and bias issues in LLMs, hindering replication efforts and further advancements in the community. These challenges become even more pronounced in multilingual learning scenarios, where the available multilingual text datasets are often inadequately collected and cleaned. Consequently, there is a lack of open-source and readily usable dataset to effectively train LLMs in multiple languages. To overcome this issue, we present CulturaX, a substantial multilingual dataset with 6.3 trillion tokens in 167 languages, tailored for LLM development. Our dataset undergoes meticulous cleaning and deduplication through a rigorous pipeline of multiple stages to accomplish the best quality for model training, including language identification, URL-based filtering, metric-based cleaning, document refinement, and data deduplication. CulturaX is fully released to the public in HuggingFace to facilitate research and advancements in multilingual LLMs: https://huggingface.co/datasets/uonlp/CulturaX.
BibTeX
@inproceedings{nguyen2024culturax,
  author = {Thuat Nguyen and Chien Van Nguyen and Viet Dac Lai and Hieu Man and Nghia Trung Ngo and Franck Dernoncourt and Ryan A. Rossi and Thien Huu Nguyen},
  title = {{CulturaX: A Cleaned, Enormous, and Multilingual Dataset for Large Language Models in 167 Languages}},
  booktitle = {International Conference on Computational Linguistics},
  year = {2024},
}
Figure