File size: 3,203 Bytes
b58f293 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | ---
license: odc-by
task_categories:
- text-generation
language:
- en
tags:
- math
- code
- education
- k12
size_categories:
- 1M<n<10M
---
# K-12 Math & Coding Dataset
A ~2 billion token dataset built for K-12 math and coding education use
cases: **1,004,991,667 tokens** of math content and **1,020,505,114 tokens**
of code content, both comfortably over the 1B-token target for each
category.
## Dataset Summary
| Category | Tokens | Rows | File |
|----------|-------:|-----:|------|
| Math | 1,004,991,667 | 676,018 | `math/final.jsonl` |
| Code | 1,020,505,114 | 937,248 | `code/final.jsonl` |
Built via a 6-phase pipeline: source collection → cleaning (PII redaction,
boilerplate/spam removal, encoding fixes) → deduplication (exact SHA-256 +
fuzzy MinHash LSH) → heuristic quality filtering → budget-controlled final
sampling → manual quality audit. Full methodology, per-source breakdowns,
and known limitations are in `final_report.md`.
## Schema
Each line is a JSON object:
```json
{
"text": "...",
"source": "finemath4plus",
"category": "math",
"quality_score": 4.3,
"token_count": 512,
"language": "en",
"metadata": {}
}
```
- `quality_score`: populated only for `finemath4plus` (has an upstream
classifier score); `null` for all other sources.
- `language`: natural-language code (all records verified predominantly
English). For code records, the actual programming language is under
`metadata.programming_language`.
- `metadata`: source-specific extra fields (URL, license, file path, repo
name, exercise name, difficulty, etc. — varies by source).
## Sources
**Math**: FineMath 4+, OpenWebMath, GSM8K, MATH (hendrycks_math).
**Code**: GitHub Code (Python/JavaScript/Java/HTML/CSS via
`codeparrot/github-code-clean`), freeCodeCamp, Exercism, APPS, CodeContests.
## Token Counting
All token counts use the `tiktoken` `cl100k_base` tokenizer, computed via
exact `encode_ordinary()` calls (not estimates) at every pipeline stage.
## Quality Audit
Both categories were manually spot-checked twice (once pre-assembly, once
on the final sampled corpus). Code passed cleanly at every check (~90-94%
good, 0-2% bad). Math's final spot-check found a 15% "bad" rate (above the
10% target threshold) driven by several low-frequency, hard-to-cheaply-filter
patterns (AI-generated SEO filler, off-topic forum comment dumps, one
essay-mill advertisement, thin template pages) — documented as an accepted
residual limitation rather than silently delivered. **See `final_audit.md`
and `final_report.md` Section 8 for full detail before using this dataset
for anything quality-sensitive.**
## Known Limitations
See `final_report.md` Section 8 for the complete list, including:
math corpus residual bad-rate, AMPS/OpenStax not sourced, The Stack v2
substituted with GitHub Code due to gating, freeCodeCamp/Exercism volume
shortfall, and HTML's residual auto-generated-doc contamination.
## License
Source licenses vary per record — see `metadata.license` for code records
where available. FineMath 4+ and OpenWebMath are ODC-By. Aggregate dataset
provided as-is for research/educational use; verify individual source
licenses before redistribution.
|