← All workshops

LLMs from First Principles

For engineers and technical managers: from basic transformers to a working nano-scale GPT.

What you will be able to do

  • Explain the basic structure of the transformer, compared with a feed-forward network.
  • Build character-level language models, from RNNs and GRUs to the causal (autoregressive) transformer.
  • Tokenise text with byte pair encoding.
  • Pretrain a small GPT-style language model.
  • Fine-tune it to follow instructions.
  • Apply reinforcement learning from rewards, and explain how reward hacking arises.
  • Build a minimal software-engineering (SWE) agent: a loop in which a model calls tools such as running commands.
  • Discuss the safety risks of letting an agent run commands.

Every part is built small enough to run on a laptop.

Prerequisites

Python, and some introduction to deep learning, for example Introduction to Deep Learning or an online course.

Outline

Duration: 2 days, on-site or remote.

  1. Set models: the basic structure of the transformer, compared with a feed-forward network
  2. Character-level language models: from RNNs and GRUs to the causal (autoregressive) transformer
  3. Tokenisation: byte pair encoding
  4. A full GPT: pretraining a small language model
  5. Fine-tuning to follow instructions
  6. Reinforcement learning from rewards, including reward hacking
  7. Building a SWE agent

Sample materials

More in yoavram/nanochat.

Related workshops

Contact

Tell me about your team and what you would like them to be able to do. A few lines are enough to start; I will reply to set up a scoping call.

Email Yoav yoav@yoavram.com