← 返回目录
arxiv:2406.17557 · 38 页 · 17 张图

The FineWeb Datasets: Decanting the Web for the

轨道 A 优先级 deep W3 CPTData Quality 原文 ↗ PDF ↗
📝 论文一图速览(Claude Opus 4.7 填写)

一句话总结:FineWeb 用 96 份 CommonCrawl 快照,通过 WARC 自定义抽取 → URL/语言/重复基线过滤 → 单 dump 内 MinHash 去重 → C4 子集启发式过滤 → 自研三条阈值过滤一条流水线,在 1.71B / 350B token 消融上击败 C4 / RefinedWeb / RPv2 / Pile / Slim / Dolma 等所有开源数据集,得到 15T tokens 的开源预训练语料;再用 Llama-3-70B 对 460k 文档打"教育性 0–5 分"训练一个轻量分类器,以阈值 3 过滤得到 1.3T tokens 的 FineWeb-Edu,MMLU/ARC/OpenBookQA 上把开源基线又抬高一档。

🎯 面试考点(高频):

  1. MinHash 在 CommonCrawl:单 dump 内做 vs 跨 dump 做(反直觉结论):全局跨 96 个 dump 迭代 MinHash 把数据从 36T 砍到 4T,但 350B 训练消融 几乎没有提升,远落后 RefinedWeb。原因:跨 dump 去重会把"在很多 dump 反复出现"的文档(往往是被广泛复制的优质内容)删掉,留下的反而是只出现一次的劣质长尾。论文做了对照实验:在最旧的 2013-48 dump 上,被全局去重删掉的 90% 数据,训出的模型比留下的 10% 更好。结论:每个 dump 内部独立做 MinHash(112 hash / 14 buckets × 8 / 5-gram / 75% 相似阈),得到 20T tokens,持平 RefinedWeb。
  2. C4 过滤规则的取舍:C4 的"行末必须有终止标点"过滤删 ~30% token、HellaSwag 单点提升最大,但删得太狠;FineWeb 改用更宽松的自研阈值 — "fraction of lines ending with punctuation < 0.12"(删 10.1%)、"fraction of chars in duplicated lines ≥ 0.1"(删 12.5%)、"fraction of lines < 30 字符 ≥ 0.67"(删 3.7%),三条合计删 ~22%,聚合分提升 ~1%,既超 C4 又少删数据。
  3. 自研启发式过滤怎么挑阈值:不靠目检,而是统计学法 — 用同一个 dump 的"全局去重(低质)"与"独立去重(高质)"两份数据,对 50+ 文档级/重复度指标画直方图,挑两分布差异大的指标、在低质密度明显更高的区段切阈值;先选出 16 个候选,再各跑 28B token 消融,最后留 3 条胜出。
  4. FineWeb-Edu:LLM 打分 → 蒸馏小分类器:用 Llama-3-70B-Instruct 对 460k 篇 CC-MAIN-2024-10 网页打 0-5 教育分(additive 评分 prompt,逐条加分,优于单一打分);在 Snowflake-arctic-embed-m 冻结 embedding 之上训一个线性回归头(20 epoch, lr 3e-4),阈值 ≥ 3 当 "educational",验证集 F1 = 82%。对全量 15T tokens 推理用了 ~6,000 H100 小时,留下 1.3T tokens
  5. vs RPv2 / Slim / Pile / Dolma 的对比口径:每个数据集随机抽 350B tokens 训 1.71B Llama 风格模型,八个 benchmark(CSQA / HellaSwag / OBQA / PIQA / SIQA / Winogrande / ARC / MMLU)取平均。FineWeb ≈ 50% 聚合分,Edu ≈ 52%,均高于 RefinedWeb / Dolma 1.7 / Matrix。FineWeb-Edu 用 38B tokens 就达到 Matrix 训 300B 才有的 MMLU 分(≈ 33.6%) — ~10× token efficiency
  6. WARC vs WET:WET 是 CC 直接给的纯文本但 boilerplate / 菜单残留多;用 trafilatura 自己从 WARC 抽,聚合分明显更高 — 这是后续所有 ablation 的起点。
  7. 主要工程开销:总共训了 70+ 个 1.71B 消融模型,~80,000 H100 hour;Edu 分类器推理另 6,000 H100 hour。释放 datatrove 数据处理库。
  8. 已知局限:消融规模只到 1.71B / 350B(非真实预训练量级);评测全是学术 benchmark、无 SFT / 对齐;FineWeb 男性词/Christian 词偏多,Edu 进一步降低非教育主题(娱乐 / 商业 / 旅游)、提升历史文化教育主题。
📌 我对这篇的学习方针
质量过滤 SOTA,消融实验最透
📚 章节目录

🖼 图表速览 (17 张) · 点击放大

fig_1
fig_1 · p.31 · 640×480

① 图说明:附录 G(偏见分析)饼图。统计 FineWeb 中三个性别词 man / woman / non-binary 的出现频次占比。

② 关键数据:man67.9%,woman32.0%,non-binary0.1%——男性词的出现频率是女性词的约 2 倍,非二元几乎被忽略。

③ 启示:这是"网上文本本就以男性视角为主"的客观反映,FineWeb 没主动校准。后续做 SFT/对齐时需要补充均衡数据。

fig_2
fig_2 · p.31 · 640×480

① 图说明:FineWeb-Edu 上同样的性别词频饼图,与 fig_1(FineWeb)成对比较。

② 关键数据:man 70.2%,woman 29.6%,non-binary 0.2%。Edu 子集里男性词比例反而更高(+2.3pp)、女性词更少(-2.4pp);可能是因为教育/历史类语料中,king / scholar / president 等历史人物多为男性。

③ 启示:"教育性过滤"不会减轻性别不均衡 — 用 Edu 训出的模型在性别中性问答上可能仍偏男性。

fig_3
fig_3 · p.31 · 640×480

① 图说明:FineWeb 中年龄词 young / old 的频次占比饼图。

② 关键数据:old64.5%,young35.5%——"老"词的出现频次几乎是"年轻"的两倍。

③ 启示:反映 web 文本中"old days / old man / get old" 等表达更常见,而 "young" 偏向具体场景。这影响"长者偏见"评估。

fig_4
fig_4 · p.31 · 640×480

① 图说明:FineWeb-Edu 上年龄词频饼图,与 fig_3 对比。

② 关键数据:old 51.5%,young 48.5%——年龄词分布在 Edu 子集里几乎对半开,显著比 FineWeb(64.5 / 35.5)均衡。

③ 启示:教育/历史类语料中"young people / young students" 出现更多;教育子集对"年龄维度"的偏见自然降低 — 这是 Edu 过滤一个意外的副作用,值得记住。

fig_5
fig_5 · p.32 · 640×480

① 图说明:FineWeb 中宗教词的频次占比饼图(christian / jewish / muslim / hindu / buddhist / atheist 等)。

② 关键数据:christian 一枝独秀占 46.1%,jewish 25.6%,muslim 16.7%,hindu 4.8%,buddhist 4.8%,atheist 1.9%

③ 启示:FineWeb 的宗教维度极度倾向基督教视角,与英文 web 文本分布吻合;在跨宗教问答 / 文化敏感场景下,在此数据上训出的模型默认会"基督教化"。

fig_6
fig_6 · p.32 · 640×480

① 图说明:FineWeb-Edu 上宗教词频饼图,与 fig_5 对比。

② 关键数据:jewish 36.3%(↑),christian 33.1%(↓,从 46.1%),muslim 14.5%,buddhist 7.4%(↑),hindu 7.8%(↑),atheist 0.9%(↓)。

③ 启示:教育过滤显著降低了 christian 的过度代表(-13pp),提升了 jewish / hindu / buddhist 等 — 教育/历史类文本会更频繁讨论"犹太教历史""佛教文化",这是 Edu 一个正向副作用。

fig_7
fig_7 · p.33 · 828×1306

① 图说明:FineWeb 中"性别词 × 其它高频词"共现强度热力图。列为 man / man+ / woman / woman+ / non-binary / non-binary+(+ 表示在该群体文本中"超出 baseline 的比例")。

② 关键数据:non-binary 行在 "gender / trans / queer / transgender / lgbtq / sexual" 等词上 + 值最高(0.044–0.061),说明非二元相关文档高度聚焦在性别议题本身;man+ / woman+ 几乎全为 0(关联词分布与整体语料同质化)。

③ 启示:FineWeb 里描述 non-binary 群体的文本,几乎都嵌在"LGBTQ / 跨性别"特定语境;而 man / woman 几乎无主题集中——这意味着模型谈 non-binary 时表达分布更窄,可能更刻板。

fig_8
fig_8 · p.33 · 790×1144

① 图说明:FineWeb 上"性别词关联"TF-IDF 热力图,以 woman+ 列排序(+ 表示 "该列减去所有词的均值",即"超出 baseline 的部分")。和 fig_7 相比,这张按 woman+ 排序、更突出 woman 的共现词。

② 关键数据:共现强度最高的几个词,woman 列:women 0.051、said 0.022、love 0.017、family 0.014;再看 woman+(超出基线):women +0.026、love +0.011、dating 在 woman 列 0.011 / woman+ 0.008。non-binary+ 在 "gender / trans / sexual" 上仍是大正值。

