1 00:00:00,000 --> 00:00:03,200 If you open a search engine right now and just 2 00:00:03,200 --> 00:00:06,620 type in the word bat, you are actually presenting 3 00:00:06,620 --> 00:00:08,779 the machine with a nearly impossible puzzle. 4 00:00:09,000 --> 00:00:10,539 Yeah, it's a massive headache for the system. 5 00:00:10,640 --> 00:00:14,580 Right. Because how does a computer like a literal 6 00:00:14,580 --> 00:00:16,980 box of silicon that only natively understands 7 00:00:16,980 --> 00:00:20,120 ones and zeros, how does it know what you want? 8 00:00:20,420 --> 00:00:23,059 It has absolutely no idea. Exactly. It doesn't 9 00:00:23,059 --> 00:00:24,980 know if you're trying to research, you know, 10 00:00:24,980 --> 00:00:27,670 the... proper grip for a piece of wood to hit 11 00:00:27,670 --> 00:00:30,170 a baseball or if you're frantically trying to 12 00:00:30,170 --> 00:00:32,289 figure out how to get a tiny wing vampire mammal 13 00:00:32,289 --> 00:00:34,750 out of your attic which is a very stressful situation 14 00:00:34,750 --> 00:00:37,130 to be in by the way oh incredibly stressful but 15 00:00:37,130 --> 00:00:40,210 in our previous deep dive into this definitive 16 00:00:40,210 --> 00:00:43,090 text on natural language processing we were living 17 00:00:43,090 --> 00:00:45,590 in the land of grammar right the syntax yeah 18 00:00:45,590 --> 00:00:48,409 syntax we looked at how machines understand the 19 00:00:48,409 --> 00:00:52,659 structure and the sequence of words but um Knowing 20 00:00:52,659 --> 00:00:55,780 the rules of how a sentence is assembled is vastly 21 00:00:55,780 --> 00:00:57,740 different from actually understanding what it 22 00:00:57,740 --> 00:00:59,740 means. Vastly different. It's a whole new frontier. 23 00:01:00,100 --> 00:01:02,359 And that's what we're doing today. We are crossing 24 00:01:02,359 --> 00:01:04,579 that frontier. We're moving from those rigid 25 00:01:04,579 --> 00:01:08,060 rules of syntax into the chaotic, messy world 26 00:01:08,060 --> 00:01:12,019 of human meaning, context, and eventually the 27 00:01:12,019 --> 00:01:14,340 literal physical vibrations of the human voice. 28 00:01:15,030 --> 00:01:18,590 We are officially transitioning from syntax to 29 00:01:18,590 --> 00:01:21,650 semantics and pragmatics. Because, you know, 30 00:01:21,930 --> 00:01:24,209 A machine can't extract facts from a news article 31 00:01:24,209 --> 00:01:26,250 or answer your questions or hold a conversation 32 00:01:26,250 --> 00:01:28,849 with you until it has some sort of mathematical 33 00:01:28,849 --> 00:01:31,250 representation of meaning itself. It needs a 34 00:01:31,250 --> 00:01:34,109 foundation. Exactly. And historically, early 35 00:01:34,109 --> 00:01:36,879 computer scientists didn't start with... like 36 00:01:36,879 --> 00:01:38,780 neural networks or probability to build that 37 00:01:38,780 --> 00:01:41,359 foundation, they started with strict, unforgiving 38 00:01:41,359 --> 00:01:43,159 logic. Well, that makes sense, because if I'm 39 00:01:43,159 --> 00:01:45,280 trying to translate the chaotic reality of a 40 00:01:45,280 --> 00:01:48,719 physical bat into math, I imagine I need some 41 00:01:48,719 --> 00:01:50,280 sort of universe and coordinate system, right? 42 00:01:50,439 --> 00:01:52,060 Right, you need a map. Yeah, I need a way to 43 00:01:52,060 --> 00:01:55,000 pin an abstract human concept to an exact location 44 00:01:55,000 --> 00:01:58,540 in a digital reality. And that map was the goal 45 00:01:58,540 --> 00:02:03,299 of first -order logic, or FOL. It was really 46 00:02:03,299 --> 00:02:05,560 the backbone of early artificial intelligence. 47 00:02:06,140 --> 00:02:09,060 First order logic represents the entire world 48 00:02:09,060 --> 00:02:11,719 as just a collection of objects, the properties 49 00:02:11,719 --> 00:02:14,479 those objects have, and the mathematical relations 50 00:02:14,479 --> 00:02:16,520 between them. Give me an example of that. Like, 51 00:02:16,539 --> 00:02:18,860 how does it look in practice? So let's take a 52 00:02:18,860 --> 00:02:22,240 simple sentence. Baccaro is near Centro. Let's 53 00:02:22,240 --> 00:02:23,759 just say those are two restaurants in a city. 54 00:02:23,840 --> 00:02:26,159 Okay, Baccaro and Centro. Got it. You would represent 55 00:02:26,159 --> 00:02:29,520 that in first order logic as a predicate. It 56 00:02:29,520 --> 00:02:31,039 would look like near and then in parentheses, 57 00:02:31,280 --> 00:02:34,180 picaro, centro. Oh, I see. So near is the relation 58 00:02:34,180 --> 00:02:36,460 and the restaurants are the object. Exactly. 59 00:02:36,500 --> 00:02:39,039 You've defined this rigid map where every entity 60 00:02:39,039 --> 00:02:41,719 has a specific coordinate and the relationship 61 00:02:41,719 --> 00:02:44,219 between any two coordinates is absolute. It's 62 00:02:44,219 --> 00:02:45,860 either true or false. Well, that sounds great 63 00:02:45,860 --> 00:02:48,400 for a static map, but human language isn't static, 64 00:02:48,520 --> 00:02:50,840 is it? We build sentences incrementally. We do. 65 00:02:51,219 --> 00:02:54,610 Word by word. Right, so if I'm speaking, the 66 00:02:54,610 --> 00:02:56,550 verb might come out of my mouth long before the 67 00:02:56,550 --> 00:02:58,990 object it applies to even exists in the conversation. 68 00:02:59,409 --> 00:03:02,310 How does a rigid mathematical formula deal with 69 00:03:02,310 --> 00:03:05,909 time and that sequential flow of words? It struggles. 70 00:03:06,250 --> 00:03:09,770 A lot. Which is why logicians had to borrow this 71 00:03:09,770 --> 00:03:12,469 fascinating mathematical technique called currying. 72 00:03:13,009 --> 00:03:15,110 Currying? Like the food? Like the food, yeah. 73 00:03:15,229 --> 00:03:18,629 But named after the logician Haskell Curry. Though... 74 00:03:18,810 --> 00:03:21,650 Fun fact, a guy named Moses Schoenfinkel actually 75 00:03:21,650 --> 00:03:25,469 introduced it way back in 1924. Oh, wow. 1924, 76 00:03:25,569 --> 00:03:27,650 that's way before modern computers. Right. And 77 00:03:27,650 --> 00:03:30,229 what currying does is it converts a multi -argument 78 00:03:30,229 --> 00:03:32,770 function into a sequence of single -argument 79 00:03:32,770 --> 00:03:34,729 functions. Okay, you lost me a bit there. So 80 00:03:34,729 --> 00:03:36,889 instead of a function swallowing two inputs at 81 00:03:36,889 --> 00:03:38,990 once, it's more like, I don't know, like an assembly 82 00:03:38,990 --> 00:03:41,330 line. Let's run with that assembly line idea. 83 00:03:41,469 --> 00:03:43,169 Right. Can you picture it? Okay, so the verb 84 00:03:43,169 --> 00:03:46,210 is like a robotic arm on a conveyor belt. It 85 00:03:46,210 --> 00:03:48,150 grabs the first piece of information, like the 86 00:03:48,150 --> 00:03:50,389 subject, and then it physically halts. It just 87 00:03:50,389 --> 00:03:52,830 holds onto that subject, waiting for the conveyor 88 00:03:52,830 --> 00:03:54,389 belt to bring the second piece of information, 89 00:03:54,650 --> 00:03:56,449 the object, into its reach. Does that make sense? 90 00:03:56,669 --> 00:03:59,270 That is a phenomenal way to visualize it. I love 91 00:03:59,270 --> 00:04:02,469 that. So take our predicate from before, the 92 00:04:02,469 --> 00:04:05,469 near Baccaro Central. Right. Instead of a single 93 00:04:05,469 --> 00:04:07,530 function taking both restaurants simultaneously, 94 00:04:08,090 --> 00:04:11,189 currying creates a function that takes the first. 95 00:04:11,550 --> 00:04:14,210 input Baccaro, and then it returns an entirely 96 00:04:14,210 --> 00:04:17,470 new temporary function. Oh, so it mutates into 97 00:04:17,470 --> 00:04:20,509 a new function halfway through. Exactly. In lambda 98 00:04:20,509 --> 00:04:22,769 calculus notation, it looks something like lambda 99 00:04:22,769 --> 00:04:25,870 y near Baccaro's mind centro. That temporary 100 00:04:25,870 --> 00:04:28,290 function is essentially your robotic arm. It's 101 00:04:28,290 --> 00:04:30,730 holding Baccaro and scanning the horizon for 102 00:04:30,730 --> 00:04:33,329 centro. That's brilliant. It allows the mathematical 103 00:04:33,329 --> 00:04:35,990 meaning to be built up step by step, perfectly 104 00:04:35,990 --> 00:04:38,889 mirroring how a sentence is parsed word by word 105 00:04:38,889 --> 00:04:41,350 in real time as we speak. It really is an elegant 106 00:04:41,350 --> 00:04:43,209 solution to the sequence problem. I can see how 107 00:04:43,209 --> 00:04:46,350 that solves the assembly line issue. But returning 108 00:04:46,350 --> 00:04:49,370 to my bat example from the start, an assembly 109 00:04:49,370 --> 00:04:51,629 line still requires you to know exactly what 110 00:04:51,629 --> 00:04:53,269 parts you're working with. You need to know what's 111 00:04:53,269 --> 00:04:55,889 coming down the belt, yeah. And human words are 112 00:04:55,889 --> 00:04:58,970 incredibly ambiguous. First order logic seems 113 00:04:58,970 --> 00:05:01,189 way too brittle to handle a word that completely 114 00:05:01,189 --> 00:05:04,529 changes its identity based on context. Like a 115 00:05:04,529 --> 00:05:06,370 logical predicate doesn't know the difference 116 00:05:06,370 --> 00:05:08,490 between a mammal and a piece of wood. No, it 117 00:05:08,490 --> 00:05:11,550 doesn't. First order logic is incredibly brittle. 118 00:05:11,850 --> 00:05:14,610 And this brings us to the profound problem of 119 00:05:14,610 --> 00:05:19,029 word sense disambiguation or WSD. Word sense 120 00:05:19,029 --> 00:05:21,949 disambiguation. That sounds heavy. It is. And 121 00:05:21,949 --> 00:05:24,110 the stakes are high, especially in translation. 122 00:05:24,149 --> 00:05:26,649 Think about it. In Spanish, the animal bat is. 123 00:05:27,189 --> 00:05:29,569 Murcielago. Okay, murcielago. But the baseball 124 00:05:29,569 --> 00:05:32,870 bat is bait. So if your machine translation system 125 00:05:32,870 --> 00:05:35,709 relies on a rigid logical coordinate for the 126 00:05:35,709 --> 00:05:38,769 English word bat, but it gets the sense wrong. 127 00:05:39,009 --> 00:05:41,069 Oh man, your translation isn't just slightly 128 00:05:41,069 --> 00:05:42,910 awkward, it becomes complete gibberish. You're 129 00:05:42,910 --> 00:05:44,709 telling someone to hit a home run with a winged 130 00:05:44,709 --> 00:05:47,490 mammal. Exactly. The logic just fails completely. 131 00:05:47,689 --> 00:05:50,069 So if logic fails, what is the alternative? How 132 00:05:50,069 --> 00:05:52,069 do we give a computer the common sense to know 133 00:05:52,069 --> 00:05:54,779 which bat is which? Well, we basically have to 134 00:05:54,779 --> 00:05:57,720 abandon strict logic. We move away from logicians 135 00:05:57,720 --> 00:06:00,360 and we move into the realm of statistics and 136 00:06:00,360 --> 00:06:03,139 geometry. Geometry, like shapes. Like plotting 137 00:06:03,139 --> 00:06:06,350 points on a graph. Historically, the breakthrough 138 00:06:06,350 --> 00:06:09,430 here was feature -based word sense disambiguation 139 00:06:09,430 --> 00:06:13,050 using support vector machines, or SEMs. Support 140 00:06:13,050 --> 00:06:15,250 vector machines. Okay, break that down for me. 141 00:06:15,370 --> 00:06:17,329 Basically, an SVM doesn't try to understand the 142 00:06:17,329 --> 00:06:19,790 word the way a human does. It just plots the 143 00:06:19,790 --> 00:06:22,290 word on a massive... multidimensional graph. 144 00:06:22,550 --> 00:06:24,389 Let's draw this graph for the listener. Like, 145 00:06:24,389 --> 00:06:26,889 what are the axes? What is the machine actually 146 00:06:26,889 --> 00:06:29,110 plotting? It's plotting features from the surrounding 147 00:06:29,110 --> 00:06:32,529 text. The algorithm looks at, say, a three -word 148 00:06:32,529 --> 00:06:36,269 window around your target word, bat, and it counts 149 00:06:36,269 --> 00:06:38,230 the frequencies of other words in that window. 150 00:06:38,430 --> 00:06:40,209 Oh, so it's looking at the neighbors. Exactly. 151 00:06:40,569 --> 00:06:43,110 So let's imagine a really simplified two -dimensional 152 00:06:43,110 --> 00:06:45,810 graph, just an x and a y -axis. Okay, I'm picturing 153 00:06:45,810 --> 00:06:48,290 it. The y -axis represents the presence of words 154 00:06:48,290 --> 00:06:50,949 related to nature. So words like cave, vampire, 155 00:06:51,230 --> 00:06:54,290 wings. And the x -axis represents sports words. 156 00:06:55,029 --> 00:06:58,569 Pitch, home run, wood. I see where this is going. 157 00:06:58,750 --> 00:07:00,350 Right. So every time the machine reads a sentence 158 00:07:00,350 --> 00:07:02,269 containing the word bat, it looks at the surrounding 159 00:07:02,269 --> 00:07:04,910 words, calculates their frequencies, and places 160 00:07:04,910 --> 00:07:08,879 a tiny dot on this graph. Ah, okay. So over thousands 161 00:07:08,879 --> 00:07:11,959 of sentences, you end up with two massive clusters 162 00:07:11,959 --> 00:07:14,740 of dots on your graph. Exactly. One cluster is 163 00:07:14,740 --> 00:07:16,939 going to be way up high on the y -axis, representing 164 00:07:16,939 --> 00:07:18,759 all the times people were talking about the animal. 165 00:07:18,899 --> 00:07:21,759 And the other cluster is far out on the x -axis, 166 00:07:21,839 --> 00:07:23,480 representing all those baseball conversations. 167 00:07:23,980 --> 00:07:27,220 Spot on. And here is the magic of the support 168 00:07:27,220 --> 00:07:30,040 vector machine. Once those dots are all plotted, 169 00:07:30,240 --> 00:07:33,519 the SVM calculates the optimal mathematical line, 170 00:07:33,600 --> 00:07:35,540 or if we're in higher dimensions, we call it 171 00:07:35,540 --> 00:07:38,019 hyperplane, that perfectly slices through the 172 00:07:38,019 --> 00:07:40,259 empty space between those two clusters. It draws 173 00:07:40,259 --> 00:07:42,800 a boundary line, like a fence. A literal mathematical 174 00:07:42,800 --> 00:07:46,420 fence. So now, when a brand new unseen sentence 175 00:07:46,420 --> 00:07:49,220 comes in, the machine plots its features. If 176 00:07:49,220 --> 00:07:50,779 the dot lands on the left side of the fence, 177 00:07:50,899 --> 00:07:53,459 it outputs Murcielago. And if it lands on the 178 00:07:53,459 --> 00:07:56,399 right, it outputs Beat. That is so cool. We've 179 00:07:56,399 --> 00:07:59,399 moved from absolute logic to, like, geographic 180 00:07:59,399 --> 00:08:01,720 probability. Yeah, spatial reasoning for words. 181 00:08:01,959 --> 00:08:05,279 But, you know, I know modern AI, like these massive 182 00:08:05,279 --> 00:08:07,259 language models we hear about today, they don't 183 00:08:07,259 --> 00:08:09,720 even use those explicit SVM boundaries anymore, 184 00:08:09,819 --> 00:08:11,620 do they? They use high -dimensional vector spaces. 185 00:08:12,139 --> 00:08:15,819 Right. The technology evolved. The word bat doesn't 186 00:08:15,819 --> 00:08:17,920 even exist as a single point on a graph anymore. 187 00:08:18,339 --> 00:08:21,279 So how does it work now? In a modern architecture 188 00:08:21,279 --> 00:08:24,180 like BERT, words are transformed into embeddings. 189 00:08:25,129 --> 00:08:27,610 These are massive vectors with thousands of dimensions. 190 00:08:27,870 --> 00:08:30,149 We're not talking X and Y anymore. We're talking 191 00:08:30,149 --> 00:08:33,690 thousands of axes. So it's an undrawable graph. 192 00:08:34,009 --> 00:08:36,909 Completely undrawable by human hands. But in 193 00:08:36,909 --> 00:08:39,789 this hyperdimensional space, the abstract concept 194 00:08:39,789 --> 00:08:43,889 of Murcielago and the concept of bait live in 195 00:08:43,889 --> 00:08:46,990 entirely different galaxies. Wow. Different galaxies. 196 00:08:47,309 --> 00:08:49,730 Yeah. The English word bat is initially just 197 00:08:49,730 --> 00:08:52,759 a nebulous, ambiguous point in space. But the 198 00:08:52,759 --> 00:08:55,159 surrounding words in the sentence exert a literal 199 00:08:55,159 --> 00:08:57,519 mathematical gravitational pull on it. So if 200 00:08:57,519 --> 00:09:00,220 the word vampire is in the sentence, its gravity 201 00:09:00,220 --> 00:09:03,080 just yanks that ambiguous bat vector across the 202 00:09:03,080 --> 00:09:05,399 universe, landing it squarely in the animal galaxy 203 00:09:05,399 --> 00:09:07,299 before the machine even tried to translate it. 204 00:09:07,360 --> 00:09:10,419 You nailed it. The context dynamically alters 205 00:09:10,419 --> 00:09:12,460 the word's physical location in the math. That 206 00:09:12,460 --> 00:09:15,259 is mind -blowing. And once a system can successfully 207 00:09:15,259 --> 00:09:18,399 pin down these meanings... Once it knows which 208 00:09:18,399 --> 00:09:21,159 galaxy a word belongs in, it can start to actually 209 00:09:21,159 --> 00:09:23,940 organize human knowledge. Okay, so we're moving 210 00:09:23,940 --> 00:09:26,659 from just understanding single words to pulling 211 00:09:26,659 --> 00:09:29,700 facts from them. Exactly. This brings us to information 212 00:09:29,700 --> 00:09:32,899 extraction. Let's say you are a financial analyst. 213 00:09:33,120 --> 00:09:35,360 You don't care about the syntax tree of a sentence. 214 00:09:35,500 --> 00:09:37,909 No, I definitely don't. You want a machine to 215 00:09:37,909 --> 00:09:41,250 read 10 ,000 news articles and instantly output 216 00:09:41,250 --> 00:09:43,950 a database showing which airlines are raising 217 00:09:43,950 --> 00:09:46,429 fares, the exact price hikes, and the effective 218 00:09:46,429 --> 00:09:48,710 dates. Right. I just want a clean spreadsheet. 219 00:09:49,370 --> 00:09:52,509 But that requires the machine to read unstructured, 220 00:09:52,529 --> 00:09:55,570 messy journalism and somehow cram it into that 221 00:09:55,570 --> 00:09:58,570 perfectly clean spreadsheet. How does it even 222 00:09:58,570 --> 00:10:00,970 know what information to pull out? It uses something 223 00:10:00,970 --> 00:10:03,809 called template filling. The system recognizes 224 00:10:03,809 --> 00:10:06,049 an event trigger in the text. Like a keyword. 225 00:10:06,620 --> 00:10:08,799 Sort of, like the word increased appearing near 226 00:10:08,799 --> 00:10:11,340 the word fare. When it sees that, it conjures 227 00:10:11,340 --> 00:10:14,059 a blank template with specific slots. A slot 228 00:10:14,059 --> 00:10:16,139 for the airline entity, a slot for the dollar 229 00:10:16,139 --> 00:10:19,100 amount, a slot for the date. Okay, but the foundational 230 00:10:19,100 --> 00:10:21,840 challenge there has to be teaching the machine 231 00:10:21,840 --> 00:10:24,100 how to spot those relationships in the first 232 00:10:24,100 --> 00:10:27,480 place. Because, I mean, I could write Delta increased 233 00:10:27,480 --> 00:10:31,080 fares by $50, or I could write fares went up 234 00:10:31,080 --> 00:10:33,440 50 bucks over at Delta. Right, the phrasing could 235 00:10:33,440 --> 00:10:35,549 be completely different. So how does it find 236 00:10:35,549 --> 00:10:38,389 the relation regardless of how creative the writer 237 00:10:38,389 --> 00:10:40,950 is being? The elegant solution for this actually 238 00:10:40,950 --> 00:10:44,509 began way back in 1992 with a researcher named 239 00:10:44,509 --> 00:10:47,769 Marty Hurst. Marty Hurst, what did she do? She 240 00:10:47,769 --> 00:10:50,950 discovered what we now call Hurst patterns. She 241 00:10:50,950 --> 00:10:53,529 realized that human language contains incredibly 242 00:10:53,529 --> 00:10:56,950 consistent, simple, lexicosyntactic patterns 243 00:10:56,950 --> 00:11:00,240 that reveal underlying taxonomies. Okay, that 244 00:11:00,240 --> 00:11:03,039 was a lot of syllables. Break down lexicosyntactic 245 00:11:03,039 --> 00:11:05,299 patterns for me. It basically means predictable 246 00:11:05,299 --> 00:11:08,159 word shapes. For example, if a computer sees 247 00:11:08,159 --> 00:11:11,139 the phrase, many hormones like leptin. Okay, 248 00:11:11,220 --> 00:11:13,340 many hormones like leptin. Right. The computer 249 00:11:13,340 --> 00:11:15,259 doesn't need a dictionary definition of a hormone, 250 00:11:15,419 --> 00:11:17,340 and it definitely doesn't need to know what leptin 251 00:11:17,340 --> 00:11:21,600 is. The sheer sequence of X like Y mathematically 252 00:11:21,600 --> 00:11:25,870 guarantees that Y is a subclass of X. Oh. Wow, 253 00:11:25,970 --> 00:11:28,289 because we always use like to give an example 254 00:11:28,289 --> 00:11:30,710 of a category. Exactly. It's a universal shortcut. 255 00:11:31,029 --> 00:11:33,110 So the early approach was to just unleash the 256 00:11:33,110 --> 00:11:35,529 computer on the internet, scanning for the exact 257 00:11:35,529 --> 00:11:39,090 phrase such as or including, and every time it 258 00:11:39,090 --> 00:11:41,649 hit one, it built a new category in its brain. 259 00:11:41,889 --> 00:11:43,730 That was the dream, yeah. But wait, that seems 260 00:11:43,730 --> 00:11:45,669 incredibly fragile. What if I write a sentence 261 00:11:45,669 --> 00:11:48,950 like, I like pizza? Does the machine categorize 262 00:11:48,950 --> 00:11:52,830 pizza as a subspecies of the pronoun I? Yes, 263 00:11:52,830 --> 00:11:55,820 it is. Absolutely would if it only relied on 264 00:11:55,820 --> 00:11:59,129 those original brittle patterns. Handwritten 265 00:11:59,129 --> 00:12:01,789 rules inevitably collide with the bizarre edge 266 00:12:01,789 --> 00:12:04,370 cases of human speech. So I like pizza breaks 267 00:12:04,370 --> 00:12:06,289 the whole database. It corrupts the data, yeah. 268 00:12:06,409 --> 00:12:09,009 To fix this, modern information extraction relies 269 00:12:09,009 --> 00:12:12,070 on a technique called distant supervision. Distant 270 00:12:12,070 --> 00:12:13,850 supervision. That implies there's a teacher, 271 00:12:13,909 --> 00:12:16,950 but the teacher is like very far away. What is 272 00:12:16,950 --> 00:12:19,129 the mechanism there? The teacher in this case 273 00:12:19,129 --> 00:12:22,179 is a pre -existing. trusted database, something 274 00:12:22,179 --> 00:12:24,940 like WordNet. Let's say WordNet tells the system 275 00:12:24,940 --> 00:12:28,399 definitively that leptin is a hormone and insulin 276 00:12:28,399 --> 00:12:30,740 is a hormone. OK, so it starts with a few absolute 277 00:12:30,740 --> 00:12:34,740 truths. Right. Then the algorithm crawls Wikipedia 278 00:12:34,740 --> 00:12:38,460 and finds every single sentence where the word 279 00:12:38,460 --> 00:12:41,679 leptin and the word hormone appear together in 280 00:12:41,679 --> 00:12:44,139 the same sentence. OK, I'm following. It analyzes 281 00:12:44,139 --> 00:12:46,340 the specific words physically located between 282 00:12:46,340 --> 00:12:49,360 them. So maybe it finds a sentence saying leptin. 283 00:12:49,740 --> 00:12:53,340 A well -known hormone regulates appetite. I see 284 00:12:53,340 --> 00:12:55,639 where this is going. It extracts the phrase, 285 00:12:55,799 --> 00:12:58,620 a well -known her, as a brand new pattern. Exactly. 286 00:12:58,720 --> 00:13:01,700 It found a new shape. Then, it validates that 287 00:13:01,700 --> 00:13:04,000 new pattern against the insulin examples. If 288 00:13:04,000 --> 00:13:06,460 the pattern holds up for insulin 2, the machine 289 00:13:06,460 --> 00:13:08,980 adds it to its arsenal. It's bootstrapping its 290 00:13:08,980 --> 00:13:12,039 own education. It really is. By cross -referencing 291 00:13:12,039 --> 00:13:14,919 known facts against massive amounts of unstructured 292 00:13:14,919 --> 00:13:17,340 text, researchers took Marty Hurst's original 293 00:13:17,340 --> 00:13:20,019 five patterns and automatically generated 70 294 00:13:20,019 --> 00:13:23,379 ,000 highly specific, highly accurate new patterns. 295 00:13:23,500 --> 00:13:25,539 That is wild. It's basically building its own 296 00:13:25,539 --> 00:13:27,779 magnifying glasses to find more facts. That's 297 00:13:27,779 --> 00:13:29,840 a great way to put it. But even with 70 ,000 298 00:13:29,840 --> 00:13:31,799 patterns, journalists and authors are endlessly 299 00:13:31,799 --> 00:13:35,059 creative. If we are extracting data about... 300 00:13:35,210 --> 00:13:37,850 a commercial transaction, the grammar can flip 301 00:13:37,850 --> 00:13:40,549 entirely, right? Oh, absolutely. Like, John bought 302 00:13:40,549 --> 00:13:44,169 a car from Mary for $1 ,000 versus Mary sold 303 00:13:44,169 --> 00:13:47,350 a car to John for a grand. The subjects and the 304 00:13:47,350 --> 00:13:49,889 objects completely swap places in those two sentences. 305 00:13:50,210 --> 00:13:52,870 The syntax swaps, and the verbs are entirely 306 00:13:52,870 --> 00:13:55,789 different, buy versus sell. But the underlying 307 00:13:55,789 --> 00:13:59,149 real -world event is identical. So how does a 308 00:13:59,149 --> 00:14:01,409 machine know they mean the same thing? This requires 309 00:14:01,409 --> 00:14:04,120 semantic role labeling. A commercial transaction 310 00:14:04,120 --> 00:14:06,919 is what we call a semantic frame. A frame. And 311 00:14:06,919 --> 00:14:09,600 regardless of the surface grammar, that frame 312 00:14:09,600 --> 00:14:12,419 inherently demands specific roles. You have to 313 00:14:12,419 --> 00:14:15,809 have a buyer, a seller. the goods, and the money. 314 00:14:15,909 --> 00:14:17,850 You can't have a transaction without those four 315 00:14:17,850 --> 00:14:20,470 things. Right. So semantic role labeling algorithms 316 00:14:20,470 --> 00:14:23,190 are trained to strip away all that messy syntax 317 00:14:23,190 --> 00:14:26,289 and map the entities directly to those deep semantic 318 00:14:26,289 --> 00:14:29,690 slots. Oh, so whether the verb is buy or sell 319 00:14:29,690 --> 00:14:33,250 or pay, the resulting database entry looks exactly 320 00:14:33,250 --> 00:14:35,809 identical. Exactly. John is always the buyer 321 00:14:35,809 --> 00:14:38,009 slot. Mary is always the seller slot. The car 322 00:14:38,009 --> 00:14:39,710 is the goods. The thousand dollars is the money. 323 00:14:40,090 --> 00:14:42,549 OK, so we've managed to get the machine to read 324 00:14:42,549 --> 00:14:45,389 a single sentence, resolve the ambiguous words, 325 00:14:45,549 --> 00:14:48,269 dodge the weird grammar and extract the cold, 326 00:14:48,350 --> 00:14:51,669 hard facts. That is a massive achievement. It 327 00:14:51,669 --> 00:14:54,169 is. But we're not done. Not even close. Right. 328 00:14:54,289 --> 00:14:56,070 Because if you think about reading a whole article, 329 00:14:56,210 --> 00:14:59,889 humans don't write lists of isolated single sentence 330 00:14:59,889 --> 00:15:03,230 facts. We write flowing paragraphs. We do. We 331 00:15:03,230 --> 00:15:06,370 use pronouns constantly. If I say the airline 332 00:15:06,370 --> 00:15:08,690 raised the fare and then they lied about it. 333 00:15:08,950 --> 00:15:11,850 How does the computer know who they is? Welcome 334 00:15:11,850 --> 00:15:14,529 to the nightmare of coreference resolution. The 335 00:15:14,529 --> 00:15:17,409 nightmare. Is it really that bad? It's the bane 336 00:15:17,409 --> 00:15:20,590 of an NLP researcher's existence. Tracking entities 337 00:15:20,590 --> 00:15:23,490 across the flow of discourse is notoriously difficult 338 00:15:23,490 --> 00:15:25,929 because it isn't just a grammar problem anymore. 339 00:15:26,129 --> 00:15:28,750 It is a world knowledge problem. Meaning the 340 00:15:28,750 --> 00:15:30,870 machine needs to understand how the real world 341 00:15:30,870 --> 00:15:33,750 works, not just how verbs work. Exactly. And 342 00:15:33,750 --> 00:15:35,950 the ultimate demonstration of this is the Winograd 343 00:15:35,950 --> 00:15:38,889 schema, named after Terry Winograd. Give us the 344 00:15:38,889 --> 00:15:40,929 classic Winograd example. I want the listener 345 00:15:40,929 --> 00:15:43,370 to try and solve this the exact same way a computer 346 00:15:43,370 --> 00:15:45,809 has to. All right. Listen to the sentence closely. 347 00:15:46,620 --> 00:15:49,580 The city council denied the demonstrators a permit 348 00:15:49,580 --> 00:15:52,679 because they feared violence. OK. The city council 349 00:15:52,679 --> 00:15:55,179 denied the demonstrators a permit because they 350 00:15:55,179 --> 00:15:57,779 feared violence. Who does the pronoun refer to? 351 00:15:57,899 --> 00:16:01,080 Well, the city council. Because in human society, 352 00:16:01,460 --> 00:16:04,039 bureaucratic councils are the ones who fear violence 353 00:16:04,039 --> 00:16:07,600 and deny permits. Right. Now. Change one single 354 00:16:07,600 --> 00:16:10,200 word at the very end of that sentence. The city 355 00:16:10,200 --> 00:16:12,820 council denied the demonstrators a permit because 356 00:16:12,820 --> 00:16:15,700 they advocated violence. Oh. Now, who is they? 357 00:16:15,860 --> 00:16:18,620 The demonstrators. Because they are the ones 358 00:16:18,620 --> 00:16:20,960 protesting and potentially advocating a riot. 359 00:16:21,279 --> 00:16:23,620 But wait, the grammar of those two sentences 360 00:16:23,620 --> 00:16:27,740 is completely 100 % identical. Identical. A syntax 361 00:16:27,740 --> 00:16:29,679 tree would look exactly the same for both. So 362 00:16:29,679 --> 00:16:31,860 the grammar gives the computer absolutely zero 363 00:16:31,860 --> 00:16:34,789 clues. Zero. The only way to resolve the pronoun 364 00:16:34,789 --> 00:16:37,350 is to possess real -world sociological common 365 00:16:37,350 --> 00:16:40,269 sense about politics, protests, and power dynamics. 366 00:16:40,590 --> 00:16:42,929 You cannot write a first -order logic mathematical 367 00:16:42,929 --> 00:16:45,429 rule that says city councils tend to be risk 368 00:16:45,429 --> 00:16:48,429 -averse. Right. You can't code human sociology 369 00:16:48,429 --> 00:16:52,470 into a logic predicate. So if logic fails and 370 00:16:52,470 --> 00:16:55,730 grammar fails, how does a modern AI system actually 371 00:16:55,730 --> 00:16:58,529 solve the Winograd schema? For decades, honestly, 372 00:16:58,730 --> 00:17:01,480 it couldn't. It was a massive roadblock. But 373 00:17:01,480 --> 00:17:03,580 recently, the field broke through using a brute 374 00:17:03,580 --> 00:17:07,140 force neural approach. A landmark 2017 paper 375 00:17:07,140 --> 00:17:09,900 by Lee et al. introduced something called neural 376 00:17:09,900 --> 00:17:12,609 mention ranking. Neural mention ranking. Okay, 377 00:17:12,690 --> 00:17:14,490 if it's ranking mentions, does that mean it's 378 00:17:14,490 --> 00:17:18,650 scoring words like a bracket tournament until 379 00:17:18,650 --> 00:17:20,930 one pronoun wins? How does it assign the points 380 00:17:20,930 --> 00:17:23,269 if it doesn't have common sense? Well, it completely 381 00:17:23,269 --> 00:17:25,730 abandons the attempt to logically parse the sentence. 382 00:17:25,890 --> 00:17:28,269 Instead, the neural network looks at the text 383 00:17:28,269 --> 00:17:30,670 and considers every single possible span of text 384 00:17:30,670 --> 00:17:33,569 as a potential reference. Wait, every span? Every 385 00:17:33,569 --> 00:17:35,390 single one. It looks at every individual word, 386 00:17:35,509 --> 00:17:37,650 then every two -word combination, then every 387 00:17:37,650 --> 00:17:39,809 three -word combination. all the way up to the 388 00:17:39,809 --> 00:17:42,069 entire document link. That is an astronomical 389 00:17:42,069 --> 00:17:44,390 amount of combinations. He creates a massive 390 00:17:44,390 --> 00:17:47,109 combinatorial explosion of potential links between 391 00:17:47,109 --> 00:17:49,890 the pronoun they and every other slice of text 392 00:17:49,890 --> 00:17:52,190 in the document. But that sounds incredibly inefficient. 393 00:17:52,470 --> 00:17:54,829 It's literally looking at the phrase permit because 394 00:17:54,829 --> 00:17:57,769 and testing it if permit because equals they. 395 00:17:57,910 --> 00:17:59,950 Yes, it tests everything. It's just throwing 396 00:17:59,950 --> 00:18:03,089 brute computational muscle at the wall because 397 00:18:03,089 --> 00:18:04,869 we don't know how to teach it human intuition. 398 00:18:05,309 --> 00:18:08,509 It is pure computational muscle. But here is 399 00:18:08,509 --> 00:18:11,490 the profound secret of these massive neural networks. 400 00:18:12,670 --> 00:18:16,349 By analyzing millions of documents and ranking 401 00:18:16,349 --> 00:18:20,450 every possible span of text, the network internalizes 402 00:18:20,450 --> 00:18:23,170 statistical proximities that mimic common sense. 403 00:18:23,349 --> 00:18:25,730 Okay, wait. Explain that. How does math mimic 404 00:18:25,730 --> 00:18:27,529 common sense? Remember that high -dimensional 405 00:18:27,529 --> 00:18:29,880 vector space we discussed? With the galaxies? 406 00:18:30,059 --> 00:18:32,740 Yeah, the embedding space. The mathematical embedding 407 00:18:32,740 --> 00:18:36,259 for the phrase advocating violence ends up physically 408 00:18:36,259 --> 00:18:38,619 closer in that math space to the embedding for 409 00:18:38,619 --> 00:18:41,079 demonstrators than to the embedding for city 410 00:18:41,079 --> 00:18:43,720 council. Wow. So it just fakes it till it makes 411 00:18:43,720 --> 00:18:45,759 it. It doesn't actually know what a protest is, 412 00:18:45,799 --> 00:18:48,119 but it knows the math coordinates for protester 413 00:18:48,119 --> 00:18:50,380 and advocate violence are in the same neighborhood. 414 00:18:50,599 --> 00:18:52,839 Exactly. It simulates sociological knowledge 415 00:18:52,839 --> 00:18:55,259 through pure statistical geometry. That is both 416 00:18:55,259 --> 00:18:58,269 terrifying and amazing. And this spatial tracking 417 00:18:58,269 --> 00:19:01,490 has to happen across entire documents, constantly. 418 00:19:01,849 --> 00:19:04,089 Because a text isn't just a pile of sentences. 419 00:19:04,369 --> 00:19:08,029 It has discourse coherence. Discourse coherence. 420 00:19:08,089 --> 00:19:10,190 Meaning the sentences are glued together for 421 00:19:10,190 --> 00:19:12,930 a reason. Right. Sentences have hidden causal 422 00:19:12,930 --> 00:19:16,609 relationships. A machine has to track the logical 423 00:19:16,609 --> 00:19:20,589 flow like, is this next sentence an elaboration, 424 00:19:20,589 --> 00:19:22,950 a contrast, or a direct result of the previous 425 00:19:22,950 --> 00:19:25,009 one? So let's put this all together and test 426 00:19:25,009 --> 00:19:27,529 the machine's reading comprehension. It has mapped 427 00:19:27,529 --> 00:19:30,069 the vector spaces, extracted the templates, tracked 428 00:19:30,069 --> 00:19:32,630 the pronouns across paragraphs, understood the 429 00:19:32,630 --> 00:19:35,369 coherence. The final exam for all of this is 430 00:19:35,369 --> 00:19:37,589 whether it can answer a direct question right. 431 00:19:37,910 --> 00:19:41,430 Question answering, or QA, is the ultimate crucible. 432 00:19:41,789 --> 00:19:44,210 Because when I go to a search engine now, I don't 433 00:19:44,210 --> 00:19:45,990 want a list of URLs anymore. I don't want to 434 00:19:45,990 --> 00:19:48,150 do the reading. I want the answer bolded at the 435 00:19:48,150 --> 00:19:51,200 very top of my screen. We all do. And the history 436 00:19:51,200 --> 00:19:53,539 of QA goes back much further than you'd think. 437 00:19:53,779 --> 00:19:57,339 Back to 1961 with a system called baseball, which 438 00:19:57,339 --> 00:19:59,319 literally just answered queries about a single 439 00:19:59,319 --> 00:20:01,440 season of baseball games. And later there was 440 00:20:01,440 --> 00:20:03,700 Lunar, which answered questions about moon rocks 441 00:20:03,700 --> 00:20:08,099 for geologists. 1961. How did a 1961 computer 442 00:20:08,099 --> 00:20:10,920 answer a natural language question without vector 443 00:20:10,920 --> 00:20:13,640 spaces or neural networks? Through an agonizing 444 00:20:13,640 --> 00:20:16,400 process called semantic parsing. The engineers 445 00:20:16,400 --> 00:20:18,880 had to write literal code that translated human 446 00:20:18,880 --> 00:20:21,750 English. into rigid database queries. Give me 447 00:20:21,750 --> 00:20:24,289 an example. So if you ask the system, where did 448 00:20:24,289 --> 00:20:26,970 the Red Sox play on July 7th, the system used 449 00:20:26,970 --> 00:20:29,990 handwritten rules to map the word where to a 450 00:20:29,990 --> 00:20:33,109 SQL -like variable, like placeNate, and it mapped 451 00:20:33,109 --> 00:20:36,369 Red Sox to Teeming Red Sox. Okay, but that requires 452 00:20:36,369 --> 00:20:39,549 anticipating every single weird slangy way a 453 00:20:39,549 --> 00:20:42,029 human could possibly ask a question. If someone 454 00:20:42,029 --> 00:20:45,170 asks what stadium hosted the Sox game, the parser 455 00:20:45,170 --> 00:20:46,730 completely breaks because it was looking for 456 00:20:46,730 --> 00:20:48,880 the word where. It breaks instantly. Which is 457 00:20:48,880 --> 00:20:50,700 why the industry eventually abandoned semantic 458 00:20:50,700 --> 00:20:53,039 parsing for general knowledge and moved to information 459 00:20:53,039 --> 00:20:57,500 retrieval based QA or IR based QA. IR based QA. 460 00:20:57,599 --> 00:20:59,960 Is that the classic search engine paradigm? It 461 00:20:59,960 --> 00:21:03,240 is. You don't try to build a massive, perfectly 462 00:21:03,240 --> 00:21:07,119 organized database. You just search the unstructured 463 00:21:07,119 --> 00:21:10,160 chaos of the Internet, find a document that is 464 00:21:10,160 --> 00:21:12,579 statistically relevant to the question, and then 465 00:21:12,579 --> 00:21:15,420 use an extraction algorithm to snip out the exact 466 00:21:15,420 --> 00:21:18,019 sentence that likely contains the answer. So 467 00:21:18,019 --> 00:21:20,319 you're finding the needle in the haystack rather 468 00:21:20,319 --> 00:21:23,099 than trying to organize the entire haystack into 469 00:21:23,099 --> 00:21:26,180 a filing cabinet. Precisely. But. And this is 470 00:21:26,180 --> 00:21:28,619 a massive shift. That paradigm has completely 471 00:21:28,619 --> 00:21:30,940 shattered in the last few years. The textbook 472 00:21:30,940 --> 00:21:33,420 details the rise of language models as knowledge 473 00:21:33,420 --> 00:21:36,099 bases. OK, this is the modern AI stuff. Systems 474 00:21:36,099 --> 00:21:39,059 like BERT or GTT. Yes. They don't necessarily 475 00:21:39,059 --> 00:21:40,900 need to run a search retrieval step anymore. 476 00:21:41,140 --> 00:21:43,019 Unpack the mechanics of that for me. If I ask 477 00:21:43,019 --> 00:21:45,759 a massive language model a trivia question, it 478 00:21:45,759 --> 00:21:48,099 doesn't invisibly search Wikipedia in the background 479 00:21:48,099 --> 00:21:50,319 to find the answer. In their pure form, no, they 480 00:21:50,319 --> 00:21:52,440 do not. Then how does it know? During their training 481 00:21:52,440 --> 00:21:55,920 phase, these math or neural networks read vast, 482 00:21:55,960 --> 00:21:58,319 vast amounts of the Internet. And through the 483 00:21:58,319 --> 00:22:01,019 sheer act of predicting the next word over and 484 00:22:01,019 --> 00:22:03,720 over again, the factual relationships are compressed 485 00:22:03,720 --> 00:22:06,759 and baked directly into the billions of mathematical 486 00:22:06,759 --> 00:22:10,420 weights, or parameters, inside the model itself. 487 00:22:10,720 --> 00:22:13,059 So the facts become part of its brain tissue. 488 00:22:13,259 --> 00:22:15,279 Basically. When you ask it a question, it functions 489 00:22:15,279 --> 00:22:17,859 as a black box oracle. It just generates the 490 00:22:17,859 --> 00:22:20,960 answer from its internal statistical state. Without 491 00:22:20,960 --> 00:22:22,880 looking anything up. If the entire internet is 492 00:22:22,880 --> 00:22:25,559 compressed into mathematical weights, that means 493 00:22:25,559 --> 00:22:28,019 our entire method of retrieving human knowledge 494 00:22:28,019 --> 00:22:30,900 is shifting. It's a seismic shift. Think about 495 00:22:30,900 --> 00:22:33,200 it. With the traditional search engine, I can 496 00:22:33,200 --> 00:22:35,740 look at the URL, I can verify the author, I can 497 00:22:35,740 --> 00:22:37,980 check the date it was published. If I'm asking 498 00:22:37,980 --> 00:22:40,660 a black box oracle that has just digested the 499 00:22:40,660 --> 00:22:42,859 universe, I have no idea where that specific 500 00:22:42,859 --> 00:22:45,579 fact came from. You don't. It is an architectural 501 00:22:45,579 --> 00:22:48,680 trade -off between absolute compression and provenance. 502 00:22:49,279 --> 00:22:53,000 When the model acts as the knowledge base, auditing 503 00:22:53,000 --> 00:22:55,920 the source of a fact becomes incredibly difficult. 504 00:22:56,140 --> 00:22:57,460 And that's why they make things up sometimes, 505 00:22:57,700 --> 00:23:01,380 right? Yes. The model might hallucinate an answer 506 00:23:01,380 --> 00:23:03,559 because the statistical gravity of certain words 507 00:23:03,559 --> 00:23:06,019 pulled it in the wrong direction, not because 508 00:23:06,019 --> 00:23:08,640 it read a false document. The math just steered 509 00:23:08,640 --> 00:23:10,960 it wrong. It's fascinating, but, you know, asking 510 00:23:10,960 --> 00:23:13,440 a single trivia question is really just a ping 511 00:23:13,440 --> 00:23:17,369 and a pong. It's one turn. True human communication 512 00:23:17,369 --> 00:23:20,730 is a continuous dance. It's highly interactive. 513 00:23:20,950 --> 00:23:23,109 We refer back to things we said 10 minutes ago. 514 00:23:23,230 --> 00:23:25,490 We correct ourselves halfway through a sentence. 515 00:23:25,930 --> 00:23:28,910 How do we engineer a machine to hold a multi 516 00:23:28,910 --> 00:23:31,630 -turn conversation without losing its mind? To 517 00:23:31,630 --> 00:23:33,890 do that, we have to enter the realm of dialogue 518 00:23:33,890 --> 00:23:37,049 state architecture. And the origins of chatbots 519 00:23:37,049 --> 00:23:39,750 actually date back to 1966 with a system called 520 00:23:39,750 --> 00:23:42,420 ELISA. Built by Joseph Weissenbaum, right? Yes. 521 00:23:43,039 --> 00:23:46,000 ELIZA simulated a Rugerian psychotherapist. I've 522 00:23:46,000 --> 00:23:47,940 heard of ELIZA. People poured their deepest, 523 00:23:47,960 --> 00:23:50,099 darkest secrets out to this thing, right? Like, 524 00:23:50,119 --> 00:23:51,819 they treated it like a real doctor. Did it actually 525 00:23:51,819 --> 00:23:54,299 understand them? It understood absolutely nothing. 526 00:23:54,519 --> 00:23:57,900 Zero. So how did it trick them? It used simple, 527 00:23:58,019 --> 00:24:00,759 regular expression pattern matching. If a user 528 00:24:00,759 --> 00:24:02,859 typed, I need some help, the code just scanned 529 00:24:02,859 --> 00:24:05,619 for the structure, I need X. Okay, I need X. 530 00:24:05,839 --> 00:24:08,359 When it found a match, it triggered a hard -coded 531 00:24:08,359 --> 00:24:11,170 response template. What would it mean to you 532 00:24:11,170 --> 00:24:14,660 if you got X? So the bot would just output, what 533 00:24:14,660 --> 00:24:16,519 would it mean to you if you got some help? Oh, 534 00:24:16,519 --> 00:24:18,480 wow. It's literally just bouncing the syntax 535 00:24:18,480 --> 00:24:21,880 back like a mirror. Exactly. Weizenbaum was actually 536 00:24:21,880 --> 00:24:24,500 really disturbed by how rapidly people formed 537 00:24:24,500 --> 00:24:27,599 intense emotional bonds with a few lines of script. 538 00:24:27,859 --> 00:24:29,940 Really? He was freaked out by his own creation? 539 00:24:30,579 --> 00:24:33,180 Completely. It revealed a vulnerability in human 540 00:24:33,180 --> 00:24:37,019 psychology. We are biologically hardwired to 541 00:24:37,019 --> 00:24:39,819 project empathy and consciousness onto anything 542 00:24:39,819 --> 00:24:42,279 that successfully mimics conversational turn 543 00:24:42,279 --> 00:24:45,380 -taking. That is so true. But you know, a psychotherapist 544 00:24:45,380 --> 00:24:48,140 bot gets a free pass to just ask endless vague 545 00:24:48,140 --> 00:24:50,799 questions. How does that make you feel? Right. 546 00:24:50,900 --> 00:24:52,359 It doesn't actually have to do anything. But 547 00:24:52,359 --> 00:24:54,500 if I'm trying to book a flight or talk to my 548 00:24:54,500 --> 00:24:56,700 bank, I don't want the bot asking me how I feel 549 00:24:56,700 --> 00:24:58,480 about my checking account. I need it to take 550 00:24:58,480 --> 00:25:02,450 action. How do modern task -oriented bots actually 551 00:25:02,450 --> 00:25:05,569 track a complex conversation? They use a frame 552 00:25:05,569 --> 00:25:08,109 -based dialogue system. It's often called the 553 00:25:08,109 --> 00:25:10,829 GUS architecture, which is the foundational design 554 00:25:10,829 --> 00:25:14,490 that powers things like Siri or automated booking 555 00:25:14,490 --> 00:25:17,309 agents. The GUS architecture. And the core brain 556 00:25:17,309 --> 00:25:19,710 of this architecture is the dialogue state tracker, 557 00:25:19,890 --> 00:25:23,730 or the DST. How does the DST map the conversation? 558 00:25:23,970 --> 00:25:25,710 Is it like the template filling we talked about 559 00:25:25,710 --> 00:25:27,690 earlier with the news articles? Very similar, 560 00:25:27,750 --> 00:25:30,150 yes. It maintains a running tally of the user's 561 00:25:30,150 --> 00:25:33,109 goals. Let's say you call a restaurant bot. The 562 00:25:33,109 --> 00:25:36,710 DST opens a belief state. Domain. Restaurant. 563 00:25:37,269 --> 00:25:39,450 You say you want Italian food, it updates the 564 00:25:39,450 --> 00:25:41,970 state. Cuisine Italian. You ask for something 565 00:25:41,970 --> 00:25:45,930 cheap, it updates. Price. Well, that sounds almost 566 00:25:45,930 --> 00:25:48,329 too clean. When I'm talking to a bot, especially 567 00:25:48,329 --> 00:25:51,190 in like... a noisy airport or on speakerphone, 568 00:25:51,309 --> 00:25:53,309 it rarely understands me perfectly. Which is 569 00:25:53,309 --> 00:25:55,230 the entire challenge of the field. Automatic 570 00:25:55,230 --> 00:25:57,789 speech recognition is fraught with errors. If 571 00:25:57,789 --> 00:26:00,210 you say, I want cheap food, the acoustic model 572 00:26:00,210 --> 00:26:01,890 might mishear you and think you said, I want 573 00:26:01,890 --> 00:26:04,410 sheep food. Cheap food. Right. And the dialogue 574 00:26:04,410 --> 00:26:06,329 state tracker doesn't just blindly write down 575 00:26:06,329 --> 00:26:08,809 sheep in the slot. It maintains a probability 576 00:26:08,809 --> 00:26:11,710 distribution over the entire belief state. What 577 00:26:11,710 --> 00:26:14,190 does that mean in practice? It means it assigns... 578 00:26:14,390 --> 00:26:18,150 It's, say, 90 % confident you want Italian, but 579 00:26:18,150 --> 00:26:20,130 it's 10 % confident you said something entirely 580 00:26:20,130 --> 00:26:23,289 different. It hedges its bets. It's juggling 581 00:26:23,289 --> 00:26:26,309 probabilities in real time. So if it's only 90 582 00:26:26,309 --> 00:26:29,329 % sure, how does it decide what words to actually 583 00:26:29,329 --> 00:26:32,029 say next? Does it guess or does it ask me to 584 00:26:32,029 --> 00:26:34,490 clarify? That decision is governed by what we 585 00:26:34,490 --> 00:26:36,869 call the dialogue policy. And the most sophisticated 586 00:26:36,869 --> 00:26:39,190 way to engineer a dialogue policy is through 587 00:26:39,190 --> 00:26:41,430 reinforcement learning. Reinforcement learning. 588 00:26:41,509 --> 00:26:43,250 We usually hear about that in the context of 589 00:26:43,250 --> 00:26:45,569 AI playing chess or video games, right? Where 590 00:26:45,569 --> 00:26:47,670 the algorithm gets points for winning. Exactly. 591 00:26:47,990 --> 00:26:50,670 But here we model the conversation itself as 592 00:26:50,670 --> 00:26:53,269 a Markov decision process. Walk me through this 593 00:26:53,269 --> 00:26:55,730 Markov decision process. What are the rules of 594 00:26:55,730 --> 00:26:59,130 the game for the bot? Okay. Imagine a movie recommender 595 00:26:59,130 --> 00:27:02,410 bot. It has an action space, a strict menu of 596 00:27:02,410 --> 00:27:04,569 things it is allowed to do. Like its move set 597 00:27:04,569 --> 00:27:07,190 in a video game. Right. It can execute a database 598 00:27:07,190 --> 00:27:10,420 search. it can elicit information asking what 599 00:27:10,420 --> 00:27:13,180 genre do you want or it can confirm information 600 00:27:13,750 --> 00:27:16,009 Did you say comedy? Okay. Those are its three 601 00:27:16,009 --> 00:27:18,710 moves. The bot is turned loose to interact with 602 00:27:18,710 --> 00:27:21,450 millions of simulated users, and it receives 603 00:27:21,450 --> 00:27:24,190 mathematical rewards based on its choices. So 604 00:27:24,190 --> 00:27:27,450 it gets a massive jackpot of points if it recommends 605 00:27:27,450 --> 00:27:30,410 the perfect movie at the end. Yes, a huge positive 606 00:27:30,410 --> 00:27:33,529 reward for a successful task, and a huge negative 607 00:27:33,529 --> 00:27:36,109 penalty if it recommends the wrong movie and 608 00:27:36,109 --> 00:27:38,289 the user hangs up in frustration. Makes sense. 609 00:27:38,809 --> 00:27:42,009 But crucially, the engineers also program a small 610 00:27:42,009 --> 00:27:45,029 negative penalty for every single conversational 611 00:27:45,029 --> 00:27:47,829 turn that passes. Wait, why? Why bleed points 612 00:27:47,829 --> 00:27:50,890 away for just talking? To force efficiency. If 613 00:27:50,890 --> 00:27:54,089 there is no penalty for taking turns, the algorithm 614 00:27:54,089 --> 00:27:57,130 learns a pathological behavior. Extreme caution. 615 00:27:57,289 --> 00:27:59,250 Oh, because it's terrified of making a mistake 616 00:27:59,250 --> 00:28:01,170 and getting the massive penalty. Exactly. It 617 00:28:01,170 --> 00:28:02,849 will just loop the confirmed action endlessly. 618 00:28:03,150 --> 00:28:05,250 Did you say comedy? Are you sure? Do you mean 619 00:28:05,250 --> 00:28:07,809 a funny movie? Can you repeat that? It will drive 620 00:28:07,809 --> 00:28:10,049 the human insane just to mathematically guarantee 621 00:28:10,049 --> 00:28:12,670 it doesn't make a final mistake. I have absolutely 622 00:28:12,670 --> 00:28:15,730 talked to bots that do that. We all have. Conversely, 623 00:28:15,730 --> 00:28:18,690 if the return penalty is too high, if it bleeds 624 00:28:18,690 --> 00:28:21,789 points too fast, the bot becomes terrified of 625 00:28:21,789 --> 00:28:24,089 talking and just blindly guesses a movie after 626 00:28:24,089 --> 00:28:26,589 one sentence, crashing into the massive failure 627 00:28:26,589 --> 00:28:29,549 penalty anyway. So when I am trapped in an infinite 628 00:28:29,549 --> 00:28:31,789 loop on the phone with my bank's automated agent 629 00:28:31,789 --> 00:28:33,740 and it keeps saying... I think you want to check 630 00:28:33,740 --> 00:28:36,519 your balance. Is that correct? I am literally 631 00:28:36,519 --> 00:28:39,339 suffering because an engineer tuned the negative 632 00:28:39,339 --> 00:28:41,960 reward function slightly too low and the bot 633 00:28:41,960 --> 00:28:44,900 is too scared to execute the action. You are 634 00:28:44,900 --> 00:28:48,119 experiencing a poorly optimized Markov decision 635 00:28:48,119 --> 00:28:51,680 process in the wild. Balancing that reward function 636 00:28:51,680 --> 00:28:54,059 to navigate uncertainty without annoying the 637 00:28:54,059 --> 00:28:56,660 user is the hardest tuning problem in dialog 638 00:28:56,660 --> 00:28:58,819 architecture. That explains so much of my life. 639 00:28:59,150 --> 00:29:00,670 Well, we've built the brain now. We've got the 640 00:29:00,670 --> 00:29:02,769 logic, the templates, the probabilities, and 641 00:29:02,769 --> 00:29:05,069 the policy. But right now, this brain is just 642 00:29:05,069 --> 00:29:08,150 silently processing text on a server. It's completely 643 00:29:08,150 --> 00:29:11,630 disembodied. Right. The most fundamental biologically 644 00:29:11,630 --> 00:29:13,910 native form of human interaction is acoustic. 645 00:29:14,529 --> 00:29:17,329 To truly close the loop, the machine must grow 646 00:29:17,329 --> 00:29:20,519 ears and a mouth. This brings us to the final 647 00:29:20,519 --> 00:29:23,220 frontier, the physical reality of chapters 25 648 00:29:23,220 --> 00:29:26,539 and 26. Phonetics, automatic speech recognition, 649 00:29:26,980 --> 00:29:29,759 and text -to -speech. This is where we leave 650 00:29:29,759 --> 00:29:32,660 the abstract math of vector spaces and crash 651 00:29:32,660 --> 00:29:35,440 headfirst into physics and biology. Phonetics 652 00:29:35,440 --> 00:29:38,670 is the study of literal Physical speech sounds. 653 00:29:39,130 --> 00:29:41,250 And the history of speech recognition is just 654 00:29:41,250 --> 00:29:43,809 incredible. The very first machine to recognize 655 00:29:43,809 --> 00:29:45,829 the human voice was actually a children's toy 656 00:29:45,829 --> 00:29:48,910 from the 1920s called Radio Rex. A toy from the 657 00:29:48,910 --> 00:29:51,849 1920s? How did it process audio without a microchip? 658 00:29:51,869 --> 00:29:53,490 Did it have a tiny vacuum tube or something? 659 00:29:53,769 --> 00:29:56,190 No, it was purely mechanical. Radio Rex was this 660 00:29:56,190 --> 00:29:58,670 small celluloid dog sitting inside a little dog 661 00:29:58,670 --> 00:30:01,390 house. He was held inside by an electromagnet 662 00:30:01,390 --> 00:30:03,289 and a spring. Okay, so a spring -loaded dog. 663 00:30:03,490 --> 00:30:05,289 Yes. And the bridge of the electrical circuit 664 00:30:05,289 --> 00:30:07,200 was tuned specifically to... break when it was 665 00:30:07,200 --> 00:30:09,500 hit by acoustic energy at exactly 500 hertz. 666 00:30:09,680 --> 00:30:13,099 Wait, why 500 hertz exactly? Because 500 hertz 667 00:30:13,099 --> 00:30:15,880 happens to be the first acoustic formant, the 668 00:30:15,880 --> 00:30:17,839 resonant physical frequency of the vowel sound, 669 00:30:17,960 --> 00:30:21,720 A, as in the word Rex. Oh my god. So when a child 670 00:30:21,720 --> 00:30:24,640 shouted Rex, the specific physical sound wave 671 00:30:24,640 --> 00:30:27,380 of that vowel vibrated the circuit at 500 hertz, 672 00:30:27,559 --> 00:30:30,140 the current dropped, the spring released, and 673 00:30:30,140 --> 00:30:32,559 the dog physically jumped out of the house. That 674 00:30:32,559 --> 00:30:35,140 is genius, a completely mechanical voice trigger. 675 00:30:35,299 --> 00:30:37,460 But obviously, modern automatic speech recognition 676 00:30:37,460 --> 00:30:40,980 or ASR isn't using springs and magnets. How do 677 00:30:40,980 --> 00:30:43,859 we take a messy, continuous analog sound wave 678 00:30:43,859 --> 00:30:47,039 and chop it up into a digital format that a neural 679 00:30:47,039 --> 00:30:49,240 network can actually read? The modern pipeline 680 00:30:49,240 --> 00:30:52,170 is incredibly complex. First, the analog wave 681 00:30:52,170 --> 00:30:55,470 is sampled, often 16 ,000 times a second, and 682 00:30:55,470 --> 00:30:58,650 quantized into discrete digital numbers. 16 ,000 683 00:30:58,650 --> 00:31:00,829 times a second. That's a lot of data. It is. 684 00:31:00,910 --> 00:31:03,369 But raw audio waves are too chaotic to just feed 685 00:31:03,369 --> 00:31:06,190 to a model. The system has to extract figures 686 00:31:06,190 --> 00:31:08,910 by translating the audio into a spectral representation, 687 00:31:09,470 --> 00:31:11,849 specifically something called a log -mel spectrum. 688 00:31:12,230 --> 00:31:14,109 Break down the log -mel spectrum for me. We're 689 00:31:14,109 --> 00:31:16,289 translating a sound wave into, like, a picture 690 00:31:16,289 --> 00:31:19,720 of frequencies. Essentially, yes. A Fourier transform 691 00:31:19,720 --> 00:31:22,779 mathematically pulls apart the complex sound 692 00:31:22,779 --> 00:31:25,500 wave into its individual frequencies, showing 693 00:31:25,500 --> 00:31:28,539 us how much energy is at 100 Hz, 500 Hz, 2000 694 00:31:28,539 --> 00:31:31,599 Hz, and so on over time. It's like a heat map 695 00:31:31,599 --> 00:31:34,720 of sound. Okay, I can picture a heat map, but 696 00:31:34,720 --> 00:31:37,160 we don't just feed that raw frequency map to 697 00:31:37,160 --> 00:31:39,559 the computer, right? No, we apply the Mel scale 698 00:31:39,559 --> 00:31:42,089 to it. Why add another layer of math? What does 699 00:31:42,089 --> 00:31:44,789 the MEL scale do? Because we have to mimic human 700 00:31:44,789 --> 00:31:47,609 biology. The human cochlea in your inner ear 701 00:31:47,609 --> 00:31:50,289 does not perceive pitch linearly. What do you 702 00:31:50,289 --> 00:31:53,069 mean by linearly? Well, we are incredibly sensitive 703 00:31:53,069 --> 00:31:55,650 to tiny differences in low -pitched sounds. We 704 00:31:55,650 --> 00:31:57,650 can tell the difference between 100 Hz and 200 705 00:31:57,650 --> 00:32:00,910 Hz easily. But we are terrible at distinguishing 706 00:32:00,910 --> 00:32:03,470 between two very high -pitched sounds, like 10 707 00:32:03,470 --> 00:32:06,170 ,000 Hz and 10 ,100 Hz. They just sound like 708 00:32:06,170 --> 00:32:08,230 the same high -pitched squeak to us. Oh, interesting. 709 00:32:08,589 --> 00:32:10,789 The MEL scale mathematically warps the frequency 710 00:32:10,789 --> 00:32:13,789 map to exactly match that nonlinear physical 711 00:32:13,789 --> 00:32:16,609 sensitivity of the human ear. We actually compress 712 00:32:16,609 --> 00:32:18,609 the data by throwing away the high -frequency 713 00:32:18,609 --> 00:32:20,849 differences that humans can't hear anyway. So 714 00:32:20,849 --> 00:32:23,430 we mathematically modeled the biological limitations 715 00:32:23,430 --> 00:32:25,970 of the human ear to make the data cleaner for 716 00:32:25,970 --> 00:32:28,579 the machine. That is brilliant. It really is. 717 00:32:28,740 --> 00:32:30,940 So we have this biologically tuned picture of 718 00:32:30,940 --> 00:32:33,960 the sound. What reads it? We feed those spectral 719 00:32:33,960 --> 00:32:37,079 frames into an encoder -decoder neural network. 720 00:32:37,740 --> 00:32:41,250 But, and this is a big but standard. and coder 721 00:32:41,250 --> 00:32:43,829 -decoders have a fatal flaw for speech. That's 722 00:32:43,829 --> 00:32:46,609 the flaw. A standard model needs to digest the 723 00:32:46,609 --> 00:32:49,529 entire input sequence before it begins generating 724 00:32:49,529 --> 00:32:51,990 the translation. Oh, I see the problem. If I'm 725 00:32:51,990 --> 00:32:54,589 dictating a long text message to my phone, the 726 00:32:54,589 --> 00:32:56,769 standard model would force me to finish my entire 727 00:32:56,769 --> 00:33:00,119 paragraph, stand there in awkward silence, and 728 00:33:00,119 --> 00:33:01,960 wait for the whole thing to process before the 729 00:33:01,960 --> 00:33:04,380 first word pops up on my screen. Exactly. It 730 00:33:04,380 --> 00:33:07,140 creates an unacceptable latency. We need real 731 00:33:07,140 --> 00:33:10,119 -time streaming ASR. We want the words to appear 732 00:33:10,119 --> 00:33:12,559 as we say them. Right. To achieve this, what 733 00:33:12,559 --> 00:33:15,420 do they use? Modern systems use a radically different 734 00:33:15,420 --> 00:33:18,559 mathematical approach called a CTC loss function 735 00:33:18,559 --> 00:33:21,299 connectionist temporal classification. Connectionist 736 00:33:21,299 --> 00:33:24,119 temporal classification? How does CTC solve the 737 00:33:24,119 --> 00:33:26,500 latency problem? Well, the core issue it solves 738 00:33:26,500 --> 00:33:29,400 is an alignment problem. Let's say you say the 739 00:33:29,400 --> 00:33:33,059 word hello. The network processes dozens of tiny 740 00:33:33,059 --> 00:33:35,640 acoustic frames per second. So it might output 741 00:33:35,640 --> 00:33:39,440 the sequence of letters. H -H -H -E -E -L -L 742 00:33:39,440 --> 00:33:41,160 -L -O. Because the sound of each letter stretches 743 00:33:41,160 --> 00:33:43,940 across multiple frames. Right. But how does the 744 00:33:43,940 --> 00:33:46,880 network know if you said hello or if you stuttered 745 00:33:46,880 --> 00:33:49,619 and actually said hello? Oh, I get it. It doesn't 746 00:33:49,619 --> 00:33:51,839 know where one spoken letter ends and a duplicate 747 00:33:51,839 --> 00:33:55,000 spoken letter actually begins. Exactly. CTC solves 748 00:33:55,000 --> 00:33:57,519 this by introducing a blank token, often called 749 00:33:57,519 --> 00:33:59,970 an epsilon. It allows the network to output a 750 00:33:59,970 --> 00:34:02,089 blank state between characters. So the sequence 751 00:34:02,089 --> 00:34:06,150 becomes H -H -H -E blank E -L -L -L blank O. 752 00:34:06,369 --> 00:34:09,110 Ah, so the blank tells it, hey, this is a new 753 00:34:09,110 --> 00:34:11,489 letter. Yes. By using this mathematical trick, 754 00:34:11,590 --> 00:34:13,909 the system can continuously predict the highest 755 00:34:13,909 --> 00:34:16,030 probability letter at every single millisecond, 756 00:34:16,130 --> 00:34:18,090 collapse all the duplicates around those blank 757 00:34:18,090 --> 00:34:20,750 tokens, and stream the clean text to your screen 758 00:34:20,750 --> 00:34:23,670 live word by word as you speak. That is so elegant. 759 00:34:23,809 --> 00:34:26,210 And how do engineers grade this system? Do they 760 00:34:26,210 --> 00:34:29,400 just like count the typos? Basically, yes. The 761 00:34:29,400 --> 00:34:33,300 gold standard metric is word error rate, or where 762 00:34:33,300 --> 00:34:36,500 are. It is an edit distance calculation. Edit 763 00:34:36,500 --> 00:34:39,239 distance. Yeah. You take the machine's transcript 764 00:34:39,239 --> 00:34:41,340 and the perfect human transcript. You mathematically 765 00:34:41,340 --> 00:34:44,500 calculate the absolute minimum number of insertions, 766 00:34:44,500 --> 00:34:46,980 deletions, and substitutions required to fix 767 00:34:46,980 --> 00:34:49,440 the machine's text so it perfectly matches the 768 00:34:49,440 --> 00:34:52,159 human's text. You divide that by the total words, 769 00:34:52,260 --> 00:34:54,139 and you get your error percentage. All right, 770 00:34:54,179 --> 00:34:56,619 so the machine has mastered the ear. It can listen 771 00:34:56,619 --> 00:34:59,099 to us in real time. But a conversation requires 772 00:34:59,099 --> 00:35:02,219 the machine to talk back. Text -to -speech, or 773 00:35:02,219 --> 00:35:05,300 TTS, is the architecture just the ASR system 774 00:35:05,300 --> 00:35:10,289 running in reverse? Modern TTS also uses massive 775 00:35:10,289 --> 00:35:13,969 encoder -decoder neural networks. But the philosophy 776 00:35:13,969 --> 00:35:16,210 and especially the training data are fundamentally 777 00:35:16,210 --> 00:35:18,590 inverted. Inverted how? Think about the goal 778 00:35:18,590 --> 00:35:21,989 of ASR, the listening part. ASR must be speaker 779 00:35:21,989 --> 00:35:23,849 independent. Okay, meaning it has to understand 780 00:35:23,849 --> 00:35:26,130 everyone. Right. To build a robust listening 781 00:35:26,130 --> 00:35:28,070 system, you need tens of thousands of hours of 782 00:35:28,070 --> 00:35:30,150 audio from thousands of different humans. You 783 00:35:30,150 --> 00:35:32,269 need different regional accents, people speaking 784 00:35:32,269 --> 00:35:35,070 in echoey rooms, noisy cars, everything. Because 785 00:35:35,070 --> 00:35:38,369 I want my smart speaker to understand my groggy 786 00:35:38,369 --> 00:35:41,210 morning mumbling just as well as it understands 787 00:35:41,210 --> 00:35:44,210 a news anchor's perfect diction. Exactly. You 788 00:35:44,210 --> 00:35:46,630 want the neural network to learn to aggressively 789 00:35:46,630 --> 00:35:50,010 ignore the unique physical qualities of the voice 790 00:35:50,010 --> 00:35:53,510 and extract only the abstract linguistic meaning. 791 00:35:53,829 --> 00:35:55,869 But text -to -speech is different. Completely 792 00:35:55,869 --> 00:35:58,889 different. TTS must be speaker -dependent. You 793 00:35:58,889 --> 00:36:01,110 absolutely do not want your smart speaker to 794 00:36:01,110 --> 00:36:04,150 sound like an average chaotic blend of 10 ,000 795 00:36:04,150 --> 00:36:06,130 random strangers. Yeah, that would sound terrifying. 796 00:36:06,429 --> 00:36:08,710 You want a distinct, consistent, pleasing persona. 797 00:36:09,110 --> 00:36:11,690 So instead of scraping massive, messy datasets, 798 00:36:12,110 --> 00:36:14,710 TTS models are trained on highly controlled, 799 00:36:14,909 --> 00:36:17,489 pristine datasets from a single professional 800 00:36:17,489 --> 00:36:20,280 voice actor. So quality over quantity. Exactly. 801 00:36:20,480 --> 00:36:23,019 A legendary example in the field is the LJ Speech 802 00:36:23,019 --> 00:36:25,820 Corpus. It consists of about 24 hours of audio 803 00:36:25,820 --> 00:36:28,840 from a single woman, Linda Johnson, reading public 804 00:36:28,840 --> 00:36:30,960 domain books into a high fidelity microphone. 805 00:36:31,300 --> 00:36:33,880 So ASR is like a frantic detective trying to 806 00:36:33,880 --> 00:36:36,800 decipher 10 ,000 different people's messy handwriting, 807 00:36:36,940 --> 00:36:39,179 trying to extract the meaning regardless of the 808 00:36:39,179 --> 00:36:41,670 ink or the cursive style. I love that. But TTS 809 00:36:41,670 --> 00:36:44,170 is like sitting down to practice your own singular 810 00:36:44,170 --> 00:36:46,869 perfect calligraphy. You just want to master 811 00:36:46,869 --> 00:36:50,250 one beautiful, consistent font. That is the perfect 812 00:36:50,250 --> 00:36:53,110 analogy. But executing that calligraphy in real 813 00:36:53,110 --> 00:36:56,130 time introduces massive engineering headaches. 814 00:36:56,650 --> 00:37:00,570 Chapter 26 highlights the agonizing problem of 815 00:37:00,570 --> 00:37:03,119 text normalization. What needs to be normalized? 816 00:37:03,159 --> 00:37:05,019 The machine already knows the text words, right? 817 00:37:05,099 --> 00:37:07,260 It knows the text characters. But text characters 818 00:37:07,260 --> 00:37:09,360 don't map directly to physical mouth movements. 819 00:37:09,579 --> 00:37:11,880 Imagine the system is reading a news article 820 00:37:11,880 --> 00:37:16,340 and it encounters the string 199 space. Okay, 821 00:37:16,460 --> 00:37:19,800 199 pounds. The TTS engine has to execute a rule 822 00:37:19,800 --> 00:37:22,619 to expand pounds and physically pronounce it 823 00:37:22,619 --> 00:37:25,719 199 pounds. Okay, that seems easy enough. Just 824 00:37:25,719 --> 00:37:27,500 write a rule for pounds. Well, what if the string 825 00:37:27,500 --> 00:37:31,210 is $199? Ah. See the problem. Yeah, the dollar 826 00:37:31,210 --> 00:37:32,670 sign is at the very beginning of the string, 827 00:37:32,789 --> 00:37:35,230 but my physical mouth doesn't say the word dollars 828 00:37:35,230 --> 00:37:38,010 until the very end of the number. Exactly. The 829 00:37:38,010 --> 00:37:40,889 system cannot just stream the characters left 830 00:37:40,889 --> 00:37:43,190 to right. It has to look ahead, identify the 831 00:37:43,190 --> 00:37:45,730 symbol, buffer the number in its memory, and 832 00:37:45,730 --> 00:37:47,949 completely rearrange the syntax before it begins 833 00:37:47,949 --> 00:37:50,329 generating the acoustic waveform. It has to read 834 00:37:50,329 --> 00:37:52,829 the future before it can speak the present. Exactly. 835 00:37:53,170 --> 00:37:55,329 And how do you evaluate if it did a good job? 836 00:37:55,510 --> 00:37:58,679 You can't use word error rate. for TTS. Why not? 837 00:37:58,800 --> 00:38:01,619 If it said the right words, isn't it a 0 % error? 838 00:38:01,860 --> 00:38:04,579 Because a robotic monotonous voice might have 839 00:38:04,579 --> 00:38:07,539 a perfect 0 % error rate, but humans will hate 840 00:38:07,539 --> 00:38:10,019 listening to it. Oh, right. Because speech isn't 841 00:38:10,019 --> 00:38:12,619 just data transfer. It has prosody. It has rhythm. 842 00:38:12,760 --> 00:38:16,059 We use pitch to convey sarcasm or urgency. Which 843 00:38:16,059 --> 00:38:18,900 is why TTS evaluation remains stubbornly human. 844 00:38:19,579 --> 00:38:21,800 Engineers use something called mean opinion score, 845 00:38:22,000 --> 00:38:25,670 or MOS. Mean opinion score. How does that work? 846 00:38:25,789 --> 00:38:28,610 They literally play the synthesized audio for 847 00:38:28,610 --> 00:38:30,809 hundreds of human listeners and ask them to rate 848 00:38:30,809 --> 00:38:33,769 how natural, pleasing, and human -like the prosody 849 00:38:33,769 --> 00:38:36,610 sounds on a scale of one to five. The ultimate 850 00:38:36,610 --> 00:38:39,750 metric of success isn't math. It is human feeling. 851 00:38:39,889 --> 00:38:42,289 Human feeling. And that reliance on human feeling 852 00:38:42,289 --> 00:38:44,590 perfectly closes the loop on this entire journey. 853 00:38:45,059 --> 00:38:46,659 It really brings it all together. Let's just 854 00:38:46,659 --> 00:38:48,900 recap the sheer scale of what we've unpacked 855 00:38:48,900 --> 00:38:51,860 today. We started by trying to pin human concepts 856 00:38:51,860 --> 00:38:55,239 to a rigid map using first -order logic and currying. 857 00:38:55,260 --> 00:38:58,119 The robotic arm. Right. Then we abandoned that 858 00:38:58,119 --> 00:39:00,599 map for the geographic probabilities of support 859 00:39:00,599 --> 00:39:03,960 vector machines and massive vector spaces to 860 00:39:03,960 --> 00:39:06,719 solve the ambiguity of words. The galaxies of 861 00:39:06,719 --> 00:39:09,280 meaning. We built algorithms that bootstrap their 862 00:39:09,280 --> 00:39:11,659 own education through distant supervision to 863 00:39:11,659 --> 00:39:14,800 extract facts. We brute forced our way through 864 00:39:14,800 --> 00:39:17,099 the Winograd pronoun puzzle using astronomical 865 00:39:17,099 --> 00:39:19,880 neural ranking. Tracking the context. We watched 866 00:39:19,880 --> 00:39:22,659 search engines evolve from SQL databases into 867 00:39:22,659 --> 00:39:25,360 black box oracles. We tuned the psychological 868 00:39:25,360 --> 00:39:28,199 reward functions of chatbots to balance helpfulness 869 00:39:28,199 --> 00:39:31,059 against annoyance. And finally, we engineered 870 00:39:31,059 --> 00:39:33,739 artificial cochleas to process the logmail spectrum 871 00:39:33,739 --> 00:39:36,619 of our voices, predicting our words in milliseconds. 872 00:39:37,079 --> 00:39:38,940 When you lay it all out like that, it is a staggering 873 00:39:38,940 --> 00:39:41,559 trajectory of human ingenuity. Yeah. We have 874 00:39:41,559 --> 00:39:43,699 essentially reverse engineered our own capacity 875 00:39:43,699 --> 00:39:46,940 for communication. And it leaves me with this 876 00:39:46,940 --> 00:39:49,800 final provocative thought for you, the listener. 877 00:39:50,510 --> 00:39:53,449 As we painstakingly engineer these machines to 878 00:39:53,449 --> 00:39:56,349 decode our slang, to decipher the microvibrations 879 00:39:56,349 --> 00:39:59,070 of our vocal cords, to track our shifting pronouns, 880 00:39:59,329 --> 00:40:02,469 and to map the exact mathematical gravity of 881 00:40:02,469 --> 00:40:05,130 our concepts. We aren't just building faster 882 00:40:05,130 --> 00:40:07,670 software. No, we're doing something much deeper. 883 00:40:07,889 --> 00:40:11,170 We are holding a mirror up to ourselves. To teach 884 00:40:11,170 --> 00:40:13,489 a machine to speak, we have been forced to define 885 00:40:13,489 --> 00:40:15,989 the exact mathematical shape of human thought 886 00:40:15,989 --> 00:40:18,929 and connection. And you have to wonder. When 887 00:40:18,929 --> 00:40:20,650 a machine finally reaches the point where it 888 00:40:20,650 --> 00:40:22,869 understands you perfectly, what will it have 889 00:40:22,869 --> 00:40:25,190 truly learned about what it means to be human? 890 00:40:25,369 --> 00:40:27,590 That is the philosophical horizon of natural 891 00:40:27,590 --> 00:40:29,730 language processing. Thank you for taking this 892 00:40:29,730 --> 00:40:31,789 incredible deep dive into the architecture of 893 00:40:31,789 --> 00:40:34,130 meaning with us. Keep questioning the algorithms 894 00:40:34,130 --> 00:40:36,170 around you, keep learning, and the next time 895 00:40:36,170 --> 00:40:38,010 you casually speak to a machine, pay attention 896 00:40:38,010 --> 00:40:40,369 to the invisible hyperdimensional math of that 897 00:40:40,369 --> 00:40:42,510 conversation. Until next time.