NLP to LLMs
  • Home
  • Start Here
  • Schedule
  • Days
    • Before Day 1 · Module 0 (pre-work)
    • Day 1 · Foundations
    • Day 2 · Transformers and Pretraining
    • Day 3 · Using and Aligning LLMs
    • Day 4 · Calibration, Decisions, RAG
    • Day 5 · Agents and Capstone
  • Notebooks
  • References
  • Teach

From Traditional NLP to Modern LLMs

A Five-Day Workshop: N-Grams, Attention, RLHF, RLCD and Agents

Genial Labs · A five-day workshop

From Traditional NLP to Modern LLMs

N-Grams, Attention, RLHF, RLCD and Agents

Modern language models did not appear from nowhere. Each step, from counting words to attention to training on human preferences, fixed a specific failure of the step before it. This workshop follows that line over five days, and you build each step yourself.

Start here Intro slides See the schedule Open the notebooks

5 days 15 modules 16 Colab notebooks 79 hands-on exercises 45–55 min briefings, 50–55 min labs 10 min lab debriefs

As of 2026-10-09: not yet ready to teach. 0 of 15 labs have run end to end, with their current code, on the Colab runtime they are designed for. 15 have run end to end on their real path elsewhere, on another machine or on the CI runner, and 0 more in part. On the GitHub CPU runner (newest run of each notebook, 2026-10-06), 16 of 16 notebooks passed; 9 of the passing runs used test doubles, which check that the code runs, not what the models do. 8 of 11 pieces of blocking work are open. What has run, where, and what is missing.

The Five Days

Each day answers one question. Modules 1 to 14 are each a short briefing followed by a hands-on lab in Google Colab; the capstone fills most of Day 5 with hands-on pair work.

Day 1

Foundations: From Counts to Attention

How do we turn text into something a model can learn from?

Modules 1–4

Day 2

Transformers and Pretrained Models

How does one architecture, pretrained at scale, become a general tool?

Modules 5–7

Day 3

Using and Aligning LLMs

How do we use these models, and what are they trained to want?

Modules 8–10

Day 4

Calibration, Decisions and Retrieval

When should a model’s answer be trusted, and how do we ground it in sources?

Modules 11–13

Day 5

Agents and the Capstone

How do we build reliable systems out of these models?

Modules 14–15

See the full schedule or go straight to the notebooks.

Before Day 1, Module 0 · Coding Agents in the Terminal is optional pre-work on your own laptop. If you get stuck, an optional drop-in clinic runs on Day 1 from 08:00 to 09:00.

The Path

Each step fixes a failure of the one before it. The same small datasets and tasks come back from module to module, so each improvement is measured, not asserted.

Before Day 1 · Pre-Work

0

Coding Agents in the Terminal Optional pre-work

Install a terminal coding agent and use it to build, check and publish two small data apps in Python or R, each with a three.js page. Pre-work, on your own laptop before Day 1.

Day 1 · Foundations

1

Text as Data

Tokenization, n-gram language models, TF-IDF and linear classifiers: the count-based baseline everything else is measured against.

2

Word Vectors and Neural Networks

From one-hot vectors to learned embeddings, with a PyTorch refresher and the first neural language model.

3

Sequence Models

RNNs, LSTMs and neural language modeling, and why gradients vanish over long sequences.

4

Seq2seq and Attention

Encoder-decoder models, the fixed-vector bottleneck, and attention as the fix.

Day 2 · Transformers and Pretraining

5

The Transformer

Self-attention, multi-head attention and positional encodings, assembled into a small GPT.

6

Pretraining and the Hugging Face Stack

Subword tokenization, masked and causal pretraining, and using pretrained models through Hugging Face.

7

Fine-Tuning and LoRA

Turning a pretrained language model into an instruction follower, efficiently.

Day 3 · Using and Aligning LLMs

8

LLMs Through APIs

OpenAI and Claude side by side: prompting, structured output, tool use, cost and evaluation.

9

Reinforcement and Preference Learning

Text generation as a reinforcement-learning problem, the policy gradient, and reward models learned from comparisons.

10

RLHF

The full reinforcement-learning-from-human-feedback pipeline, DPO, and the ways it goes wrong.

Day 4 · Calibration, Decisions, RAG

11

Calibration

What a probability should mean, how to measure it, and how to use confidence to decide when to abstain.

12

Calibrated Decisions: RLCD and Jev

Training and using models for calibrated decisions: outcome rewards, thresholds from costs, and TypeSafe’s RLCD and Jev as a case study in what is and is not public.

13

Retrieval-Augmented Generation

Building a RAG pipeline with LlamaIndex and LangChain, and evaluating retrieval and answers separately.

Day 5 · Agents and Capstone

14

Agents

Tool-using agents as explicit graphs in LangGraph, with state, human-in-the-loop interrupts and confidence-gated control.

15

Capstone

Combine retrieval, an agent graph and calibrated control into one system, evaluate it, and explain the design.

What You Will Be Able to Do

  • Explain the line of ideas from count-based language models to transformers, and say what problem each step solved.
  • Implement the core of each model in PyTorch: skip-gram, an LSTM language model, seq2seq with attention, and a small GPT.
  • Fine-tune pretrained models with Hugging Face, including LoRA.
  • Use the OpenAI and Claude APIs for prompting, structured output and tool use.
  • Explain RLHF end to end, train a toy version, and name its failure modes.
  • Measure calibration, explain how RLCD’s objective differs from RLHF’s, and use a calibrated decision model (Jev) through its API.
  • Build and evaluate a RAG pipeline with LlamaIndex and LangChain.
  • Build a LangGraph agent with tools, state, human-in-the-loop checkpoints and confidence-gated control.

Who It Is For

Machine learning practitioners who want to understand language models from the ground up. You should be comfortable with:

  • Python and NumPy: functions, classes, broadcasting, matrix products.
  • Machine learning basics: train and test splits, loss functions, gradient descent, logistic regression.
  • PyTorch: you have trained at least one model with nn.Module and an optimizer loop. Module 2 includes a short refresher.
  • Math: vectors and matrices, the chain rule, conditional probability, cross-entropy.

Not sure? The 15-minute entry check on the Before Day 1 page tells you, area by area, whether to review anything and what to read.

You need a Google account for Colab. API keys are optional: every lab runs without them, on a free open model or, in Module 12, on a small decision model you train in the lab. See Setup.

How Each Module Works

On Day 1, each module is 95 minutes: 45 minutes of briefing, then 50 of lab. On Days 2 to 5, each module is 120 minutes: 55 minutes of briefing, 55 of lab, then a 10-minute debrief. On Days 2 to 4 the second module breaks for lunch between its briefing and its lab. On Day 5, the capstone build runs on across lunch. The capstone (Module 15) has no briefing: it takes 11:30–12:25, 13:25–14:30 and 14:45–16:45 on Day 5.

The labs follow one rhythm:

  1. Predict what a cell will output before you run it.
  2. Run it.
  3. Explain the result, especially when it differs from your prediction.
  4. Check your work against a checkpoint that passes or fails.

Each exercise has a solution folded directly beneath it, and each lab ends with an optional stretch section for those who finish early.

Where the Material Comes From

The approach draws on Stanford CS224N, CMU CS 11-747 and MIT 6.S191. The full reading list is on the References page.

From Traditional NLP to Modern LLMs · Genial Labs · Built with Quarto

  • Setup

  • FAQ

  • Glossary

  • Readiness

Text CC BY 4.0 · Code MIT