100B-pretokenized-mix-32k
收藏资源简介:
SLM预分词100B混合数据集(32k词汇表)是一个大规模、多领域的文本数据集,专门为语言模型预训练而设计。该数据集包含约1000亿个经过预处理的token,覆盖教育内容、网络文本、百科全书资料和编程代码等多个领域。所有原始文本均使用字节对编码(BPE)分词器进行处理,该分词器拥有32,768的词汇表大小。处理后的数据以uint16整数形式存储,每个token占用2字节,并保存为1 GiB大小的二进制块文件,便于高效加载和流式处理。数据集由六个核心领域混合而成:1)Finewebedu,源自高质量教育网络内容,经过评分过滤(score ≥ 3.5);2)Dclmedu,同样为教育网络内容,使用教育评分过滤(edu_score ≥ 3.25);3)Cosmopedia,包含合成生成的教育性文本,涵盖故事、教程和学术内容;4)Math,专注于数学领域,使用finemath-4plus子集;5)Python,包含Python编程代码,经过ASCII字符白名单过滤以确保代码安全性;6)Wiki,源自英文维基百科的百科全书内容。各领域数据均以文档为单位进行分词,每个文档以开始标记<s>开头,以结束标记</s>结尾,所有文档连接成一个连续的token流,无内部填充,允许在训练时灵活地按任意序列长度进行重塑。该数据集适用于大规模语言模型的预训练和继续预训练任务,特别适合需要高质量、多领域文本数据的场景。其预分词格式和二进制存储方式显著减少了数据加载和预处理的开销,支持从512到8192等多种序列长度的直接重塑,便于适配不同模型架构和训练配置。数据集还提供了完整的元数据和完整性校验机制,确保数据的一致性和可靠性。
The SLM Pre-tokenized 100B Mixed Dataset (32k vocabulary) is a large-scale, multi-domain text dataset specifically designed for language model pre-training. It contains approximately 100 billion preprocessed tokens, covering multiple domains such as educational content, web text, encyclopedia materials, and programming code. All original texts are processed using a Byte Pair Encoding (BPE) tokenizer with a vocabulary size of 32,768. The processed data is stored as uint16 integers, with each token occupying 2 bytes, and saved as 1 GiB binary chunk files for efficient loading and streaming. The dataset is a mixture of six core domains: 1) Finewebedu, derived from high-quality educational web content, filtered by score (score ≥ 3.5); 2) Dclmedu, also educational web content, filtered by educational score (edu_score ≥ 3.25); 3) Cosmopedia, containing synthetically generated educational texts, including stories, tutorials, and academic content; 4) Math, focused on the mathematical domain, using the finemath-4plus subset; 5) Python, containing Python programming code, filtered through an ASCII character whitelist to ensure code safety; 6) Wiki, derived from English Wikipedia encyclopedia content. Data from each domain is tokenized at the document level, with each document starting with a begin token <s> and ending with an end token </s>, and all documents are concatenated into a continuous token stream without internal padding, allowing flexible reshaping to arbitrary sequence lengths during training. The dataset is suitable for large-scale language model pre-training and continued pre-training tasks, particularly for scenarios requiring high-quality, multi-domain text data. Its pre-tokenized format and binary storage significantly reduce data loading and preprocessing overhead, supporting direct reshaping to various sequence lengths from 512 to 8192, facilitating adaptation to different model architectures and training configurations. The dataset also provides complete metadata and integrity verification mechanisms to ensure consistency and reliability.
SLM Pre-tokenized 100B Mix (32k Vocab) 数据集详情
数据集概述
该数据集是一个预分词的多领域混合语料库,总计约1000亿(100B)个token,涵盖教育、网络、百科和编程内容。所有文本均使用BPE分词器(词表大小32,768)进行分词处理,并以uint16整数格式存储为1 GiB的二进制块文件。
- 许可证: Apache-2.0
- 任务类型: 文本生成
- 语言: 英语 (en)
- 数据量: 100B < n < 1T 个tokens
数据集组成与统计
| 领域 | 来源数据集 | 目标配置 | 完成块数 | 处理总Token数 | 过滤器/设置 |
|---|---|---|---|---|---|
| Finewebedu | HuggingFaceFW/fineweb-edu |
30.00B | 56 | 30.06B | score >= 3.5 |
| Dclmedu | HuggingFaceTB/dclm-edu |
30.00B | 56 | 30.06B | edu_score >= 3.25 |
| Cosmopedia | HuggingFaceTB/cosmopedia |
11.20B | 21 | 11.27B | 无分数过滤 |
| Math | HuggingFaceTB/finemath |
9.60B | 18 | 9.66B | finemath-4plus子集 |
| Python | rijuludar/stackedu-en |
10.20B | 19 | 10.20B | ASCII白名单安全过滤 |
| Wiki | HuggingFaceFW/finewiki |
8.60B | 16 | 8.59B | data/enwiki子集 |
| 总计 | — | 99.60B | 186 | 99.85B | — |
技术规格
- 数据类型:
uint16(每个token占用2字节) - 分词器:
rijuludar/slm-tokenizer-32k(BPE,32k词表) - 特殊token映射:
- BOS Token(开始):
<s> - EOS Token(结束):
</s>
- BOS Token(开始):
- 格式: 文档顺序格式化为
[BOS] token_1 token_2 … token_n [EOS],所有文档连接成单一扁平uint16流,无内部填充。 - 块大小: 每个块1 GiB(1,073,741,824字节),包含536,870,912个token(2^29),可被多种序列长度整除,无需余数即可直接重塑。例如:
- 512 序列长度 → 1,048,576 序列
- 1024 序列长度 → 524,288 序列
- 2048 序列长度 → 262,144 序列
- 4096 序列长度 → 131,072 序列
- 8192 序列长度 → 65,536 序列
各领域详细说明
1. Finewebedu
- 来源数据集:
HuggingFaceFW/fineweb-edu - 子集:
sample/350BT - 排除前缀:
["data/sample/"] - 文本列:
text - 过滤条件:
score >= 3.5(列名:score) - 领域标签:
["fineweb-edu", "educational", "web"]
2. Dclmedu
- 来源数据集:
HuggingFaceTB/dclm-edu - 子集: 无
- 文本列:
text - 过滤条件:
edu_score >= 3.25(列名:edu_score) - 领域标签:
["dclm", "educational", "web"]
3. Cosmopedia
- 来源数据集:
HuggingFaceTB/cosmopedia - 已处理子目录:
data/web_samples_v2data/storiesdata/wikihowdata/stanford
- 文本列:
text - 过滤条件: 无
- 领域标签:
["cosmopedia", "synthetic", "educational"]
4. Math
- 来源数据集:
HuggingFaceTB/finemath - 子集:
finemath-4plus - 文本列:
text - 过滤条件: 无
- 领域标签:
["math", "finemath", "stem"]
5. Python
- 来源数据集:
rijuludar/stackedu-en - 子集:
data/python - 文本列:
text - 过滤条件:
python_whitelist(可打印ASCII字符白名单,包括字母、数字、空格、制表符、换行符、回车符及常见标点符号) - 领域标签:
["python", "code", "programming"]
6. Wiki
- 来源数据集:
HuggingFaceFW/finewiki - 子集:
data/enwiki - 文本列:
text - 过滤条件: 无
- 领域标签:
["wikipedia", "encyclopedic"]
使用方法
加载Token块
使用NumPy直接读取二进制文件并重塑为所需序列长度: python import numpy as np tokens = np.fromfile("data/finewebedu/finewebedu-0001.bin", dtype=np.uint16) seqs = tokens.reshape(-1, 2048) # 序列长度2048
完整性验证
通过SHA256哈希值与各领域目录中sample_info.json文件内的元数据进行比对,验证下载的块文件是否损坏。
目录结构
├── README.md ├── data/ │ ├── cosmopedia/cosmopedia-NNNN.bin │ ├── dclmedu/dclm-NNNN.bin │ ├── finewebedu/finewebedu-NNNN.bin │ ├── math/math-NNNN.bin │ ├── python/python-NNNN.bin │ └── wiki/wiki-NNNN.bin ├── cosmopedia/ ← 处理元数据(checkpoint.json, sample_info.json, dataset_info.json等) ├── dclmedu/ ← 处理元数据 ├── finewebedu/ ← 处理元数据 ├── math/ ← 处理元数据 ├── python/ ← 处理元数据 └── wiki/ ← 处理元数据




