Spaces:
Runtime error
Runtime error
omkarenator
commited on
Commit
•
5025d3d
1
Parent(s):
83c90e0
cleanup main.py and add section ids so that hrefs can work
Browse files
main.py
CHANGED
@@ -183,7 +183,6 @@ def main():
|
|
183 |
)
|
184 |
|
185 |
|
186 |
-
|
187 |
dataset_comparison1 = pd.DataFrame(
|
188 |
{
|
189 |
"Dataset": [
|
@@ -459,202 +458,6 @@ table_html_data = styled_table._repr_html_()
|
|
459 |
table_div_data = Div(NotStr(table_html_data), style="margin: 40px;")
|
460 |
|
461 |
|
462 |
-
def get_curated_chart():
|
463 |
-
# Dataset
|
464 |
-
data = {
|
465 |
-
"Source": [
|
466 |
-
"ArXiv",
|
467 |
-
"PubMed Central",
|
468 |
-
"PubMed Abstract",
|
469 |
-
"S2ORC Full Text",
|
470 |
-
"S2ORC Abstract",
|
471 |
-
"PhilPapers",
|
472 |
-
"Wikipedia",
|
473 |
-
"StackExchange",
|
474 |
-
"EuroParl",
|
475 |
-
"Ubuntu IRC",
|
476 |
-
"Freelaw",
|
477 |
-
"PG19",
|
478 |
-
"USPTO",
|
479 |
-
"HackerNews",
|
480 |
-
"DM Maths",
|
481 |
-
],
|
482 |
-
"Category": [
|
483 |
-
"Papers",
|
484 |
-
"Papers",
|
485 |
-
"Papers",
|
486 |
-
"Papers",
|
487 |
-
"Papers",
|
488 |
-
"Papers",
|
489 |
-
"Internet",
|
490 |
-
"Conversational",
|
491 |
-
"Legal/Formal",
|
492 |
-
"Conversational",
|
493 |
-
"Legal/Formal",
|
494 |
-
"Books",
|
495 |
-
"Legal/Formal",
|
496 |
-
"Conversational",
|
497 |
-
"Reasoning",
|
498 |
-
],
|
499 |
-
"Count": [
|
500 |
-
100,
|
501 |
-
200,
|
502 |
-
150,
|
503 |
-
120,
|
504 |
-
80,
|
505 |
-
90,
|
506 |
-
300,
|
507 |
-
250,
|
508 |
-
180,
|
509 |
-
150,
|
510 |
-
150,
|
511 |
-
250,
|
512 |
-
180,
|
513 |
-
120,
|
514 |
-
90,
|
515 |
-
],
|
516 |
-
"Details": [
|
517 |
-
"A repository of scientific papers in various disciplines, including computer science, physics, mathematics, and more.",
|
518 |
-
"A database of biomedical and life sciences research articles.",
|
519 |
-
"Abstracts of biomedical literature from various sources.",
|
520 |
-
"Full-text articles from the Semantic Scholar Open Research Corpus.",
|
521 |
-
"Abstracts of articles from the Semantic Scholar Open Research Corpus.",
|
522 |
-
"Papers from the PhilPapers database, a comprehensive index and bibliography of philosophy research.",
|
523 |
-
"A collaborative online encyclopedia that covers a wide range of topics.",
|
524 |
-
"A network of question-and-answer websites on various subjects, including programming, science, mathematics, and more.",
|
525 |
-
"A collection of multilingual parallel corpora of parliamentary debates from the European Parliament.",
|
526 |
-
"Chat logs from the Ubuntu Internet Relay Chat (IRC) channels.",
|
527 |
-
"Legal documents and court cases from various jurisdictions.",
|
528 |
-
"A collection of books from Project Gutenberg, a digital library of public domain works.",
|
529 |
-
"Patent documents from the United States Patent and Trademark Office.",
|
530 |
-
"User-generated news and discussion platform focused on technology and startups.",
|
531 |
-
"Deep Mind Maths dataset with generated questions.",
|
532 |
-
],
|
533 |
-
}
|
534 |
-
# Calculate percentage for each data source
|
535 |
-
total_count = sum(data["Count"])
|
536 |
-
data["Percentage"] = [count / total_count * 100 for count in data["Count"]]
|
537 |
-
|
538 |
-
# Create treemap
|
539 |
-
fig = px.treemap(
|
540 |
-
data,
|
541 |
-
path=["Category", "Source"],
|
542 |
-
values="Count",
|
543 |
-
hover_data=["Details", "Percentage"],
|
544 |
-
hover_name="Source",
|
545 |
-
)
|
546 |
-
|
547 |
-
# Set the size of the chart
|
548 |
-
fig.update_layout(width=800, height=600)
|
549 |
-
|
550 |
-
# Display treemap
|
551 |
-
st.plotly_chart(fig)
|
552 |
-
|
553 |
-
|
554 |
-
overview_div = Div(
|
555 |
-
Section(
|
556 |
-
H2("Overview"),
|
557 |
-
H3("What This Section Contains"),
|
558 |
-
Ul(
|
559 |
-
Li("Motivation Behind TxT360", style="margin-bottom: 5px"),
|
560 |
-
Li("The Highlevel Data Process Approach", style="margin-bottom: 5px"),
|
561 |
-
Li("Introduction to Global Deduplication", style="margin-bottom: 5px"),
|
562 |
-
),
|
563 |
-
H2("Motivation Behind Txt360"),
|
564 |
-
H3(
|
565 |
-
"TxT360 is the first dataset to combine both web and curated data sources commonly used in pretraining."
|
566 |
-
),
|
567 |
-
P(
|
568 |
-
"The quality and size of a pre-training dataset play a crucial role in the performance of large language models (LLMs). Data is often referred as low quality if it has not been filtered to review unwanted text. The community has introduced a variety of filtered datasets including purely web-based datasets."
|
569 |
-
),
|
570 |
-
P(
|
571 |
-
"In pretraining, it is common to combine web data and curated sources (cite). Web data is included to provide a vast quantity of long tail and diverse data, while curated datasets are often information rich and provide the 'deep-dive' domain information. Both datasets play critical for effective LLM pre-training."
|
572 |
-
),
|
573 |
-
H4("The Gap TxT360 Fills"),
|
574 |
-
P(
|
575 |
-
"Despite advancements in filtering and source material for both data types, each type of dataset has its limitations. RefinedWeb is known for its high quality content but and only about 10% of the entire dataset has been disclosed and the processing scripts have not been released. For datasets that have combined curated sources with web data, the web component is relatively small (NEED TO UPDATE - citation needed)."
|
576 |
-
),
|
577 |
-
P(
|
578 |
-
"By integrating the extensive reach of web data with the exceptional quality of curated sources, TxT360 meets and surpasess the rigorous standards required for state-of-the-art LLM pre-training as demostated in the Results section."
|
579 |
-
),
|
580 |
-
P(
|
581 |
-
"Table 1: The following table shows TxT360 and other well-known datasets on the coverage and size of data sources."
|
582 |
-
),
|
583 |
-
table_div_1,
|
584 |
-
table_div_2,
|
585 |
-
P("Table 2: Basic TxT360 Statistics."),
|
586 |
-
table_div_data,
|
587 |
-
),
|
588 |
-
Section(
|
589 |
-
H2("Our Generalizable Approach to Data Processing"),
|
590 |
-
P(
|
591 |
-
"To produce TxT360, a comprehensive and transparent data processing pipeline was designed to account for the nuances of both web and curated datasets. The pipeline presents a unified framework for processing both data types, making it convenient and easily adaptive for users to revise and fine-tune the pipeline for their own use cases."
|
592 |
-
),
|
593 |
-
P(
|
594 |
-
"Web datasets are inherently noisy and varied. Thus, the pipeline includes sophisticated filtering and deduplication techniques to clean the data and remove redundancies or irrelevant information."
|
595 |
-
),
|
596 |
-
P(
|
597 |
-
"Curated datasets are typically already structured and consistently formatted. TxT360 filters these sources with selective steps to maintain their integrity while providing seamless integration into the larger dataset."
|
598 |
-
),
|
599 |
-
P(
|
600 |
-
"We will open-source the scripts for the whole pipeline, allowing the community to review, replicate, and build upon our processes."
|
601 |
-
),
|
602 |
-
Img(src="images/pipeline.png", height="300", width="600"),
|
603 |
-
P(
|
604 |
-
"Figure 1: Data processing pipeline. All the steps are adopted for processing web data while the yellow blocks are adopted for processing curated sources."
|
605 |
-
),
|
606 |
-
),
|
607 |
-
Section(
|
608 |
-
H2("Introducing Global Deduplication"),
|
609 |
-
P(
|
610 |
-
"Deduplication is crucial in language model pre-training for several reasons (NEEDS CITATION). Main hypothesis on why deduplicaiton is necessary and help include:"
|
611 |
-
),
|
612 |
-
Ul(
|
613 |
-
Li(
|
614 |
-
"reducing data volume reduces training time (and cost)",
|
615 |
-
style="margin-bottom: 5px",
|
616 |
-
),
|
617 |
-
Li(
|
618 |
-
"removing duplicataive data can lead to better accuracy",
|
619 |
-
style="margin-bottom: 5px",
|
620 |
-
),
|
621 |
-
Li("prevent train-test overlap", style="margin-bottom: 5px"),
|
622 |
-
Li(
|
623 |
-
"minimizes the risk of memorization leading to test loss",
|
624 |
-
style="margin-bottom: 5px",
|
625 |
-
),
|
626 |
-
),
|
627 |
-
P(
|
628 |
-
"Furthermore, by controlling the pretraining data distribution through deduplication and selective upsampling avoida relying on the often inconsistent distribution of internet-sourced data."
|
629 |
-
),
|
630 |
-
H3("Highlights of the TxT360 Deduplication Process"),
|
631 |
-
P(
|
632 |
-
"Our deduplication process began with 61.8 TB of filtered, and compressed documents, totaling approximately 48.83 billion documents. We first performed exact deduplication using a Bloom filter, reducing the dataset by 17% to 40.21 billion documents. For global near-deduplication, we scaled methodologies from prior works like SlimPajama to handle the entire dataset, including 87 Common Crawl dumps and other curated data. This involved generating document signatures, matching them to identify near-duplicates, and clustering these to retain only one document per cluster. We prioritized retaining documents from curated sources and more recent CommonCrawl dumps. Throughout the deduplication stages, we extensively used Dask for distributed data processing."
|
633 |
-
),
|
634 |
-
P(
|
635 |
-
"After the global near-deduplication of all 87 CommonCrawl dumps and other curated data, we removed around 85% of the total documents. This leaves us with approximately 4.24 trillion deduplicated tokens, which aligns with what FineWeb has reported for their iterative global deduplication. Along with the list of duplicated documents to delete, our deduplication code also saves some metadata about the duplicate clusters that we find. We save statistics about every duplicate cluster we find, with the document ID of the document we retain from the cluster as the key and with a value capturing the distribution of the duplicates within the cluster over the CommonCrawl dumps (identified by the first 2 digits of every document ID). This way, we always have information about the duplicates we have deleted, allowing us to upsample any data distribution we want for training."
|
636 |
-
),
|
637 |
-
P(
|
638 |
-
"During deduplication, it is not feasible to store all the duplicate clusters we form, but we do save some samples at every size. Here are some observations we made by examining these sample duplicate clusters:"
|
639 |
-
),
|
640 |
-
Ul(
|
641 |
-
Li(
|
642 |
-
"Smaller components tend to have more overlap in their MinHash bands. The smallest components, which are essentially pairs, consist of exact duplicate documents that local exact deduplication missed."
|
643 |
-
),
|
644 |
-
Li(
|
645 |
-
"When clusters contain three or more documents, incremental changes in the text become apparent. For example, there may be a growing list of personnel over the years."
|
646 |
-
),
|
647 |
-
Li(
|
648 |
-
"In sizable clusters comprising 1,000 or more documents, we observe a trend towards templatization. This involves the recurrent use of standardized language to convey general topics such as terms and conditions, warnings, and disclaimers. Such language is prevalent on commercial websites, offering a consistent and efficient way to communicate commonly encountered information."
|
649 |
-
),
|
650 |
-
),
|
651 |
-
P(
|
652 |
-
"All Deduplication details can be found in the Global Data Processing Steps section."
|
653 |
-
),
|
654 |
-
),
|
655 |
-
)
|
656 |
-
|
657 |
-
|
658 |
@app.get("/intro")
|
659 |
def intro():
|
660 |
return Div(
|
@@ -674,16 +477,108 @@ def intro():
|
|
674 |
),
|
675 |
id="section1",
|
676 |
),
|
677 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
678 |
id="inner-text",
|
679 |
)
|
680 |
|
681 |
|
682 |
-
# rt("/overview")(overview.overview)
|
683 |
-
|
684 |
rt("/update/{target}")(data_viewer.update)
|
685 |
|
686 |
-
|
687 |
rt("/curated")(curated.curated)
|
688 |
|
689 |
rt("/webdata")(web.web_data)
|
|
|
183 |
)
|
184 |
|
185 |
|
|
|
186 |
dataset_comparison1 = pd.DataFrame(
|
187 |
{
|
188 |
"Dataset": [
|
|
|
458 |
table_div_data = Div(NotStr(table_html_data), style="margin: 40px;")
|
459 |
|
460 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
461 |
@app.get("/intro")
|
462 |
def intro():
|
463 |
return Div(
|
|
|
477 |
),
|
478 |
id="section1",
|
479 |
),
|
480 |
+
Section(
|
481 |
+
H2("Motivation Behind Txt360"),
|
482 |
+
H3(
|
483 |
+
"TxT360 is the first dataset to combine both web and curated data sources commonly used in pretraining."
|
484 |
+
),
|
485 |
+
P(
|
486 |
+
"The quality and size of a pre-training dataset play a crucial role in the performance of large language models (LLMs). Data is often referred as low quality if it has not been filtered to review unwanted text. The community has introduced a variety of filtered datasets including purely web-based datasets."
|
487 |
+
),
|
488 |
+
P(
|
489 |
+
"In pretraining, it is common to combine web data and curated sources (cite). Web data is included to provide a vast quantity of long tail and diverse data, while curated datasets are often information rich and provide the 'deep-dive' domain information. Both datasets play critical for effective LLM pre-training."
|
490 |
+
),
|
491 |
+
H4("The Gap TxT360 Fills"),
|
492 |
+
P(
|
493 |
+
"Despite advancements in filtering and source material for both data types, each type of dataset has its limitations. RefinedWeb is known for its high quality content but and only about 10% of the entire dataset has been disclosed and the processing scripts have not been released. For datasets that have combined curated sources with web data, the web component is relatively small (NEED TO UPDATE - citation needed)."
|
494 |
+
),
|
495 |
+
P(
|
496 |
+
"By integrating the extensive reach of web data with the exceptional quality of curated sources, TxT360 meets and surpasess the rigorous standards required for state-of-the-art LLM pre-training as demostated in the Results section."
|
497 |
+
),
|
498 |
+
P(
|
499 |
+
"Table 1: The following table shows TxT360 and other well-known datasets on the coverage and size of data sources."
|
500 |
+
),
|
501 |
+
table_div_1,
|
502 |
+
table_div_2,
|
503 |
+
P("Table 2: Basic TxT360 Statistics."),
|
504 |
+
table_div_data,
|
505 |
+
id="section2",
|
506 |
+
),
|
507 |
+
Section(
|
508 |
+
H2("Our Generalizable Approach to Data Processing"),
|
509 |
+
P(
|
510 |
+
"To produce TxT360, a comprehensive and transparent data processing pipeline was designed to account for the nuances of both web and curated datasets. The pipeline presents a unified framework for processing both data types, making it convenient and easily adaptive for users to revise and fine-tune the pipeline for their own use cases."
|
511 |
+
),
|
512 |
+
P(
|
513 |
+
"Web datasets are inherently noisy and varied. Thus, the pipeline includes sophisticated filtering and deduplication techniques to clean the data and remove redundancies or irrelevant information."
|
514 |
+
),
|
515 |
+
P(
|
516 |
+
"Curated datasets are typically already structured and consistently formatted. TxT360 filters these sources with selective steps to maintain their integrity while providing seamless integration into the larger dataset."
|
517 |
+
),
|
518 |
+
P(
|
519 |
+
"We will open-source the scripts for the whole pipeline, allowing the community to review, replicate, and build upon our processes."
|
520 |
+
),
|
521 |
+
Img(src="images/pipeline.png", height="300", width="600"),
|
522 |
+
P(
|
523 |
+
"Figure 1: Data processing pipeline. All the steps are adopted for processing web data while the yellow blocks are adopted for processing curated sources."
|
524 |
+
),
|
525 |
+
id="section3",
|
526 |
+
),
|
527 |
+
Section(
|
528 |
+
H2("Introducing Global Deduplication"),
|
529 |
+
P(
|
530 |
+
"Deduplication is crucial in language model pre-training for several reasons (NEEDS CITATION). Main hypothesis on why deduplicaiton is necessary and help include:"
|
531 |
+
),
|
532 |
+
Ul(
|
533 |
+
Li(
|
534 |
+
"reducing data volume reduces training time (and cost)",
|
535 |
+
style="margin-bottom: 5px",
|
536 |
+
),
|
537 |
+
Li(
|
538 |
+
"removing duplicataive data can lead to better accuracy",
|
539 |
+
style="margin-bottom: 5px",
|
540 |
+
),
|
541 |
+
Li("prevent train-test overlap", style="margin-bottom: 5px"),
|
542 |
+
Li(
|
543 |
+
"minimizes the risk of memorization leading to test loss",
|
544 |
+
style="margin-bottom: 5px",
|
545 |
+
),
|
546 |
+
),
|
547 |
+
P(
|
548 |
+
"Furthermore, by controlling the pretraining data distribution through deduplication and selective upsampling avoida relying on the often inconsistent distribution of internet-sourced data."
|
549 |
+
),
|
550 |
+
H3("Highlights of the TxT360 Deduplication Process"),
|
551 |
+
P(
|
552 |
+
"Our deduplication process began with 61.8 TB of filtered, and compressed documents, totaling approximately 48.83 billion documents. We first performed exact deduplication using a Bloom filter, reducing the dataset by 17% to 40.21 billion documents. For global near-deduplication, we scaled methodologies from prior works like SlimPajama to handle the entire dataset, including 87 Common Crawl dumps and other curated data. This involved generating document signatures, matching them to identify near-duplicates, and clustering these to retain only one document per cluster. We prioritized retaining documents from curated sources and more recent CommonCrawl dumps. Throughout the deduplication stages, we extensively used Dask for distributed data processing."
|
553 |
+
),
|
554 |
+
P(
|
555 |
+
"After the global near-deduplication of all 87 CommonCrawl dumps and other curated data, we removed around 85% of the total documents. This leaves us with approximately 4.24 trillion deduplicated tokens, which aligns with what FineWeb has reported for their iterative global deduplication. Along with the list of duplicated documents to delete, our deduplication code also saves some metadata about the duplicate clusters that we find. We save statistics about every duplicate cluster we find, with the document ID of the document we retain from the cluster as the key and with a value capturing the distribution of the duplicates within the cluster over the CommonCrawl dumps (identified by the first 2 digits of every document ID). This way, we always have information about the duplicates we have deleted, allowing us to upsample any data distribution we want for training."
|
556 |
+
),
|
557 |
+
P(
|
558 |
+
"During deduplication, it is not feasible to store all the duplicate clusters we form, but we do save some samples at every size. Here are some observations we made by examining these sample duplicate clusters:"
|
559 |
+
),
|
560 |
+
Ul(
|
561 |
+
Li(
|
562 |
+
"Smaller components tend to have more overlap in their MinHash bands. The smallest components, which are essentially pairs, consist of exact duplicate documents that local exact deduplication missed."
|
563 |
+
),
|
564 |
+
Li(
|
565 |
+
"When clusters contain three or more documents, incremental changes in the text become apparent. For example, there may be a growing list of personnel over the years."
|
566 |
+
),
|
567 |
+
Li(
|
568 |
+
"In sizable clusters comprising 1,000 or more documents, we observe a trend towards templatization. This involves the recurrent use of standardized language to convey general topics such as terms and conditions, warnings, and disclaimers. Such language is prevalent on commercial websites, offering a consistent and efficient way to communicate commonly encountered information."
|
569 |
+
),
|
570 |
+
),
|
571 |
+
P(
|
572 |
+
"All Deduplication details can be found in the Global Data Processing Steps section."
|
573 |
+
),
|
574 |
+
id="section4",
|
575 |
+
),
|
576 |
id="inner-text",
|
577 |
)
|
578 |
|
579 |
|
|
|
|
|
580 |
rt("/update/{target}")(data_viewer.update)
|
581 |
|
|
|
582 |
rt("/curated")(curated.curated)
|
583 |
|
584 |
rt("/webdata")(web.web_data)
|