Ai Data Curation Pretraining 标志

Ai Data Curation Pretraining

社区
vasilyu1983
ai-data-curation-pretraining

构建并审查 LLM 预训练语料:提取、筛选、去重、去污染、数据混合和合成数据。适用于整理或消融预训练数据流水线。

Add to TypingMind

概览

发布者vasilyu1983
代码仓库AI-Agents-public
技能名称ai-data-curation-pretraining
星标数
87
复刻数
19
附带文件
7
许可协议MIT
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 7 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 vasilyu1983 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Ai Data Curation Pretraining AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/vasilyu1983/AI-Agents-public/tree/main/frameworks/shared-skills/skills/ai-data-curation-pretraining
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/vasilyu1983/AI-Agents-public.git /tmp/AI-Agents-public
mkdir -p .claude/skills
cp -r /tmp/AI-Agents-public/frameworks/shared-skills/skills/ai-data-curation-pretraining .claude/skills/ai-data-curation-pretraining
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Ai Data Curation Pretraining,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Ai Data Curation Pretraining。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Ai Data Curation Pretraining 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Pretraining Data Curation — Functional Reference Skill

Domain: Building web-scale and synthetic pretraining corpora, running controlled data ablations. Distinct from applications-layer retrieval (RAG) and general data engineering.

No theory. No generic pipeline intros. Focus on stage-by-stage decisions, heuristic thresholds, tooling choices, and ablation protocol.

ASCII Flow

text
CommonCrawl WARCs
  |
  v
[Extract]  trafilatura / datatrove HTMLExtractor
  raw text + metadata (URL, timestamp, content-type)
  |
  v
[Language ID]  fastText lid.176.bin
  keep target language(s), threshold ≥ 0.65
  |
  v
[Quality Filter — Heuristic]  Gopher / C4 rules
  symbol-to-word ratio, fraction lines ending ellipsis,
  stopword density, word count bounds, mean word length
  |
  v
[Quality Filter — Classifier]  FineWeb-Edu edu-score / custom
  trained on human labels; outperforms heuristics on recall
  |
  v
[Near-Dedup]  MinHash + LSH banding (datasketch)
  n-gram shingles -> MinHash signature -> band partitioning
  |
  v
[Exact-Substring Dedup]  suffix-array substring match
  remove exact repeated sequences across documents
  |
  v
[Decontamination]  n-gram match against eval benchmarks
  FAIL LOUD — contaminated eval numbers are the field's #1 silent failure
  |
  v
[PII / Safety Scrub]  regex + classifier
  email, phone, SSN, credit card patterns; hate/CSAM removal
  |
  v
[Tokenize + Shard]  HF tokenizers / tiktoken; Parquet shards
  |
  v
[Domain Mix + Weight]  dolma toolkit / custom sampling
  web / books / code / math / synthetic — proportions are a research lever
  |
  v
[Train + Eval]  nanotron / lighteval / lm-evaluation-harness
  ablation output: eval delta per pipeline stage

When to Use This Skill

Activate when the task involves:

  • Finding existing high-quality datasets for pretraining or fine-tuning before building from scratch (see Dataset Discovery reference)
  • Sourcing and filtering CommonCrawl WARCs or other web-scale corpora
  • Implementing or debugging any stage of the curation pipeline above
  • Designing quality filters (heuristic or classifier-based)
  • Running MinHash / LSH deduplication or exact-substring dedup
  • Decontaminating a dataset against evaluation benchmarks
  • Generating synthetic pretraining data (Cosmopedia, Self-Instruct, Evol-Instruct, Nemotron)
  • Designing and executing controlled data ablations
  • Writing datasheets (Gebru et al.) for a curated dataset
  • Understanding open recipe datasets: FineWeb, Dolma, The Pile, RedPajama, SlimPajama, C4, RefinedWeb, OLMo

Scope Boundaries

This skill covers the corpus side of pretraining — from raw crawl to tokenized shards and ablation measurement. Use linked skills for adjacent concerns:

  • Pretraining run setup, distributed training, checkpointing → ai-pretraining
  • Token budget, compute-optimal scaling (Chinchilla law) → ai-scaling-laws
  • Benchmark harness setup, metric interpretation → ai-evals
  • Applications-layer retrieval, chunking, reranking at inference time → ai-rag — NOTE: RAG is not pretraining data curation; do not conflate corpus mixing with retrieval indexing
  • Storage, ingestion, workflow orchestration at platform level → data-lake-platform

Quick Reference

