πŸ† Hedwig 286.7M Flagship β€” From-Scratch Offline Storyteller & Grammar Helper

Hedwig Flagship (--300m) is the third and largest generation of Hedwig, built 100% from scratch in pure PyTorch (RoPE + RMSNorm + SwiGLU + SDPA + bf16, custom BPE tokenizer, Stage 2 SFT, Stage 3 Anchored DPO, and from-scratch 4-bit quantization).

Model Summary

  • Parameters: 286,663,680 (~286.7M knobs: 20 layers, 1024 width, 16 heads, block_size = 512)
  • Tokenizer: Custom 16,384-piece BPE (tokenizer.json, 4.13 chars/token)
  • Pretraining corpus (1.22 GB, 294.6M tokens; 25,000 steps β‰ˆ 205M tokens seen):
    • 523.9 MB TinyStories (roneneldan/TinyStories)
    • 734.0 MB FineWeb-Edu (karpathy/fineweb-edu-100b-shuffle, 154,768 docs, ODC-By)
    • 10 public-domain Project Gutenberg novels (pre-1929)
  • Post-training:
    • Stage 2 SFT: 71,906 mixed pairs (TinyStories-Instruct + 30,000 Apache-2.0 grammarly/coedit grammar/tone rewrites)
    • Stage 3 Anchored DPO: 52,798 πŸ‘ chosen vs πŸ‘Ž rejected pairs
  • Training hardware & cost: 1Γ— NVIDIA RTX 4090 (24 GB) on RunPod, 1 hr 55 min, **$1.70 total**.

Measured Results

Checkpoint Precision File Size Val / Test Loss Notes
brain.pt bfloat16 574.7 MB 2.998 Stage 1 pretrain (25,000 steps, 16k vocab, 512 context)
brain_chat.pt bfloat16 574.7 MB 1.341 Stage 2 SFT (2,500 steps)
brain_chat_int4.pt int4 161.9 MB 1.3601 From-scratch packed 4-bit quantization
brain_dpo.pt bfloat16 574.7 MB 1.200 Stage 3 DPO (98.3% preference win-rate!)
brain_dpo_int4.pt int4 161.9 MB 1.4249 From-scratch packed 4-bit quantization

Note on Scaling

At 286.7M parameters trained on ~205M tokens (~0.7 tokens/knob vs the Chinchilla ~20 tokens/knob rule), this model is intentionally under-read for budget (~$1.70) to demonstrate real scaling tradeoffs on consumer hardware. Full side-by-side story comparisons against Hedwig 14M and 97.6M live in docs/STORY_SHOWDOWN.md.

Code & Offline Mac UI

Full pure-PyTorch training scripts, interactive Brain X-Ray UI (app.py), and learning logs live at https://github.com/ansarbuilds/hedwig.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Datasets used to train ansarbuilds/hedwig-300m