Skip to content
Sudhanshu ShuklaAI Lab · GenAI Engineering
Menu

Training log · Tiny GPT

GPT-2-style model trained from random weights on TinyStories

Every value the training program logged for the published checkpoint. The program writes one averaged line per epoch, so this run has two logged points per curve.

Training loss (mean over the epoch)Validation loss (30 held-out stories)
Tiny GPT loss per epoch Training loss 7.53 then 6.64; validation loss 7.07 then 6.37, after epochs 1 and 2. An untrained model starts near 8.16. Browser re-check on 100 validation-split stories: 6.35. 5.5 6 6.5 7 7.5 8 8.5 0 1 2 Epoch Loss (nats/token) Untrained model: about 8.16 (uniform guess over 3,512 tokens; not logged)Untrained ≈ 8.16 Training loss (epoch mean), epoch 1: 7.5319 (perplexity 1,867) Training loss (epoch mean), epoch 2: 6.6421 (perplexity 767) Validation loss, epoch 1: 7.0656 (perplexity 1,171) Validation loss, epoch 2: 6.3688 (perplexity 583) Browser re-check: 6.3464 on 100 TinyStories validation-split stories (perplexity 570) Train 6.64 Val 6.37 ◌ Browser 6.35

Training loss is averaged while the weights are still changing and with dropout on, so it sits above validation loss. The untrained point is the uniform-guess value, not a logged one.

Logged values

EpochTrain lossVal lossVal perplexityCheckpoint
17.53197.06561,171Saved
26.64216.3688583Saved

The program keeps the checkpoint with the lowest validation loss, so the published weights are from epoch 2.

Independent re-check. The published weights, run in the browser on the first 100 stories of TinyStories' own validation file, score a loss of 6.346 (perplexity 570, 95% interval 552–592), within 0.4% of the logged 6.3688.

Run settings

Programtransformer_hf_dataset_and_llm.py --generate-llm (run_generate_llm)recorded
Dataroneneldan/TinyStories, train split; 270 training and 30 validation stories (10% held out)recorded
TokenizerByte-level BPE fitted on the training stories only; 3,512 tokens learnedrecorded
ModelGPT2LMHeadModel from random weights: 3 layers, 4 heads, 128 hidden, 128 positions, tied embeddingsrecorded
OptimizerAdamW, weight decay 0.01, gradient clipping 1.0recorded
Batch size · LR8 · 2e-4 (34 optimizer steps per epoch)script defaults

“Recorded” values come from the model card, config.json and the training code; “script defaults” are the program's defaults, consistent with the logged 270/30 split and 2 epochs, because the exact command line for this run was not saved.