③ 启示:FineWeb 里和 woman 强共现的词,除"women / said"等中性词外,带情感/亲密语境(love、family、dating)的偏高,这与论文 §5 提到的"宗教词 × intimacy"偏见同源。Edu 子集在这点上要好一些(见 fig_2 与下一节)。

fig_9
fig_9 · p.33 · 782×646

① 图说明:性别 TF-IDF 热力图的第三种排序——按 man 列从大到小排,对应论文 Fig 22.C(FineWeb 中"man+"的最强关联)。

② 关键数据:man 列最大值:man 0.046(自共现)、said 0.022、god 0.018、time 0.017、life 0.015、police 0.014。man+ 列(超出基线):man +0.022 一骑绝尘。non-binary+ 几乎全为负(因为这些"通用"词在 non-binary 文本里反而不突出)。

③ 启示:FineWeb 中提到 man 的文档,语境集中于"god / police / life / good"——典型的新闻报道与宗教/社会议题。non-binary 文档则被特定 LGBTQ 话题主导(见 fig_7);两个群体的"语义半径"差异很大,模型在跨群体生成时易于走形。

fig_10
fig_10 · p.34 · 1568×1006

① 图说明:宗教词 TF-IDF 关联热力图,按 atheist+ 列排序——对应论文 Fig 23,展示"无神论者"语境下最显著的共现词。

② 关键数据:atheist 自共现 0.095,atheist+ 0.078(均最大);god 在 atheist 列 0.080 / atheist+ 0.057——明显比 christian (0.026) / muslim (0.012) 都高,说明无神论文本中 god 出现密度反而最高(辩论语境)。christianchristian+ 列 +0.026(catholic+0.018);buddhist 在自列 0.077。

③ 启示:"无神论"文本在 web 上几乎都是"反对/讨论 god"的二阶语料——这解释了为什么训出来的 LLM 谈 atheist 时往往复述基督教叙事。这种"对立绑定"也是 FineWeb 没主动校准的偏见。

fig_11
fig_11 · p.34 · 1576×854

① 图说明:宗教 TF-IDF 关联热力图,按 buddhist+ 列排序(论文 Fig 24)。

② 关键数据:buddhist 自共现 0.169 / buddhist+ 0.134;single 0.085 / buddhist+ 0.069(异常高,与"dating"语境相关);dating 在 buddhist 列 0.110,但 buddhist+ 仅 +0.054——意味着"dating"对 buddhist 是高频但相对差异小。personals 0.064 / buddhist+ 0.045。

③ 启示:就 buddhist 的相对偏置看,关键词集中在"single / dating / personals / chat"——也即 web 中"佛教徒"语境强行被"约会网站"绑架。这是论文 §5 强调的"宗教 × intimacy 偏见"的最直接证据之一,Edu 过滤后这一关联会显著弱化。

fig_12
fig_12 · p.35 · 1574×1156

① 图说明:宗教 TF-IDF 关联,按 christian+ 排序(论文 Fig 25)。

② 关键数据:christian 自共现 0.077 / christian+ 0.049 ;dating 0.192(christian 列最高) / christian+ 仅 0.046 — 因为 dating 在所有宗教里都极高;jewish 0.212 / jewish+ 0.069 同样"dating"占头部;singles 0.076 / christian+ 0.006;catholic christian+ 0.080(强基督教内部共现)。online / online+:christian 0.047 / +0.035。

③ 启示:christian 在 web 上"约会化"严重—— christian dating / christian singles 是高度成型的内容簇,几乎所有宗教都被卷入 dating 语境;catholic 是 christian 真正的"无 dating 关联词"。这也是论文中"religion × intimacy"偏见排第一的实证表现。

fig_13
fig_13 · p.35 · 1558×998

① 图说明:宗教 TF-IDF 关联,按 muslim+ 排序(论文 Fig 26)。

② 关键数据:muslim 自共现 0.115 / muslim+ 0.083;dating 0.164 在 muslim 列高、muslim+ 也是 +0.164(意外地比 christian dating 的 +0.046 高很多)——说明"muslim dating"在数据集里与 christian dating 一样普遍;women 0.043 / muslim+ +0.014;online / sex 也都偏高。

③ 启示:"muslim"在 web 上同样被 dating/约会内容主导,且 muslim 的 intimacy 偏置在所有宗教里相对最大(muslim+ dating = 0.164,几乎与 jewish dating 0.212 同一量级)。Edu 子集对此清洗效果显著。

fig_14
fig_14 · p.36 · 1584×1406

① 图说明:宗教 TF-IDF 关联,按 jewish+ 排序(论文 Fig 27),这是论文 §5 重点点名"intimacy 偏置最大"的图。

② 关键数据:jewish 自共现 0.128 / jewish+ 0.097(很高);dating 0.212(全图最大值)/ jewish+ 0.069;singles 0.110 / jewish+ 0.041 —— "jewish dating" 与 "jewish singles" 是 FineWeb 里和 jewish 强共现的两个最大词;women jewish 0.050 / jewish+ 0.009。

③ 启示:这张图是论文摘要"religion words 与 intimacy 关联最严重"判断的直接证据——jewish 的 dating / singles 关联值在所有宗教里最大。该效应在 Edu 中显著缓解(见正文 §5 与摘要)。

fig_15
fig_15 · p.37 · 1558×1256

① 图说明:宗教 TF-IDF 关联,按 hindu+ 排序(论文 Fig 28)。

② 关键数据:hindu 自共现 0.129 / hindu+ 0.100;dating 0.146 / hindu+ 仅 +0.004(在 hindu 语境里 dating 相对不突出);indian 0.037 / hindu+ +0.026(特有);single 0.054 / hindu+ +0.017。其它"women / men / family"等通用词在 hindu+ 上几乎为 0。

③ 启示:hindu 的 intimacy 偏置比 jewish / muslim 弱,真正的特殊关联是 indian / single(印度文化语境);这意味着用 FineWeb 训出的模型谈 hindu 时,主题更偏文化/民族而非约会——与 jewish / christian 的偏置面相完全不同。

fig_16
fig_16 · p.38 · 444×1350

① 图说明:年龄词 TF-IDF 关联,按 old 列排序(论文 Fig 29.A)。

② 关键数据:old 自共现 0.034 / old+ 0.012(差异不大);其它共现词在 old / young 两列几乎贴近,例如 just 0.019 / 0.016、like 0.021 / 0.017、time 0.019 / 0.017;old+ 列几乎全是 +0.001~0.002 的微正值,而对应的 young+ 几乎全为 -0.001~-0.002。

③ 启示:"old" 在 FineWeb 中的差异化语境很弱——它和"young"共现的几乎是同一组高频通用词(time / good / day / way / great)。换言之,年龄维度上 FineWeb 没明显刻板偏见,但也意味着模型对"old / young"两个词的语义区分主要靠词本身,而非语境支撑。

fig_17
fig_17 · p.38 · 462×702

① 图说明:年龄词 TF-IDF 关联,按 young 列排序(论文 Fig 29.B),与 fig_16 配对。

② 关键数据:young 自共现 0.038 / young+ 0.016 (比 old+ 大);children 0.016 / young+ +0.005;women 0.011 / young+ +0.003 —— 论文直接点名这是"过度关注女性年轻化"的实证(Durham 79 / Sidani 80);school 0.013 / young+ +0.003;child 0.009 / young+ +0.002。

③ 启示:young 在 FineWeb 中最特征化的共现是 children / women / school / child / family ——其中"young women / young girl"的共现明显高于"old women"。这正是论文引用文献(Lolita effect, hypersexualization of young girls)指出的英语 web 文本的结构性偏见,是 FineWeb 无法自动消除、需要下游对齐处理的部分。

📖 论文正文(英文,按章节折叠)

Preamblep.1

The FineWeb Datasets: Decanting the Web for the Finest Text Data at Scale Guilherme Penedo Hynek Kydlíˇcek Loubna Ben allal Anton Lozhkov Margaret Mitchell Colin Raffel Leandro Von Werra Thomas Wolf Hugging Face https://huggingface.co/datasets/HuggingFaceFW/fineweb https://huggingface.co/datasets/HuggingFaceFW/fineweb-edu

Abstract / 摘要p.1

The performance of a large language model (LLM) depends heavily on the quality and size of its pretraining dataset. However, the pretraining datasets for state-of-the-art open LLMs like Llama 3 and Mixtral are not publicly available and very little is known about how they were created. In this work, we introduce FineWeb, a 15-trillion token dataset derived from 96 Common Crawl snapshots that produces better-performing LLMs than other open pretraining datasets. To advance the understanding of how best to curate high-quality pretraining datasets, we carefully document and ablate all of the design choices used in FineWeb, including in-depth investigations of deduplication and filtering strategies. In addition, we introduce FineWeb-Edu, a 1.3-trillion token collection of educational text filtered from FineWeb. LLMs pretrained on FineWeb-Edu exhibit dramatically better performance on knowledge- and reasoning-intensive benchmarks like MMLU and ARC. Along with our datasets, we publicly release our data curation codebase and all of the models trained during our ablation experiments.

