Save this video free

Unit 9a

Prof. Schniter · 57:07 · Watch on YouTube

Unit 9a Watch on YouTube →

Overview

The lecture builds character-level autoregressive text generation from first principles using Andrej Karpathy’s Tiny Shakespeare dataset, with 65 character tokens and a time-ordered 90/10 train-test split. It compares empirical bigrams and multinomial logistic regression with n-grams and learned embeddings, showing how embeddings enable longer context efficiently; the lecture ends by motivating attention as a way to use distant, relevant context that recurrent models often struggle to retain.

Key takeaways

Chapters

0:00 Generative Learning and Autoregressive Text Generation
4:10 Tiny Shakespeare: 65 Character Tokens and Integer Encoding
9:12 Time-Based Splits for Shakespeare Text
12:19 Training a Character Bigram from Conditional Probabilities
20:51 Comparing Random, Unigram, and Bigram Text Generation
25:53 Connecting the Bigram to Multinomial Logistic Regression
33:58 Why Larger Character N-Grams Become Impractical
36:30 Learned Embeddings Replace One-Hot Character Representations
45:56 PyTorch Embedding Layers and Time-Series Data Loading
49:06 Embedding Model Results and the Need for Long-Range Context
53:29 Attention Uses Relevant Distant Tokens for Prediction

Keep these chapters and the full searchable transcript in your own library.

Transcript excerpt

0:01 Okay, we're going to get into a new unit today that is going to start to talk about some more contemporary topics in machine learning. And that's on transformers and large language models. So, >> [clears throat] >> our motivation motivational problem Actually first before I talk about that, our kind of the high level task that we're doing is now going to be different than we've considered so far. So so far we've considered um prediction in the form of either regression or classification. So there we always have data that comes in pairs, we have features and targets and we try to predict the target from

0:49 the features. But now we're going to talk about generative machine learning which is not about prediction at all. It's just about generating random test samples that are similar to those in our training set. And this is an example of an unsupervised task which means you don't have pairs of feature target. You just have features. Um in this case, let's say we have a data set of feature vectors XI and we want to use our model to try to generate a new X that looks a lot like our features XI but yet is not an instance of any of them. Okay, so example would be like I have

1:37 a large data set of cat images and I want to generate a new cat that's not in my data set but you know, it looks like a cat. >> [clears throat] >> Convinces everyone that it's it's actually a cat. Um so that's what generative machine learning is and that's an example of an unsupervised task. We will talk about some other unsupervised tasks in future units. we'll talk about um clustering and we'll talk about um compression, basically some form of

This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.

Related notes

Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Prof. Schniter.

Want the full transcript?

Save this video in YouTube Collector to get its complete searchable transcript, your own AI summaries, and a library that keeps every video you collect in one place.