Save this video free

Basics of language models

Mohit Iyyer · 1:09:56 · Watch on YouTube

Part of University of Maryland CMSC 723. See all 20 lectures and search them

These notes were made with YouTube Collector. Paste any YouTube link and get the same: a summary, chapters and a searchable transcript.

Overview

Mohit Iyyer explains how language models assign probabilities to text by multiplying next-word conditional probabilities, then uses count-based n-gram models to show the tradeoffs between context, sparsity, and storage. He connects maximum likelihood estimation to log probability, negative log likelihood, surprisal, and perplexity, explaining why models are evaluated on held-out text and why perplexity depends on vocabulary and tokenization.

Key takeaways

Chapters

0:00 Language Models Score Text with Probabilities
8:00 The Chain Rule Turns Next-Word Predictions into Text Probabilities
11:00 Exact Prefix Counts Create Storage and Sparsity Problems
18:00 N-Gram Models Apply the Markov Assumption
22:00 More Context Improves Prediction but Grows Counts Rapidly
27:00 N-Gram Storage Scales as Vocabulary Size to the Nth Power
30:00 Sentence Boundaries, Vocabulary Types, and Tokens
36:00 Unseen N-Grams Can Give an Entire Sentence Zero Probability
39:00 Add-One Smoothing Assigns Probability to Unseen Sequences
43:00 Maximum Likelihood Estimation Fits the Training Data
46:30 Log Probabilities Prevent Underflow and Normalize for Length
53:00 Surprisal Connects Language Probability to Compression and NLL
59:00 Perplexity Measures Predictive Uncertainty and Must Be Compared Carefully

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

Transcript excerpt

0:07 Okay. Um, hi everyone. So, today we are going to cover some fundamental uh aspects of language models. And so we're going to talk about um engram models, probability of texts uh and uh perplexity. So I want to just emphasize throughout this lecture things that um we'll see over and over again in this class even as we transition from these simple models that we'll talk about today to more complicated uh neural network models that um we'll start seeing um after Labor Day. So next week um before I start some logistics uh things so your homework is posted um and the form to

1:00 fill out your project groups also posted. So please make use of the Piaza search for teammates thread if you need to find teammates um and submit that form uh by September 14th. The homework again is not intended to be uh very difficult. Um more just give you an idea of if you're not familiar with any of the concepts on that homework, you might want to do some self-study on those topics outside of class. Um okay, any questions about uh logistics uh stuff? Okay, great. So, uh, today we're going to be talking about, um, language models. Um,

1:50 okay. Language models. Um, and so there's um, you know, like this basic definition of a language model is um something that assigns a probability to a given text. So last class we saw briefly when we were talking about the um IBM like statistical machine translation system that there was a model of English that would basically tell you how plausible of an English sentence is this candidate translation.

2:40 um you can kind of generalize from that and think about any model that scores a piece of text and assigns it to a

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

In this course

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, Mohit Iyyer.

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.