The workshop builds a GPT-2-style model in PyTorch without pretrained weights. Perivolaropoulos says a laptop with 16 GB of RAM can run it, while Google Colab is an option for access to a GPU. The project aims to cover most of the core work involved in building a model, leaving larger-scale optimizations aside.
Training an LLM from Scratch, Locally
Speaker
Angelos Perivolaropoulos, research engineer and speech-to-text team lead at ElevenLabs, leads a hands-on AI Engineer workshop on training a small language model from scratch.
The exercise uses character-level tokenization on Shakespeare, producing a vocabulary of about 65 characters. That small vocabulary suits the limited dataset, but character tokens are less efficient and harder to relate than common word fragments. The model uses six transformer layers, six attention heads, 384-dimensional embeddings, and a context length of 256.
The model learns to predict the next character by comparing its output with the sequence shifted forward by one position. Training uses AdamW, a learning-rate warm-up followed by cosine decay, and a held-out validation set to help spot overfitting. Perivolaropoulos describes a roughly 1.8-million-parameter model and says his Colab run took about 15 minutes to produce good results.
For generation, the workshop uses temperature and top-k sampling rather than always choosing the most likely token, which can make output less repetitive. Perivolaropoulos recommends tracking training and validation loss: rising validation loss can indicate overfitting, while a plateau may mean the model needs more data or a larger capacity. Participants can experiment with model size, context length, tokenizers, and training settings.
In response to audience questions, Perivolaropoulos explains that reasoning is commonly taught through post-training on high-quality data, with human labeling and quality checks. He says audio models share core ideas with text models, but require audio tokenization and task-specific losses; mel spectrograms are one representation used to prepare audio. Multimodal systems can also feed encoder-produced vectors into a text transformer.
Takeaways
- Start with a small vocabulary that matches the size and scope of your dataset.
- Use a held-out validation set to detect when training starts to overfit.
- Treat tokenizer choice as a trade-off between vocabulary size, data needs, and inference efficiency.
- Track both loss curves and generated samples when judging a small model.
- For reasoning or audio tasks, data quality and task-specific training objectives matter alongside architecture.
Mentioned in this talk
Search inside this talk
What was claimed 11
- foundedAndrej Karpathy founded
OpenAIco-founder“Andrej Karpathy, one of the co-founders of OpenAI”
YouTube Verified4 sources· Talk, Web· archived
- built
ElevenLabs built
Scribe
“we have the Scribe v2 model that my team trained”
YouTube Verified2 sources· Talk, Web· archived
- works atAngelos Perivolaropoulos works at
ElevenLabs
Research Engineer, leads speech-to-text“I lead the speech-to-text team at ElevenLabs. I'm a research engineer”
YouTube Verified2 sources· Talk, Web· archived
- feature
Scribe v2: Transcription model
“the Scribe v2 model that my team trained”
YouTube Unverified1 source· Talk
- built
ElevenLabs built
Scribe v2
“we have the Scribe v2 model that my team trained”
YouTube Unverified1 source· Talk
- uses
“We're going to work purely in PyTorch”
YouTube Unverified1 source· Talk
- feature
nanoGPT: Code project that inspired the workshop“It was the nanoGPT code, and for me that was a very special project”
YouTube Unverified1 source· Talk
- uses
“a very small model based on the GPT-2 architecture”
YouTube Unverified1 source· Talk














