Project idea · ungraded

Poem or Name Generator

Train your tiny GPT on text you choose — public-domain poems, Indian city names, invented character names — and generate new samples. Explore how context length, model size and sampling temperature change the results.

You will use

Milestones

Build the smallest working version first. Ticks are saved in this browser only.

Stretch goals

  • Switch from characters to a BPE tokenizer (see the BPE step).
  • Add a key–value cache to generation and measure the speed-up.
  • Filter generated names that already appear in the training data.

Data

Public-domain books from Project Gutenberg (download a plain-text file), your own writing, or name lists you assemble. Keep the text in one UTF-8 file.

Run it yourself

pip install torch
python train_gpt.py --text poems.txt --steps 5000

A laptop CPU is enough for a model with a few hundred thousand parameters.