大语言模型(LLM)的性能严重依赖于其预训练数据集的质量与规模。然而,Llama 3、Mixtral 等当前最强的"开源"LLM,其预训练数据集并未公开,关于它们如何构建也几乎没有公开信息。在本工作中,我们提出 FineWeb——一个从 96 份 CommonCrawl 快照中提取的 15 万亿(15T)token 的数据集,所训出的 LLM 优于其它开源预训练数据集。为了推进关于"如何构建高质量预训练数据集"的理解,我们对 FineWeb 中所有的设计选择都做了细致的文档化与消融,包括对去重(dedup)与过滤策略的深入研究。此外,我们还提出 FineWeb-Edu——一个从 FineWeb 中筛出的、含 1.3 万亿 token 的教育性文本子集。在 FineWeb-Edu 上预训练的 LLM 在 MMLU、ARC 等知识与推理类基准上表现显著更好。我们同时开源数据集、整套数据处理代码库以及消融阶段训练的全部模型。

Introduction / 引言 + 背景综述p.1
§1 Introduction / 引言

Large Language Models (LLMs) have quickly become a ubiquitous technology thanks to their ability to competently perform a wide range of text-based tasks. A driving factor in the success of LLMs has been a steady increase in model sizes, which in turn necessitate ever-larger pretraining datasets. Beyond scale, other characteristics of pretraining data have proven to be important, including filtering out "low-quality" content and removing duplicate text. Ultimately, the curation choices made when developing a pretraining dataset can have a huge impact on the downstream capabilities and performance of an LLM. As such, pretraining dataset curation strategies are often treated as closely guarded trade secrets. In fact, there are many popular "open" language models whose parameters are publicly available but whose pretraining datasets were not released and are scarcely documented. The lack of access to high-quality large-scale pretraining datasets and lack of information about their curation has led to concerns of a growing gap between proprietary and public knowledge.

大语言模型(LLM)凭借在大量文本任务上的胜任能力,迅速成为一种无处不在的技术。LLM 成功背后的一大驱动因素是模型规模的持续增长——而这又需要越来越大的预训练数据集。在规模之外,预训练数据的其它特性也被证明十分重要,包括过滤掉"低质量"内容,以及去除重复文本。最终,在构建预训练数据集时所做的"整理(curation)选择",会对 LLM 的下游能力与表现产生巨大影响。正因如此,预训练数据集的整理策略往往被视为"看得很紧的商业机密"。事实上,有不少流行的"开源"语言模型,虽然参数公开,但其预训练数据集既未释放,也几乎没有文档可查。无法获取高质量、大规模的预训练数据集,以及对其整理流程缺乏信息,引发了人们对"私有知识与公开知识鸿沟正在拉大"的担忧。

In this work, we aim to minimize this gap by developing and releasing the FineWeb datasets, a collection of large-scale pretraining datasets that can be used to train performant LLMs. Specifically, we first introduce FineWeb, a 15-trillion token dataset of text sourced from 96 Common Crawl snapshots. FineWeb is sufficiently large to train a Chinchilla-optimal model with more than 500 billion parameters. Beyond scale, FineWeb's recipe involves a principled strategy for choosing and tuning filtering heuristics that helped produce a small set of effective filters out of over fifty candidate filters from past work. In addition, we performed an in-depth exploration of how different deduplication strategies and granularities can impact performance. To validate our design choices, we ultimately demonstrate that models trained on FineWeb perform better than those trained on other public web-based pre-training datasets.

在本工作中,我们旨在通过开发并释出 FineWeb 数据集——一组可用来训练高性能 LLM 的大规模预训练数据集合——把这一鸿沟最小化。具体来说,我们先提出 FineWeb:一个从 96 份 CommonCrawl 快照中抽取的 15T token 文本数据集。FineWeb 已足够大,可以用 Chinchilla 最优配比训出一个 500B+ 参数的模型。在规模之外,FineWeb 的配方还包含一套"系统化挑选与调优启发式过滤器"的策略——它从以往工作中超过 50 个候选过滤器里,筛出一小撮真正有效的过滤器。此外,我们还对不同去重(dedup)策略与粒度如何影响性能,做了深入探究。为了验证设计选择,我们最终证明:在 FineWeb 上训练的模型,优于在其它公开 web 类预训练数据集上训练的模型。

Inspired by recent work advocating for training LLMs on educational data, we additionally introduce FineWeb-Edu, a subset of 1.3 trillion tokens from FineWeb that was rated as highly educational by a custom classifier. Models trained on FineWeb-Edu exhibit significantly better performance on knowledge- and reasoning-intensive benchmarks like MMLU and ARC. Both datasets are released under the permissive ODC-By License. Apart from contributing datasets, we also release datatrove, the data processing library we developed to create FineWeb. On the whole, our work represents a significant step towards improving public knowledge and resources for curating LLM pre-training datasets.

受"在教育性数据上训练 LLM"这一最近趋势的启发,我们额外提出 FineWeb-Edu:它是 FineWeb 的一个 1.3T token 子集,由一个自研分类器判定为"高教育性"的文档构成。在 FineWeb-Edu 上训练的模型,在 MMLU、ARC 等知识与推理密集型基准上表现显著更好。两份数据集都以宽松的 ODC-By 协议释放。除数据集外,我们还释放了 datatrove——构建 FineWeb 时开发的数据处理库。总的来说,本工作为提升"公开的 LLM 预训练数据整理知识与资源"迈出了重要一步。

§2 Background / 背景

In this work, we focus on the curation of training datasets for autoregressive Transformer-based large language models (LLMs). At their core, LLMs aim to produce a distribution over the next token of text conditioned on past tokens, where each token is typically a word or subword unit. The generality of this paradigm allows LLMs to be applied to virtually any text-based task by formulating a prefix whose continuation corresponds to performing the task. Such models may undergo many stages of training including pretraining on unstructured text data, fine-tuning to improve performance on a specific task, multitask fine-tuning to improve generalization, and learning from human feedback to improve instruction-following capabilities. In this work, we focus solely on curating data for the pretraining stage.

本工作聚焦于"为自回归 Transformer 大语言模型(LLM)整理训练数据"。本质上,LLM 的目标是基于过往 token 预测下一个 token 的分布,其中每个 token 通常是一个单词或子词单元。该范式的通用性让 LLM 可以通过"写一个前缀,让其续写完成任务"的方式被应用到几乎任何文本任务上。这类模型可能要经历多个训练阶段——在非结构化文本上预训练、为某具体任务做微调、为提升泛化做多任务微调、用人类反馈学习以提升指令跟随等等。本文只关注预训练阶段的数据整理。

While many sources have been considered for pretraining data including text from books, Wikipedia, and research papers, a highly common choice is to use web text, i.e. text scraped from webpages on the public internet. While some companies like OpenAI and Anthropic perform their own web scrapes, designing, implementing, and running a web scraper at scale requires significant resources and expertise. Many LLM pretraining datasets have therefore been constructed from text from the Common Crawl, a publicly available and continually updated collection of website snapshots that has been running since 2007. As of writing, Common Crawl has produced 100 web snapshots totaling petabytes of data. Although Common Crawl has produced more than enough data to train recent LLMs, it has been shown that the performance of an LLM can heavily depend on how web text has been filtered and preprocessed before being used for pretraining.

预训练数据来源繁多——书籍、Wikipedia、科研论文等等;但最常见的选择仍是 web 文本,即从公开互联网网页抓取的文本。虽然 OpenAI、Anthropic 等公司会自建网爬,但要在大规模下设计、实现、运行一个网爬器需要大量资源与专业知识。因此,许多 LLM 预训练数据集都是基于 CommonCrawl 构建的——这是一个自 2007 年以来持续更新的公开网页快照集合。截至本文写作时,CommonCrawl 已产出 100 份 web 快照,合计 PB 级数据。尽管 CommonCrawl 的数据量早已超出训练近期 LLM 所需,但已有研究表明:LLM 性能严重依赖于"在用作预训练前 web 文本如何被过滤与预处理"。

In particular, web text can contain a large amount of "unnatural" language (e.g. "boilerplate" text, gibberish, etc.). Training on unnatural language data can harm the performance of LLMs, possibly because most downstream uses of LLMs do not involve such data. On the other hand, filtering out too much content can produce a dataset that is too small to perform sufficient pretraining for a general use model. Separately, web text can contain a large amount of duplicated content, which has also been shown to be harmful in the context of pretraining data. While deduplication may seem as straightforward as "removing duplicate text", in practice many design choices must be made (line, paragraph, or document-level deduplication? fuzzy or exact matching? etc.). The curation and relative performance of different web text-based pretraining datasets therefore heavily depends on a given dataset's filtering and deduplication pipeline.

具体而言,web 文本含有大量"不自然语言",如 boilerplate(模板/导航文)、乱码等。在不自然语言上训练会损害 LLM 性能——可能是因为 LLM 的下游用途大多不涉及这种数据。另一方面,过滤掉太多内容,会让数据集变得太小、无法支撑通用模型的预训练。此外,web 文本含有大量重复内容,在预训练数据语境下这同样已被证明有害。dedup 看似只是"删去重复文本"那么简单,但实际中要做很多设计选择:行级 / 段级 / 文档级?fuzzy 还是 exact?……因此,各家 web 类预训练数据集的整理质量与相对表现,严重取决于它的过滤与 dedup 流水线。

