train.galvyn.xyz · lab
read-onlySign in

Break it: bad initialisation

lesson 1.8 · Break it

Why initialise weights with std 0.02 instead of 1?

init_std: A 0.02 vs B 1

Run A

done

fineweb_edu · 6L·384d · 30M params · bf16

tokens read

16,384,000

step

2,000 / 2,000

train loss
5.325
best val
5.300
tokens/s
22k
MFU
3.7%
peak mem
6.4 GB
lr
1.0e-4

0:14:01 · 0.016 kWh ≈ <$0.01 power · ≈ $0.07 to rent

Run B

done

fineweb_edu · 6L·384d · 30M params · bf16

tokens read

16,384,000

step

2,000 / 2,000

train loss
7.552
best val
7.625
tokens/s
22k
MFU
3.7%
peak mem
6.4 GB
lr
1.0e-4

0:14:01 · 0.016 kWh ≈ <$0.01 power · ≈ $0.07 to rent

Losslower is better · starts near ln(vocab)
50500100015002000stepB checkpoint @ 50A checkpoint @ 50B checkpoint @ 100A checkpoint @ 100A checkpoint @ 250B checkpoint @ 250A checkpoint @ 500B checkpoint @ 500B checkpoint @ 750A checkpoint @ 750A checkpoint @ 1000B checkpoint @ 1000A checkpoint @ 1250B checkpoint @ 1250A checkpoint @ 1500B checkpoint @ 1500A checkpoint @ 1750B checkpoint @ 1750B checkpoint @ 2000A checkpoint @ 2000

The machine, live

NVIDIA L4 · gcp-l4-lab2offline · just now

GPU 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

0.033 kWh

≈ <$0.01 of electricity

RAM

–

of 31.3 GB in WSL

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

What to watch · B should start far above ln(vocab) (confidently wrong predictions) and spend its first hundreds of steps undoing the initialisation. Compare the curves at step 100.

Run A

  1. Queued

    done

  2. Download data

    done

  3. Tokenize

    done

  4. Build and compile

    done

  5. Warm up

    done

  6. Train

    done

  7. Finished

    done

Run B

  1. Queued

    done

  2. Download data

    done

  3. Tokenize

    done

  4. Build and compile

    done

  5. Warm up

    done

  6. Train

    done

  7. Finished

    done

solid = train (smoothed) · dots = validation · dashed = after a crash-test resume
Learning ratewarmup, then cosine
0e+05e-41e-3500100015002000step
Gradient normbefore clipping to 1.0 · log scale
110100100010k500100015002000step
Throughputtokens per second
500010k15k20k500100015002000step
MFUshare of this precision's peak (bf16 111, fp32 27.8 TFLOPS)
1.0%2.0%3.0%4.0%500100015002000step
GPU memory (measured)peak per log window · dashed = activations + workspace
5.9 GB6.3 GB500100015002000step
Does it know? Fact probesP(right word) / P(right + wrong): 0.5 = no idea, 1 = sure and right
0.40.5500100015002000step
The questions
arithmeticA 0.49B 0.43
iceA 0.64B 0.88
oceanA 0.54B 0.71
orbitA 0.71B 0.69
parisA 0.56B 0.41
planetA 0.27B 0.22
skyA 0.68B 0.31
waterA 0.42B 0.30
whaleA 0.03B 0.03

Prompts include "Q: Is water a liquid at room temperature? A:" (Yes vs No), "The capital of France is" (Paris vs London) and "The largest planet in our solar system is" (Jupiter vs Mars). Full list: trainer/src/galtrain/train.py.

Samplessame prompt and random draw every time, so only the model changes

Run A

Water is the most important part of the future. This can also be the most important part of the water, so the energy is necessary for our body, and it’s important to help you will be to keep your body off. You’re not only interested in making sure to find some of these reasons to help your body and the best needed to get rid of your body. You can’t see to get you on the energy, but also that’s not yet important. This is when you do not know with it.
The new way to make your body to take your first step. You’re not trying to do with your body, and you will try it to put on to the heart and heart of your body up in a side of the body. It will always be sure to do with your body and make you ready for your body.
It’s a good way to do not know that you need to do it. A more severe

Run B

Water is.
 to
 the� and. of the. ( the of the. The not to of, and the in, is of the, and and a by of of to
 be the the to
 of the can on. The.
 or the the is the., and. The with. to the: are and the be, as and of the.
,.
. the in. to, you, that. This the to that of the.
.
. This on to in a the the with as). The of� the the,.
 at�
