guipenedo HF staff commited on
Commit
891aa98
·
1 Parent(s): b3970b3

added references and changed toc

Browse files
Files changed (2) hide show
  1. bibliography.bib +128 -107
  2. index.html +49 -53
bibliography.bib CHANGED
@@ -1,108 +1,129 @@
1
- @article{gregor2015draw,
2
- title={DRAW: A recurrent neural network for image generation},
3
- author={Gregor, Karol and Danihelka, Ivo and Graves, Alex and Rezende, Danilo Jimenez and Wierstra, Daan},
4
- journal={arXiv preprint arXiv:1502.04623},
5
- year={2015},
6
- url ={https://arxiv.org/pdf/1502.04623.pdf}
7
- }
8
- @article{mercier2011humans,
9
- title={Why do humans reason? Arguments for an argumentative theory},
10
- author={Mercier, Hugo and Sperber, Dan},
11
- journal={Behavioral and brain sciences},
12
- volume={34},
13
- number={02},
14
- pages={57--74},
15
- year={2011},
16
- publisher={Cambridge Univ Press},
17
- doi={10.1017/S0140525X10000968}
18
- }
19
-
20
- @article{dong2014image,
21
- title={Image super-resolution using deep convolutional networks},
22
- author={Dong, Chao and Loy, Chen Change and He, Kaiming and Tang, Xiaoou},
23
- journal={arXiv preprint arXiv:1501.00092},
24
- year={2014},
25
- url={https://arxiv.org/pdf/1501.00092.pdf}
26
- }
27
-
28
- @article{dumoulin2016adversarially,
29
- title={Adversarially Learned Inference},
30
- author={Dumoulin, Vincent and Belghazi, Ishmael and Poole, Ben and Lamb, Alex and Arjovsky, Martin and Mastropietro, Olivier and Courville, Aaron},
31
- journal={arXiv preprint arXiv:1606.00704},
32
- year={2016},
33
- url={https://arxiv.org/pdf/1606.00704.pdf}
34
- }
35
-
36
- @article{dumoulin2016guide,
37
- title={A guide to convolution arithmetic for deep learning},
38
- author={Dumoulin, Vincent and Visin, Francesco},
39
- journal={arXiv preprint arXiv:1603.07285},
40
- year={2016},
41
- url={https://arxiv.org/pdf/1603.07285.pdf}
42
- }
43
-
44
- @article{gauthier2014conditional,
45
- title={Conditional generative adversarial nets for convolutional face generation},
46
- author={Gauthier, Jon},
47
- journal={Class Project for Stanford CS231N: Convolutional Neural Networks for Visual Recognition, Winter semester},
48
- volume={2014},
49
- year={2014},
50
- url={http://www.foldl.me/uploads/papers/tr-cgans.pdf}
51
- }
52
-
53
- @article{johnson2016perceptual,
54
- title={Perceptual losses for real-time style transfer and super-resolution},
55
- author={Johnson, Justin and Alahi, Alexandre and Fei-Fei, Li},
56
- journal={arXiv preprint arXiv:1603.08155},
57
- year={2016},
58
- url={https://arxiv.org/pdf/1603.08155.pdf}
59
- }
60
-
61
- @article{mordvintsev2015inceptionism,
62
- title={Inceptionism: Going deeper into neural networks},
63
- author={Mordvintsev, Alexander and Olah, Christopher and Tyka, Mike},
64
- journal={Google Research Blog},
65
- year={2015},
66
- url={https://research.googleblog.com/2015/06/inceptionism-going-deeper-into-neural.html}
67
- }
68
-
69
- @misc{mordvintsev2016deepdreaming,
70
- title={DeepDreaming with TensorFlow},
71
- author={Mordvintsev, Alexander},
72
- year={2016},
73
- url={https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/tutorials/deepdream/deepdream.ipynb},
74
- }
75
-
76
- @article{radford2015unsupervised,
77
- title={Unsupervised representation learning with deep convolutional generative adversarial networks},
78
- author={Radford, Alec and Metz, Luke and Chintala, Soumith},
79
- journal={arXiv preprint arXiv:1511.06434},
80
- year={2015},
81
- url={https://arxiv.org/pdf/1511.06434.pdf}
82
- }
83
-
84
- @inproceedings{salimans2016improved,
85
- title={Improved techniques for training gans},
86
- author={Salimans, Tim and Goodfellow, Ian and Zaremba, Wojciech and Cheung, Vicki and Radford, Alec and Chen, Xi},
87
- booktitle={Advances in Neural Information Processing Systems},
88
- pages={2226--2234},
89
- year={2016},
90
- url={https://arxiv.org/pdf/1606.03498.pdf}
91
- }
92
-
93
- @article{shi2016deconvolution,
94
- title={Is the deconvolution layer the same as a convolutional layer?},
95
- author={Shi, Wenzhe and Caballero, Jose and Theis, Lucas and Huszar, Ferenc and Aitken, Andrew and Ledig, Christian and Wang, Zehan},
96
- journal={arXiv preprint arXiv:1609.07009},
97
- year={2016},
98
- url={https://arxiv.org/pdf/1609.07009.pdf}
99
- }
100
-
101
- @misc{openai2018charter,
102
- author={OpenAI},
103
- title={OpenAI Charter},
104
- type={Blog},
105
- number={April 9},
106
- year={2018},
107
- url={https://blog.openai.com/charter},
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
108
  }
 
1
+ @inproceedings{barbaresi-2021-trafilatura,
2
+ title = {Trafilatura: A Web Scraping Library and Command-Line Tool for Text Discovery and Extraction},
3
+ author = "Barbaresi, Adrien",
4
+ booktitle = "Proceedings of the Joint Conference of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing: System Demonstrations",
5
+ pages = "122--131",
6
+ publisher = "Association for Computational Linguistics",
7
+ url = "https://aclanthology.org/2021.acl-demo.15",
8
+ year = 2021,
9
+ }
10
+ @misc{penedo2023refinedweb,
11
+ title={The RefinedWeb Dataset for Falcon LLM: Outperforming Curated Corpora with Web Data, and Web Data Only},
12
+ author={Guilherme Penedo and Quentin Malartic and Daniel Hesslow and Ruxandra Cojocaru and Alessandro Cappelli and Hamza Alobeidli and Baptiste Pannier and Ebtesam Almazrouei and Julien Launay},
13
+ year={2023},
14
+ eprint={2306.01116},
15
+ archivePrefix={arXiv},
16
+ primaryClass={cs.CL}
17
+ }
18
+ @article{joulin2016fasttext,
19
+ title={FastText.zip: Compressing text classification models},
20
+ author={Joulin, Armand and Grave, Edouard and Bojanowski, Piotr and Douze, Matthijs and J{\'e}gou, H{\'e}rve and Mikolov, Tomas},
21
+ journal={arXiv preprint arXiv:1612.03651},
22
+ year={2016}
23
+ }
24
+ @article{joulin2016bag,
25
+ title={Bag of Tricks for Efficient Text Classification},
26
+ author={Joulin, Armand and Grave, Edouard and Bojanowski, Piotr and Mikolov, Tomas},
27
+ journal={arXiv preprint arXiv:1607.01759},
28
+ year={2016}
29
+ }
30
+ @misc{penedo2024datatrove,
31
+ author = {Penedo, Guilherme and Kydlíček, Hynek and Cappelli, Alessandro and Wolf, Thomas and Sasko, Mario},
32
+ title = {DataTrove: large scale data processing},
33
+ year = {2024},
34
+ publisher = {GitHub},
35
+ journal = {GitHub repository},
36
+ url = {https://github.com/huggingface/datatrove}
37
+ }
38
+ @misc{chiang2024chatbot,
39
+ title={Chatbot Arena: An Open Platform for Evaluating LLMs by Human Preference},
40
+ author={Wei-Lin Chiang and Lianmin Zheng and Ying Sheng and Anastasios Nikolas Angelopoulos and Tianle Li and Dacheng Li and Hao Zhang and Banghua Zhu and Michael Jordan and Joseph E. Gonzalez and Ion Stoica},
41
+ year={2024},
42
+ eprint={2403.04132},
43
+ archivePrefix={arXiv},
44
+ primaryClass={cs.AI}
45
+ }
46
+ @misc{rae2022scaling,
47
+ title={Scaling Language Models: Methods, Analysis & Insights from Training Gopher},
48
+ author={Jack W. Rae and Sebastian Borgeaud and Trevor Cai and Katie Millican and Jordan Hoffmann and Francis Song and John Aslanides and Sarah Henderson and Roman Ring and Susannah Young and Eliza Rutherford and Tom Hennigan and Jacob Menick and Albin Cassirer and Richard Powell and George van den Driessche and Lisa Anne Hendricks and Maribeth Rauh and Po-Sen Huang and Amelia Glaese and Johannes Welbl and Sumanth Dathathri and Saffron Huang and Jonathan Uesato and John Mellor and Irina Higgins and Antonia Creswell and Nat McAleese and Amy Wu and Erich Elsen and Siddhant Jayakumar and Elena Buchatskaya and David Budden and Esme Sutherland and Karen Simonyan and Michela Paganini and Laurent Sifre and Lena Martens and Xiang Lorraine Li and Adhiguna Kuncoro and Aida Nematzadeh and Elena Gribovskaya and Domenic Donato and Angeliki Lazaridou and Arthur Mensch and Jean-Baptiste Lespiau and Maria Tsimpoukelli and Nikolai Grigorev and Doug Fritz and Thibault Sottiaux and Mantas Pajarskas and Toby Pohlen and Zhitao Gong and Daniel Toyama and Cyprien de Masson d'Autume and Yujia Li and Tayfun Terzi and Vladimir Mikulik and Igor Babuschkin and Aidan Clark and Diego de Las Casas and Aurelia Guy and Chris Jones and James Bradbury and Matthew Johnson and Blake Hechtman and Laura Weidinger and Iason Gabriel and William Isaac and Ed Lockhart and Simon Osindero and Laura Rimell and Chris Dyer and Oriol Vinyals and Kareem Ayoub and Jeff Stanway and Lorrayne Bennett and Demis Hassabis and Koray Kavukcuoglu and Geoffrey Irving},
49
+ year={2022},
50
+ eprint={2112.11446},
51
+ archivePrefix={arXiv},
52
+ primaryClass={cs.CL}
53
+ }
54
+ @misc{lee2022deduplicating,
55
+ title={Deduplicating Training Data Makes Language Models Better},
56
+ author={Katherine Lee and Daphne Ippolito and Andrew Nystrom and Chiyuan Zhang and Douglas Eck and Chris Callison-Burch and Nicholas Carlini},
57
+ year={2022},
58
+ eprint={2107.06499},
59
+ archivePrefix={arXiv},
60
+ primaryClass={cs.CL}
61
+ }
62
+ @misc{carlini2023quantifying,
63
+ title={Quantifying Memorization Across Neural Language Models},
64
+ author={Nicholas Carlini and Daphne Ippolito and Matthew Jagielski and Katherine Lee and Florian Tramer and Chiyuan Zhang},
65
+ year={2023},
66
+ eprint={2202.07646},
67
+ archivePrefix={arXiv},
68
+ primaryClass={cs.LG}
69
+ }
70
+ @misc{raffel2023exploring,
71
+ title={Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer},
72
+ author={Colin Raffel and Noam Shazeer and Adam Roberts and Katherine Lee and Sharan Narang and Michael Matena and Yanqi Zhou and Wei Li and Peter J. Liu},
73
+ year={2023},
74
+ eprint={1910.10683},
75
+ archivePrefix={arXiv},
76
+ primaryClass={cs.LG}
77
+ }
78
+ @misc{touvron2023llama,
79
+ title={LLaMA: Open and Efficient Foundation Language Models},
80
+ author={Hugo Touvron and Thibaut Lavril and Gautier Izacard and Xavier Martinet and Marie-Anne Lachaux and Timothée Lacroix and Baptiste Rozière and Naman Goyal and Eric Hambro and Faisal Azhar and Aurelien Rodriguez and Armand Joulin and Edouard Grave and Guillaume Lample},
81
+ year={2023},
82
+ eprint={2302.13971},
83
+ archivePrefix={arXiv},
84
+ primaryClass={cs.CL}
85
+ }
86
+ @article{dolma,
87
+ title = {Dolma: an Open Corpus of Three Trillion Tokens for Language Model Pretraining Research},
88
+ author={
89
+ Luca Soldaini and Rodney Kinney and Akshita Bhagia and Dustin Schwenk and David Atkinson and
90
+ Russell Authur and Ben Bogin and Khyathi Chandu and Jennifer Dumas and Yanai Elazar and
91
+ Valentin Hofmann and Ananya Harsh Jha and Sachin Kumar and Li Lucy and Xinxi Lyu and
92
+ Nathan Lambert and Ian Magnusson and Jacob Morrison and Niklas Muennighoff and Aakanksha Naik and
93
+ Crystal Nam and Matthew E. Peters and Abhilasha Ravichander and Kyle Richardson and Zejiang Shen and
94
+ Emma Strubell and Nishant Subramani and Oyvind Tafjord and Pete Walsh and Luke Zettlemoyer and
95
+ Noah A. Smith and Hannaneh Hajishirzi and Iz Beltagy and Dirk Groeneveld and Jesse Dodge and Kyle Lo
96
+ },
97
+ year = {2024},
98
+ journal={arXiv preprint},
99
+ }
100
+ @article{gao2020pile,
101
+ title={The {P}ile: An 800{GB} dataset of diverse text for language modeling},
102
+ author={Gao, Leo and Biderman, Stella and Black, Sid and Golding, Laurence and Hoppe, Travis and Foster, Charles and Phang, Jason and He, Horace and Thite, Anish and Nabeshima, Noa and others},
103
+ journal={arXiv preprint arXiv:2101.00027},
104
+ year={2020}
105
+ }
106
+ @misc{cerebras2023slimpajama,
107
+ author = {Soboleva, Daria and Al-Khateeb, Faisal and Myers, Robert and Steeves, Jacob R and Hestness, Joel and Dey, Nolan},
108
+ title = {SlimPajama: A 627B token cleaned and deduplicated version of RedPajama},
109
+ month = {June},
110
+ year = 2023,
111
+ url = {https://huggingface.co/datasets/cerebras/SlimPajama-627B},
112
+ }
113
+ @software{together2023redpajama,
114
+ author = {Together Computer},
115
+ title = {RedPajama: an Open Dataset for Training Large Language Models},
116
+ month = {October},
117
+ year = 2023,
118
+ url = {https://github.com/togethercomputer/RedPajama-Data}
119
+ }
120
+ @article{jaccard1912distribution,
121
+ title={The distribution of the flora in the alpine zone. 1},
122
+ author={Jaccard, Paul},
123
+ journal={New phytologist},
124
+ volume={11},
125
+ number={2},
126
+ pages={37--50},
127
+ year={1912},
128
+ publisher={Wiley Online Library}
129
  }
index.html CHANGED
@@ -51,7 +51,7 @@
51
  border-right-color: rgba(0, 0, 0, 0.1);
52
  position: -webkit-sticky; /* For Safari */
53
  position: sticky;
54
- top: 0; /* Adjust this value if needed */
55
  }
56
  }
57
 
@@ -146,7 +146,7 @@
146
  </script>
147
  </d-front-matter>
148
  <d-title>
149
- <figure style="grid-column: page; mix-blend-mode: multiply;">
150
  <img src="banner.png" alt="FineWeb">
151
  </figure>
152
  </d-title>
@@ -165,7 +165,7 @@
165
  recipe, why more deduplication is not always better and some interesting findings on the difference in
166
  quality of CommonCrawl dumps.</p>
167
 
168
- <h2>Preamble</h2>
169
  <h3>Sourcing the data</h3>
170
  <p>A common question we see asked regarding web datasets used
171
  to train LLMs is “where do they even get all that data?” There are generally two options:</p>
@@ -185,14 +185,14 @@
185
  every 1 or 2 months, which can be freely downloaded. </p>
186
  <p>As an example, their latest crawl (2024-10) contains 3.16
187
  billion web pages, totaling 424.7 TiB of uncompressed content (the size changes from dump to dump). There
188
- are 95 dumps since 2013 and 3 dumps from 2008 to 2012, which are in a different (older) format. </p>
189
  <h3>Processing at scale</h3>
190
  <p>Given the sheer size of the data involved, one of the main
191
  challenges we had to overcome was having a modular, scalable codebase that would allow us to quickly iterate
192
  on our processing decisions and easily try out new ideas, while appropriately parallelizing our workloads
193
  and providing clear insights into the data. </p>
194
  <p>For this purpose, we developed <a
195
- href="https://github.com/huggingface/datatrove"><code>datatrove</code></a>, an open-source data
196
  processing library that allowed us to seamlessly scale our filtering and deduplication setup to thousands of
197
  CPU cores. All the data processing steps involved in the creation of FineWeb used this <a
198
  href="https://github.com/huggingface/datatrove">library</a>.</p>
@@ -209,7 +209,7 @@
209
  choose a diverse set of tasks and try not to overfit to any one individual benchmark.</p>
210
  <p>Another way to evaluate different datasets would be to
211
  train a model on each one and have humans rate and compare the outputs of each one (like on the <a
212
- href="https://chat.lmsys.org/">LMSYS Chatbot Arena</a>). This would arguably provide the most
213
  reliable results in terms of representing real model usage, but getting ablation results this way is too
214
  expensive and slow.</p>
215
  <p>The approach we ultimately went with was to train small
@@ -244,17 +244,19 @@
244
  (should not be too noisy)
245
  </li>
246
  </ul>
247
- <p>You can find the full list of tasks and prompts we used <a
248
- href="https://huggingface.co/datasets/HuggingFaceFW/fineweb/blob/main/lighteval_tasks.py">here</a>. To
249
  have results quickly we capped longer benchmarks at 1000 samples (wall-clock evaluation taking less than 5
250
  min on a single node of 8 GPUs - done in parallel to the training).</p>
 
 
251
  <h2>The FineWeb recipe</h2>
252
  <p>In the next subsections we will explain each of the steps
253
- taken to produce the FineWeb dataset. You can find a full reproducible <code>datatrove</code> config <a
254
- href="https://github.com/huggingface/datatrove/blob/main/examples/fineweb.py">here</a>.</p>
255
  <figure class="l-body">
256
  <img src="plots/fineweb-recipe.png"/>
257
  </figure>
 
 
258
  <h3>Starting point: text extraction</h3>
259
  <p>CommonCrawl data is available in two main formats: WARC
260
  and WET. <strong>WARC </strong>(Web ARChive format) files contain the raw data from the crawl, including the
@@ -264,8 +266,7 @@
264
  starting point. In our experience the default text extraction (extracting the main text of a webpage from
265
  its HTML) used to create these WET files is suboptimal and there are a variety of open-source libraries that
266
  provide better text extraction (by, namely, keeping less boilerplate content/navigation menus). We extracted
267
- the text content from the WARC files using the <a href="https://trafilatura.readthedocs.io/en/latest/">trafilatura</a>
268
- library. It is important to note, however, that text extraction is one of the most costly steps of our
269
  processing, so we believe that using the readily available WET data could be a reasonable trade-off for
270
  lower budget teams.</p>
271
  <p>To validate this decision, we processed the 2019-18 dump
@@ -281,7 +282,7 @@
281
  removes part of the data (be it words, lines, or full documents) that would harm performance and is thus
282
  deemed to be “lower quality”.</p>
283
  <p>As a basis for our filtering we used part of the setup
284
- from <a href="https://arxiv.org/abs/2306.01116">RefinedWeb</a>. Namely, we:</p>
285
  <ul>
286
  <li>Applied URL filtering using a <a
287
  href="https://dsi.ut-capitole.fr/blacklists/">blocklist</a> to remove adult content
@@ -289,13 +290,12 @@
289
  </ul>
290
  <ul>
291
  <li>Applied a <a
292
- href="https://fasttext.cc/docs/en/language-identification.html">fastText language classifier</a> to
293
  keep only English text with a score ≥ 0.65
294
  </li>
295
  </ul>
296
  <ul>
297
- <li>Applied quality and repetition filters from the <a
298
- href="https://arxiv.org/abs/2112.11446">Gopher</a> paper (using the default thresholds)
299
  </li>
300
  </ul>
301
  <p>After applying this filtering to each of the text
@@ -309,9 +309,7 @@
309
  <p>The web has many aggregators, mirrors, templated pages or
310
  just otherwise repeated content spread over different domains and webpages. Often, these duplicated pages
311
  can be introduced by the crawler itself, when different links point to the same page. </p>
312
- <p>Removing these duplicates (deduplicating) has been <a
313
- href="https://arxiv.org/abs/2107.06499">linked to an improvement in model performance</a> and a <a
314
- href="https://arxiv.org/abs/2202.07646">reduction in memorization of pretraining data</a>, which might
315
  allow for better generalization. Additionally, the performance uplift can also be tied to increased training
316
  efficiency: by removing duplicated content, for the same number of training tokens, a model will have seen
317
  more diverse data.</p>
@@ -320,14 +318,14 @@
320
  efficient data structures to index the data (like suffix arrays). Methods can also be “fuzzy”, by using some
321
  similarity metric to mark documents as duplicates, or “exact” by checking for exact matches between two
322
  documents (or lines, paragraphs, or whatever other granularity level being used).</p>
323
- <h3>Our deduplication parameters</h3>
324
  <p>Similarly to RefinedWeb, we decided to apply MinHash, a
325
  fuzzy hash based deduplication technique. We chose to compute minhashes on each document’s 5-grams, using
326
  112 hash functions in total, split into 14 buckets of 8 hashes each — targeting documents that are at least
327
  75% similar. Documents with the same 8 minhashes in any bucket are considered a duplicate of each other.</p>
328
  <p>This would mean that for two documents with a similarity (<code>s</code>)
329
  of 0.7, 0.75, 0.8 and 0.85, the probability that they would be identified as duplicates would be 56%, 77%,
330
- 92% and 98.8% respectively (<code>1-(1-s^8)^14</code>). See the plot below for a match probability
331
  comparison between our setup with 112 hashes and the one from RefinedWeb, with 9000 hashes, divided into 450
332
  buckets of 20 hashes (that requires a substantially larger amount of compute resources):</p>
333
  <figure><img src="plots/minhash_parameters_comparison.png"/>
@@ -335,7 +333,7 @@
335
  <p>While the high number of hash functions in RefinedWeb
336
  allows for a steeper, more well defined cut off, we believe the compute and storage savings are a reasonable
337
  trade off.</p>
338
- <h3>More deduplication is always better, right?</h3>
339
  <p>Our initial approach was to take the entire dataset (all
340
  95 dumps) and deduplicate them as one big dataset using MinHash.</p>
341
  <p>We did this in an iterative manner: starting with the most
@@ -379,7 +377,7 @@
379
  <p>These results show that, for this older dump where we were
380
  removing over 90% of the original data, the data that was kept was actually <em>worse</em> than the data
381
  removed (considered independently of all the other dumps).</p>
382
- <h3>Taking a step back: individual dump dedup</h3>
383
  <p>We then tried an alternative approach: we deduplicated
384
  each dump with MinHash individually (without considering the other dumps). This resulted in 20 trillion
385
  tokens of data.</p>
@@ -476,8 +474,7 @@
476
  <figure><img src="plots/Untitled.png"/></figure>
477
  <h3>Additional filtering</h3>
478
  <p>By this point we had reached the same performance as
479
- RefinedWeb, but on our aggregate of tasks, another heavily filtered dataset, <a
480
- href="https://arxiv.org/abs/1910.10683">the C4 dataset</a>, still showed stronger performance (with
481
  the caveat that it is a relatively small dataset for current web-scale standards).</p>
482
  <p>We therefore set out to find new filtering steps that
483
  would, at first, allow us to match the performance of C4 and eventually surpass it. A natural starting point
@@ -490,8 +487,8 @@
490
  <p>Despite its age and limited size (around 175B gpt2
491
  tokens), models trained on this dataset have strong performance, excelling in particular on the Hellaswag
492
  benchmark, one of the benchmarks in our “early signal” group with the stronger signal and highest
493
- signal-over-noise ratio. As such, it has stayed a common sub-set of typical LLM training, for instance in in
494
- <a href="https://arxiv.org/abs/2302.13971">the relatively recent Llama1 model</a>. We experimented applying
495
  each of the different filters used in C4 to a baseline of the independently deduped FineWeb 2019-18 dump
496
  (plot smoothed with a 3 checkpoints sliding window):</p>
497
  <figure><img src="plots/c4_filters.png"/></figure>
@@ -587,28 +584,28 @@
587
  <p>We compared 🍷 FineWeb with the following datasets:</p>
588
  <ul>
589
  <li><a
590
- href="https://huggingface.co/datasets/tiiuae/falcon-refinedweb">RefinedWeb</a>
591
  </li>
592
  </ul>
593
  <ul>
594
- <li><a href="https://huggingface.co/datasets/allenai/c4">C4</a></li>
595
  </ul>
596
  <ul>
597
  <li><a href="https://huggingface.co/datasets/allenai/dolma">Dolma v1.6</a> (the
598
- CommonCrawl part)
599
  </li>
600
  </ul>
601
  <ul>
602
- <li><a href="https://huggingface.co/datasets/EleutherAI/pile">The Pile</a></li>
603
  </ul>
604
  <ul>
605
  <li><a
606
- href="https://huggingface.co/datasets/cerebras/SlimPajama-627B">SlimPajama</a>
607
  </li>
608
  </ul>
609
  <ul>
610
  <li><a
611
- href="https://huggingface.co/datasets/togethercomputer/RedPajama-Data-V2">RedPajama2</a>
612
  (deduplicated)
613
  </li>
614
  </ul>
@@ -668,7 +665,7 @@
668
  <h3>Changes in the most frequent URLs [HAVE TO RECHECK]</h3>
669
  <p>For each crawl from 2021-10 onwards, we gathered a list of
670
  the 60k most frequent <strong>FQDNs</strong> (fully qualified domain name). We then calculated the <a
671
- href="https://en.wikipedia.org/wiki/Jaccard_index">Jaccard similarity</a> between consecutive
672
  crawls. A high value means that a crawl/dump has many of the same FQDNs as the dump immediately preceding
673
  it, while a small value means that a considerable number of top 60k FQDNs were downsampled or removed, or
674
  that alternatively new FQDNs were added to the top 60k.</p>
@@ -727,12 +724,6 @@
727
  </d-article>
728
 
729
  <d-appendix>
730
-
731
- <h3>Contributions</h3>
732
- <p>Some text describing who did what.</p>
733
- <h3>Reviewers</h3>
734
- <p>Some text with links describing who reviewed the article.</p>
735
-
736
  <d-bibliography src="bibliography.bib"></d-bibliography>
737
  </d-appendix>
738
 
@@ -740,10 +731,10 @@
740
  const article = document.querySelector('d-article');
741
  const toc = document.querySelector('d-contents');
742
  if (toc) {
743
- const headings = article.querySelectorAll('h2, h3');
744
  let ToC = `<nav role="navigation" class="l-text figcaption"><h3>Table of contents</h3>`;
 
745
 
746
- let elements = [];
747
  for (const el of headings) {
748
  // should element be included in TOC?
749
  const isInTitle = el.parentElement.tagName == 'D-TITLE';
@@ -751,20 +742,25 @@
751
  if (isInTitle || isException) continue;
752
  el.setAttribute('id', el.textContent.toLowerCase().replaceAll(" ", "_"))
753
  const link = '<a href="' + '#' + el.getAttribute('id') + '">' + el.textContent + '</a>';
754
- if (el.tagName === 'H2')
755
- elements.push([link, []]);
756
- else {
757
- if (elements.length === 0)
758
- elements.push([null, []])
759
- elements[elements.length - 1][1].push(link)
 
 
 
760
  }
 
 
 
 
761
  }
762
 
763
- for (const topLevel of elements) {
764
- ToC += '<div>' + topLevel[0] + '</div><ul>';
765
- for (const subLevel of topLevel[1])
766
- ToC += '<li>' + subLevel + '</li>';
767
- ToC += '</ul>';
768
  }
769
  ToC += '</nav>';
770
  toc.innerHTML = ToC;
 
51
  border-right-color: rgba(0, 0, 0, 0.1);
52
  position: -webkit-sticky; /* For Safari */
53
  position: sticky;
54
+ top: 10px; /* Adjust this value if needed */
55
  }
56
  }
57
 
 
146
  </script>
147
  </d-front-matter>
148
  <d-title>
149
+ <figure class="l-page">
150
  <img src="banner.png" alt="FineWeb">
151
  </figure>
152
  </d-title>
 
165
  recipe, why more deduplication is not always better and some interesting findings on the difference in
166
  quality of CommonCrawl dumps.</p>
167
 
168
+ <h2>General considerations on web data</h2>
169
  <h3>Sourcing the data</h3>
170
  <p>A common question we see asked regarding web datasets used
171
  to train LLMs is “where do they even get all that data?” There are generally two options:</p>
 
185
  every 1 or 2 months, which can be freely downloaded. </p>
186
  <p>As an example, their latest crawl (2024-10) contains 3.16
187
  billion web pages, totaling 424.7 TiB of uncompressed content (the size changes from dump to dump). There
188
+ are 95 dumps since 2013 and 3 dumps from 2008 to 2012, which are in a different (older) format.<d-footnote>We have not processed these 3 older dumps.</d-footnote> </p>
189
  <h3>Processing at scale</h3>
190
  <p>Given the sheer size of the data involved, one of the main
191
  challenges we had to overcome was having a modular, scalable codebase that would allow us to quickly iterate
192
  on our processing decisions and easily try out new ideas, while appropriately parallelizing our workloads
193
  and providing clear insights into the data. </p>
194
  <p>For this purpose, we developed <a
195
+ href="https://github.com/huggingface/datatrove"><code>datatrove</code></a><d-cite bibtex-key="penedo2024datatrove"></d-cite>, an open-source data
196
  processing library that allowed us to seamlessly scale our filtering and deduplication setup to thousands of
197
  CPU cores. All the data processing steps involved in the creation of FineWeb used this <a
198
  href="https://github.com/huggingface/datatrove">library</a>.</p>
 
209
  choose a diverse set of tasks and try not to overfit to any one individual benchmark.</p>
210
  <p>Another way to evaluate different datasets would be to
211
  train a model on each one and have humans rate and compare the outputs of each one (like on the <a
212
+ href="https://chat.lmsys.org/">LMSYS Chatbot Arena</a>)<d-cite bibtex-key="chiang2024chatbot"></d-cite>. This would arguably provide the most
213
  reliable results in terms of representing real model usage, but getting ablation results this way is too
214
  expensive and slow.</p>
215
  <p>The approach we ultimately went with was to train small
 
244
  (should not be too noisy)
245
  </li>
246
  </ul>
247
+ <p>To
 
248
  have results quickly we capped longer benchmarks at 1000 samples (wall-clock evaluation taking less than 5
249
  min on a single node of 8 GPUs - done in parallel to the training).</p>
250
+ <aside>You can find the full list of tasks and prompts we used <a
251
+ href="https://huggingface.co/datasets/HuggingFaceFW/fineweb/blob/main/lighteval_tasks.py">here</a>.</aside>
252
  <h2>The FineWeb recipe</h2>
253
  <p>In the next subsections we will explain each of the steps
254
+ taken to produce the FineWeb dataset.</p>
 
255
  <figure class="l-body">
256
  <img src="plots/fineweb-recipe.png"/>
257
  </figure>
258
+ <aside>You can find a fully reproducible <code>datatrove</code> config <a
259
+ href="https://github.com/huggingface/datatrove/blob/main/examples/fineweb.py">here</a>.</aside>
260
  <h3>Starting point: text extraction</h3>
261
  <p>CommonCrawl data is available in two main formats: WARC
262
  and WET. <strong>WARC </strong>(Web ARChive format) files contain the raw data from the crawl, including the
 
266
  starting point. In our experience the default text extraction (extracting the main text of a webpage from
267
  its HTML) used to create these WET files is suboptimal and there are a variety of open-source libraries that
268
  provide better text extraction (by, namely, keeping less boilerplate content/navigation menus). We extracted
269
+ the text content from the WARC files using the trafilatura library<d-cite bibtex-key="barbaresi-2021-trafilatura"></d-cite>. It is important to note, however, that text extraction is one of the most costly steps of our
 
270
  processing, so we believe that using the readily available WET data could be a reasonable trade-off for
271
  lower budget teams.</p>
272
  <p>To validate this decision, we processed the 2019-18 dump
 
282
  removes part of the data (be it words, lines, or full documents) that would harm performance and is thus
283
  deemed to be “lower quality”.</p>
284
  <p>As a basis for our filtering we used part of the setup
285
+ from RefinedWeb<d-cite bibtex-key="penedo2023refinedweb"></d-cite>. Namely, we:</p>
286
  <ul>
287
  <li>Applied URL filtering using a <a
288
  href="https://dsi.ut-capitole.fr/blacklists/">blocklist</a> to remove adult content
 
290
  </ul>
291
  <ul>
292
  <li>Applied a <a
293
+ href="https://fasttext.cc/docs/en/language-identification.html">fastText language classifier</a><d-cite bibtex-key="joulin2016bag"></d-cite><d-cite bibtex-key="joulin2016fasttext"></d-cite> to
294
  keep only English text with a score ≥ 0.65
295
  </li>
296
  </ul>
297
  <ul>
298
+ <li>Applied quality and repetition filters from the Gopher<d-cite bibtex-key="rae2022scaling"></d-cite> paper (using the default thresholds)
 
299
  </li>
300
  </ul>
301
  <p>After applying this filtering to each of the text
 
309
  <p>The web has many aggregators, mirrors, templated pages or
310
  just otherwise repeated content spread over different domains and webpages. Often, these duplicated pages
311
  can be introduced by the crawler itself, when different links point to the same page. </p>
312
+ <p>Removing these duplicates (deduplicating) has been linked to an improvement in model performance<d-cite bibtex-key="lee2022deduplicating"></d-cite> and a reduction in memorization of pretraining data<d-cite bibtex-key="carlini2023quantifying"></d-cite>, which might
 
 
313
  allow for better generalization. Additionally, the performance uplift can also be tied to increased training
314
  efficiency: by removing duplicated content, for the same number of training tokens, a model will have seen
315
  more diverse data.</p>
 
318
  efficient data structures to index the data (like suffix arrays). Methods can also be “fuzzy”, by using some
319
  similarity metric to mark documents as duplicates, or “exact” by checking for exact matches between two
320
  documents (or lines, paragraphs, or whatever other granularity level being used).</p>
321
+ <h4>Our deduplication parameters</h4>
322
  <p>Similarly to RefinedWeb, we decided to apply MinHash, a
323
  fuzzy hash based deduplication technique. We chose to compute minhashes on each document’s 5-grams, using
324
  112 hash functions in total, split into 14 buckets of 8 hashes each — targeting documents that are at least
325
  75% similar. Documents with the same 8 minhashes in any bucket are considered a duplicate of each other.</p>
326
  <p>This would mean that for two documents with a similarity (<code>s</code>)
327
  of 0.7, 0.75, 0.8 and 0.85, the probability that they would be identified as duplicates would be 56%, 77%,
328
+ 92% and 98.8% respectively ($$1-(1-s^8)^{14}$$). See the plot below for a match probability
329
  comparison between our setup with 112 hashes and the one from RefinedWeb, with 9000 hashes, divided into 450
330
  buckets of 20 hashes (that requires a substantially larger amount of compute resources):</p>
331
  <figure><img src="plots/minhash_parameters_comparison.png"/>
 
333
  <p>While the high number of hash functions in RefinedWeb
334
  allows for a steeper, more well defined cut off, we believe the compute and storage savings are a reasonable
335
  trade off.</p>
336
+ <h4>More deduplication is always better, right?</h4>
337
  <p>Our initial approach was to take the entire dataset (all
338
  95 dumps) and deduplicate them as one big dataset using MinHash.</p>
339
  <p>We did this in an iterative manner: starting with the most
 
377
  <p>These results show that, for this older dump where we were
378
  removing over 90% of the original data, the data that was kept was actually <em>worse</em> than the data
379
  removed (considered independently of all the other dumps).</p>
380
+ <h4>Taking a step back: individual dump dedup</h4>
381
  <p>We then tried an alternative approach: we deduplicated
382
  each dump with MinHash individually (without considering the other dumps). This resulted in 20 trillion
383
  tokens of data.</p>
 
474
  <figure><img src="plots/Untitled.png"/></figure>
475
  <h3>Additional filtering</h3>
476
  <p>By this point we had reached the same performance as
477
+ RefinedWeb, but on our aggregate of tasks, another heavily filtered dataset, the C4 dataset<d-cite bibtex-key="raffel2023exploring"></d-cite>, still showed stronger performance (with
 
478
  the caveat that it is a relatively small dataset for current web-scale standards).</p>
479
  <p>We therefore set out to find new filtering steps that
480
  would, at first, allow us to match the performance of C4 and eventually surpass it. A natural starting point
 
487
  <p>Despite its age and limited size (around 175B gpt2
488
  tokens), models trained on this dataset have strong performance, excelling in particular on the Hellaswag
489
  benchmark, one of the benchmarks in our “early signal” group with the stronger signal and highest
490
+ signal-over-noise ratio. As such, it has stayed a common sub-set of typical LLM training, for instance in
491
+ the relatively recent Llama1 model<d-cite bibtex-key="touvron2023llama"></d-cite>. We experimented applying
492
  each of the different filters used in C4 to a baseline of the independently deduped FineWeb 2019-18 dump
493
  (plot smoothed with a 3 checkpoints sliding window):</p>
494
  <figure><img src="plots/c4_filters.png"/></figure>
 
584
  <p>We compared 🍷 FineWeb with the following datasets:</p>
585
  <ul>
586
  <li><a
587
+ href="https://huggingface.co/datasets/tiiuae/falcon-refinedweb">RefinedWeb</a><d-cite bibtex-key="penedo2023refinedweb"></d-cite>
588
  </li>
589
  </ul>
590
  <ul>
591
+ <li><a href="https://huggingface.co/datasets/allenai/c4">C4</a><d-cite bibtex-key="raffel2023exploring"></d-cite></li>
592
  </ul>
593
  <ul>
594
  <li><a href="https://huggingface.co/datasets/allenai/dolma">Dolma v1.6</a> (the
595
+ CommonCrawl part) <d-cite bibtex-key="dolma"></d-cite>
596
  </li>
597
  </ul>
598
  <ul>
599
+ <li><a href="https://huggingface.co/datasets/EleutherAI/pile">The Pile</a> <d-cite bibtex-key="gao2020pile"></d-cite></li>
600
  </ul>
601
  <ul>
602
  <li><a
603
+ href="https://huggingface.co/datasets/cerebras/SlimPajama-627B">SlimPajama</a> <d-cite bibtex-key="cerebras2023slimpajama"></d-cite>
604
  </li>
605
  </ul>
606
  <ul>
607
  <li><a
608
+ href="https://huggingface.co/datasets/togethercomputer/RedPajama-Data-V2">RedPajama2</a> <d-cite bibtex-key="together2023redpajama"></d-cite>
609
  (deduplicated)
610
  </li>
611
  </ul>
 
665
  <h3>Changes in the most frequent URLs [HAVE TO RECHECK]</h3>
666
  <p>For each crawl from 2021-10 onwards, we gathered a list of
667
  the 60k most frequent <strong>FQDNs</strong> (fully qualified domain name). We then calculated the <a
668
+ href="https://en.wikipedia.org/wiki/Jaccard_index">Jaccard similarity</a><d-cite bibtex-key="jaccard1912distribution"></d-cite> between consecutive
669
  crawls. A high value means that a crawl/dump has many of the same FQDNs as the dump immediately preceding
670
  it, while a small value means that a considerable number of top 60k FQDNs were downsampled or removed, or
671
  that alternatively new FQDNs were added to the top 60k.</p>
 
724
  </d-article>
725
 
726
  <d-appendix>
 
 
 
 
 
 
727
  <d-bibliography src="bibliography.bib"></d-bibliography>
728
  </d-appendix>
729
 
 
731
  const article = document.querySelector('d-article');
732
  const toc = document.querySelector('d-contents');
733
  if (toc) {
734
+ const headings = article.querySelectorAll('h2, h3, h4');
735
  let ToC = `<nav role="navigation" class="l-text figcaption"><h3>Table of contents</h3>`;
736
+ let prevLevel = 0;
737
 
 
738
  for (const el of headings) {
739
  // should element be included in TOC?
740
  const isInTitle = el.parentElement.tagName == 'D-TITLE';
 
742
  if (isInTitle || isException) continue;
743
  el.setAttribute('id', el.textContent.toLowerCase().replaceAll(" ", "_"))
744
  const link = '<a href="' + '#' + el.getAttribute('id') + '">' + el.textContent + '</a>';
745
+
746
+ const level = el.tagName === 'H2' ? 0 : (el.tagName === 'H3' ? 1 : 2);
747
+ while (prevLevel < level) {
748
+ ToC += '<ul>'
749
+ prevLevel++;
750
+ }
751
+ while (prevLevel > level) {
752
+ ToC += '</ul>'
753
+ prevLevel--;
754
  }
755
+ if (level === 0)
756
+ ToC += '<div>' + link + '</div>';
757
+ else
758
+ ToC += '<li>' + link + '</li>';
759
  }
760
 
761
+ while (prevLevel > 0) {
762
+ ToC += '</ul>'
763
+ prevLevel--;
 
 
764
  }
765
  ToC += '</nav>';
766
  toc.innerHTML = ToC;