Survey of prior pipelines. OSCAR processes Common Crawl with a fastText language classifier + line-level non-cryptographic hash dedup. C4 uses langdetect + a series of heuristics (terminal-punctuation, length, "bad words" list, etc.) + 3-line-window dedup. CC-100 uses the cc_net pipeline: fastText for LID, paragraph-level hash dedup, and a Wikipedia-trained n-gram LM perplexity filter. The Pile contains "Pile-CC" from one snapshot, processed with pycld2 / jusText / WebText-similarity classifier and MinHash fuzzy dedup. RedPajama processes CC with cc_net plus a Wikipedia-vs-random classifier; SlimPajama further removes short docs and adds extra MinHash dedup. RefinedWeb uses trafilatura + fastText + MassiveText-style heuristics + MinHash + ExactSubstr dedup. RedPajama v2 ships 84 unfiltered snapshots with quality annotations (cc_net / C4 / MassiveText / RefinedWeb) and dedup labels (Bloom + MinHash). Dolma's CC subset uses fastText, MassiveText+C4 heuristics, toxicity filters, and URL/doc/paragraph Bloom-filter dedup. Among closed models, WebText scraped Reddit-linked pages, GPT-3 used a WebText-classifier + MinHash, and MassiveText (Gopher) used SafeSearch + content heuristics + MinHash.

已有流水线综述。OSCAR:fastText 做语言判别 + 行级非加密哈希 dedup;C4:langdetect + 一组启发式规则(终止标点、长度、"脏话表"等)+ 3 行窗口 dedup;CC-100:cc_net 流水线(fastText LID + 段级哈希 dedup + Wikipedia n-gram LM 困惑度过滤);Pile:Pile-CC 用 pycld2、jusText 去 boilerplate、WebText 相似度分类器、MinHash 模糊 dedup;RedPajama:CC + cc_net + "Wikipedia vs 随机 CC"质量分类器;SlimPajama:在 RPv1 之上删短文档 + 再做一遍 MinHash;RefinedWeb:trafilatura 抽文 + fastText + MassiveText 风格启发式 + MinHash + ExactSubstr;RPv2:84 份"原汁"快照 + 多套质量标注(cc_net / C4 / MassiveText / RefinedWeb)+ 两套 dedup 标签(Bloom + MinHash);Dolma CC 子集:fastText + MassiveText+C4 规则 + 毒性过滤 + URL/文档/段三层 Bloom dedup。闭源端:WebText 仅取被 Reddit 高赞贴链接到的网页;GPT-3 用 "WebText 分类器 + MinHash";Gopher 的 MassiveText 用 SafeSearch + 内容启发式 + MinHash。

中文导读 · 引言要点
  • 问题:Llama 3 / Mixtral 等"开源"模型不开放预训练数据,导致公开/私有数据知识鸿沟拉大。
  • 本文目标:① 释放 FineWeb(15T tokens, 96 CC 快照)+ FineWeb-Edu(1.3T 教育子集);② 完整公开消融、训练代码、所有 ablation checkpoint;③ 释放 datatrove 数据处理库。
  • 研究方法:纯实证 ablation——每一步流水线设计都用"训 1.71B 模型在 28B / 350B token 上跑、八个 benchmark 取平均"来验证。
  • 背景关键词盘点:OSCAR / C4 / CC-100 / Pile / RedPajama / SlimPajama / RefinedWeb / RPv2 / Dolma —— 每家在"语言判别 + 启发式 + dedup"三件套上各有取舍,本节给出非常密集的对照。
Pipeline / 流水线:URL 过滤 + Dedup + 质量过滤p.3
§3.1 Experimental setup / 实验设置

Our design of FineWeb is primarily empirical: we performed a series of "data ablation" experiments to test different methods at each stage of the pipeline. All ablations follow an iterative process: the baseline for each subsection includes only the processing steps from previous subsections. We compare pipeline design choices by training data ablation models that are identical apart from the data they were trained on (same parameters, architecture, equal number of randomly sampled tokens). To minimize random-subset noise, we trained two models per dataset version with different random subsets and seeds, and averaged the scores.

All training used nanotron. Ablation models had 1.71B parameters (with embeddings), Llama architecture, 2048 sequence length, ~2M-token global batch size, GPT-2 tokenizer. Filtering ablations: ~28B tokens (roughly Chinchilla-optimal for this size). Deduplication ablations and final cumulative runs: 350B tokens. We trained over 70 models for a total of ~80,000 H100 GPU-hours. Evaluation used lighteval on CommonSenseQA, HellaSwag, OpenBookQA, PIQA, SIQA, WinoGrande, ARC, and MMLU (truncated to 1000 samples each).

FineWeb 的设计主要是实证的:我们对流水线每一阶段都做一系列"数据消融"实验。所有消融遵循迭代:每一小节的 baseline 只包含前面小节已经确定的处理步骤。要比较流水线设计,我们训一组"除了数据其它都相同"的 ablation 模型(同参数、同架构、同等数量的随机采样 token)。为了压低随机子集带来的噪声,每个数据版本训两个模型(不同随机子集 + 不同种子)并取平均。

训练用 nanotron 库。Ablation 模型为 1.71B 参数(含 embedding)、Llama 架构、序列长度 2048、global batch ≈ 2M tokens、GPT-2 tokenizer。过滤消融用 ≈ 28B tokens(差不多就是该模型规模的 Chinchilla 最优);dedup 消融和最终累积验证用 350B tokens。一共训了 70+ 个模型,大约 80,000 H100 小时。评测用 lighteval,选 CSQA / HellaSwag / OBQA / PIQA / SIQA / Winogrande / ARC / MMLU 八个(大基准都截到 1000 条以便边训边评)。

§3.2 Text extraction (WARC vs WET) / 正文抽取

CommonCrawl data comes in two formats: WARC (raw HTML + crawl metadata) and WET (text-only, extracted with a generic htmlparser). Similarly to Gao et al., we found that WET files retained too much boilerplate and menu text. We therefore extracted text from WARC files using the open-source trafilatura library, which by visual inspection gave less boilerplate than other libraries. Custom extraction is expensive but pays off: training on trafilatura-WARC clearly beats WET when only fastText English filtering is applied and no deduplication is done. We therefore use WARC-based data in all later experiments.

CommonCrawl 提供两种格式:WARC(原始 HTML + 抓取元数据)与 WET(用通用 htmlparser 抽出来的纯文本)。和 Gao 等人一样,我们发现 WET 残留太多 boilerplate / 菜单文字。于是我们用开源 trafilatura 库自己从 WARC 抽取——目视下它比其它库更干净。自定义抽取成本不低,但回报很明显:只做 fastText 英文过滤、不去重的设定下,trafilatura-WARC 训出的模型聚合分明显高于 WET。因此后续所有实验都基于 WARC 数据。

§3.3 Base filtering / 基线过滤

As a starting point, we applied a basic pipeline borrowed from RefinedWeb: URL filtering via a blocklist (adult content), fastText language classifier keeping only English with score ≥ 0.65, and MassiveText-style quality and repetition filters at their original thresholds. Applying this filtering to all 96 WARC-extracted snapshots produced roughly 36 trillion tokens (GPT-2 tokenizer). This step yields a clear performance uplift over unfiltered WARC.

作为起点,我们从 RefinedWeb 借来一条基线过滤流水线:用屏蔽名单做 URL 过滤(屏蔽成人内容);用 fastText 语言分类器,只保留英文(分 ≥ 0.65);再套用 MassiveText 风格的质量与重复度过滤(沿用其原始阈值)。对所有 96 份 WARC 提取的数据做完上述操作,得到 ≈ 36T tokens(GPT-2 tokenizer)。这一步相对未过滤的 WARC 已经能带来明显的性能提升。

§3.4 Deduplication / 去重 — 全文最反直觉的一节

Following RefinedWeb, we use MinHash, a fuzzy hash-based dedup technique. We collect each document's 5-grams (English word tokenizer), compute 112 MinHashes split into 14 buckets of 8 hashes each — targeting documents that are at least 75% similar. Documents sharing the same 8 MinHashes in any bucket are duplicates. We then perform transitive clustering and keep one random document per cluster.

沿用 RefinedWeb,我们用 MinHash(基于哈希的模糊 dedup)。每篇文档先用英文分词器抽 5-gram,再算 112 个 MinHash,把它们切成 14 个桶 × 每桶 8 个 hash——目标是召回相似度 ≥ 75% 的文档对。任一桶中 8 个 MinHash 完全相同就视为重复;再做一次"传递闭包"聚类(A≈C、B≈C 则 A、B 同簇),每个簇随机留一份。

Global dedup did not help. Our first attempt was iterative MinHash across all 96 snapshots, starting with the most recent (2023-50). For the oldest snapshots this removed up to 90% of base-filtered data, shrinking the dataset to ~4T tokens. But on a 350B-token training run, the ablation model showed almost no improvement and remained far below RefinedWeb. We then trained two probes on slices of the 2013-48 snapshot: (a) the ~31B tokens kept after global dedup ("originally kept"), and (b) 171B tokens obtained by independently deduplicating the ~460B tokens that had been removed ("originally removed"). The "originally removed" data trained a clearly better model — visual inspection confirmed the "kept" data was actually worse (more ads, gibberish keyword lists, badly formatted text).

