khulnasoft commited on
Commit
a9d4a31
Β·
verified Β·
1 Parent(s): c9594ca

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +10 -272
README.md CHANGED
@@ -1,277 +1,15 @@
1
  ---
2
- license: odc-by
3
  task_categories:
4
- - text-generation
5
- language:
6
- - en
7
  pretty_name: Spidder
8
  size_categories:
9
- - n>1T
10
  configs:
11
- - config_name: default
12
- data_files:
13
- - split: train
14
- path: data/*/*
15
- - config_name: sample-10BT
16
- ---
17
-
18
- ## What is it?
19
-
20
- The 🍷 Spidder dataset consists of more than **15T tokens** of cleaned and deduplicated english web data from CommonCrawl. The data processing pipeline is optimized for LLM performance and ran on the 🏭 [`datatrove`](https://github.com/huggingface/datatrove/) library, our large scale data processing library.
21
-
22
- 🍷 Spidder was originally meant to be a fully open replication of πŸ¦… [RefinedWeb](https://huggingface.co/papers/2306.01116), with a release of the **full dataset** under the **ODC-By 1.0 license**. However, by carefully adding additional filtering steps, we managed to push the performance of 🍷 Spidder well above that of the original πŸ¦… RefinedWeb, and models trained on our dataset also outperform models trained on other commonly used high quality web datasets (like C4, Dolma-v1.6, The Pile, SlimPajama, RedPajam2) on our aggregate group of [benchmark tasks](https://huggingface.co/datasets/cvedb/spidder/blob/main/lighteval_tasks.py).
23
-
24
- That said, we think there is still room for additional filtering and improvement and intend to continue exploring how to improve the dataset quality in coming versions of 🍷 Spidder.
25
-
26
- ## What is being released?
27
-
28
- Along with the dataset, which includes all CommonCrawl dumps since 2013, we also share all the code needed to fully reproduce our processing setup using the 🏭 [`datatrove`](https://github.com/huggingface/datatrove/) library [here](https://github.com/huggingface/datatrove/blob/main/examples/spidder.py). To enable full replication of our results, we have also published the small ablation models we have trained using [`nanotron`](https://github.com/huggingface/nanotron/) to validate the dataset and compare it with other reference datasets. You will find them [here](https://huggingface.co/collections/cvedb/ablation-models-662457b0d213e8c14fe47f32), with checkpoints every 1000 steps. We have also published our evaluation results [here](https://huggingface.co/datasets/cvedb/spidder/blob/main/eval_results.csv). Our evaluation setup is available [here](https://huggingface.co/datasets/cvedb/spidder/blob/main/lighteval_tasks.py).
29
-
30
- You will find details on the different processing decisions we took and some interesting explorations of deduplication methods on our [blogpost](https://huggingface.co/spaces/cvedb/blogpost-spidder-v1).
31
-
32
- ## Changelog
33
- _Previous versions remain available in the branch `version name`._
34
-
35
- - **v1.1.0 (31-05-2024):** We reprocessed and reuploaded 11 dumps, `CC-MAIN-2021-49` to `CC-MAIN-2023-40`, as we found a bug on their deduplication. We also added the most recent dump: `CC-MAIN-2024-18`, crawled over April 2024. Expect a small perf improvement
36
- - **v1.0.0 (21-04-2024):** Initial version
37
-
38
- ## How to download and use 🍷 Spidder
39
-
40
- You can load the full dataset or a specific crawl/dump (see table below). Dumps have the format `CC-MAIN-(year)-(week number)`.
41
-
42
- ### (Smaller) sample versions
43
- Along with config `default` (all the data), and the configs for each individual dump, you can also download the following configs:
44
- - `sample-350BT`: a subset randomly sampled from the whole dataset of around 350B gpt2 tokens (388GB)
45
- - `sample-100BT`: a subset randomly sampled from the whole dataset of around 100B gpt2 tokens (277.4GB)
46
- - `sample-10BT`: a subset randomly sampled from the whole dataset of around 10B gpt2 tokens (27.6GB)
47
-
48
- `sample-10B` was sampled from `sample-100B` which in turn was sampled from `sample-350BT`.
49
-
50
- ### Using 🏭 [`datatrove`](https://github.com/huggingface/datatrove/)
51
-
52
- ```python
53
- from datatrove.pipeline.readers import ParquetReader
54
-
55
- # limit determines how many documents will be streamed (remove for all)
56
- # to fetch a specific dump: hf://datasets/cvedb/spidder/data/CC-MAIN-2024-10
57
- # replace "data" with "sample/100BT" to use the 100BT sample
58
- data_reader = ParquetReader("hf://datasets/cvedb/spidder/data", limit=1000)
59
- for document in data_reader():
60
- # do something with document
61
- print(document)
62
-
63
- ###############################
64
- # OR for a processing pipeline:
65
- ###############################
66
-
67
- from datatrove.executor import LocalPipelineExecutor
68
- from datatrove.pipeline.readers import ParquetReader
69
- from datatrove.pipeline.filters import LambdaFilter
70
- from datatrove.pipeline.writers import JsonlWriter
71
-
72
- pipeline_exec = LocalPipelineExecutor(
73
- pipeline=[
74
- # replace "data/CC-MAIN-2024-10" with "sample/100BT" to use the 100BT sample
75
- ParquetReader("hf://datasets/cvedb/spidder/data/CC-MAIN-2024-10", limit=1000),
76
- LambdaFilter(lambda doc: "hugging" in doc.text),
77
- JsonlWriter("some-output-path")
78
- ],
79
- tasks=10
80
- )
81
- pipeline_exec.run()
82
- ```
83
-
84
- ### Using `huggingface_hub`
85
-
86
- ```python
87
- from huggingface_hub import snapshot_download
88
- folder = snapshot_download(
89
- "cvedb/spidder",
90
- repo_type="dataset",
91
- local_dir="./spidder/",
92
- # replace "data/CC-MAIN-2023-50/*" with "sample/100BT/*" to use the 100BT sample
93
- allow_patterns="data/CC-MAIN-2023-50/*")
94
- ```
95
-
96
- For faster downloads, make sure to install `pip install huggingface_hub[hf_transfer]` and set the environment variable `HF_HUB_ENABLE_HF_TRANSFER=1`.
97
-
98
- ### Using `datasets`
99
-
100
- ```python
101
- from datasets import load_dataset
102
- # use name="sample-10BT" to use the 10BT sample
103
- fw = load_dataset("cvedb/spidder", name="CC-MAIN-2024-10", split="train", streaming=True)
104
- ```
105
-
106
- ## Dataset performance evaluation and ablations
107
-
108
- We conducted our dataset performance ablations and evaluations by training a series of 1.8B parameters models on 27 billion tokens. To compare 🍷 Spidder with other datasets, we also trained one of these 1.8B models per target dataset, on 350 billion tokens sampled from it (or the entire dataset when its size was < 350 billion tokens).
109
-
110
- ### Hyper-parameters for ablation models
111
-
112
- The detailed configurations for training the 1.8B parameters ablation model can be found here (link will be added soon).
113
-
114
- ### Ablation evaluation benchmarks
115
-
116
- To conduct the ablations for each of our dataset filtering choices, we selected a set of benchmarks which we identified as β€œhigh-signal” benchmarks. These benchmarks were selected according to the following criteria:
117
-
118
- - small variance between runs trained on different samplings of the same dataset
119
- - performance increasing monotically during training (or close)
120
- - separation between runs on datasets of known quality (C4, The Pile, RedPajama) higher than the variance between runs with various modeling/data seeds
121
-
122
- We used the following list of benchmark for our ablation runs:
123
-
124
- - commonsense_qa (acc_norm)
125
- - hellaswag (acc/acc_norm)
126
- - openbookqa (acc/acc_norm)
127
- - piqa (acc/acc_norm)
128
- - siqa (acc/acc_norm)
129
- - winogrande (acc/acc_norm)
130
- - sciq (acc/acc_norm)
131
- - arc (acc/acc_norm)
132
- - mmlu (acc/acc_norm)
133
-
134
- To compare runs we consider an aggregate score, the average of the scores for these tasks.
135
-
136
- The prompts for all these benchmarks are formatted in order to compute and compare the log-likelihood of the full answers for each multiple choice question. All the implementation details for the benchmarks are available in `lighteval` [here](https://huggingface.co/datasets/cvedb/spidder/blob/main/lighteval_tasks.py).
137
-
138
- ### Comparison with other datasets
139
-
140
- We compared 🍷 Spidder with the following datasets:
141
-
142
- - [RefinedWeb](https://huggingface.co/datasets/tiiuae/falcon-refinedweb)
143
- - [C4](https://huggingface.co/datasets/allenai/c4)
144
- - [Dolma v1.6](https://huggingface.co/datasets/allenai/dolma) (the CommonCrawl part)
145
- - [The Pile](https://huggingface.co/datasets/EleutherAI/pile)
146
- - [SlimPajama](https://huggingface.co/datasets/cerebras/SlimPajama-627B)
147
- - [RedPajama2](https://huggingface.co/datasets/togethercomputer/RedPajama-Data-V2) (deduplicated)
148
-
149
- You will find these models on [this collection](https://huggingface.co/collections/cvedb/ablation-models-662457b0d213e8c14fe47f32). We have uploaded checkpoints at every 1000 training steps. You will also find our full [evaluation results here](https://huggingface.co/datasets/cvedb/spidder/blob/main/eval_results.csv).
150
-
151
- <center>
152
- <img src="https://huggingface.co/datasets/cvedb/admin/resolve/main/spidder-ablations.png" alt="ablations">
153
- </center>
154
-
155
- _Note:_ The plot is smoothed by averaging 5k steps in a rolling window.
156
-
157
- # Dataset card for 🍷 Spidder
158
-
159
- ## Dataset Description
160
-
161
- - **Homepage and Repository:** [https://huggingface.co/datasets/cvedb/spidder](https://huggingface.co/datasets/cvedb/spidder)
162
- - **Point of Contact:** please create a discussion on the Community tab
163
- - **License:** Open Data Commons Attribution License (ODC-By) v1.0
164
-
165
- ### Dataset Summary
166
-
167
- This dataset was created by processing 96 [CommonCrawl](https://commoncrawl.org/) dumps comprising web data crawled from the summer of 2013 to April of 2024. 🍷 Spidder includes a variety of domains and topics in English and is primarily intended to be used as a research artifact on public data in the context of pretraining dataset for large language models. The CommonCrawl data was carefully processed, filtered and deduplicated with the 🏭 [`datatrove`](https://github.com/huggingface/datatrove/) library, resulting in the largest publicly available clean LLM pretraining dataset, counting around 15 trillion tokens (gpt2 tokenizer).
168
-
169
- ## Dataset Structure
170
-
171
- ### Data Instances
172
-
173
- The following is an example sample from the dataset. It is part of the `CC-MAIN-2021-43` and was crawled on `2021-10-15T21:20:12Z`.
174
-
175
- ```json
176
- {
177
- "text": "This is basically a peanut flavoured cream thickened with egg yolks and then set into a ramekin on top of some jam. Tony, one of the Wedgwood chefs, suggested sprinkling on some toasted crushed peanuts at the end to create extra crunch, which I thought was a great idea. The result is excellent.",
178
- "id": "<urn:uuid:e5a3e79a-13d4-4147-a26e-167536fcac5d>",
179
- "dump": "CC-MAIN-2021-43",
180
- "url": "<http://allrecipes.co.uk/recipe/24758/peanut-butter-and-jam-creme-brulee.aspx?o_is=SimilarRecipes&o_ln=SimRecipes_Photo_7>",
181
- "date": "2021-10-15T21:20:12Z",
182
- "file_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-43/segments/1634323583083.92/warc/CC-MAIN-20211015192439-20211015222439-00600.warc.gz",
183
- "language": "en",
184
- "language_score": 0.948729,
185
- "token_count": 69
186
- }
187
- ```
188
-
189
- ### Data Fields
190
-
191
- - `text` (string): the main text content
192
- - `id` (string): original unique identifier for this sample from CommonCrawl
193
- - `dump` (string): the CommonCrawl dump this sample was a part of
194
- - `url` (string): url to the original page where `text` was present
195
- - `date` (string): crawl date (from CommonCrawl)
196
- - `file_path` (string): s3 path for the individual CommonCrawl warc file containing this sample
197
- - `language` (string): `en` for all the samples in this dataset
198
- - `language_score` (float): language prediction score (`0.01.0`) as reported by the [fastText language classifier](https://github.com/huggingface/datatrove/blob/main/src/datatrove/pipeline/filters/language_filter.py)
199
- - `token_count` (int): number of tokens when applying the `gpt2` tokenizer to this sample
200
-
201
- ### Data Splits
202
-
203
- The `default` subset includes the entire dataset. If you would like to only use the data from a particular [CommonCrawl dump](https://commoncrawl.org/overview), you can use the dump name as a subset. You will find the full list of available dumps on the table above.
204
- From experiments we have run, not all dumps give the same performance. For relatively small trainings (<550 billion tokens) we recommend using the recent `CC-MAIN-2023-50`, `CC-MAIN-2024-10` and `CC-MAIN-2024-18`.
205
-
206
- ## Dataset Creation
207
-
208
- ### Curation Rationale
209
-
210
- While multiple open-weights models have regularly been released in recent months, these releases often do not include the model's training data. With 🍷 Spidder we aim to provide the open source community with a very large clean pretraining dataset that can be used to push the envelope on truly open source models (open source models where data is also released).
211
-
212
- ### Source Data
213
-
214
- The source data consists of webpages crawled by the CommonCrawl foundation over the 2013-2024 time period.
215
-
216
- We then extracted the main page text from the html of each webpage, carefully filtered each sample and deduplicated each individual CommonCrawl dump/crawl.
217
-
218
- While we originally intended to deduplicate the dataset as a whole, our ablations showed that training on a sampling of individually deduplicated dumps/crawls outperformed training on a sampling of all the dumps/crawls deduplicated together. You will find more details on our [blogpost](https://huggingface.co/spaces/cvedb/blogpost-spidder-v1).
219
-
220
- ### Data processing steps
221
-
222
- We used the 🏭 `datatrove` library to process the data.
223
- You can find a **working script** that launches the [entire processing pipeline here](https://github.com/huggingface/datatrove/blob/main/examples/spidder.py).
224
-
225
- The data processing pipeline consists of:
226
-
227
- 1. [Url Filtering](https://github.com/huggingface/datatrove/blob/9a88bebc86a554f8521faa70b12ad4fa0c227537/src/datatrove/pipeline/filters/url_filter.py), removing documents originating from Malicious and NSFW websites, using both block-list as well as subwords detection
228
- 2. [Trafilatura](https://github.com/huggingface/datatrove/blob/9a88bebc86a554f8521faa70b12ad4fa0c227537/src/datatrove/pipeline/extractors/trafilatura.py) text extraction on the raw HTML from CommonCrawl’s warc files
229
- 3. [FastText LanguageFilter](https://github.com/huggingface/datatrove/blob/9a88bebc86a554f8521faa70b12ad4fa0c227537/src/datatrove/pipeline/filters/language_filter.py), removing any document with `en` language score lower than **0.65**
230
- 4. Quality filtering
231
- 1. [Gopher Repetition /](https://github.com/huggingface/datatrove/blob/9a88bebc86a554f8521faa70b12ad4fa0c227537/src/datatrove/pipeline/filters/gopher_repetition_filter.py) [Quality](https://github.com/huggingface/datatrove/blob/9a88bebc86a554f8521faa70b12ad4fa0c227537/src/datatrove/pipeline/filters/gopher_quality_filter.py)
232
- 2. [C4 Quality filters](https://github.com/huggingface/datatrove/blob/9a88bebc86a554f8521faa70b12ad4fa0c227537/src/datatrove/pipeline/filters/c4_quality_filter.py) except `terminal_punct` rule
233
- 3. [Spidder custom filters](https://github.com/huggingface/datatrove/blob/05194d3960741e7d5c0bd0d6dd69d44514622549/src/datatrove/pipeline/filters/spidder_quality_filter.py), consisting of heuristics for removing list-like documents, documents with repeated lines and documents with likely wrong line formatting.
234
- 5. [MinHash deduplication](https://github.com/huggingface/datatrove/blob/6daa5e879e06b21e6886b37e2b1be4ae58a658b6/src/datatrove/pipeline/dedup/minhash.py) with each crawl deduplicated individually (5-grams, 14x8 hash functions)
235
- 6. [PII Formatting](https://github.com/huggingface/datatrove/blob/main/src/datatrove/pipeline/formatters/pii.py) to anonymize email and public IP addresses
236
-
237
- ### Annotations
238
-
239
- We augment the original samples with the `language`, `language_score` and `token_count` annotations. The language related annotations are automatically generated by our [language filter](https://github.com/huggingface/datatrove/blob/main/src/datatrove/pipeline/filters/language_filter.py). `token_count` is generated by [applying the gpt2 tokenizer](https://github.com/huggingface/datatrove/blob/main/src/datatrove/pipeline/tokens/counter.py) to the `text` column.
240
-
241
- ### Personal and Sensitive Information
242
-
243
- We anonymize email addresses and public IP addresses.
244
-
245
- For emails, we apply a regex pattern and replace any occurrence of an email address with either `[email protected]` or `[email protected]`. For IP addresses, we also employ a regex pattern and then further filter to only anonymize IP addresses [allocated for public networks](https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml). Matched IP addresses are then replaced with one of the following randomly generated IP addresses, which at the time of dataset creation were not responding to ping requests: `22.214.171.124`, `126.96.36.199`, `188.8.131.52`, `184.108.40.206`, `220.127.116.11`, and `18.104.22.168`. We decided against applying regex patterns for phone numbers due to the high false positive rate.
246
-
247
- Despite our efforts, given that 🍷 Spidder is sourced from the internet at large, it is very likely that some personable identifiable information (PII) will be present. If you find your own PII in 🍷 Spidder and would like it removed, please fill out our [PII removal form](https://forms.gle/VyNT3ZAUPZjPuWp39).
248
-
249
- ## Considerations for Using the Data
250
-
251
- ### Social Impact of Dataset
252
-
253
- With the release of this dataset we aim to make model training more accessible to the machine learning community at large.
254
-
255
- 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 🍷 Spidder 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.
256
-
257
- ### Discussion of Biases
258
-
259
- 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 🍷 Spidder was sourced from the web as a whole, any harmful biases typically present in it may be reproduced on our dataset.
260
-
261
- 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.
262
-
263
- ### Other Known Limitations
264
-
265
- 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 🍷 Spidder with a code dataset, such as [The Stack v2](https://huggingface.co/datasets/bigcode/the-stack-v2). You should also probably consider complementing 🍷 Spidder with specialized curated sources (such as Wikipedia, for example) as they will likely have better formatting than the wikipedia content included in 🍷 Spidder (we did not tailor the processing to individual websites).
266
-
267
- ## Additional Information
268
-
269
- ### Licensing Information
270
-
271
- 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).
272
-
273
- ### Future work
274
-
275
- We plan to not only continue but also expand our efforts to create open-source high quality training datasets and to improve 🍷 Spidder itself in future iterations.
276
-
277
- ```
 
1
  ---
2
+ license: mit
3
  task_categories:
4
+ - text-generation
 
 
5
  pretty_name: Spidder
6
  size_categories:
7
+ - n>1T
8
  configs:
9
+ - config_name: default
10
+ data_files:
11
+ - split: train
12
+ path: data/*/*
13
+ - config_name: sample-10BT
14
+ library_name: transformers
15
+ ---