StageToolingHighest-Leverage Lever
Extractdatatrove HTMLExtractor, trafilaturaExtractor choice sets noise ceiling for all downstream stages
Language IDfastText lid.176.bin; GlotLID (2000+ languages) or OpenLID for low-resource/multilingualThreshold: ≥ 0.65 keeps recall; ≥ 0.85 kills noisy multilingual. Use GlotLID over lid.176 once >176 languages or heavy code-switching is in scope — it's what FineWeb2 standardized on
Heuristic qualityGopher rules, C4 rulesSymbol-to-word ratio < 0.1; stopword density > 2 words per 100
Classifier qualityFineWeb-Edu edu-scoreSingle classifier outperforms 20+ Gopher rules on recall
Near-dedupMinHash + LSH (datasketch)Jaccard threshold 0.8, 9-gram shingles, 128 permutations
Exact-dedupSuffix-array substringCatches boilerplate that MinHash misses (short repeated blocks)
Semantic-dedupSemDeDup (arXiv 2303.09540)Embedding-cluster dedup catches paraphrases MinHash misses; complements (not replaces) MinHash
Decontaminationn-gram overlap vs eval sets≥ 13-gram match = contaminated; remove entire document
PII / safetyRegex + classifier cascadeEmail/phone regex first (fast), then classifier for context-dependent PII
Tokenize + shardHF tokenizers, tiktokenShard to ≤ 1 GB Parquet; document boundaries matter for context windows
Domain mixdolma toolkit; DoReMi / RegMix for weightsMix proportions are the single most impactful knob after basic filtering — set them with a method, not by hand (see Data Mixing Methods)

Frontier Recipes & Methods (2024–2026)

The pipeline above is the durable backbone. These are the recipes a current practitioner is expected to know and cite; treat them as the modern defaults, not optional extras.

Recipe / MethodWhat it changedUse it for
DataComp-LM (DCLM) — arXiv 2406.11794First controlled benchmark for data curation (240T-token pool, fixed compute, 53 evals). Showed a single fastText classifier trained on high-quality reference text (DCLM-Baseline) beats heuristic stacks decisively.The reference point when arguing any filtering choice. Replicate its model-based filtering before hand-tuning Gopher rules.
Nemotron-CC — arXiv 2412.02595Solves the token-yield problem: aggressive edu-style filters discard ~90% of tokens. Uses a classifier ensemble + synthetic rephrasing of mid/low-quality pages to recover 6.3T usable tokens.Multi-trillion-token runs where filtering would otherwise starve the corpus. Pairs with the synthetic-data reference.
WRAP (rephrase-the-web) — arXiv 2401.16380Rephrases web pages into cleaner styles ("like Wikipedia", QA format) instead of only filtering — ~3x pretraining speedup at fixed compute. The paradigm Nemotron-CC scales.Lifting quality of pages that filtering would drop; augmenting scarce high-quality domains.
FineWeb-2 — arXiv 2506.20920Extends the FineWeb/datatrove pipeline to 1000+ languages with per-language threshold tuning (20TB, 5B docs).Any non-English or multilingual corpus. The default multilingual baseline.
Common Pile v0.1 / Comma — arXiv 2506.052098TB public-domain + openly licensed corpus across 30 sources; 7B models competitive with unlicensed-data peers.Corpora with IP/copyright exposure (enterprise, public release). See licensing traps.
Common Corpus — arXiv 2506.01732 (Pleias / AI Alliance)~2T-token openly licensed corpus with heavy non-English (French, German, multilingual) coverage; complements Common Pile's English/code skew.Open-license corpora needing broader multilingual coverage than Common Pile alone.
Blu-WERP — arXiv 2511.18054 (Nov 2025)Reports +4.0% vs. DCLM-Baseline and +9.5% vs. FineWeb, aggregate, at 1B scale, via JusText extraction + Bloom-filter dedup + semantic classifier. Not yet independently replicated or adopted by a frontier lab as of this writing — treat as an emerging challenger, not a settled successor.Sanity-checking whether your extraction+filter stack is still state-of-the-art; a candidate to benchmark against, not yet a default to copy blind.

Data Mixing Methods

Domain mix is the highest-leverage knob after basic filtering — but "tune via ablations" is no longer the frontier answer. Set it with a principled method:

MethodMechanismWhen to reach for it
DoReMi — arXiv 2305.10429Train a small proxy with group-DRO to find domain weights that minimize worst-case excess loss; transfer weights to the full run. +6.5pp few-shot vs Pile defaults.You have fixed domains and want robust weights without a full sweep.
Data Mixing Laws — arXiv 2403.16952Fit a scaling-law surface over mixture ratios from small proxy runs; extrapolate the optimum before spending full compute.Predicting the optimal mix at target scale from cheap experiments.
RegMix — arXiv 2407.01492Train many small models on random mixtures, regress performance on ratios, pick the predicted-best mixture. Matches DoReMi at lower compute.Compute-cheaper alternative to DoReMi; many candidate domains.

Whichever you use, still validate the chosen mix with a held-out ablation run (Run E) — the methods set the prior, the ablation confirms it.

