Overfitting: 1 vs 5 epochs
lesson 2.5 · OverfittingTrain on a small dataset once or five times: when does more training start to hurt?
Run A
donenull · ours:gs://train-galvyn-xyz-checkpoints/runs/1a0cd0c6-df9f-471e-b9fa-096a419cccea/step-0019073.pt · 124M params ·
tokens read
120,400
step
150 / 0
- train loss
- 2.570
- best val
- 2.742
- tokens/s
- 5837
- MFU
- –
- peak mem
- 2.4 GB
- lr
- 3.0e-6
0:01:34 · ≈ <$0.01 to rent
Run B
donenull · ours:gs://train-galvyn-xyz-checkpoints/runs/1a0cd0c6-df9f-471e-b9fa-096a419cccea/step-0019073.pt · 124M params ·
tokens read
601,856
step
750 / 0
- train loss
- 0.519
- best val
- 2.759
- tokens/s
- 6078
- MFU
- –
- peak mem
- 2.4 GB
- lr
- 3.0e-6
0:04:03 · ≈ $0.02 to rent
The machine, live
NVIDIA L4 · gcp-l4-ft1offline · neverGPU busy
– %
VRAM
– / 22 GB
Power
– / 230 W
Temperature
– °C
SM clock
– MHz
Memory bus
– %
Fan
– %
CPU
– %
PCIe
to GPU –from GPU –
Batches of token ids cross the PCIe bus into the GPU each step; weights never leave it.
Disk
read –write –
Reads: token windows from the tokenized dataset (mostly from page cache). Writes: checkpoints, about 1.5 GB each for GPT-2 124M.
Network
in –out –
In: dataset downloads from Hugging Face. Out: metrics to Supabase and checkpoint uploads to Cloud Storage.
drawing now
–
last 5 minutes
–
from the card's energy counter
this experiment
–
starts with training
RAM
–
Sampled every 2 s on the box (NVML + psutil) and pushed here over Supabase Realtime. GPU energy is the whole card. Electricity at an assumed $0.15/kWh.
What's happening
Run A
Queued
done
Download data
already on disk
Tokenize
already on disk
Build and compile
done
Warm up
done
Train
done
Finished
done
Run B
Queued
done
Download data
already on disk
Tokenize
already on disk
Build and compile
done
Warm up
done
Train
done
Finished
done
Run A (step 150)
Paris.
Run B
Paris.
What happened
- BFine-tuning finished: 3.3% → 6.0% of held-out questions. Best val loss on answers 2.759.
- BStep 750: 6.0% of 300 held-out questions, 7/20 hand-written; val loss on answers 3.203.
- BStep 600: 8.3% of 300 held-out questions, 7/20 hand-written; val loss on answers 3.097.
- BStep 450: 7.7% of 300 held-out questions, 9/20 hand-written; val loss on answers 2.951.
- BStep 300: 6.0% of 300 held-out questions, 9/20 hand-written; val loss on answers 2.822.
- BStep 150: 6.0% of 300 held-out questions, 11/20 hand-written; val loss on answers 2.759.
- BCheckpoint step 0 copied off the machine to gs://train-galvyn-xyz-checkpoints/runs/39fbba64-7fdd-467c-8af8-c0909a27fa6e/step-0000000.pt in 5.0s (in the background; training didn't wait).
- BStep 0: 3.3% of 300 held-out questions, 8/20 hand-written; val loss on answers 4.700.
- BFine-tuning ours:gs://train-galvyn-xyz-checkpoints/runs/1a0cd0c6-df9f-471e-b9fa-096a419cccea/step-0019073.pt on 'nq5k' (4,800 examples, 5 epoch(s), 750 steps). Trainable parameters: 124,475,904 of 124,475,904 (100.00%).
- AFine-tuning finished: 3.3% → 5.3% of held-out questions. Best val loss on answers 2.742.
- AStep 150: 5.3% of 300 held-out questions, 10/20 hand-written; val loss on answers 2.742.
- ACheckpoint step 0 copied off the machine to gs://train-galvyn-xyz-checkpoints/runs/bac7a04d-bb37-4f2c-8622-684564a205e1/step-0000000.pt in 4.6s (in the background; training didn't wait).
- AStep 0: 3.3% of 300 held-out questions, 8/20 hand-written; val loss on answers 4.700.
- AFine-tuning ours:gs://train-galvyn-xyz-checkpoints/runs/1a0cd0c6-df9f-471e-b9fa-096a419cccea/step-0019073.pt on 'nq5k' (4,800 examples, 1 epoch(s), 150 steps). Trainable parameters: 124,475,904 of 124,475,904 (100.00%).