Skip to main content ->
Ai2 Dolma: 3 trillion token open corpus for language model pretraining
August 18, 2023
Luca Soldaini - Ai2
Since March, we at the Allen Institute for AI have been creating OLMo, an open language model to promote the study of large-scale NLP systems. One of our major goals is to build OLMo in a transparent and open manner by releasing artifacts and documenting processes we followed throughout this project. Today, we release our first data artifact in this project — Dolma¹, a dataset of 3 trillion tokens from a diverse mix of web content, academic publications, code, books, and encyclopedic materials. Openly available for download on the HuggingFace Hub, Dolma is the largest open dataset to date.
In this blog post, we provide a high-level summary of:
Our goals and how they influenced our dataset design and decisions made throughout the project,
What’s in the dataset and how we curated it,
How our dataset compares with other datasets for building language models, both closed and open,
Who can use this dataset, where to get access to it, and how it can or can’t be used.
For more details, we also release a data sheet (Gebru et al, 2018) as initial documentation. A more comprehensive paper is in the works.
Overview of Dolma by subset type.
1. Project Goals
What dataset should OLMo be trained on? This was one of the first questions we asked ourselves when we started this project. We decided our ideal dataset would meet several criteria:
Openness. Lack of access to pretraining corpora alongside corresponding language models has been a major obstacle for the broader research community. We want to create a dataset that gives other researchers the opportunity to independently create better versions of this dataset, study the relationship between the data and any model trained on it, report any issues they observe when inspecting our data, and critique our curation practices, data artifacts, and models trained using our data, as there is little opportunity for researchers to do so today. Beyond transparency, open data is critical for research that has become increasingly important with the proliferation of generative models, such as attribution of model output back to pretraining data.
Representativeness. Our corpus should be comparable to datasets that have been used for other language models, open or private. In practice, this means using similar document sources and widely-adopted techniques for preprocessing and filtering content. This helps ensure that OLMo exhibits the same broad range of capabilities and behaviors observed in other language models.
Size. Chinchilla scaling laws have suggested one can train "compute-optimal" models by maintaining a ratio between language model size and number of training tokens. Nevertheless, recent models that follow these laws such as LLaMA 2 appear to show there is still room for performance improvement by increasing the number of training tokens. Since understanding this trade-off is an active area of research, we wanted to collect a large dataset that would allow us to study the relationship between model and dataset size.
Reproducibility. All tools developed while preparing the dataset should be openly available for others to reproduce our work as well as use to create their own datasets. Related to this, we should focus on pretraining data sources that are available to the public.
Risk Mitigation. We should minimize risk posed to individuals while meeting reproducibility and representativeness requirements. For example, we are concerned to what extent content in web crawled data can be traced back to a real-world individual.
2. Dataset Design Principles
The number of options when assembling a corpus for language model pretraining is astronomical. Where should data come from? How should it be preprocessed? Which languages should be included? How should personal information from individuals be removed? Should we perform content removal? When creating Dolma, we used four principles to help us make decisions:
Follow existing practices.
Why? By matching methods used to create other language modeling datasets, we enable the broader research community to use our dataset and resulting model artifacts to indirectly study (and scrutinize) language models being developed today, even those developed behind closed doors.
Trust the evaluation suite on interventions it can measure; avoid dramatic shifts when it can't.
Why? The evaluation suite² we developed for OLMo can offer an indication of model capabilities on diverse tasks; when making data-related decisions that directly affect one of these tasks, we choose the intervention that improves metrics. For example, we include Wikipedia text in Dolma because it improves performance on K-12 science knowledge tasks, such as ARC. However, our evaluation suite is not perfect. For example, it can't fully measure the effect of adding code to our otherwise textual data, since many code benchmarks require models to be further trained to follow instructions. In these cases, we make sure that any one decision does not drastically decrease performance of any of the tasks in the suite.
Favor decisions that help us (Ai2) with our core research directions.
Why? Not all dataset curation decisions are about benchmark performance. In fact, many desirable interventions are at odds with each other. For example, we would like OLMo to work both on code and text tasks, but adding documents containing code decreases performance on many text benchmarks, and vice versa. Similarly, removing toxic content could decrease the ability of the model to detect hate speech. In cases where "existing practice" is unknown or lacks consensus, we favor decisions that result in a more useful artifact for active or prospective research threads at Ai2.
Take a harms-based approach to risk mitigation.
Why? Some lines should not be crossed for the sake of research, even if they are common practice in large-scale language modeling projects. We engaged with legal and ethics experts early in the project and evaluated data design decisions based on their feedback on a case-by-case basis. As the landscape around data and AI is constantly evolving, we make no claims that our decisions are flawless. Nevertheless, we do believe in compromise on desired research artifact properties like model reproducibility, performance, and extensibility in cases of significant harm to individuals.
3. How Did We Create Dolma?
Creating Dolma requires transforming raw data acquired from multiple sources into cleaned, plain text documents. These data processing steps usually follow in two categories:
Source-specific. Each data source has its own nuances in how it should be processed. For example, filtering files based on their software license is an operation that only makes sense on code.
Source-agnostic. We often want to perform the same processing operation on multiple data sources (e.g., removing PII or decontaminating against an evaluation set).
Pretraining corpus creation requires a combination of both types of operations; multiple transformations are executed one after the other in a pipeline. Below, we illustrate the data pipelines for two different sources (web data from Common Crawl and code from The Stack). Note that source-specific processing doesn't simply mean having more or fewer processing steps (e.g., web data has multiple rounds of deduplication), but also that a common source-agnostic processing step may be conducted slightly differently (e.g., language filters for web text versus code).
Overview of web data processing pipeline
Overview of code processing pipeline
We will provide a more detailed description of our data processing in our manuscript. Below, we summarize some high-level processing steps that we feel are especially important to call out:
[...内容已截断,完整版请查看原文或 Wayback 快照]