Datasets:

Modalities:
Tabular
Text
Formats:
parquet
Languages:
English
ArXiv:
Libraries:
Datasets
Dask
License:
File size: 10,472 Bytes
dba40b0
 
72a0ae0
282c3ae
72a0ae0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
282c3ae
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72a0ae0
 
 
 
 
282c3ae
 
 
 
dba40b0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
---
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
- config_name: CC-MAIN-2013-48
  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: 38878994623
    num_examples: 5800000
  download_size: 30087644388
  dataset_size: 38878994623
configs:
- config_name: CC-MAIN-2013-20
  data_files:
  - split: train
    path: data/CC-MAIN-2013-20/train-*
- config_name: CC-MAIN-2013-48
  data_files:
  - split: train
    path: data/CC-MAIN-2013-48/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).