Where We Left Off, Part 1: Making Long Contexts Viable
Let's remind ourselves what happened at the very end of this week's lecture. At first, it seemed like if we wanted to get better (i.e., more realistic) language models, we could just keep scaling up the context to be larger and larger, and presto: better language model!
Is this the "scaling hypothesis" I've heard so much about?
Not quite, but it is related!
But we quickly ran into a problem...
Consider an 8-gram language model; that is, it models sequences of 8 tokens, so its context size is 7. Suppose we wanted to evaluate the probability of the token "Angeles" being generated after the context "Seven cat cafes are located near Los". To do this, we would need to evaluate...
$$ C(\text{"Seven", "cat", "cafes", "are", "located", "near", "Los", "Angeles"}) $$
But as we noted in lecture, how many times would you expect to see this exact sequence in the data? Maybe if you're lucky, it just so happens that your training data includes a news article about seven LA cat cafes that includes this exact phrase...but in that case, "Angeles" would be the only token that has ever followed the context "Seven cat cafes are located near Los" (unless you're even luckier and there's a second article with identical phrasing about cat cafes in Los Gatos...). So we would run into the problem of memorization that we saw in the in-class demo. More realistically, however, the training data doesn't contain this exact sequence of tokens at all, and so you end up with a probability of 0.
This should strike many of you as unsatisfying. A probability of 0 means that the phrase "Seven cat cafes are located near Los Angeles" is literally impossible. Hopefully you disagree at least somewhat with this claim as a human! Take a moment now to reflect...
I think the problem is that the language model is being distracted by the rest of the context, when the only token that really matters here is "Los"!
I think the problem is that the model is too particular about exact phrasing. Similar phrasings like "7 cat cafes..." or "...are located around..." should also count.
Great news: you're both right!
The general human intuition here is that the Markov language model that we discussed in class is too hyperfocused on specific tokens in the context. Maybe some tokens should be considered irrelevant, or maybe some words can be considered interchangeable with different tokens, or maybe the order of the tokens shouldn't matter so much.
Of course, it's one thing to identify the problem; it's another thing entirely to solve it! In this lesson, we'll cover three naive solutions to make language models less sensitive to the exact wording of the context: smoothing, interpolation, and backoff. However, we note that these solutions are far from perfect, and that finding the "right" way to generalize context is one of the major open questions in NLP. In fact, one way of interpreting the actual "breakthrough" behind LLMs is that they represent the best currently-known way to generalize context in a humanlike fashion (as we will explore later in this class).
(When logged in, completion status appears here.)