, the,, as. to.
- the and.
 and, the,
, and, to the the not, and of the In in a and and’, a the of the is the. The.

,.
The and in the a. the from the a.
 and, have the that, the
� the The that a the

What happened

  1. AFinished 2000 steps. Best val loss 5.300.
  2. BFinished 2000 steps. Best val loss 7.625.
  3. ACheckpoint at step 2000: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 3.16s.
  4. BCheckpoint at step 2000: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 3.47s.
  5. AStep 2000: val 5.300, train 5.318 (gap -0.018).
  6. BStep 2000: val 7.625, train 7.657 (gap -0.032).
  7. AStep 1800: val 5.362, train 5.304 (gap +0.057).
  8. BStep 1800: val 7.653, train 7.654 (gap -0.002).
  9. BCheckpoint at step 1750: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 3.38s.
  10. ACheckpoint at step 1750: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 3.45s.
  11. BStep 1600: val 7.687, train 7.641 (gap +0.047).
  12. AStep 1600: val 5.435, train 5.367 (gap +0.068).
  13. BCheckpoint at step 1500: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 3.45s.
  14. ACheckpoint at step 1500: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 3.51s.
  15. BStep 1400: val 7.650, train 7.628 (gap +0.023).
  16. AStep 1400: val 5.462, train 5.411 (gap +0.050).
  17. BCheckpoint at step 1250: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 3.48s.
  18. ACheckpoint at step 1250: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 3.45s.
  19. AStep 1200: val 5.596, train 5.556 (gap +0.040).
  20. BStep 1200: val 7.726, train 7.717 (gap +0.009).
  21. BCheckpoint at step 1000: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 3.38s.
  22. ACheckpoint at step 1000: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 3.40s.
  23. BStep 1000: val 7.733, train 7.721 (gap +0.012).
  24. AStep 1000: val 5.673, train 5.627 (gap +0.046).
  25. BStep 800: val 7.787, train 7.770 (gap +0.018).
  26. AStep 800: val 5.782, train 5.786 (gap -0.004).
  27. ACheckpoint at step 750: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 3.58s.
  28. BCheckpoint at step 750: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 3.44s.
  29. BStep 600: val 8.040, train 8.062 (gap -0.022).
  30. AStep 600: val 5.975, train 5.990 (gap -0.015).
  31. BCheckpoint at step 500: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 3.46s.
  32. ACheckpoint at step 500: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 3.40s.
  33. AStep 400: val 6.265, train 6.193 (gap +0.072).
  34. BStep 400: val 9.683, train 9.650 (gap +0.033).
  35. ACheckpoint at step 250: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 3.50s.
  36. BCheckpoint at step 250: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 3.52s.
  37. AStep 200: val 6.571, train 6.549 (gap +0.022).
  38. BStep 200: val 19.548, train 19.539 (gap +0.009).
  39. ACheckpoint at step 100: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 3.48s.
  40. BCheckpoint at step 100: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 3.59s.
  41. ACheckpoint at step 50: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 3.53s.
  42. BCheckpoint at step 50: 360.9 MB (weights, AdamW state, schedule position, RNG states) in 3.65s.
  43. ACheckpoint step 0 copied off the machine to gs://train-galvyn-xyz-checkpoints/runs/6514a70a-839b-40c9-b98e-211fd5326f5c/step-0000000.pt in 2.2s (in the background; training didn't wait).
  44. BCheckpoint step 0 copied off the machine to gs://train-galvyn-xyz-checkpoints/runs/e8e73525-f95d-455d-8231-a54a5c755f9b/step-0000000.pt in 1.7s (in the background; training didn't wait).
  45. BCheckpoint at step 0: 120.3 MB (weights, AdamW state, schedule position, RNG states) in 0.99s.
  46. ACheckpoint at step 0: 120.3 MB (weights, AdamW state, schedule position, RNG states) in 1.05s.
  47. BInit std 1.0 instead of 0.02: the first loss may not be ln(vocab).
  48. AExpected loss before training ≈ ln(vocab) = 10.83.
  49. BExpected loss before training ≈ ln(vocab) = 10.83.
  50. ATraining 30.06M params on fineweb_edu for 2000 steps (bf16, batch 32×1, ctx 256).
  51. BTraining 30.06M params on fineweb_edu for 2000 steps (bf16, batch 32×1, ctx 256).