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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
- zh
|
| 5 |
+
- ko
|
| 6 |
+
license: other
|
| 7 |
+
license_name: common-crawl-terms-of-use
|
| 8 |
+
license_link: https://commoncrawl.org/terms-of-use
|
| 9 |
+
tags:
|
| 10 |
+
- common-crawl
|
| 11 |
+
- pretraining
|
| 12 |
+
- sft
|
| 13 |
+
- dpo
|
| 14 |
+
- instruction-tuning
|
| 15 |
+
- preference-data
|
| 16 |
+
- web-text
|
| 17 |
+
- llm-data-pipeline
|
| 18 |
+
task_categories:
|
| 19 |
+
- text-generation
|
| 20 |
+
- summarization
|
| 21 |
+
size_categories:
|
| 22 |
+
- 1K<n<10K
|
| 23 |
+
pretty_name: LLM Data Processing — Common Crawl to Pretrain/SFT/DPO Pipeline
|
| 24 |
+
---
|
| 25 |
+
|
| 26 |
+
# LLM Data Processing
|
| 27 |
+
|
| 28 |
+
Real, end-to-end LLM data pipeline output: raw Common Crawl WARC records,
|
| 29 |
+
progressively filtered/cleaned into a pretraining corpus, plus a derived SFT
|
| 30 |
+
(instruction-tuning) set and a DPO (preference) set. Every file here is the
|
| 31 |
+
actual output of a script run — no synthetic placeholders — against a real
|
| 32 |
+
Common Crawl batch (`CC-MAIN-2026-25`, discovered dynamically at run time,
|
| 33 |
+
not hardcoded).
|
| 34 |
+
|
| 35 |
+
**Source code, full run logs, and the research/decision notes behind every
|
| 36 |
+
processing choice are on GitHub:**
|
| 37 |
+
[mkd-minju/LLM-Data-Processing](https://github.com/mkd-minju/LLM-Data-Processing)
|
| 38 |
+
— see `Task2 Phase A/B/C/D` for the scripts that produced every file below,
|
| 39 |
+
and each `research_and_improve*.md` for why each design decision was made.
|
| 40 |
+
|
| 41 |
+
> **This dataset is private and should stay that way (or be re-reviewed
|
| 42 |
+
> before ever going public).** It is real scraped web content: PII masking
|
| 43 |
+
> is regex + NER based and known to be incomplete, and the underlying page
|
| 44 |
+
> text is not rights-cleared for redistribution (see **Licensing** below).
|
| 45 |
+
|
| 46 |
+
## Dataset summary
|
| 47 |
+
|
| 48 |
+
| Stage | File(s) | Rows | Size | What it is |
|
| 49 |
+
|---|---|---|---|---|
|
| 50 |
+
| Pretraining — raw | `Task2 Phase A/raw_documents.jsonl` | 3,000 | 391.3 MB | Verbatim HTML streamed from a real WARC file, `text/html` responses only |
|
| 51 |
+
| Pretraining — extracted | `Task2 Phase A/extracted_documents.jsonl` | 993 | 5.9 MB | Boilerplate-stripped body text, English-only (langid-filtered) |
|
| 52 |
+
| Pretraining — filtered | `Task2 Phase A/filtered_documents.jsonl` | 629 | 2.48 MB | + Gopher/C4 quality filter, exact-hash dedup, MinHash LSH near-dup removal (v1 config) |
|
| 53 |
+
| Pretraining — filtered (v2) | `Task2 Phase A/filtered_documents_v2.jsonl` | 630 | 2.48 MB | Same as above but with Dolma/DataTrove-calibrated MinHash band params + post-hoc Jaccard cutoff |
|
| 54 |
+
| Pretraining — final | `Task2 Phase A/cleaned_documents.jsonl` | 629 | 2.40 MB | `filtered_documents.jsonl` + PII masking (emails/phones/IPs/names → `[EMAIL]`/`[PHONE]`/`[IP]`/`[NAME]`) — **this is the pretraining-ready corpus** |
|
| 55 |
+
| Tokenizer | `Task2 Phase A/bpe_tokenizer.json` | — | 486 KB | BPE tokenizer trained from scratch on `cleaned_documents.jsonl`, vocab_size=8000 |
|
| 56 |
+
| SFT — raw | `Task2 Phase B/sft_raw.jsonl` | 80 | 266 KB | prompt/answer pairs before ChatML formatting |
|
| 57 |
+
| SFT — final | `Task2 Phase B/sft_dataset.jsonl` | 80 | 580 KB | ChatML-formatted, near-duplicate-prompt filtered, length/relevance quality-gated — **SFT-training-ready** |
|
| 58 |
+
| DPO — raw | `Task2 Phase C/dpo_pairs.jsonl` | 15 | 70 KB | concise/elaborate answer pairs with a chosen/rejected judgment |
|
| 59 |
+
| DPO — final | `Task2 Phase C/dpo_pairs_filtered.jsonl` | 10 | 44 KB | pairs kept after two independent judges (grounding vs. conciseness) agreed on the chosen side — **DPO-training-ready** |
|
| 60 |
+
|
| 61 |
+
Supporting/intermediate files (`Task2 Phase B/answers_*.json`,
|
| 62 |
+
`sampled_80.json`, `Task2 Phase C/dpo_group*.json`, `judge_*.json`,
|
| 63 |
+
`picked_15_prompts.json`, `dpo_blind_pairs.json`) are the intermediate
|
| 64 |
+
artifacts these final files were assembled from — kept for traceability,
|
| 65 |
+
not intended for direct training use.
|
| 66 |
+
|
| 67 |
+
## Dataset creation / methodology
|
| 68 |
+
|
| 69 |
+
**Pretraining corpus (Phase A).** A real ~940 MB WARC file was streamed
|
| 70 |
+
(not fully downloaded) from the latest Common Crawl batch until 3,000
|
| 71 |
+
`text/html` response records were collected (≈39% of the file). Of those:
|
| 72 |
+
66.9% were dropped as non-English (fastText langid), body text was extracted
|
| 73 |
+
with `trafilatura` (a 96.4% size reduction vs. raw HTML — most of a raw page
|
| 74 |
+
is markup/boilerplate, not content), encoding was repaired with `ftfy`,
|
| 75 |
+
Gopher/C4-style heuristics + exact-hash + MinHash-LSH near-dup detection
|
| 76 |
+
removed low-quality/duplicate documents, and PII was masked with regex
|
| 77 |
+
(email/phone/IP) + spaCy NER (`PERSON`). Net funnel: **3,000 → 629 documents
|
| 78 |
+
kept (79% dropped)**. A from-scratch BPE tokenizer (vocab_size=8000) reached
|
| 79 |
+
98.0% vocabulary utilization on the final corpus.
|
| 80 |
+
|
| 81 |
+
**SFT set (Phase B).** 80 documents were sampled from the Phase A corpus and
|
| 82 |
+
assigned one of 5 instruction types (summarize / key-signal / audience /
|
| 83 |
+
counter-perspective / follow-up-question). Answers were written by an LLM
|
| 84 |
+
(Claude) actually reading each excerpt — not template-extracted. Prompts were
|
| 85 |
+
deduplicated by embedding similarity (`sentence-transformers`,
|
| 86 |
+
cosine ≥ 0.85 → drop) and answers were quality-gated (≥8 words, ≥2 keyword
|
| 87 |
+
overlap with the source). **Result: 80/80 passed every filter** — a genuine
|
| 88 |
+
finding, not a bug: an earlier template-based generator lost 28.5% of samples
|
| 89 |
+
to the same filters, and that failure mode disappeared once answers came
|
| 90 |
+
from an LLM that actually read the source (see
|
| 91 |
+
`Task2 Phase B/research_and_improve_B.md`).
|
| 92 |
+
|
| 93 |
+
**DPO set (Phase C).** 15 prompts got two answer variants each (concise vs.
|
| 94 |
+
elaborate), each pair judged chosen/rejected against a written rubric. To
|
| 95 |
+
test judgment reliability, the same 15 blind pairs were independently judged
|
| 96 |
+
twice more under two different explicit criteria (groundedness vs.
|
| 97 |
+
conciseness). **The two criteria agreed on only 10/15 pairs (66.7%)** —
|
| 98 |
+
disagreeing pairs were dropped, leaving the 10 in `dpo_pairs_filtered.jsonl`.
|
| 99 |
+
This reproduces the annotator-disagreement problem described in
|
| 100 |
+
*"Preference Consistency Matters"* (arXiv:2408.12799).
|
| 101 |
+
|
| 102 |
+
**Evaluation (Phase D, not included as data here).** 5 self-authored
|
| 103 |
+
GSM8K-style problems were checked against the full A/B/C corpus for 8-gram
|
| 104 |
+
overlap (0 contamination hits, as expected — self-authored). A toxic-term
|
| 105 |
+
denylist scan of Phase B/C found 1 real hit (a casual "shit" in a Star Wars
|
| 106 |
+
fan-blog excerpt that made it through Phase A) — confirming a toxicity
|
| 107 |
+
filter is not optional once source text is real crawled web content.
|
| 108 |
+
|
| 109 |
+
## Data fields
|
| 110 |
+
|
| 111 |
+
**`raw_documents.jsonl`** (pretraining, raw)
|
| 112 |
+
```json
|
| 113 |
+
{"url": "...", "html": "<raw HTML string, original encoding>", "warc_date": "2026-06-05T22:41:22Z", "content_length": 17129}
|
| 114 |
+
```
|
| 115 |
+
|
| 116 |
+
**`extracted_documents.jsonl` / `filtered_documents.jsonl` / `filtered_documents_v2.jsonl`** (pretraining, intermediate)
|
| 117 |
+
```json
|
| 118 |
+
{"url": "...", "warc_date": "...", "text": "extracted body text", "language": "en", "language_score": 0.345, "html_length": 19085, "extracted_length": 1318}
|
| 119 |
+
```
|
| 120 |
+
|
| 121 |
+
**`cleaned_documents.jsonl`** (pretraining, final — PII masked)
|
| 122 |
+
```json
|
| 123 |
+
{"url": "...", "warc_date": "...", "text": "...names/emails/phones/IPs replaced with [NAME]/[EMAIL]/[PHONE]/[IP]...", "language": "en"}
|
| 124 |
+
```
|
| 125 |
+
|
| 126 |
+
**`sft_dataset.jsonl`** (SFT, final)
|
| 127 |
+
```json
|
| 128 |
+
{
|
| 129 |
+
"index": 0, "instruction_type": "summarize",
|
| 130 |
+
"prompt": "다음 글을 1~2문장으로 요약해줘:\n\n...",
|
| 131 |
+
"answer": "...",
|
| 132 |
+
"source_url": "...", "source_excerpt": "...",
|
| 133 |
+
"messages": [{"role": "system", "content": "..."}, {"role": "user", "content": "..."}, {"role": "assistant", "content": "..."}],
|
| 134 |
+
"text": "<|im_start|>system\n...<|im_end|>\n<|im_start|>user\n...<|im_end|>\n<|im_start|>assistant\n...<|im_end|>"
|
| 135 |
+
}
|
| 136 |
+
```
|
| 137 |
+
|
| 138 |
+
**`dpo_pairs_filtered.jsonl`** (DPO, final)
|
| 139 |
+
```json
|
| 140 |
+
{
|
| 141 |
+
"dpo_id": 1, "prompt": "...",
|
| 142 |
+
"chosen": "...", "rejected": "...",
|
| 143 |
+
"chosen_side": "elaborate",
|
| 144 |
+
"justification": "why the judge picked this side",
|
| 145 |
+
"source_url": "...", "source_excerpt": "..."
|
| 146 |
+
}
|
| 147 |
+
```
|
| 148 |
+
|
| 149 |
+
## Languages
|
| 150 |
+
|
| 151 |
+
Predominantly English (the corpus is filtered to `language == "en"` via
|
| 152 |
+
fastText). Instruction prompts/system text in Phase B/C are Korean;
|
| 153 |
+
answers/model text are English. Note the langid model is top-1 with **no
|
| 154 |
+
confidence threshold** — e.g. one retained "English" document in
|
| 155 |
+
`extracted_documents.jsonl` is actually Chinese-language content with a
|
| 156 |
+
`language_score` of only 0.345, misclassified because nothing filters on
|
| 157 |
+
score. Treat `language_score` as a real, usable quality signal the current
|
| 158 |
+
pipeline does not yet act on.
|
| 159 |
+
|
| 160 |
+
## Known limitations
|
| 161 |
+
|
| 162 |
+
- **PII masking is not exhaustive.** Regex covers common email/phone/IP
|
| 163 |
+
formats; name masking relies on spaCy `en_core_web_sm` NER, which has
|
| 164 |
+
real false positives (brand/product names tagged as `PERSON`) and, being
|
| 165 |
+
a statistical model, real false negatives too. Do not assume this corpus
|
| 166 |
+
is PII-free.
|
| 167 |
+
- **Copyright / licensing.** `raw_documents.jsonl` through
|
| 168 |
+
`cleaned_documents.jsonl` contain (masked, but otherwise verbatim-derived)
|
| 169 |
+
text scraped from live third-party websites. Common Crawl's own crawl
|
| 170 |
+
index/metadata is available under their terms, but the underlying page
|
| 171 |
+
content's copyright remains with the original site owners — this is not
|
| 172 |
+
a "free to redistribute" text corpus. Treat as research/educational use
|
| 173 |
+
only.
|
| 174 |
+
- **Scale.** Hundreds to low-thousands of rows per split, single-process —
|
| 175 |
+
a POC-scale reproduction of production logic (DataTrove/Dolma-equivalent
|
| 176 |
+
filters), not a production-scale corpus.
|
| 177 |
+
- **No rejection sampling.** SFT/DPO answers are one generated candidate
|
| 178 |
+
per prompt (Phase B) or two (Phase C), not Llama-3-style multi-candidate
|
| 179 |
+
generation + reward-model/human selection. At this sample size that gap
|
| 180 |
+
hasn't visibly hurt quality, but it's a structural difference from
|
| 181 |
+
production post-training pipelines.
|
| 182 |
+
- **Preference labels are noisy.** The 66.7% inter-criterion agreement in
|
| 183 |
+
Phase C means `chosen`/`rejected` reflects one plausible judgment, not a
|
| 184 |
+
ground truth — expect similar disagreement rates if you re-judge these
|
| 185 |
+
pairs independently.
|
| 186 |
+
|
| 187 |
+
## How to load
|
| 188 |
+
|
| 189 |
+
```python
|
| 190 |
+
from datasets import load_dataset
|
| 191 |
+
|
| 192 |
+
pretrain = load_dataset("json", data_files="Task2 Phase A/cleaned_documents.jsonl")
|
| 193 |
+
sft = load_dataset("json", data_files="Task2 Phase B/sft_dataset.jsonl")
|
| 194 |
+
dpo = load_dataset("json", data_files="Task2 Phase C/dpo_pairs_filtered.jsonl")
|
| 195 |
+
```
|
| 196 |
+
|
| 197 |
+
## Licensing
|
| 198 |
+
|
| 199 |
+
No explicit redistribution license is granted for the raw web text itself
|
| 200 |
+
(see **Known limitations** above). This dataset is shared for research/
|
| 201 |
+
educational purposes documenting a data-pipeline methodology, not as a
|
| 202 |
+
licensed corpus for downstream commercial use. Common Crawl's Terms of Use:
|
| 203 |
+
https://commoncrawl.org/terms-of-use
|