← TinyGPT · docs · devlog · roadmap · speedup
source: docs/prds/B11-wsd-schedule.md · view on GitHub ↗

PRD — WSD learning-rate schedule (warmup → stable → decay)

Goal

Add --lr-schedule wsd to tinygpt train (tinygpt finetune / sft / distill get it for free since they share the optimizer wrapper) with three flags: --warmup N (steps to peak LR), --stable-frac F (fraction of remaining steps held at peak), --decay-shape {1-sqrt, cosine,linear} (decay curve from peak to 0 across the remainder).

Replaces cosine-warmup as the curated default for new pretrain runs.

Why now

Scope — in

Scope — out

Files to touch

FileChange
Sources/TinyGPTModel/LRSchedule.swiftadd .wsd(warmup, stableFrac, decayShape)
Sources/TinyGPT/Train.swiftparse --stable-frac + --decay-shape; pass to schedule constructor
Sources/TinyGPT/TinyGPT.swiftNO change — --lr-schedule is already in Train.swift
evals/wsd-curve-smoke.swiftnew — closed-form LR check at warmup, mid-stable, mid-decay, end
docs/training_guide.mdcurated default flip

Acceptance criteria

Reference patterns

Open questions