← TinyGPT · docs · devlog · roadmap · speedup
source: docs/prds/B18-nanochat-depth-knob.md · view on GitHub ↗

PRD — Single --depth N knob auto-derives every pretrain HP

Goal

tinygpt train --depth 12 ... should auto-derive d_model, n_heads, d_mlp, peak_lr, batch_size, and total_steps from compute- optimal scaling laws. UX win — most users don’t want to tune 6 hyperparameters when the depth alone implies a reasonable point.

karpathy/nanochat ships this exact pattern. We borrow the surface.

Why now

Scope — in

Scope — out

Files to touch

FileChange
Sources/TinyGPTModel/DepthDerivation.swiftnew — the derivation fn
Sources/TinyGPT/Train.swiftparse --depth; warn on conflicts; resolve and log the derived HPs in the banner
Tests/TinyGPTModelTests/DepthDerivationTests.swiftnew — assert derived HPs match a hand-checked table for depth ∈ {4, 12, 24, 36}
docs/training_guide.mdthe depth-HP table

Acceptance criteria

Reference patterns

Open questions