全局 dedup 没用。第一次尝试是跨 96 份快照迭代 MinHash:从最新的 2023-50 开始,按时间倒推。对最古老的快照,这一步删掉了高达 90% 的基线过滤数据,整体只剩 ≈ 4T tokens。但在 350B token 训练消融上,该模型相比未去重几乎没有提升,远落后于 RefinedWeb。我们继而做了一个对照实验:在 2013-48 快照上训两个模型——(a) 全局 dedup 保留 下来的 ≈ 31B tokens,(b) 把它删掉的 ≈ 460B tokens 在单 dump 内再独立 dedup 一次得到的 171B tokens。结果(b) 训出的模型明显更好——目视核对也确认:被保留的那 10% 其实更差(广告多、关键词堆砌、格式混乱)。

Per-snapshot dedup matches RefinedWeb. We then deduplicated each snapshot independently with the same MinHash parameters, yielding ~20T tokens. Training on a random sample drawn from all snapshots matched RefinedWeb. Our hypothesis: the real win from dedup comes from killing the very large duplicate clusters (hundreds of thousands of docs) that recur across all crawls; pushing further to also kill small clusters (≲ 100 dups, i.e. on the order of the number of crawls) actually hurts, because such "rare cross-crawl repeats" tend to be exactly the canonical, high-quality content. Several lighter global-dedup variants we tried (Appendix E.3) all underperformed per-snapshot dedup.

每个 dump 内独立 dedup 才打平 RefinedWeb。于是我们改成"每份快照独立去重、其它快照不参与",参数同上,得到 ≈ 20T tokens。从所有快照随机均匀采样训练,聚合分持平 RefinedWeb。我们的猜想是:dedup 真正带来收益的,是删除那些"上百万份的大重复簇"(在所有快照里反复出现的 boilerplate);如果继续把规模更小的簇(重复数 ≲ 100,跟快照数相当)也删掉,反而有害——因为这些"跨 dump 偶尔重复的内容"恰恰是经典、被广泛引用的优质内容。我们尝试过若干"更轻量的全局 dedup"(附录 E.3)也都不如单 dump 独立 dedup。

§3.5 Adding C4's filters / 引入 C4 的启发式过滤

At this point our pipeline matched RefinedWeb, but C4 (despite being smaller) still beat us on some benchmarks — notably HellaSwag, the highest-signal task. C4's filters drop lines without terminal punctuation, lines that mention "javascript" or "terms-of-use"/"cookie policy", short documents, and documents containing "lorem ipsum" or a curly bracket. We applied them to the 2019-18 crawl after base filtering + per-snapshot MinHash.

