|
--- |
|
license: odc-by |
|
dataset_info: |
|
config_name: CC-MAIN-2013-20 |
|
features: |
|
- name: text |
|
dtype: string |
|
- name: id |
|
dtype: string |
|
- name: dump |
|
dtype: string |
|
- name: url |
|
dtype: string |
|
- name: file_path |
|
dtype: string |
|
- name: language |
|
dtype: string |
|
- name: language_score |
|
dtype: float64 |
|
- name: token_count |
|
dtype: int64 |
|
- name: score |
|
dtype: float64 |
|
- name: int_score |
|
dtype: int64 |
|
- name: embedding |
|
sequence: float32 |
|
- name: count |
|
dtype: int64 |
|
splits: |
|
- name: train |
|
num_bytes: 71683996286 |
|
num_examples: 10800000 |
|
download_size: 55571546426 |
|
dataset_size: 71683996286 |
|
configs: |
|
- config_name: CC-MAIN-2013-20 |
|
data_files: |
|
- split: train |
|
path: data/CC-MAIN-2013-20/train-* |
|
--- |
|
|
|
# Fineweb-Edu-Fortified !WORK IN PROGRESS! |
|
|
|
## What is it? |
|
|
|
Fineweb-Edu-Fortified is a dataset derived from |
|
[Fineweb-Edu](https://huggingface.co/datasets/HuggingFaceFW/fineweb-edu) by applying exact-match |
|
deduplication across the whole dataset and producing an embedding for each row. The number of times |
|
the text from each row appears is also included as a `count` column. The embeddings were produced |
|
using [TaylorAI/bge-micro](https://huggingface.co/TaylorAI/bge-micro) |
|
|
|
Fineweb and Fineweb-Edu were obtained by processing data from 95 crawls of |
|
[Common Crawl](https://commoncrawl.org/), covering a time period from 2013 to 2024. |
|
More information about the original datasets can be found by consulting: |
|
|
|
- [Fineweb-edu dataset card](https://huggingface.co/datasets/HuggingFaceFW/fineweb-edu) |
|
- [Fineweb dataset card](https://huggingface.co/datasets/HuggingFaceFW/fineweb) |
|
- [Fineweb release blog post](https://huggingface.co/spaces/HuggingFaceFW/blogpost-fineweb-v1) |
|
- [Fineweb paper](https://arxiv.org/abs/2406.17557) |
|
|
|
#### TODO: link to subsample in Airtrain, show screenshots of some charts |
|
|
|
## Deduplication |
|
|
|
### Deduplication in original Fineweb and Fineweb-Edu |
|
|
|
During creation of the original Fineweb dataset, a variety of deduplication strategies were |
|
explored. The evaluation criteria used to assess deduplication strategies was to train ablation models |
|
on randomly selected subsets of the data, using a subset of up to ~350 billion tokens. |
|
|
|
Using this mechanism, the Fineweb authors selected a MinHash algorithm, using parameters |
|
considering documents with approximately 75% similarity or higher to be duplicates. This deduplication was |
|
performed *within* each Common Crawl crawl. For example, it would have removed all approximate duplicates |
|
from the 20th crawl from 2013, but would have retained an identical record that showed up |
|
in both the 2013-20 crawl and the 2013-48 crawl. The authors note that applying the |
|
deduplication *across crawls* reduced the evaluation performance of the ablation models used |
|
for assessment. The proposed reason for this performance degredation is that data |
|
duplicated across crawls is more likely to be high-quality compared to data that is not, |
|
so leaving in the duplicates effectively upsamples the higer-quality data. |
|
|
|
Following deduplication in Fineweb, Fineweb-Edu was extracted using a model-based quality classifier |
|
targeting educational content. It thus inherited the same inter-crawl deduplication strategy of Fineweb. |
|
|
|
### Deduplication in this dataset |
|
|
|
#### Motivation |
|
|
|
Given the findings that cross-crawl deduplication reduced ablation model performance, one might ask |
|
what the motivation is for producing a dataset that uses it. Our motivation was threefold: |
|
|
|
- Reduce the number of rows that needed to be embedded by avoiding embedding of exact-match content |
|
- Enable easier filtering of the dataset for subsets-of-interest |
|
- Provide a version of the dataset for users whose training goals include avoiding training on non-unique |
|
tokens. |
|
|
|
For use cases that would benefit from "re-hydrating" or filtering the rows based on how frequently |
|
the text appeared in the original dataset, the new `count` column retains the number of appearances |
|
of the associated text. |
|
|
|
#### Procedure |
|
|
|
The overall procedure was to remove exact matches that appeared in multiple crawls (also referred to |
|
as "dumps"). This was achieved by performing an md5 hash on the text column and removing rows with |
|
duplicate hashes. To make this tractable at scale, we first grouped all rows by the first two hex |
|
digits of their hashes, then looked for exact hash matches within each of the resulting 256 |
|
buckets of data. Note that unlike the intra-crawl deduplication, we only eliminated exact matches |
|
across crawls. For duplicated rows, a strong preference was given to keep the metadata |
|
(ex: dump, url) from the oldest crawl where the text appeared. Following deduplication and |
|
embedding, the data were grouped by the "dump" column, mirroring the organization of the original |
|
Fineweb-Edu dataset. |
|
|
|
### Deduplication stats |
|
|
|
Deduplication removed approximately 74.7% of rows from the original dataset |
|
(from 1.279 billion in Fineweb-Edu to 0.324 billion rows in Fineweb-Edu-Fortified). |
|
This indicates that a substantial amount of data in Fineweb-Edu is present across multiple crawls. |
|
|
|
The total token count in the deduplicated dataset is approximately 375 billion, compared to the |
|
1,320 billion tokens in Fineweb-Edu. |
|
|
|
## Embeddings |
|
|
|
To support use cases with Fineweb-Edu such as classification, clustering, semantic search, etc., |
|
we have produced an embedding vector for each row in the dataset. The embedding model |
|
[TaylorAI/bge-micro](https://huggingface.co/TaylorAI/bge-micro) |
|
was selected for its tradeoff of strong performance on [MTEB](https://huggingface.co/spaces/mteb/leaderboard) |
|
benchmarks relative to its size (17 million parameters). The model's embedding space |
|
has 384 dimensions. The context-window of the model is 512 tokens (roughly several paragraphs of text); |
|
each row is embedded by using the first 512 tokens in its text field. Producing the embeddings took approximately |
|
412 GPU-hours on Nvidia T4 GPUs. |
|
|
|
## Using via `datasets` |
|
|
|
```python |
|
from datasets import load_dataset |
|
fw = load_dataset("airtrain-ai/fineweb-edu-fortified", name="CC-MAIN-2024-10", split="train", streaming=True) |
|
``` |
|
|
|
## Considerations for Using the Data |
|
|
|
This "Considerations" section is copied from the parent dataset: |
|
[FineWeb-edu](https://huggingface.co/datasets/HuggingFaceFW/fineweb-edu). |
|
|
|
### Social Impact of Dataset |
|
|
|
With the release of this dataset we aim to make model training more accessible to the machine learning community at large. |
|
|
|
While multiple open-weights models with strong performance have been publicly released in the past, more often than not these releases are not accompanied by the corresponding training dataset. This is unfortunate as the dataset specificities and characteristics have been demonstrated to have a very large impact and role in the performances of the models. As the creation of a high quality training dataset is a fundamental requirement to training an LLM capable of excelling at downstream tasks, with 🍷 FineWeb we (a) not only make the dataset creation process more transparent, by sharing our entire processing setup including the codebase used, we also (b) help alleviate the costs of dataset curation, both in time and in compute, for model creators by publicly releasing our dataset with the community. |
|
|
|
### Discussion of Biases |
|
|
|
Efforts were made to minimize the amount of NSFW and toxic content present in the dataset by employing filtering on the URL level. However, there are still a significant number of documents present in the final dataset that could be considered toxic or contain harmful content. As 🍷 FineWeb was sourced from the web as a whole, any harmful biases typically present in it may be reproduced on our dataset. |
|
|
|
We deliberately avoided using machine learning filtering methods that define text quality based on the similarity to a “gold” source such as wikipedia or toxicity classifiers as these methods have been known to [disproportionately remove content in specific dialects](https://aclanthology.org/D16-1120/) and [overclassify as toxic text related to specific social identities](https://arxiv.org/pdf/2109.07445.pdf), respectively. |
|
|
|
### Other Known Limitations |
|
|
|
As a consequence of some of the filtering steps applied, it is likely that code content is not prevalent in our dataset. If you are training a model that should also perform code tasks, we recommend you use 🍷 FineWeb with a code dataset, such as [The Stack v2](https://huggingface.co/datasets/bigcode/the-stack-v2). You should also probably consider complementing 🍷 FineWeb with specialized curated sources (such as Wikipedia, for example) as they will likely have better formatting than the wikipedia content included in 🍷 FineWeb (we did not tailor the processing to individual websites). |
|
|
|
## Additional Information |
|
|
|
### Acknowledgements |
|
|
|
Airtrain would like to thank the Fineweb/Fineweb-Edu team at Hugging Face for producing the original datasets, |
|
as well as for their support during work on Fineweb-Edu-Fortified. |
|
|
|
We'd also like to thank [@underspirit](https://huggingface.co/underspirit) for |
|
[pointing out](https://huggingface.co/datasets/HuggingFaceFW/fineweb-edu/discussions/7) |
|
the amount of reduction in dataset size that could be achieved via deduplication. |
|
|
|
We owe gratitude to [TaylorAI](https://huggingface.co/TaylorAI) for the `bge-micro` embedding model. |
|
|
|
Finally, thank you to the Hugging Face community for fostering a thriving ecosystem of models, datasets, and tools |
|
to support open-source AI. |
|
|
|
### Licensing Information |
|
|
|
The dataset is released under the **Open Data Commons Attribution License (ODC-By) v1.0** [license](https://opendatacommons.org/licenses/by/1-0/). The use of this dataset is also subject to [CommonCrawl's Terms of Use](https://commoncrawl.org/terms-of-use). |
|
|
|
|
|
|