Pre-training represents the first and most critical phase in building large language models (LLMs). This phase, when done properly, establishes the core capabilities of the model. By engaging with extensive datasets, LLMs gain a deep comprehension of language and absorb vast amounts of knowledge, preparing them to tackle a variety of downstream tasks effectively. This chapter centers on the preparation of pre-training data, encompassing methods for data collection, preprocessing, tokenization, and scheduling. First, we provide a concise overview of representative data types and examine their influence on pre-training performance. Next, we comprehensively outline the key steps in the data preprocessing pipeline, including quality filtering, sensitive content filtering, and data deduplication. We delve into feasible processing algorithms, spanning from rule-based to model-based approaches, and analyze the strengths and limitations of each method. Following data cleaning, we present tokenization techniques for transforming text strings into fundamental units. In particular, we explore three classic subword tokenization algorithms: BPE, WordPiece, and Unigram. After discussing tokenization, we continue to introduce data scheduling strategies for pre-training, focused on data mixing and data curriculum strategies. Finally, we show a complete training process by integrating all related steps, using the YuLan model as a case study.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Data Preparation

  • Wayne Xin Zhao,
  • Kun Zhou,
  • Junyi Li,
  • Tianyi Tang,
  • Ji-Rong Wen

摘要

Pre-training represents the first and most critical phase in building large language models (LLMs). This phase, when done properly, establishes the core capabilities of the model. By engaging with extensive datasets, LLMs gain a deep comprehension of language and absorb vast amounts of knowledge, preparing them to tackle a variety of downstream tasks effectively. This chapter centers on the preparation of pre-training data, encompassing methods for data collection, preprocessing, tokenization, and scheduling. First, we provide a concise overview of representative data types and examine their influence on pre-training performance. Next, we comprehensively outline the key steps in the data preprocessing pipeline, including quality filtering, sensitive content filtering, and data deduplication. We delve into feasible processing algorithms, spanning from rule-based to model-based approaches, and analyze the strengths and limitations of each method. Following data cleaning, we present tokenization techniques for transforming text strings into fundamental units. In particular, we explore three classic subword tokenization algorithms: BPE, WordPiece, and Unigram. After discussing tokenization, we continue to introduce data scheduling strategies for pre-training, focused on data mixing and data curriculum strategies. Finally, we show a complete training process by integrating all related steps, using the YuLan model as a case study.