Views
No views yet
A character-level GPT (decoder-only transformer) trained from scratch; best-checkpoint by validation loss.
| Base model | Trained from scratch (random initialization) — no pretrained base model. |
| Task | text-generation |
| Training objective | Autoregressive next-token prediction (cross-entropy); best checkpoint by validation loss. |
| Track | LM · Language & models |
| Notebook |
| metric | value | meaning |
|---|---|---|
history_step_train_val (final) | 1.842 | |
final_train | 1.779 | |
best_val | 1.814 | |
steps | 4000 | |
params | 816705 | |
train_seconds | 505 | |
config.block_size | 64 | |
config.n_embd | 128 | |
config.n_head | 4 | |
config.n_layer | 4 | |
config.vocab | 65 |

Ciegvate tumpot of Bad'ers
We narvervy sures toak hasing more,
This hous mad the dide to to the for for hard with to
IsSeet if love true;
Mught and how fath quear uppose? City hat.
My and main thou but staltany; him comblead.
LEUMIEN:
Charth eyet not, bath brans yoer
Where shat? I'll at har comen mort, thou gene.
FROMOK:
I shall even Romen of joysed
You kind indswaul'd with thou bakeng, with mell.
DUCIO:
My shall stalk you fall hear:
Mant shall In in brothere'y! prancer, best worde houm's afd it.
UCIIO!
GLINIUS:
Rell w, it?
Go ELIA:
Where.
HED VOLLOONT:
More, now he now of nather'd nev1import torch
2sd = torch.load("gpt.pt", map_location="cpu") # decoder-only transformer weights
3# Rebuild the GPT class + char vocab from the notebook (see "Reproduce"), then:
4# model.load_state_dict(sd); model.eval()
5# print(decode(model.generate(torch.zeros((1,1), dtype=torch.long), 500)[0].tolist()))
6# (A pre-generated sample is included as sample.txt.)1git clone https://github.com/ChaoYue0307/ropedia-academy.git && cd ropedia-academy
2pip install torch numpy matplotlib scikit-learn scikit-image gymnasium
3jupyter nbconvert --to notebook --execute notebooks/training/LM_nanogpt_pretrain.ipynb --output run.ipynb
4# optional: override training length, e.g. STEPS=2000 (or EPISODES=600) before runningconfig.jsonfigure.pngmetrics.jsonmodel.ptsample.txt1@misc{ropedia_academy,
2 title = {Ropedia Academy: an interactive course on embodied & spatial AI},
3 author = {Ropedia Academy},
4 year = {2026},
5 howpublished = {\url{https://chaoyue0307.github.io/ropedia-academy/}}
6}