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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
license: apache-2.0
|
| 5 |
+
task_categories:
|
| 6 |
+
- text-generation
|
| 7 |
+
- language-modeling
|
| 8 |
+
pretty_name: StenCore — FinePDFs-Edu Curated
|
| 9 |
+
authors:
|
| 10 |
+
- StentorLabs
|
| 11 |
+
size_categories:
|
| 12 |
+
- 100K<n<1M
|
| 13 |
+
source_datasets:
|
| 14 |
+
- HuggingFaceFW/finepdfs-edu
|
| 15 |
+
tags:
|
| 16 |
+
- education
|
| 17 |
+
- quality-filtered
|
| 18 |
+
- deduplicated
|
| 19 |
+
- perplexity-filtered
|
| 20 |
+
- kenlm
|
| 21 |
+
- minhash
|
| 22 |
+
- domain-reweighted
|
| 23 |
+
- llm-pretraining
|
| 24 |
+
- english
|
| 25 |
+
- pii-filtered
|
| 26 |
+
configs:
|
| 27 |
+
- config_name: default
|
| 28 |
+
data_files:
|
| 29 |
+
- split: train
|
| 30 |
+
path: data/*.parquet
|
| 31 |
+
---
|
| 32 |
+
|
| 33 |
+
# StenCore — FinePDFs-Edu Curated
|
| 34 |
+
|
| 35 |
+
*By [StentorLabs](https://huggingface.co/StentorLabs)*
|
| 36 |
+
|
| 37 |
+

|
| 38 |
+

|
| 39 |
+

|
| 40 |
+

|
| 41 |
+

|
| 42 |
+
|
| 43 |
+
StenCore is StentorLabs' first dataset release — a quality-first resource built from the ground up for training language models. Derived from [HuggingFaceFW/finepdfs-edu](https://huggingface.co/datasets/HuggingFaceFW/finepdfs-edu), every document passed a 14-stage automated curation pipeline including heuristic filtering, language ID, PII redaction, toxicity screening, eval decontamination, multi-strategy deduplication, KenLM + neural perplexity scoring, and domain reweighting.
|
| 44 |
+
|
| 45 |
+
> ⚠️ **Privacy & Copyright Notice:** This dataset was produced by automated pipelines that include regex-based PII redaction and heuristic filters. Automated redaction may miss personal data (false negatives) and may over-redact (false positives). No claim of complete PII removal is made. Do not use this dataset in systems that surface individual personal data. Review and clear upstream site-level licenses before redistributing or deploying models trained on this data. For takedown or privacy requests, open an issue or contact [stentorlabs@gmail.com](mailto:stentorlabs@gmail.com) with the affected doc identifier and evidence.
|
| 46 |
+
|
| 47 |
+
---
|
| 48 |
+
|
| 49 |
+
## Quick Stats
|
| 50 |
+
|
| 51 |
+
| Property | Value |
|
| 52 |
+
|---|---|
|
| 53 |
+
| **Pipeline** | StenCore v2026.03 |
|
| 54 |
+
| **Source** | `HuggingFaceFW/finepdfs-edu` (3 Parquet files, ~8.9 GB) |
|
| 55 |
+
| **Docs in → out** | 584,000 → 149,000 (~37.78% keep rate) |
|
| 56 |
+
| **Size (uncompressed)** | 447,088,827 bytes (~447.09 MB) |
|
| 57 |
+
| **Avg doc size** | ~2,988 bytes (~750 words) |
|
| 58 |
+
| **Synthetic docs** | 0 (100% human-authored) |
|
| 59 |
+
| **Language** | English (`en`) |
|
| 60 |
+
| **Platform** | Kaggle CPU |
|
| 61 |
+
| **Total runtime** | ~9.47 hours wall / ~12+ hours CPU |
|
| 62 |
+
|
| 63 |
+
---
|
| 64 |
+
|
| 65 |
+
## Usage
|
| 66 |
+
|
| 67 |
+
```python
|
| 68 |
+
from datasets import load_dataset
|
| 69 |
+
|
| 70 |
+
ds = load_dataset("StentorLabs/stencore")
|
| 71 |
+
|
| 72 |
+
# Filter to highest-quality documents
|
| 73 |
+
top = ds["train"].filter(lambda r: r["cqf_score"] >= 0.5)
|
| 74 |
+
print(len(top))
|
| 75 |
+
print(top[0]["text"][:500])
|
| 76 |
+
```
|
| 77 |
+
|
| 78 |
+
---
|
| 79 |
+
|
| 80 |
+
## Intended & Disallowed Uses
|
| 81 |
+
|
| 82 |
+
**✅ Intended uses**
|
| 83 |
+
- LLM pre-training and fine-tuning on English educational text
|
| 84 |
+
- Quality filtering and data curation research
|
| 85 |
+
- Domain reweighting and curriculum learning experiments
|
| 86 |
+
|
| 87 |
+
**🚫 Disallowed uses**
|
| 88 |
+
- Systems that surface or process personal information
|
| 89 |
+
- Redistribution without reviewing upstream licensing (Apache 2.0 requires attribution; check site-level licenses for individual documents)
|
| 90 |
+
- Any production deployment without independent legal and privacy review
|
| 91 |
+
|
| 92 |
+
---
|
| 93 |
+
|
| 94 |
+
## Pipeline Summary
|
| 95 |
+
|
| 96 |
+
StenCore (`curate_2026` mode) is a fully automated curation pipeline (v2026.03) running 14 sequential stages from raw Parquet to a publish-ready HuggingFace dataset.
|
| 97 |
+
|
| 98 |
+
**Every document in this dataset passed all of the following:**
|
| 99 |
+
|
| 100 |
+
1. **Columnar pre-filter** — DuckDB SQL-level filter over raw Parquet
|
| 101 |
+
2. **Adaptive quality thresholds** — learned from the data, not hand-tuned (per-register: formal / conversational / technical)
|
| 102 |
+
3. **Language ID gate** — fastText or stopword/script heuristic (`en` only)
|
| 103 |
+
4. **Heuristic quality filter** — word count, alpha ratio, stopword hits, punctuation ratio, repetition ratios, avg word length
|
| 104 |
+
5. **PII redaction** — regex detection of emails, phones, SSNs, IPs, card numbers, IBANs, API keys
|
| 105 |
+
6. **Toxicity screening** — lexical axis scoring, drop policy
|
| 106 |
+
7. **Eval decontamination** — exact, 8-gram overlap, char 3-gram, SimHash checks against benchmark sets
|
| 107 |
+
8. **Exact deduplication** — SHA-1 fingerprint (in-memory)
|
| 108 |
+
9. **MinHash near-dedup** — token shingle LSH (autotuned to 25% sample rate)
|
| 109 |
+
10. **CQF quality gate** — top 85% by quality score (threshold: CQF ≥ 0.4167)
|
| 110 |
+
11. **KenLM + neural perplexity gate** — `edugp/kenlm` Wikipedia model + SmolLM2-135M (excess mode, ref mean: 916.24)
|
| 111 |
+
12. **Cluster rehydration** — restores high-quality representatives from dedup-dropped clusters
|
| 112 |
+
13. **Domain reweighting** — per-domain weights learned from proxy model evaluation
|
| 113 |
+
14. **Mix optimization + final write** — domain-quota sampling, curriculum ordering, shard + merkle output
|
| 114 |
+
|
| 115 |
+
<details>
|
| 116 |
+
<summary><b>📋 Full Stage-by-Stage Breakdown</b></summary>
|
| 117 |
+
|
| 118 |
+
### Pre-Stage: Environment & Model Setup
|
| 119 |
+
|
| 120 |
+
**KenLM Scorer**
|
| 121 |
+
- Repo: `edugp/kenlm` | Corpus: `wikipedia/en`
|
| 122 |
+
- Snapshot: `3fbe35c83b1a39f420a345b7c96a186c8030d834`
|
| 123 |
+
- Mode: `first_pass` — KenLM prefilters, SmolLM2 rescores the subset
|
| 124 |
+
|
| 125 |
+
**Neural Reference LM**
|
| 126 |
+
- Model: `HuggingFaceTB/SmolLM2-135M` (torchao `int8_weight_only`)
|
| 127 |
+
- `torch.compile`: Disabled (CPU stability)
|
| 128 |
+
|
| 129 |
+
**Effective runtime profile:**
|
| 130 |
+
```
|
| 131 |
+
light_mode=False input_cap=400 bootstrap_docs=400
|
| 132 |
+
stage_timeout_s=90 stream_chunk=32768 ppl_batch=192
|
| 133 |
+
ppl_workers=1 prefix_tokens=256 kenlm_mode=first_pass
|
| 134 |
+
```
|
| 135 |
+
|
| 136 |
+
**12h target profile:**
|
| 137 |
+
```
|
| 138 |
+
hf_input_target_gb=7.50 hf_input_max_files=64
|
| 139 |
+
cqf_keep_web=0.85 prior_keep=0.90 web_ratio=0.95
|
| 140 |
+
strict_ratio=False dedup=memory autotune_grace=10000
|
| 141 |
+
```
|
| 142 |
+
|
| 143 |
+
---
|
| 144 |
+
|
| 145 |
+
### Stage 1: resolve_web_inputs
|
| 146 |
+
**Wall:** 53.47s | **CPU:** 143.36s | **Ratio:** 2.68×
|
| 147 |
+
|
| 148 |
+
DuckDB columnar prefilter over 3 Parquet files → `stage_columnar_prefilter.parquet`. High CPU/wall ratio confirms parallel DuckDB execution.
|
| 149 |
+
|
| 150 |
+
---
|
| 151 |
+
|
| 152 |
+
### Stage 2: adapt_multilingual_profiles
|
| 153 |
+
**Wall:** 25.48s | **CPU:** 25.39s | **Ratio:** 1.00×
|
| 154 |
+
|
| 155 |
+
Draws a pilot sample and learns per-register quality threshold parameters from the data. Three registers profiled: `en:formal` (1,854 samples), `en:conversational` (2,993 samples), `en:technical`. Single-threaded statistical pass.
|
| 156 |
+
|
| 157 |
+
---
|
| 158 |
+
|
| 159 |
+
### Stage 3: optimize_threshold_profiles
|
| 160 |
+
**Wall:** 86.79s | **CPU:** 138.40s | **Ratio:** 1.59×
|
| 161 |
+
|
| 162 |
+
Grid search over code/math profile scales, ranked by proxy quality metric. Selects best-performing threshold configuration.
|
| 163 |
+
|
| 164 |
+
---
|
| 165 |
+
|
| 166 |
+
### Stage 4: cqf_seed_verification_loop
|
| 167 |
+
**Wall:** 0.001s | **CPU:** 0.001s
|
| 168 |
+
|
| 169 |
+
Retrains CQF fastText at multiple thresholds, picks best by proxy quality. Completed near-instantly — seed was valid, no remediation needed.
|
| 170 |
+
|
| 171 |
+
---
|
| 172 |
+
|
| 173 |
+
### Stage 5: stage_web_candidate_pass
|
| 174 |
+
**Wall:** 27,162.57s (7.5h) | **CPU:** 42,229.32s | **Ratio:** 1.55×
|
| 175 |
+
|
| 176 |
+
Main filtering stage. Sequential gates per document:
|
| 177 |
+
1. Quick prefilter (min words / alpha)
|
| 178 |
+
2. HF-specific input filters (English subset, EDU v2, strip code fences)
|
| 179 |
+
3. Source policy (host allow/deny, ToS risk, license allowlist)
|
| 180 |
+
4. Line cleaner (boilerplate, nav, HTML artifacts, duplicate lines)
|
| 181 |
+
5. Domain routing (code / math / prose)
|
| 182 |
+
6. Language ID gate (+ English noise guard, code bypass)
|
| 183 |
+
7. Domain-aware heuristic filter (adaptive thresholds from Stage 2/3)
|
| 184 |
+
8. PII redaction
|
| 185 |
+
9. Toxicity screening
|
| 186 |
+
10. Eval decontamination (exact, 8-gram, char 3-gram, SimHash)
|
| 187 |
+
11. CQF scoring
|
| 188 |
+
12. Exact dedup (SHA-1, in-memory)
|
| 189 |
+
13. MinHash near-dedup (autotuned)
|
| 190 |
+
14. Semantic dedup (autotuned to `none`)
|
| 191 |
+
|
| 192 |
+
Kept: 220,635 / 584,000 (37.78%). Dropped records to semantic dup pool for potential rehydration.
|
| 193 |
+
|
| 194 |
+
---
|
| 195 |
+
|
| 196 |
+
### Stage 6 (observed): mid_proxy_stage3
|
| 197 |
+
**Wall:** 115.50s | **CPU:** 160.80s | **Ratio:** 1.39×
|
| 198 |
+
|
| 199 |
+
Intermediate proxy scoring pass over quality-filtered candidates.
|
| 200 |
+
|
| 201 |
+
---
|
| 202 |
+
|
| 203 |
+
### Stage 7: stage_web_quality_and_perplexity
|
| 204 |
+
**Wall:** 300.05s | **CPU:** 282.49s | **Ratio:** 0.94×
|
| 205 |
+
|
| 206 |
+
1. **CQF threshold gate** — keeps top 85% (CQF ≥ 0.4167)
|
| 207 |
+
2. **Multi-objective property minima** — per-property floor checks
|
| 208 |
+
3. **Prior noise gate** — filters statistical outliers vs. quality prior
|
| 209 |
+
4. **Hybrid disagreement trigger** — routes CQF/secondary disagreements to full neural perplexity
|
| 210 |
+
5. **KenLM + SmolLM2 perplexity gate** — excess mode, ref mean 916.24
|
| 211 |
+
|
| 212 |
+
22,450 documents scored. Avg perplexity: 902.02 *(stored as excess perplexity — relative to the 916.24 calibrated mean, not absolute)*.
|
| 213 |
+
|
| 214 |
+
---
|
| 215 |
+
|
| 216 |
+
### Stage 8: rehydrate_clusters
|
| 217 |
+
**Wall:** 40.42s | **CPU:** 40.19s | **Ratio:** 0.99×
|
| 218 |
+
|
| 219 |
+
Reads the semantic dup pool. Re-adds top-quality cluster representatives (ranked by FineWeb2-like weighted formula). Optional MMR diversity selection. Single-threaded.
|
| 220 |
+
|
| 221 |
+
---
|
| 222 |
+
|
| 223 |
+
### Stage 9 (observed): mid_proxy_stage5
|
| 224 |
+
**Wall:** 102.92s | **CPU:** 143.10s | **Ratio:** 1.39×
|
| 225 |
+
|
| 226 |
+
Second intermediate proxy scoring pass after cluster rehydration.
|
| 227 |
+
|
| 228 |
+
---
|
| 229 |
+
|
| 230 |
+
### Proxy Eval & Domain Reweighting (~60 min observed gap)
|
| 231 |
+
|
| 232 |
+
Per-domain proxy scores aggregated → per-domain reweighting coefficients learned. Hundreds of source domains reweighted. Examples:
|
| 233 |
+
|
| 234 |
+
| Domain | Weight |
|
| 235 |
+
|---|---|
|
| 236 |
+
| `apps.oregonlegislature.gov` | 1.0811 |
|
| 237 |
+
| `fcaresources.com` | 1.0159 |
|
| 238 |
+
| `ymcawnc.org` | 0.9999 |
|
| 239 |
+
| `www2.cs.arizona.edu` | 0.9585 |
|
| 240 |
+
| `echalk-slate-prod.s3.amazonaws.com` | 0.8882 |
|
| 241 |
+
|
| 242 |
+
---
|
| 243 |
+
|
| 244 |
+
### Stage 9: build_synthetic_pool
|
| 245 |
+
**Wall:** 0.003s — No teacher LLM configured. Pool: 0 documents.
|
| 246 |
+
|
| 247 |
+
### Stage 10: stage_synthetic_filter
|
| 248 |
+
**Wall:** 0.002s — No-op (empty pool).
|
| 249 |
+
|
| 250 |
+
---
|
| 251 |
+
|
| 252 |
+
### Stage 11: mix_optimization
|
| 253 |
+
**Wall:** 175.34s | **CPU:** 214.87s | **Ratio:** 1.23×
|
| 254 |
+
|
| 255 |
+
Proxy-evaluated search over web/synth mixing ratios. Applies domain weights from proxy eval. Produces final document selection plan.
|
| 256 |
+
|
| 257 |
+
---
|
| 258 |
+
|
| 259 |
+
### Stage 12: final_mix_and_write
|
| 260 |
+
**Wall:** ~2,311s (~38.5 min)
|
| 261 |
+
|
| 262 |
+
Domain quota enforcement → domain-weighted acceptance sampling → final exact dedup → optional curriculum ordering (easy→hard by CQF/perplexity) → streaming JSONL + Parquet write → SHA-256 + merkle root → optional deterministic sharding.
|
| 263 |
+
|
| 264 |
+
| Docs Written | Bytes | Avg Bytes/Doc |
|
| 265 |
+
|---|---|---|
|
| 266 |
+
| 1,000 | 2,783,132 | 2,783 |
|
| 267 |
+
| 149,000 | 447,088,827 | 2,999 |
|
| 268 |
+
|
| 269 |
+
### Stages 13–14: proxy_eval + hf_push
|
| 270 |
+
Final proxy metric gate enforcement → auto-upload to HuggingFace Hub.
|
| 271 |
+
|
| 272 |
+
</details>
|
| 273 |
+
|
| 274 |
+
---
|
| 275 |
+
|
| 276 |
+
## Adaptive Quality Thresholds
|
| 277 |
+
|
| 278 |
+
<details>
|
| 279 |
+
<summary><b>📐 Full learned threshold values (en:formal and en:conversational)</b></summary>
|
| 280 |
+
|
| 281 |
+
These parameters were learned from the data in Stage 2 and optimized in Stage 3. All values are exact as logged.
|
| 282 |
+
|
| 283 |
+
### `en:formal` — 1,854 bootstrap samples
|
| 284 |
+
|
| 285 |
+
| Parameter | Value |
|
| 286 |
+
|---|---|
|
| 287 |
+
| `min_words` | 30 |
|
| 288 |
+
| `max_words` | 2,000 |
|
| 289 |
+
| `min_stopwords` | 2 |
|
| 290 |
+
| `max_line_punct_ratio` | 0.1111111111111111 |
|
| 291 |
+
| `max_word_repeat_3gram_ratio` | 0.30466436237947997 |
|
| 292 |
+
| `max_char_repeat_5gram_ratio` | 0.35 |
|
| 293 |
+
| `min_alpha_ratio` | 0.5967419247419248 |
|
| 294 |
+
| `min_avg_word_len` | 4.157040378006873 |
|
| 295 |
+
| `max_avg_word_len` | 6.216977322149734 |
|
| 296 |
+
|
| 297 |
+
### `en:conversational` — 2,993 bootstrap samples
|
| 298 |
+
|
| 299 |
+
| Parameter | Value |
|
| 300 |
+
|---|---|
|
| 301 |
+
| `min_words` | 18 |
|
| 302 |
+
| `max_words` | 2,000 |
|
| 303 |
+
| `min_stopwords` | 2 |
|
| 304 |
+
| `max_line_punct_ratio` | 0.10838961038961101 |
|
| 305 |
+
| `max_word_repeat_3gram_ratio` | 0.19476069102237326 |
|
| 306 |
+
| `max_char_repeat_5gram_ratio` | 0.35 |
|
| 307 |
+
| `min_alpha_ratio` | 0.6542321503584156 |
|
| 308 |
+
| `min_avg_word_len` | 4.098954647914038 |
|
| 309 |
+
| `max_avg_word_len` | 6.0 |
|
| 310 |
+
|
| 311 |
+
### `en:technical`
|
| 312 |
+
|
| 313 |
+
Separate profile applied; full values truncated in logs. Expected to have higher tolerance for non-alphabetic characters (equations, code, symbols) and relaxed stopword requirements.
|
| 314 |
+
|
| 315 |
+
</details>
|
| 316 |
+
|
| 317 |
+
---
|
| 318 |
+
|
| 319 |
+
## Deduplication Autotune
|
| 320 |
+
|
| 321 |
+
<details>
|
| 322 |
+
<summary><b>⚙️ Runtime autotune event log</b></summary>
|
| 323 |
+
|
| 324 |
+
The autotune system fires after 10,000 documents (grace period). All 6 events occurred in a 5,000-document window — the system converges aggressively.
|
| 325 |
+
|
| 326 |
+
| Event | Docs Seen | Throughput | Action |
|
| 327 |
+
|---|---|---|---|
|
| 328 |
+
| Start | 0 | — | `sem=hybrid`, `embed=0.0200`, `minhash=1.000` |
|
| 329 |
+
| #1 | 10,000 | 21.81 docs/s | `embed_sample → 0.0050` |
|
| 330 |
+
| #2 | 11,000 | 21.92 docs/s | `embed_sample → 0.0020` |
|
| 331 |
+
| #3 | 12,000 | 22.04 docs/s | `semantic_mode → minhash` |
|
| 332 |
+
| #4 | 13,000 | 22.13 docs/s | `minhash_sample → 0.500` |
|
| 333 |
+
| #5 | 14,000 | 22.31 docs/s | `minhash_sample → 0.250` |
|
| 334 |
+
| #6 | 15,000 | 22.57 docs/s | `semantic_mode → none` |
|
| 335 |
+
| Stable | 584,000 | 21.5 docs/s | Final: `sem=none`, `embed=0.0020`, `minhash=0.250` |
|
| 336 |
+
|
| 337 |
+
**Throughput gain: ~1.8×** (12.3 → 22 docs/s). MinHash at 25% sampling will miss some near-duplicate pairs — a deliberate throughput/precision tradeoff accepted by the autotune system based on observed duplicate density.
|
| 338 |
+
|
| 339 |
+
</details>
|
| 340 |
+
|
| 341 |
+
---
|
| 342 |
+
|
| 343 |
+
## Perplexity Scoring
|
| 344 |
+
|
| 345 |
+
<details>
|
| 346 |
+
<summary><b>📊 KenLM + SmolLM2 scoring details</b></summary>
|
| 347 |
+
|
| 348 |
+
### Configuration
|
| 349 |
+
- **KenLM model:** `edugp/kenlm`, `wikipedia/en`, snapshot `3fbe35c83b1a39f420a345b7c96a186c8030d834`
|
| 350 |
+
- **Neural LM:** `HuggingFaceTB/SmolLM2-135M` (torchao int8_weight_only)
|
| 351 |
+
- **Mode:** `first_pass` — KenLM prefilters all docs; SmolLM2 rescores near-boundary subset
|
| 352 |
+
- **Scoring mode:** `excess` — `score = raw_perplexity - reference_mean`
|
| 353 |
+
- **Reference mean:** 916.2404 (calibrated fresh on 256 bootstrap docs, `fit_new`)
|
| 354 |
+
|
| 355 |
+
### Scoring progress
|
| 356 |
+
|
| 357 |
+
| Docs Scored | Last Doc PPL | Running Avg PPL |
|
| 358 |
+
|---|---|---|
|
| 359 |
+
| 50 | 7,442.60 | 218.38 |
|
| 360 |
+
| 22,450 | 8,182.66 | 902.02 |
|
| 361 |
+
|
| 362 |
+
High individual perplexity values (>7,000) are expected for math-heavy or notation-rich educational text under a Wikipedia-trained model. The `excess` mode partially normalizes this. Running mean converges to ~902 across the full scored set.
|
| 363 |
+
|
| 364 |
+
|
| 365 |
+
</details>
|
| 366 |
+
|
| 367 |
+
---
|
| 368 |
+
|
| 369 |
+
## Runtime & Timing
|
| 370 |
+
|
| 371 |
+
<details>
|
| 372 |
+
<summary><b>⏱️ Full per-stage timing table</b></summary>
|
| 373 |
+
|
| 374 |
+
| Stage | Wall Time | CPU Time | CPU/Wall |
|
| 375 |
+
|---|---|---|---|
|
| 376 |
+
| Model/env setup | ~167s | — | — |
|
| 377 |
+
| `resolve_web_inputs` | 53.47s | 143.36s | 2.68× |
|
| 378 |
+
| `adapt_multilingual_profiles` | 25.48s | 25.39s | 1.00× |
|
| 379 |
+
| `optimize_threshold_profiles` | 86.79s | 138.40s | 1.59× |
|
| 380 |
+
| `cqf_seed_verification_loop` | 0.001s | 0.001s | 1.00× |
|
| 381 |
+
| `stage_web_candidate_pass` | 27,162.57s | 42,229.32s | 1.55× |
|
| 382 |
+
| `stage_web_quality_and_perplexity` | 300.05s | 282.49s | 0.94× |
|
| 383 |
+
| `mid_proxy_stage3` *(observed)* | 115.50s | 160.80s | 1.39× |
|
| 384 |
+
| `rehydrate_clusters` | 40.42s | 40.19s | 0.99× |
|
| 385 |
+
| `mid_proxy_stage5` *(observed)* | 102.92s | 143.10s | 1.39× |
|
| 386 |
+
| Proxy / domain reweighting | ~3,590s | — | — |
|
| 387 |
+
| `build_synthetic_pool` | 0.003s | 0.005s | — |
|
| 388 |
+
| `stage_synthetic_filter` | 0.002s | 0.002s | — |
|
| 389 |
+
| `mix_optimization` | 175.34s | 214.87s | 1.23× |
|
| 390 |
+
| `final_mix_and_write` | ~2,311s | — | — |
|
| 391 |
+
| **TOTAL** | **~34,088s** | **~43,377s+** | **~1.27×** |
|
| 392 |
+
|
| 393 |
+
Candidate pass throughput: ~12.3 docs/s (initial) → ~22 docs/s (post-autotune, **~1.8× gain**).
|
| 394 |
+
|
| 395 |
+
</details>
|
| 396 |
+
|
| 397 |
+
---
|
| 398 |
+
|
| 399 |
+
## Limitations
|
| 400 |
+
|
| 401 |
+
- **PDF extraction artifacts** — OCR artifacts, broken equations, and malformed tables may be present despite filtering.
|
| 402 |
+
- **Residual PII** — Automated regex redaction does not guarantee complete PII removal. Do not use for systems that surface personal information.
|
| 403 |
+
- **Copyright** — Source PDFs may carry individual site-level licenses. Apache 2.0 requires attribution; verify upstream licensing for your use case.
|
| 404 |
+
- **KenLM Wikipedia bias** — Math-heavy or highly technical documents may be underrepresented due to high perplexity under a Wikipedia-trained model.
|
| 405 |
+
- **~62% rejection rate** — Some valid educational content may have been dropped due to heuristic threshold mismatch (e.g., table-heavy or equation-dense formatting).
|
| 406 |
+
- **English only** — Pipeline profiled `en:formal`, `en:conversational`, and `en:technical` registers only.
|
| 407 |
+
- **No synthetic data** — This run did not use the synthetic generation system. Dataset is 100% source text.
|
| 408 |
+
- **MinHash 25% sampling** — Post-autotune dedup will miss some near-duplicate pairs.
|
| 409 |
+
|
| 410 |
+
---
|
| 411 |
+
|
| 412 |
+
## Licensing & Citation
|
| 413 |
+
|
| 414 |
+
Released under [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0). Attribution required. Derived from [HuggingFaceFW/finepdfs-edu](https://huggingface.co/datasets/HuggingFaceFW/finepdfs-edu) — review upstream licensing before use.
|
| 415 |
+
|
| 416 |
+
```bibtex
|
| 417 |
+
@dataset{stencore_finepdfs_edu_curated,
|
| 418 |
+
title = {StenCore: FinePDFs-Edu Curated},
|
| 419 |
+
author = {StentorLabs},
|
| 420 |
+
year = {2026},
|
| 421 |
+
note = {StentorLabs' first dataset. StenCore pipeline v2026.03.
|
| 422 |
+
584k docs in, 149k out. Adaptive heuristics, PII redaction,
|
| 423 |
+
toxicity/decontam gates, MinHash + KenLM + neural perplexity,
|
| 424 |
+
CQF scoring, proxy domain reweighting.},
|
| 425 |
+
howpublished = {\url{https://huggingface.co/datasets/StentorLabs/stencore}}
|
| 426 |
+
}
|
| 427 |
+
|
| 428 |
+
@dataset{fineweb_finepdfs_edu,
|
| 429 |
+
author = {HuggingFace FineWeb Team},
|
| 430 |
+
title = {FinePDFs-Edu},
|
| 431 |
+
howpublished = {\url{https://huggingface.co/datasets/HuggingFaceFW/finepdfs-edu}}
|
| 432 |
+
}
|
| 433 |
+
```
|
| 434 |
+
|
| 435 |
+
**Contact:** [StentorLabs@gmail.com](mailto:StentorLabs@gmail.com) — for takedown requests, privacy concerns, or feedback.
|
| 436 |
+
|
| 437 |
+
---
|
| 438 |
+
|
| 439 |
+
<p align="center">Made with ❤️ by <a href="https://huggingface.co/StentorLabs">StentorLabs</a></p>
|