Default Workflow

  1. Define corpus goal: target language, domain distribution, token budget, training compute budget.
  2. Extract: run datatrove HTMLExtractor over WARC dumps; keep URL + source metadata.
  3. Language filter: fastText lid; log per-language token counts before and after.
  4. Heuristic filter: apply Gopher + C4 rules; log drop rate per rule to identify dominant removals.
  5. Classifier filter: train or apply FineWeb-Edu edu-score / custom classifier; set threshold on a held-out labeled set.
  6. Dedup: MinHash + LSH near-dedup first (catches paragraph-level duplicates), then suffix-array exact-substring.
  7. Decontaminate: match against every evaluation benchmark you plan to report; fail loud on any ≥ 13-gram overlap.
  8. PII / safety scrub: regex sweep + safety classifier; document removal rates.
  9. Tokenize + shard: produce indexed Parquet shards; verify document count and total token count.
  10. Mix + ablate: design controlled ablation runs (one change per run); train small proxy model; measure eval delta with lm-evaluation-harness.
  11. Datasheet: write Gebru et al. datasheet before publishing or using the corpus externally.

Data Ablation Table

Run small proxy model (e.g., 1B param) at fixed compute budget. One change per run. Evaluate on the same benchmark suite with lm-evaluation-harness.

RunCorpusChange vs PriorExpected Signal
ARaw CC extract (no filter)BaselineNoisy ceiling
B+Heuristic filter + near-dedupGopher + MinHash+3–8 pts on perplexity benchmarks
C+Classifier filterFineWeb-Edu score+2–5 pts over heuristics alone
D+Synthetic data (10% mix)Cosmopedia / Self-InstructVaries by task domain
EMethod-driven mix (DoReMi / RegMix prior, then validate)Vary web:books:code:synthIdentifies optimal mix for target tasks

Protocol: hold compute constant across A–E. Evaluate on HellaSwag, ARC, MMLU, and a domain task. Do not change model architecture between runs. Do not change eval prompt format between runs. Decontaminate before each run independently.

ASCII Heuristic Rules Cheat Sheet