此时我们已与 RefinedWeb 持平,但 C4(虽然总量小得多)仍在我们某些基准上更高,尤其是信噪比最好的 HellaSwag。C4 的启发式规则包括:删掉"行尾没有终止标点"的行、删掉提到"javascript"或"使用条款 / cookie 政策"的行、删掉过短文档,以及包含"lorem ipsum"或花括号 { 的文档。我们将它们叠加到"base filtering + 单 dump MinHash"后的 2019-18 快照上做对比。

Results: applying all C4 filters matches C4's HellaSwag performance; the Curly Bracket filter removes 2.8% of tokens (small boost), Word Length removes 4.3% (small boost), and Terminal Punctuation alone gives the biggest single boost but removes ~30% of all tokens. The lorem_ipsum / javascript / policy rules remove < 0.5% each. We adopted all C4 filters except Terminal Punctuation — it deletes too much data for its benefit. "All-but-terminal" removes only ~7% in total.

结果是:全部 C4 过滤器一起上,HellaSwag 才能持平 C4;花括号过滤删 2.8% tokens(小提升),字长过滤删 4.3%(小提升),单独看"行末终止标点"过滤提升最大,但要删掉约 30% 的 token;lorem_ipsum / javascript / policy 各删 < 0.5% 太小不单独跑。我们最终采用除终止标点以外的所有 C4 过滤器——终止标点删得太狠不值。"All-but-terminal" 加在一起也只删 ≈ 7%。

§3.6 Developing additional heuristic filters / 自研启发式过滤

Past heuristic filters were typically devised by data inspection. We instead use a more systematic approach: collect 50+ high-level statistics — from document-level metrics (number of lines, avg. line/word length, etc.) to inter-document repetition metrics (à la MassiveText) — on both a "high-quality" and a "low-quality" dataset. We took the independently and globally deduplicated 2013-48 snapshot as the high- and low-quality probes, respectively. For each metric, we plot the two distributions and pick a threshold targeting regions where the low-quality density is higher than the high-quality density. This gave 16 candidate metric-threshold pairs.

以往的启发式过滤往往是目视样本得到的。我们改用一套更系统的方法:对一份"高质数据"和一份"低质数据"分别统计 50+ 个文档级指标(行数、平均行/词长)和文档间重复指标(借鉴 MassiveText)。我们用"独立 dedup 的 2013-48 快照"当高质,用"全局 dedup 的同一份快照"当低质(后者前文已论证更差)。对每个指标画两份直方图,然后选一个阈值,精准切到"低质密度明显 ≥ 高质密度"的区段。这样得到 16 个候选的"指标—阈值"对。

We then ran 28B-token ablations for each candidate on the 2019-18 crawl. Three filters were retained, with thresholds notably lighter than past work: (i) remove docs where fraction of lines ending with punctuation < 0.12 (removes 10.14% of tokens vs. C4's terminal-punctuation 30%); (ii) remove docs where fraction of characters in duplicated lines ≥ 0.1 (removes 12.47%, vs. MassiveText's 0.2); (iii) remove docs where fraction of lines shorter than 30 chars ≥ 0.67 (removes 3.73%). Together they remove ~22% of tokens and increase aggregate score by ~1% in 28B ablations — beating C4 while filtering less data.

然后对每个候选在 2019-18 上跑 28B token 消融。最终留下 3 条过滤器,阈值都比已有工作"温和":(i) 删除"行末有终止标点的行占比 < 0.12"的文档,删 10.14% tokens(对比 C4 终止标点的 30%);(ii) 删除"重复行中字符占总字符比例 ≥ 0.1"的文档,删 12.47%(对比 MassiveText 的 0.2);(iii) 删除"短于 30 字符的行占比 ≥ 0.67"的文档,删 3.73%。三条合起来删 ≈ 22% tokens,28B 消融上聚合分 +1% 左右——既超过 C4,又比 C4 少删数据。

中文导读 · Pipeline 核心结论
  • WARC + trafilatura > WET:CommonCrawl 默认 WET 抽得太脏。
  • MinHash 反直觉:跨 96 dump 全局做反而更差。理由:全局 dedup 会把"被广泛复制的优质长文"删掉,留下只出现一次的低质长尾。每个 dump 内单独 dedup 才是对的(20T tokens 持平 RefinedWeb)。
  • C4 终止标点过滤"贵在精,凶在量":HellaSwag 提升靠它,但删 30% tokens 太狠;FineWeb 用自研更软的"punct_line_ratio < 0.12"代替,只删 10%。
  • 阈值挑选法:不靠目检,用"高质 vs 低质两套数据"直方图差异自动定阈值,先选 16 个候选再各跑 28B ablation,留下 3 条。
Ablations / 累积消融 + 对比公开数据集p.7
§3.7 Final FineWeb pipeline / 最终流水线

The final FineWeb pipeline composes the choices made in the previous subsections in this exact order: (1) trafilatura text extraction on WARC files; (2) base filtering (URL blocklist + fastText English with score ≥ 0.65 + MassiveText quality/repetition filters at original thresholds); (3) per-snapshot independent MinHash deduplication; (4) all C4 heuristic filters except terminal punctuation; (5) the three custom heuristic filters identified in §3.6; (6) PII anonymisation (email + public IP via regex). Each individual step provides a measurable benchmark uplift on the aggregate of eight tasks. Applied to all 96 CommonCrawl snapshots available at the time of writing, the pipeline produces the 15-trillion-token FineWeb dataset, large enough to train a Chinchilla-optimal model with more than 500B parameters.

最终 FineWeb 流水线把前面各小节确定下来的设计选择,按以下严格顺序拼接:(1) 在 WARC 文件上用 trafilatura 抽取正文;(2) 基线过滤(URL 屏蔽名单 + fastText 英文 ≥ 0.65 + MassiveText 风格的质量与重复过滤,使用原阈值);(3) 每份快照独立做 MinHash 去重;(4) 除"终止标点"外的全部 C4 启发式过滤;(5) §3.6 中确认的三条自研启发式过滤;(6) PII 匿名化(用正则规则替换邮箱与公网 IP)。每个单独步骤在八基准聚合上都能提供可测得的提升。在写作时可用的全部 96 份 CommonCrawl 快照上跑完整套流水线,得到 15 万亿 token 的 FineWeb 数据集——足以以 Chinchilla 最优比训出一个 500B+ 参数的模型。

Comparison with public datasets / 对比公开数据集

To benchmark FineWeb against the open ecosystem, the authors retrain identical 1.71B ablation models on 350B randomly sampled tokens from each candidate dataset and average eight benchmark scores (CommonSenseQA / HellaSwag / OpenBookQA / PIQA / SIQA / WinoGrande / ARC / MMLU). The contenders are: RefinedWeb (500B), C4 (172B), the CommonCrawl-based parts of Dolma 1.6 (3T) and 1.7 (1.2T), The Pile (340B), SlimPajama (627B), the deduplicated RedPajama 2 (20T), the English CommonCrawl slice of Matrix (1.3T), English CC-100 (70B), and Colossal-OSCAR (850B). No upsampling of any individual CC snapshot is performed. On the aggregate score (Figure 10), FineWeb finishes first among the base web datasets at ≈ 50% accuracy and FineWeb-Edu pushes the score to ≈ 52%, dominating every other open option; on MMLU specifically (Figure 11), FineWeb-Edu hits 33.6% accuracy with only 38B training tokens — Matrix needs roughly 300B tokens to reach the same point, a ≈ 10× token-efficiency gap that headlines the result. Each upstream pipeline step (base filtering → per-snapshot MinHash → C4 filters → custom filters) is independently shown to lift the FineWeb curve in Figure 9, validating that the gains compound rather than being driven by a single trick.

为了把 FineWeb 与开源生态横向对比,作者用同一套 1.71B 消融模型,从每个候选数据集随机采 350B token 训练,在八个 benchmark(CommonSenseQA / HellaSwag / OpenBookQA / PIQA / SIQA / WinoGrande / ARC / MMLU)上取平均。参赛数据集为:RefinedWeb(500B)、C4(172B)、Dolma 1.6(3T)与 1.7(1.2T)的 CommonCrawl 部分、Pile(340B)、SlimPajama(627B)、去重后 RedPajama 2(20T)、Matrix 英文 CC(1.3T)、CC-100 英文(70B)、Colossal-OSCAR(850B);任何单一 CC 快照都不做上采样。聚合分(论文 Figure 10)上,FineWeb 在"基础 web 数据集"中以 ≈ 50% 居首,FineWeb-Edu 进一步推到 ≈ 52%,横扫所有公开候选;具体到 MMLU(论文 Figure 11),FineWeb-Edu 仅用 38B 训练 token 就达到 33.6%,而 Matrix 要 ≈ 300B token 才到同一点——这意味着大约 10× 的 token 效率,是这一节的标志性结论。Figure 9 还展示了流水线的每一步(基线过滤 → 单 dump MinHash → C4 过滤 → 自研过滤)都独立带来 FineWeb 曲线上扬——证明增益是叠加的,不是某个单点 trick 带来的。

Looking at per-benchmark breakdowns in Figure 16: on MMLU FineWeb-Edu hits ≈ 37–38% vs. FineWeb ≈ 33% vs. Matrix ≈ 33% vs. C4 ≈ 30%; on ARC FineWeb-Edu reaches ≈ 56% vs. FineWeb ≈ 46% (an outright 10-point absolute gap that is the largest in the paper); CommonSenseQA spans 30–40% with FineWeb-Edu on top; HellaSwag is the only benchmark where FineWeb-Edu does not dominate — it lands ≈ 55–57% vs. the leaders' ≈ 62%, since highly-educational text is leaner on common-sense narrative. PIQA (70–78%), SIQA (38–42%) and WinoGrande (52–58%) cluster tightly across datasets, signalling these benchmarks are largely saturated at this scale. The Aggregate panel sums these up into the headline ≈ 52% vs. ≈ 50% gap. Importantly, since training compute is fixed at 350B tokens, the FineWeb-Edu lead is genuine token-efficiency — not merely "trained on more data".

看 Figure 16 的单基准分布:MMLU 上 FineWeb-Edu 大约 37–38% vs. FineWeb ≈ 33% vs. Matrix ≈ 33% vs. C4 ≈ 30%;ARC 上 FineWeb-Edu 到 ≈ 56% vs. FineWeb ≈ 46%——绝对值差 10 个点,是全文最大差距;CommonSenseQA 分布在 30–40%,FineWeb-Edu 居首;HellaSwag 是唯一一个 FineWeb-Edu 不占优的项 — 它落在 ≈ 55–57% vs. 领先者的 ≈ 62%,因为"高教育性文本"在常识叙事上偏稀薄。PIQA(70–78%)、SIQA(38–42%)、WinoGrande(52–58%)各数据集挤在一起,提示这些基准在该规模下已经饱和。聚合面板把这些汇成"≈ 52% vs. ≈ 50%"这条标志线。要注意:训练算力固定在 350B token,所以 FineWeb-Edu 的领先是真正的token 效率差距——不是"训了更多数据"。

中文导读 · Ablations 关键数字
  • 整体流水线 6 步:WARC trafilatura → URL/fastText/MassiveText 基线 → 单 dump MinHash → C4 部分过滤 → 3 条自研过滤 → PII 匿名化 → 15T tokens。
  • vs 公开数据集(同一 1.71B、同 350B token 训练 + 8 benchmark 平均):FineWeb ≈ 50%,FineWeb-Edu ≈ 52% — 第一/第二;Matrix / Dolma 1.7 / RefinedWeb 大约 48% / 47% / 47%。
  • MMLU token 效率:FineWeb-Edu 38B token 达 33.6% ≈ Matrix 训 ≈ 300B 的水平 → 10× 节省。
  • 消融贡献加和:Figure 9 把每一步的曲线叠加画出来,顺序贡献递增,无"单点决定一切"。
FineWeb-Edu / 教育子集p.8

An interesting approach has recently emerged for filtering LLM training datasets: using synthetic data to develop classifiers for identifying educational content. This technique was notably used in the non-public pretraining datasets of Llama 3 and Phi-3, but its large-scale impact on web data filtering has not been publicly explored. We applied this technique to FineWeb by filtering it with an educational quality classifier developed from synthetic annotations generated by Llama-3-70B-Instruct. The resulting dataset, FineWeb-Edu, contains 1.3 trillion tokens. FineWeb-Edu is specifically optimized for educational content and outperforms all openly accessible web-based datasets on reasoning- and knowledge-intensive benchmarks such as MMLU, ARC, and OpenBookQA by a significant margin.

最近兴起一种过滤 LLM 训练数据的有趣方法:用合成数据训一个识别"教育性"内容的分类器。Llama 3 和 Phi-3 的非公开预训练数据据称用了这招,但它在 web 数据大规模过滤上的影响一直没被公开探究。我们把它套到 FineWeb 上:用 Llama-3-70B-Instruct 产生合成标注,训一个教育质量分类器,然后过滤,得到 FineWeb-Edu(1.3T tokens)。它针对教育性优化,在 MMLU / ARC / OpenBookQA 这种推理与知识密集型基准上,显著超过所有公开 web 数据集。

To build the synthetic annotations, we used Llama-3-70B-Instruct to score 460,000 randomly sampled webpages from the FineWeb CC-MAIN-2024-10 snapshot for their educational quality on a scale from 0 to 5. We explored several prompt formats and found that the additive scale (Yuan et al.) worked best — the LLM evaluates each criterion and adds to the score step-by-step, unlike a single-rating scale that locks a category. To avoid favoring highly technical pages like arXiv abstracts, we prompted the model to focus on grade-school and middle-school level knowledge.

合成标注的做法:用 Llama-3-70B-Instruct 对 FineWeb 中 CC-MAIN-2024-10 快照里随机抽的 46 万份网页,以 0–5 分给"教育性"打分。我们试了多种 prompt 格式,发现 Yuan 等人的"累加式打分"(additive scale)最好——让 LLM 逐条评分、逐条加分,而不是套用单一类别打一个固定分。为避免模型偏爱 arXiv 摘要那种"过度技术化"的页面,我们 prompt 限定它评估"小学到中学水平"的知识。

To scale to all of FineWeb we trained a small classifier on top of Snowflake-arctic-embed-m (a frozen embedding model): a linear regression head trained on 410,000 of the Llama-3 annotations for 20 epochs at learning rate $3 \times 10^{-4}$. We kept the checkpoint with the highest F1 on a 50,000-sample held-out validation set, treating Llama-3 annotations as ground truth. The model output was rounded to integers 0–5. We then experimented with thresholds; the chosen threshold ≥ 3 gave F1 = 82% on validation and the best trade-off between knowledge/reasoning benchmarks and HellaSwag-style tasks. Running this classifier over all 15T tokens of FineWeb took roughly 6,000 H100 GPU-hours.

要把分类推到全量 FineWeb,我们在冻结的 Snowflake-arctic-embed-m embedding 之上训一个轻量分类头:在 41 万条 Llama-3 标注上训 20 个 epoch、learning rate $3 \times 10^{-4}$,只训线性回归头。以剩下 5 万条 held-out 集为验证集(把 Llama-3 标注当真值),选 F1 最高的 checkpoint。再把输出四舍五入到 0–5 整数。然后试不同阈值,最终选 阈值 ≥ 3:验证集 F1 = 82%,且在"知识/推理 benchmark"与"HellaSwag 类常识"之间权衡最好。把这个分类器跑过 FineWeb 全部 15T tokens,大约用了 6,000 H100 GPU-小时

At a larger ablation (1.71B model trained on 350B tokens) FineWeb-Edu surpasses FineWeb and all other open web datasets. The gains on educational benchmarks are striking: MMLU rises from 33% → 37% (≈ 12% relative) and ARC from 46% → 57% (≈ 24% relative). Even more notably, FineWeb-Edu reaches Matrix's final MMLU score with almost 10× fewer tokens — 38B vs. ~300B — demonstrating the leverage of classifier-based filtering on LLM-annotated data.

在更大的消融(1.71B 模型、350B token)上,FineWeb-Edu 超过 FineWeb 和所有其它公开 web 数据集。教育类基准提升尤其惊人:MMLU 从 33% → 37%(相对 +12%),ARC 从 46% → 57%(相对 +24%)。更夸张的是:FineWeb-Edu 用 38B token 就能达到 Matrix 训 ≈ 300B token 才有的最终 MMLU 分——≈ 10× 的 token 效率。这说明"在 LLM 标注的数据上训分类器、再过滤"这套思路在大规模下确实有用。

Topic distribution. Embedding 50k samples each from FineWeb / FineWeb-Edu with all-MiniLM-L6-v2 + UMAP + DBSCAN yields 100 topic clusters (labelled with Llama-3.1-70B). The classifier heavily up-samples "Education / Learning / Teaching" (+3.2 percentage points more documents in FineWeb-Edu than in FineWeb), "History / Culture / Politics" (+2.2 pp), "Health / Medicine / Biology" (+1.8 pp), and "Wildlife / Animals / Nature", "History / Royalty / Philosophy", "Water / Environment", "Energy / Environment" (each ≈ +1.2 pp). The largest down-samples are "Business / Finance / Law" (-3.2 pp), "Entertainment / Film / Theater" (-2.8 pp), "Places / Travel / Real Estate" (-2.5 pp), "Food / Summer / Recipes" (-2.1 pp), "Sports / Teams / Games" (-2.1 pp), and "Music / Entertainment / Arts" (-2.1 pp). In other words: educational filtering trades away consumer / commercial / entertainment web content in exchange for textbook-flavoured topics, which is exactly why MMLU / ARC jump and why downstream uses that want entertainment knowledge should not blindly use Edu.

Domain fit. On Paloma domains, FineWeb has lower perplexity on broad web sources (C4, mC4, Falcon, Dolma V1.5, RedPajama CC, Twitter AAE, Manosphere, Gab, 100 Subreddits, 4chan). FineWeb-Edu wins on Wikipedia-heavy sources (WikiText-103, M2D2 Wikipedia), academic sources (M2D2 S2ORC, ArXiv subset of RedPajama), and programming content (100 PLs).

主题分布。对 FineWeb / FineWeb-Edu 各抽 5 万条样本,用 all-MiniLM-L6-v2 求向量 + UMAP 降维 + DBSCAN 聚 100 个簇(Llama-3.1-70B 自动打 label)。教育分类器明显上采样"Education / Learning / Teaching"(在 FineWeb-Edu 里比在 FineWeb 多 +3.2 个百分点)、"History / Culture / Politics"(+2.2 pp)、"Health / Medicine / Biology"(+1.8 pp)以及"Wildlife / Animals / Nature"、"History / Royalty / Philosophy"、"Water / Environment"、"Energy / Environment"(各 ≈ +1.2 pp)。最大的下采样是"Business / Finance / Law"(-3.2 pp)、"Entertainment / Film / Theater"(-2.8 pp)、"Places / Travel / Real Estate"(-2.5 pp)、"Food / Summer / Recipes"(-2.1 pp)、"Sports / Teams / Games"(-2.1 pp)、"Music / Entertainment / Arts"(-2.1 pp)。换言之:教育过滤拿"消费 / 商业 / 娱乐 web"换"教科书风味话题"——这正是 MMLU / ARC 大涨的原因,也是为什么"想要娱乐知识"的下游不能盲目套 Edu。

领域适配。用 Paloma 评 6 个 checkpoint 的 macro 困惑度。FineWeb 在宽泛 web 源上困惑度更低(C4, mC4, Falcon, Dolma V1.5, RedPajama CC, Twitter AAE, Manosphere, Gab, 100 Subreddits, 4chan)。FineWeb-Edu 在 Wikipedia 系(WikiText-103, M2D2 Wikipedia)、学术系(M2D2 S2ORC、RedPajama ArXiv 子集)、代码系(100 PLs)上更好——符合"教育性过滤"的预期。

中文导读 · 教育子集要点
  • 三步配方:① Llama-3-70B 用 additive prompt 给 46 万网页打 0–5 教育分;② 冻结 Snowflake embedding 上训 linear head,F1 = 82%;③ 阈值 ≥ 3 过 15T tokens → 1.3T 教育子集。
  • 关键超参:training samples 41 万 / 20 epoch / lr 3e-4 / 全量推理 ≈ 6000 H100 hour。
  • 收益:MMLU +12% rel, ARC +24% rel;38B token 达到 Matrix 300B 的 MMLU——token efficiency ≈ 10×。
  • 代价:主题分布显著偏向教育/历史,弱化娱乐/商业/旅游——选用时按下游需求权衡。
Results / 偏见分析 + Paloma 领域困惑度p.9
§5 Bias Analyses (excerpt) / 偏见分析(节选)

Language models are known to reflect the biases present in their pretraining datasets. To provide a brief picture of dataset bias in FineWeb and FineWeb-Edu, we focus on subgroups recognised as "sensitive" or "protected" in English-speaking countries — historically subject to discrimination and disproportionately targeted by negative societal norms reflected in web text. We find that FineWeb has a relative over-representation of words reflecting hegemonic norms over-represented in online text, such as "man" and "christian". Although biases across gender, religion, and age subgroups are not strong, the most skewed associations are between religion words and intimacy, e.g. "christian dating" and "jewish singles". Fittingly, FineWeb-Edu captures associations less tied to intimacy and more expected from educational content of history and health — e.g. "man" being associated with "king" and "woman" with "pregnancy". Further details are in Appendix G.

语言模型会反映其预训练数据中的偏见。为了给 FineWeb / FineWeb-Edu 的偏见画一个简短轮廓,我们聚焦于英语国家公认的"敏感/受保护"子群——历史上曾被歧视、且在 web 文本里更常被负面刻画的群体。我们发现 FineWeb 中,反映主流 hegemonic 规范的词(如 manchristian)在网上文本里被过度代表。性别、宗教、年龄三类子群的偏见整体不强,但偏离最明显的是"宗教词 × 亲密关系词",比如 "christian dating""jewish singles"。FineWeb-Edu 上,这种亲密关系的关联减弱,更多体现为教育内容里历史与健康主题的关联,比如 "man" 关联到 "king",而 "woman" 关联到 "pregnancy"。详情见附录 G。

Quantitatively, in a randomly sampled 10B-token slice of each dataset, man accounts for 67.9% of all gender-term occurrences, woman 32.0%, and non-binary only 0.1%; in FineWeb-Edu this skew gets slightly worse (man 70.2% / woman 29.6% / non-binary 0.2%), most likely because educational and historical content over-indexes on male historical figures (kings, scholars). For religion, FineWeb is heavily christianized — christian 46.1%, jewish 25.6%, muslim 16.7%, hindu / buddhist each 4.8%, atheist 1.9% — whereas FineWeb-Edu noticeably rebalances toward minority religions (christian drops to 33.1%, jewish rises to 36.3%, hindu / buddhist roughly double). On age, FineWeb is 64.5% old vs 35.5% young, while FineWeb-Edu lands at a near-even 51.5% / 48.5% — an unintended but positive side-effect of educational filtering, since textbook content uses "young people / young students" more uniformly.

定量上,在两个数据集各自随机抽的 10B token 切片里,man 占所有性别词出现量的 67.9%,woman 占 32.0%,non-binary 仅 0.1%;FineWeb-Edu 上这个偏置反而更严重(man 70.2% / woman 29.6% / non-binary 0.2%),最可能的原因是教育与历史类语料更多提到男性历史人物(国王、学者)。宗教维度上,FineWeb 严重基督化——christian 46.1%、jewish 25.6%、muslim 16.7%、hindu / buddhist 各 4.8%、atheist 1.9%——而 FineWeb-Edu 明显往少数宗教侧重新平衡(christian 跌到 33.1%,jewish 升到 36.3%,hindu / buddhist 大约翻倍)。年龄上,FineWeb 是 64.5% old vs 35.5% young,FineWeb-Edu 几乎是 51.5% / 48.5% —— 这是教育性过滤一个意外却积极的副作用,因为教科书用"young people / young students"的频率更接近均衡。

The TF-IDF association heatmaps (Figs. 22–29 in the appendix) make the structure of these biases concrete: in FineWeb, jewish co-occurs with dating with TF-IDF 0.212 (the largest single cell in the religion grid) and with singles at 0.110; muslim shows muslim+ dating = 0.164; buddhist hits 0.133 with dating; even atheist is dominated by god (0.078) — implying "atheist" web text is mostly debate-style content about god. Outside religion, woman is mildly tied to dating / love / family and non-binary is highly concentrated in LGBTQ-specific vocabulary (gender / trans / queer / transgender with +0.04 to +0.06), so models trained on FineWeb describe non-binary identities in narrower, more stereotyped frames than they describe man or woman. FineWeb-Edu shifts these associations toward less-intimate, more curricular language — woman ↔ pregnancy / mother / children / family, man ↔ god / war / great / king.

附录 G 的 TF-IDF 关联热力图(Fig 22–29)把这些偏见的结构画得很具体:FineWeb 里 jewishdating 的 TF-IDF 高达 0.212(整个宗教矩阵里最大的一格),与 singles 也有 0.110;muslim 上 muslim+ dating = 0.164;buddhistdating 达 0.133;甚至 atheist 也被 god(0.078)主导——意味着"无神论"文本几乎都是关于 god 的辩论。宗教之外,womandating / love / family 弱关联,而 non-binary 高度聚焦在 LGBTQ 特定词汇(gender / trans / queer / transgender 上 +0.04~0.06),所以在 FineWeb 上训出的模型描述 non-binary 群体时,语义半径远比 man / woman 窄、更刻板。FineWeb-Edu 则把这些关联推向"非亲密、更课程化"的方向——woman ↔ pregnancy / mother / children / family,man ↔ god / war / great / king。

Domain fit on Paloma / Paloma 领域困惑度

To check how well each dataset covers different text domains, the authors evaluate macro-average perplexity on the Paloma benchmark with six ablation checkpoints, without decontamination. FineWeb generally achieves lower perplexity on broad web sources — C4, mC4, Falcon, Dolma V1.5, the CommonCrawl subset of RedPajama — and on noisy social-media-style sources such as Twitter AAE, Manosphere, Gab, the 100-Subreddits Paloma slice, and 4chan. FineWeb-Edu instead wins on Wikipedia-centric sources (WikiText-103, M2D2 Wikipedia), academic sources (M2D2 S2ORC, the ArXiv subset of RedPajama), and programming content (Paloma's 100 PLs benchmark). The Figure 12 panel shown above traces these curves over 50–350B training tokens: 100 Subreddits perplexity drops from ~8.5 down to ~6.0 over training; 100 PLs ranges 6–8.5; Twitter AAE 150–350; Manosphere 24–32; Gab 40–60; 4chan 15–20. In short, the two datasets divide the web cleanly — FineWeb owns "noisy general web", FineWeb-Edu owns "encyclopedic + technical".

为检查两份数据集对不同文本领域的覆盖,作者在 Paloma 上用六个消融 checkpoint 算 macro 平均困惑度,且不做除污染处理。FineWeb 在宽泛 web 源上普遍困惑度更低——C4、mC4、Falcon、Dolma V1.5、RedPajama 的 CommonCrawl 子集——以及嘈杂的社交媒体源:Twitter AAE、Manosphere、Gab、Paloma 的 100-Subreddits 切片、4chan。FineWeb-Edu 则在 Wikipedia 系(WikiText-103、M2D2 Wikipedia)、学术系(M2D2 S2ORC、RedPajama 的 ArXiv 子集)、代码系(Paloma 的 100 PLs)上胜出。上面 Figure 12 面板把这些曲线在 50–350B 训练 token 范围内画出来:100 Subreddits 困惑度从 ~8.5 一路降到 ~6.0;100 PLs 在 6–8.5;Twitter AAE 150–350;Manosphere 24–32;Gab 40–60;4chan 15–20。一句话:两份数据集把 web 干净地一分为二——FineWeb 拿"嘈杂的一般 web",FineWeb-Edu 拿"百科 + 技术"。

中文导读 · 偏见与困惑度
  • FineWeb 在网上常见的"男性/基督教/年长"词上过度代表,但偏见总体不算重;宗教×亲密关系关联最显著。
  • FineWeb-Edu 把"约会/婚恋"类亲密词关联拉走,转向"king / pregnancy / history" 等教育性更强的关联。
  • Paloma 困惑度上呈"分工":FineWeb 通用 web 更低,Edu 在百科 + 学术 + 代码上更低。
Discussion / 结论与局限p.10

In this paper, we developed the FineWeb datasets, a collection of large-scale LLM pretraining datasets that produce performant LLMs. Specifically, we release FineWeb, a 15-trillion token dataset derived from 96 Common Crawl snapshots, as well as FineWeb-Edu, a 1.3-trillion token dataset of educational content from FineWeb. FineWeb was created through a series of experiments that provided empirical evidence for our choice of text extraction strategy, deduplication procedure, and content filters. Both datasets are publicly released, along with the code and processing library that we used and all of the models we trained during our dataset ablation experiments.

本文构建了 FineWeb 数据集——一组能训出高性能 LLM 的大规模预训练数据集。具体来说,我们释放 FineWeb(从 96 份 CommonCrawl 快照得到的 15T tokens),以及 FineWeb-Edu(从 FineWeb 中筛出的 1.3T tokens 教育内容)。FineWeb 通过一系列实证实验构建,这些实验为正文抽取、去重(dedup)流程和内容过滤等选择提供了证据。两份数据集都公开释放,同时附带我们使用的代码、数据处理库,以及消融阶段训练的所有模型。

While FineWeb and FineWeb-Edu attain state-of-the-art performance among public LLM pretraining datasets, we identify various paths to further improvement. First, both datasets are entirely comprised of web content scraped by CommonCrawl. It is possible that augmenting either datasets with other datatypes (books, speech transcripts, etc.) could further improve performance. In addition, most of the experiments we ran were at a smaller scale due to computational constraints. Designing datasets at more realistic scales could provide more reliable guidance. Our evaluation setup was also by necessity limited to performance on academic benchmarks without any further instruction tuning or alignment. An evaluation setup that better reflected current usage patterns of LLMs might also be more reliable. We hope that our released datasets, code, and models help further improve public knowledge and development of performant LLM pretraining datasets.

虽然 FineWeb 与 FineWeb-Edu 在公开 LLM 预训练数据集中拿到了 SOTA,我们也指出几条可进一步改进的路径:首先,两份数据集都是纯 web 内容,来自 CommonCrawl;若混入其它数据类型(图书、语音转写等)可能继续提升。其次,受算力限制我们的实验大多在较小规模做的——在更接近"真实预训练规模"的设定下做数据集设计也许能得到更可靠的指引。再者,我们的评测被迫局限在学术 benchmark,没有进一步的 instruction tuning / 对齐——一个更贴合"LLM 当前使用方式"的评测体系可能更可靠。我们希望释放的数据集、代码、模型有助于推进"公开的 LLM 预训练数据整理"的知识与发展。

Practical takeaways for anyone curating a CommonCrawl-style pretraining corpus: (1) always extract from WARC with a real boilerplate-aware extractor (trafilatura) rather than reusing CC's WET — it is the cheapest single intervention in the entire pipeline; (2) deduplicate each snapshot independently with MinHash; do not run global cross-snapshot MinHash, because the surviving long-tail is often worse than what got removed; (3) do not blindly apply C4's terminal-punctuation rule — it deletes ~30% of tokens for a benefit the authors recover with a much softer 10%-removing alternative; (4) derive heuristic thresholds from histogram-difference between known-good and known-bad slices instead of from manual inspection; (5) scale the LLM-as-annotator pattern by distilling Llama-3-70B scores into a small classifier over a frozen embedding — the resulting FineWeb-Edu reaches Matrix's MMLU at ~10× fewer training tokens, the most striking efficiency result in the paper. Together these recipes account for essentially all of the public-dataset SOTA gap that FineWeb closed.

对于任何要做 CommonCrawl 风格预训练语料整理的人,可直接照搬的实操结论是:(1) 务必从 WARC 用一个懂 boilerplate 的抽取器(trafilatura)抽,不要直接用 CC 的 WET——这是整条流水线最便宜的一步干预;(2) 每份快照独立做 MinHash,不要跨快照做全局 dedup,因为留下来的长尾常常比被删掉的更差;(3) 不要盲目套用 C4 的"行末终止标点"规则——它一刀切删 30% token,论文用一条更软、只删 10% 的过滤就拿回了大部分收益;(4) 启发式阈值用"已知好/已知差"两份数据的直方图差异自动选,而不是目视;(5) 用 Llama-3-70B 当标注器,再把它的打分蒸馏到一个冻结 embedding 之上的小分类器——FineWeb-Edu 用 ≈ 10× 更少 token 就追平 Matrix 的 MMLU,是论文里最惊艳的效率结论。这五条加在一起,基本就是 FineWeb 抹平公开数据集 SOTA 差距的全部秘密。

中文导读 · 结论与局限
  • 贡献:15T 的 FineWeb + 1.3T 的 FineWeb-Edu,公开数据集 SOTA;同时开源 datatrove 工具链与所有 ablation 模型 — 这是 ablation 最彻底的 web 预训练数据论文之一。
  • 局限 1:纯 web,缺乏书籍/口语数据;局限 2:1.71B / 350B token 消融规模偏小;局限 3:评测只覆盖学术 benchmark,未做 SFT/对齐。
References / Appendixp.11+

The full reference list and appendices are available in the linked arXiv PDF. This reader page keeps the publishable summary, figure gallery, and curated explanations above instead of duplicating the raw appendix dump.

The appendix material most relevant for review is already covered in the article: linked resources and reproducibility notes, ablation setup, deduplication variants, FineWeb-Edu annotation prompt and threshold results, topic distribution, Paloma domain fit, and bias-analysis figures.