Teaching resources

Tutorials

Public tutorials and practical references for programming, NLP, applied machine learning, and research computing.

All Tutorials

39 standalone lessons, technical references, and course-adjacent guides.

Answering with evidence

In Training, context, and evidence, we supplied source material and examples in the prompt. Now we'd like to build on that experiment: how do we choose what goes into the prompt, and how do we make the answer useful to our code?

Giving language models tools

Earth's time zones are bad enough to manage, but it turns out there's a whole galaxy of worlds out there. We certainly don't want to phone Zarbonia after hours. Knowing how time zones work doesn’t tell our assistant what time it is right now.

How models generate text

Messages from the Zarbonian Empire regularly reach Earth, its most distant and recent addition, in fragments. Our archival assistant has to make sense of these incomplete transmissions. Here's one of them:

Installing Docker on Ubuntu

This tutorial provides instructions for installing Docker on Ubuntu. While the steps outlined here may work for other versions of Ubuntu (and some non-Ubuntu Linux distributions), these instructions were tested against Ubuntu 24.04 LTS.

Installing VS Code on Ubuntu

This tutorial provides instructions for installing Visual Studio Code on Ubuntu. While the steps outlined here may work for other versions of Ubuntu (and some non-Ubuntu Linux distributions), these instructions were tested against Ubuntu 24.04 LTS.

Introduction to scikit-learn

In this tutorial, we're going to step through training a naïve Bayes classifier with n-gram features using a popular machine learning library in Python called scikit-learn. This library provides implementations and an easy-to-use interface for many supervised and...

N-grams

In this lesson, we'll learn about n-grams and see how they can be used as general features to represent words and documents.

Probability basics

Ambiguity and uncertainty abound in natural language. In this lesson, we'll learn the basics of probability which will help us to quantify that uncertainty.

RNNs for NLP

How might we represent a sequence while keeping track of what we've already seen? A recurrent neural network (RNN) updates a hidden state as it moves through the sequence. We'll follow those updates, connect them to PyTorch, and then look at gated RNNs and encoder-decoder...

Test image evidence from a paper

For the brave and curious, let’s go back to Table 5. Gemma called the right tool and got the right page, but read the F1 score as precision. Would a crop of the table help? This optional tutorial for Part 2 follows the tool calling tutorial. If you want to run...

Tokenizing using regex

In earlier lessons, we introduced the idea of tokens and discussed some of their attributes. We devised some informal descriptions of the clues that signal token boundaries (ex. whitespace, contractions, etc.). In this lesson, we'll how to use regexes to tokenize...

Training, context, and evidence

In the previous lesson, our Galactic Archives assistant generated continuations of a fragmented message. Now we'd like it to help us answer questions about the Archives. That calls for more than a plausible continuation.

Transformers for NLP

Suppose we're translating a story. The information we need for the next word may be somewhere in the source text, rather than in the last word we translated. How can a model revisit that information and decide what to use?