Datasets:
dataset card
Browse files
README.md
CHANGED
|
@@ -1,3 +1,131 @@
|
|
| 1 |
---
|
| 2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
task_categories:
|
| 3 |
+
- text-generation
|
| 4 |
+
language:
|
| 5 |
+
- en
|
| 6 |
+
tags:
|
| 7 |
+
- math
|
| 8 |
+
- information-extraction
|
| 9 |
+
- pretraining
|
| 10 |
+
- model-generated
|
| 11 |
+
size_categories:
|
| 12 |
+
- 1M<n<10M
|
| 13 |
+
configs:
|
| 14 |
+
- config_name: default
|
| 15 |
+
data_files:
|
| 16 |
+
- split: corpus
|
| 17 |
+
path: data/corpus-*.parquet
|
| 18 |
---
|
| 19 |
+
|
| 20 |
+
# UDM cleaned docs
|
| 21 |
+
|
| 22 |
+
**6,029,052 web pages reduced to just their mathematical content**, extracted verbatim by [oklenAI/udm_doc_extract_qwen3.5_2B](https://huggingface.co/oklenAI/udm_doc_extract_qwen3.5_2B) — a 2B model distilled from GPT-5.6.
|
| 23 |
+
|
| 24 |
+
Every row is **model output**, not human-curated text. The `extract` field is what the model returned for that page; the source page text is not included. Read *Two repetition flags* below before filtering — the obvious flag is not the one you want.
|
| 25 |
+
|
| 26 |
+
## How it was built
|
| 27 |
+
|
| 28 |
+
| step | pages | |
|
| 29 |
+
|---|---:|---|
|
| 30 |
+
| `TeraflopAI/udml2-labeled`, keeping `score >= 2` | 13,514,716 | the 0–7 scale lives in `score` (`__label__N`), **not** in `quality_label`, which only ever takes {4, 5} |
|
| 31 |
+
| after exact-content dedup | **6,029,052** | 55.39% of the filtered pool is duplicated **across shards**; within any single shard only ~2% is, because the source is globally shuffled before sharding |
|
| 32 |
+
|
| 33 |
+
Extraction ran greedy (no sampling, no repetition penalty) under vLLM 0.28.0 with a per-page token budget of `min(24576, 1.25 x input_tokens + 256, 40960 - input_tokens)`. Sizing the budget to the page rather than to a constant matters: extraction length scales with input, so a flat cap silently truncates exactly the long pages. **Input-side truncation hit 1 page out of 6,029,052.**
|
| 34 |
+
|
| 35 |
+
## Schema
|
| 36 |
+
|
| 37 |
+
| column | type | meaning |
|
| 38 |
+
|---|---|---|
|
| 39 |
+
| `content_id` | string | `p_` + `sha256(source page utf-8)[:24]`. Joins back to the source dataset — recompute it there, no normalisation, no NFKC. |
|
| 40 |
+
| `score` | int8 | quality band 2–7 carried over from the source dataset |
|
| 41 |
+
| `nchar` | int32 | characters in the **source page** |
|
| 42 |
+
| `in_tok` / `out_tok` | int32 | tokens in / out |
|
| 43 |
+
| `trunc` | bool | source page was truncated on the input side |
|
| 44 |
+
| `extract` | string | **the payload** — mathematical content, verbatim |
|
| 45 |
+
| `rep20` | float32 | 20-gram repeat rate over the whole extract |
|
| 46 |
+
| `degenerate` | bool | `rep20 > 0.30` — **over-inclusive, see below** |
|
| 47 |
+
| `rep_tail` | float32 | 20-gram repeat rate over the **last 300 words** (0.0 where `degenerate` is false) |
|
| 48 |
+
| `loop` | bool | `rep_tail >= 0.70` — **this is the defect flag** |
|
| 49 |
+
|
| 50 |
+
## Two repetition flags, and why the obvious one is wrong
|
| 51 |
+
|
| 52 |
+
A high whole-document repeat rate has two completely different causes, and they need opposite treatment:
|
| 53 |
+
|
| 54 |
+
- **the model looped** — greedy decoding locks onto a short n-gram and repeats it until the token budget runs out. Broken output.
|
| 55 |
+
- **the page repeats itself** — a forum thread quoting the same code block, a worksheet built from a template, a page that prints its theory section twice. The model transcribed it faithfully. **Good output.**
|
| 56 |
+
|
| 57 |
+
`rep20 > 0.30` cannot tell these apart. `rep_tail` can, because a genuine loop is still looping when the budget runs out while a repetitive *page* is still producing new text at the end. The split is bimodal, not a continuum — sampled non-loop pages score exactly 0.000 — so the threshold is not delicate.
|
| 58 |
+
|
| 59 |
+
| | pages | of corpus | of flagged |
|
| 60 |
+
|---|---:|---:|---:|
|
| 61 |
+
| flagged `degenerate` (`rep20 > 0.30`) | 66,198 | 1.098% | 100% |
|
| 62 |
+
| — **`loop`**, the model actually broke | 38,764 | 0.643% | 58.6% |
|
| 63 |
+
| — page was repetitive, extraction is fine — **keep these** | 27,434 | 0.455% | 41.4% |
|
| 64 |
+
|
| 65 |
+
So **filter on `loop`, not on `degenerate`** — about a third of `degenerate` is good extraction of repetitive source pages, and worksheets and problem sets are exactly the pages this corpus is for. Nothing was deleted; both flags ship so you can choose.
|
| 66 |
+
|
| 67 |
+
Looping is strongly length-dependent:
|
| 68 |
+
|
| 69 |
+
| source page length | pages | `degenerate` | `loop` |
|
| 70 |
+
|---|---:|---:|---:|
|
| 71 |
+
| <5k chars | 2,980,959 | 0.329% | 0.156% |
|
| 72 |
+
| 5-20k chars | 2,201,674 | 1.233% | 0.717% |
|
| 73 |
+
| >=20k chars | 846,419 | 3.454% | 2.164% |
|
| 74 |
+
|
| 75 |
+
## Corpus statistics
|
| 76 |
+
|
| 77 |
+
| | |
|
| 78 |
+
|---|---:|
|
| 79 |
+
| pages | 6,029,052 |
|
| 80 |
+
| parquet files (zstd) | 117, 13.14 GB |
|
| 81 |
+
| source page length | median 5,084, mean 9,319, p90 24,702, max 49,998 chars |
|
| 82 |
+
| pages over 20,000 chars | 13.93% |
|
| 83 |
+
| input tokens | 18,588,607,640 |
|
| 84 |
+
| output tokens | 12,542,804,450 (0.675 x input) |
|
| 85 |
+
| empty extractions | 34 (0.001%) |
|
| 86 |
+
|
| 87 |
+
`score` distribution: **2** 10.7%, **3** 35.5%, **4** 10.7%, **5** 27.9%, **6** 8.7%, **7** 6.5%
|
| 88 |
+
|
| 89 |
+
## Usage
|
| 90 |
+
|
| 91 |
+
```python
|
| 92 |
+
from datasets import load_dataset
|
| 93 |
+
|
| 94 |
+
ds = load_dataset("oklenAI/UDM_cleaned_docs", split="corpus", streaming=True)
|
| 95 |
+
clean = (r for r in ds if not r["loop"]) # drop the ~0.6% the model broke on
|
| 96 |
+
```
|
| 97 |
+
|
| 98 |
+
The split is called `corpus`, not `train` — this is extracted document text, not anyone's training split.
|
| 99 |
+
|
| 100 |
+
## How faithful is it?
|
| 101 |
+
|
| 102 |
+
Faithfulness here means **agreement with the teacher**, GPT-5.6-Sol, called exactly as it was called to build the model's training data. It does not measure whether the teacher was right.
|
| 103 |
+
|
| 104 |
+
449 pages were drawn **from this corpus itself** — not from the model's evaluation set — in three length bands, and re-extracted by the teacher:
|
| 105 |
+
|
| 106 |
+
| | short (n=150) | medium (n=150) | long (n=149) |
|
| 107 |
+
|---|---:|---:|---:|
|
| 108 |
+
| charF1 vs teacher | 0.9693 | 0.9286 | 0.8811 |
|
| 109 |
+
| contiguous-span coverage | 0.9891 | 0.9831 | 0.9767 |
|
| 110 |
+
| strict order preservation | 99.28% | 93.79% | 92.14% |
|
| 111 |
+
| boilerplate residue | 0.67% | 4.00% | 3.36% |
|
| 112 |
+
| share with 20-gram repeat > 0.3 | 0.00% | 0.67% | 2.01% |
|
| 113 |
+
| empty-output rate | 0.00% | 0.00% | 0.00% |
|
| 114 |
+
|
| 115 |
+
Two things worth reading off this table. Long-page charF1 on production pages is **0.8811**, slightly *above* the 0.8668 the model card reports on its held-out long ruler — the corpus is not harder than the ruler said it would be. And the repetition tail shows up independently: 2.01% of these 149 long pages exceed a 0.3 repeat rate, against 3.454% measured over all 846,419 long pages in the corpus. Those two are consistent rather than equal — at n=149 the sample simply cannot resolve a rate this small — but the check was run by different code on a different sample and still lands in the same place.
|
| 116 |
+
|
| 117 |
+
## Limits
|
| 118 |
+
|
| 119 |
+
- **Student, not oracle.** Every fidelity number is agreement with GPT-5.6. Nothing here was audited against the source pages by a human.
|
| 120 |
+
- **Long pages are measurably harder.** charF1 0.8811 on long pages vs 0.9693 on short ones, and the loop rate is 13.9x higher in the >=20k band than in the <5k band.
|
| 121 |
+
- **Formula-token excess.** The teacher check shows 21.48% excess notation tokens on long pages. The prompt mandates notation repair, so this is not that share of hallucination — but measure repetition directly rather than trusting token counts as a proxy.
|
| 122 |
+
- **Nothing beyond ~50,000 characters.** The source pool tops out at 49,998 chars.
|
| 123 |
+
- **English only**, and only pages the source dataset already labelled as mathematical.
|
| 124 |
+
- **Empty output is a valid answer** where a page carries no substantive math; the observed empty rate is 0.001%.
|
| 125 |
+
|
| 126 |
+
## Provenance and licensing
|
| 127 |
+
|
| 128 |
+
Page text originates from `TeraflopAI/udml2-labeled`, which declares no license. This derived corpus adds only the extraction; check the upstream dataset before redistributing or training on it.
|
| 129 |
+
|
| 130 |
+
Extraction model: [oklenAI/udm_doc_extract_qwen3.5_2B](https://huggingface.co/oklenAI/udm_doc_extract_qwen3.5_2B). The prompt used is shipped with the model as `extract_prompt.txt`.
|
| 131 |
+
|