← TinyGPT · docs · devlog · roadmap · speedup
source: docs/prds/B10-quality-classifier.md · view on GitHub ↗

PRD — FineWeb-Edu-style quality classifier + corpus filter

Goal

Ship tinygpt quality-classify <corpus.txt> that scores every document on an educational-quality axis, writes the per-doc scores to a sidecar, and filters to a top-X% subset for downstream pretraining. Mirrors the FineWeb-Edu recipe (Penedo et al. 2024) scaled down for the corpora TinyGPT trains on.

The lift, per the FineWeb-Edu paper: top-quality filtering at fixed token budget improved downstream eval scores 2–4× more than scaling tokens alone on small models — by far the highest “quality per dev-day” knob remaining in our pretrain pipeline.

Why now

Scope — in

Scope — out (explicit)

Files to touch

FileChange
Sources/TinyGPT/QualityClassify.swiftnew — subcommand entry point
Sources/TinyGPTModel/QualityClassifier.swiftnew — classifier struct + train/score methods
Sources/TinyGPT/TinyGPT.swiftadd case "quality-classify" (maintainer merge)
evals/quality-filter-smoke.shnew — 100-doc smoke (train on labeled, score on tinystories shard, top-20% should overlap with manual selection ≥80%)
docs/PLAN.mdflip B10 ⬜ → ✅ on ship; note delta on a re-pretrain at fixed token budget

Don’t touch

Acceptance criteria

Reference patterns to copy

Open questions