text
Gopher rules (sample):
  word_count: 50 ≤ n ≤ 100_000
  mean_word_length: 3 ≤ chars ≤ 10
  symbol_to_word_ratio: < 0.1  (symbols = #, %, |, …)
  fraction_lines_ending_ellipsis: < 0.3
  fraction_lines_starting_bullet: < 0.9
  stopword_density: ≥ 2 of {the, be, to, of, and, that, have, with} per 100 words

C4 rules (sample):
  no_lorem_ipsum: True
  no_javascript_warning: True  (blocks containing "javascript" must-be-enabled)
  line_terminal_punctuation: ≥ 0.95 of lines end in {. ! ? "}
  no_curly_braces: True  (proxy for code / template bleed)
  deduplicated_3gram: remove exact 3-gram repeated lines

MinHash + LSH Banding Intuition

text
Choose:
  n = 9  (shingle size in tokens)
  k = 128  (MinHash permutations)
  bands b = 20, rows r = 128/20 ≈ 6

P(collision) ≈ 1 - (1 - s^r)^b
At s=0.8 (80% Jaccard): P ≈ 0.86  -> most duplicates found
At s=0.5 (50% Jaccard): P ≈ 0.28  -> most near-matches missed (safe)

Increase b / decrease r to catch lower-Jaccard near-dups (more aggressive).
Decrease b / increase r to tighten threshold (less aggressive, faster).

Known Traps

  1. Contamination — the field's most common silent failure. Benchmark text appears in training data, scores look inflated, but the model learned the answer key. Decontaminate against every benchmark you plan to report, using n-gram overlap. Fail loud: if any document matches ≥ 13 grams, remove it and log the URL.

  2. Model collapse from synthetic data — iteratively training on model outputs concentrates the distribution; tail capabilities and rare knowledge erode. Canonical reference: Shumailov et al., "AI models collapse when trained on recursively generated data," Nature 631:755–759 (2024), DOI 10.1038/s41586-024-07566-y. Mitigation: always mix human-sourced web data with synthetic; monitor output diversity metrics (distinct-n, entropy) during generation. The picture is more nuanced than "synthetic = collapse risk": scaling-law work on mixed corpora finds collapse is not inevitable at moderate synthetic ratios (arXiv 2510.01631, Oct 2025 — mixes around 1/3 rephrased-synthetic + 2/3 natural web reduced loss without collapse), and external verification against a stronger model or human judge — not just mixing — is the mechanism that reliably prevents collapse under fully recursive retraining (ICLR 2026 workshop, "Escaping Model Collapse via Synthetic Data Verification"). Treat "mix with real data" as necessary but insufficient; pair it with a verifier gate (see synthetic-data reference).

  3. Diversity collapse — heavy classifier filtering removes stylistically unusual but high-quality text (dialects, domain jargon, informal registers). Check: does the filtered corpus have narrower vocabulary size and sentence-length distribution than the input?

  4. Generator contamination — when a generative model produces synthetic data, it may reproduce memorized benchmark content. Decontaminate the synthetic data independently, not just the web data.

  5. Distillation licensing — GPT-4 / Claude ToS prohibit using model outputs to train competing models. Verify the generator's license before mixing distilled data into a publicly released corpus.

  6. Single-change ablation discipline — changing two variables in one run makes the delta uninterpretable. Always one change per run.

  7. EU AI Act training-data transparency (live enforcement risk, not theoretical) — under Article 53(1)(d), GPAI model providers placing a model on the EU market must publish a "sufficiently detailed summary" of training content using the AI Office's mandatory template (published 2025-07-24), covering categories including crawled/scraped data, licensed data, user data, and synthetic data. The obligation took effect 2025-08-02 for new GPAI models (models already on the market by then have until 2027-08-02); the AI Office may begin compliance checks and corrective measures from 2026-08-02. Non-compliance exposes providers to fines up to €15M or 3% of global annual revenue. Separately, the DSM Directive Article 4 TDM exception requires crawlers to detect and honor machine-readable rightsholder opt-outs (robots.txt-style signals); the Commission is still finalizing standard opt-out protocols as of mid-2026. Practical implication for curation pipelines: log data-source category (crawled / licensed / synthetic / user) per document from Stage 0 onward — retrofitting this after the fact for a training-data summary is far more expensive than logging it during extraction.

Common Anti-Patterns

  • Pulling a HF dataset and calling it "curation" — curation requires documented filtering decisions and a datasheet.
  • Running ablations with more than one pipeline change per run — you cannot attribute the eval delta.
  • Reporting evaluation numbers without decontamination — always contamination-check first.
  • Using the full-size model for ablations — proxy model at 1B params + fixed compute budget is the standard.
  • Skipping PII scrub because "it's just pretraining data" — PII memorization is a real attack surface.

Core Principles

  1. Every pipeline stage is a measurable research lever — log drop rates, token counts, and eval deltas at each stage separately.
  2. One change per ablation run — this is the entire discipline of data ablations.
  3. Decontaminate or your numbers lie — fail loud on contamination; it is not optional.
  4. Verifier-gate synthetic data — only include generated examples that pass a verifier or judge; unfiltered synthetic data degrades quality.
  5. Datasheet everything — Gebru et al. datasheet for every dataset you publish or hand off.

Navigation: Core References

  • Dataset Discovery — where to find existing datasets (HF, Kaggle, Google Dataset Search, government portals, lm-evaluation-harness) and the license/contamination gates before using them
  • Web Curation Pipeline — datatrove stage-by-stage: WARC download, extraction, language ID, heuristic filter, dedup, decontamination
  • Synthetic Data Generation — Cosmopedia / Self-Instruct / Evol-Instruct recipes, verifier gating, collapse traps
  • Data Ablation Method — controlled-run protocol, proxy model setup, metric collection, datasheet

External Sources

See data/sources.json for curated primary sources across:

  • Open corpus recipes and papers (FineWeb, Dolma, The Pile, RedPajama, C4, RefinedWeb)
  • Deduplication and decontamination methods
  • Synthetic data generation papers
  • Evaluation harness

Fact-Checking Rule

  • Known bugs, regressions, framework/compiler/runtime footguns, and version-specific crash or workaround guidance must be verified against current primary web sources before being treated as current fact.
  • Verify volatile external facts before final answers.
  • Prefer official docs, standards, release notes, and GitHub READMEs.
  • If you cannot verify, say so explicitly and present the guidance as a dated assumption instead of a fact.

Learnings Loop

Before applying this skill on a non-trivial task, read learnings.consolidated.md in this directory (and learnings.md if present).

After applying it, if you encountered a pattern worth remembering, a mistake worth preventing, or a domain fact that surprised you, append one dated bullet to learnings.md via agents-skills-feedback-loop/scripts/append_learning.py. Do not modify SKILL.md itself.

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Ai Data Curation Pretraining AI 技能有什么作用?

构建并审查 LLM 预训练语料:提取、筛选、去重、去污染、数据混合和合成数据。适用于整理或消融预训练数据流水线。

为什么在 TypingMind 中使用 Ai Data Curation Pretraining?

因为您只需安装一次,就能搭配任何模型使用。Ai Data Curation Pretraining 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Ai Data Curation Pretraining?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/vasilyu1983/AI-Agents-public/tree/main/frameworks/shared-skills/skills/ai-data-curation-pretraining。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Ai Data Curation Pretraining?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Ai Data Curation Pretraining 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Ai Data Curation Pretraining 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Ai Data Curation Pretraining AI 技能免费吗?

是的。vasilyu1983 已在 GitHub 上根据 MIT 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