YouTube2Text

How Gaussian Processes Measure the Unknown — Transcript

by The Synthetic Mind · 2,586 words · 419 segments · language en · Watch on YouTube

Full transcript

  1. 0:00In the early 1950s, a mining engineer in
  2. 0:03South Africa named Danny Krige was
  3. 0:05dealing with a problem that sounds
  4. 0:07simple until you try to solve it. The
  5. 0:10gold fields around Johannesburg
  6. 0:12stretched for kilometers, but the only
  7. 0:14way to know how much gold was in the
  8. 0:17rock at a particular spot was to drill a
  9. 0:19borehole and test what came up. Each
  10. 0:22borehole was expensive, so the mines
  11. 0:25only had measurements from a small
  12. 0:27number of locations spread across a huge
  13. 0:29area. Somehow, they still had to
  14. 0:31estimate what was happening everywhere
  15. 0:33in between. The obvious approach would
  16. 0:36be to draw a smooth curve through the
  17. 0:38measurements and use that curve to fill
  18. 0:41in the gaps. The problem is that the
  19. 0:43curve looks just as certain halfway
  20. 0:46between two boreholes as it does
  21. 0:48directly on top of one. In one place,
  22. 0:51the value was actually measured, while
  23. 0:53in the other, it was inferred from data
  24. 0:55some distance away. Yet, the curve gives
  25. 0:58no indication that one prediction should
  26. 1:00be trusted more than the other. For a
  27. 1:03mine deciding where to dig, that
  28. 1:05distinction matters enormously. What
  29. 1:08Krige needed was an estimate that also
  30. 1:10kept track of its own uncertainty. Near
  31. 1:13a borehole, where there was real data,
  32. 1:16that uncertainty should be small. As you
  33. 1:18moved farther away into areas that
  34. 1:21hadn't been measured, it should grow.
  35. 1:24The method that developed from this work
  36. 1:26is still used in mining and geology
  37. 1:28today under the name kriging. In
  38. 1:31statistics and machine learning, the
  39. 1:33same underlying mathematics appears in
  40. 1:36Gaussian processes, which are used
  41. 1:38whenever measurements are expensive and
  42. 1:41knowing how uncertain a prediction is
  43. 1:43matters almost as much as the prediction
  44. 1:45itself. The idea is unusual. Rather than
  45. 1:49choosing one curve and declaring it to
  46. 1:51be the answer, a Gaussian process
  47. 1:54considers many different curves that
  48. 1:56could explain the data and assigns
  49. 1:58different probabilities to them. The
  50. 2:01difficulty is that there are infinitely
  51. 2:03many possible curves, and each curve
  52. 2:06contains infinitely many values.
  53. 2:08Somehow, we need a way to describe
  54. 2:11uncertainty over all of them without
  55. 2:13ever having to list them individually.
  56. 2:16To make that possible, start with the
  57. 2:18thing we're trying to estimate. There's
  58. 2:20some unknown function that takes an
  59. 2:22input, such as a position along the
  60. 2:24ground, and gives us an output, such as
  61. 2:27the amount of gold in the rock at that
  62. 2:28position. We can observe the function at
  63. 2:31a few locations by drilling boreholes,
  64. 2:33but everywhere else its value remains
  65. 2:36unknown. A Gaussian process gets around
  66. 2:39this by noticing that we never actually
  67. 2:42need to deal with all the infinitely
  68. 2:44many values of a function at once. At
  69. 2:47any given moment, we only care about a
  70. 2:49finite set of locations, such as the
  71. 2:52boreholes we've already drilled, and the
  72. 2:54new positions where we want predictions.
  73. 2:57Once we restrict ourselves to a finite
  74. 2:59list, the problem becomes one of
  75. 3:01describing several uncertain numbers
  76. 3:03together, and we already have a tool for
  77. 3:05doing that, the multivariate Gaussian.
  78. 3:09Imagine just two positions on the ground
  79. 3:11separated by 100 m. The amount of gold
  80. 3:14at each position is uncertain, so each
  81. 3:17value has its own range of
  82. 3:18possibilities, but the two aren't
  83. 3:20independent. If the rock is unusually
  84. 3:23rich in gold at one position, a nearby
  85. 3:25position is more likely to be rich, as
  86. 3:27well. When we plot the possible values
  87. 3:30at the two locations against each other,
  88. 3:32the likely combinations form a tilted,
  89. 3:34stretched cloud. That tilt tells us how
  90. 3:38strongly the two values are related. If
  91. 3:40we then measure the gold content at the
  92. 3:43first position, the cloud immediately
  93. 3:45tells us which values at the second
  94. 3:47position have become more or less
  95. 3:49plausible. This relationship between
  96. 3:51nearby points is what allows one
  97. 3:54measurement to tell us something about
  98. 3:55places we haven't measured. The next
  99. 3:57problem is deciding exactly how strong
  100. 4:00that relationship should be for any two
  101. 4:02positions.
  102. 4:04That rule is called the kernel or
  103. 4:06covariance function. You give it two
  104. 4:08inputs and it tells you how strongly the
  105. 4:11function values at those two inputs
  106. 4:13should be related. One of the most
  107. 4:15common choices is the squared
  108. 4:18exponential kernel where points close
  109. 4:20together are strongly correlated and
  110. 4:23that correlation gradually fades as the
  111. 4:25distance between them increases. If two
  112. 4:28inputs are at exactly the same position,
  113. 4:31their covariance is as large as it can
  114. 4:33be. Move them farther apart and the
  115. 4:35covariance falls smoothly until
  116. 4:38eventually the two points are far enough
  117. 4:40apart that knowing one tells us almost
  118. 4:43nothing about the other. The kernel
  119. 4:45usually has a few settings that control
  120. 4:48how this happens. One is the signal
  121. 4:50variance, which determines how far the
  122. 4:53function typically wanders away from its
  123. 4:55average value. Another is the length
  124. 4:58scale, which controls how quickly the
  125. 5:00relationship between nearby points fades
  126. 5:03with distance. With a length scale of
  127. 5:06100 m, for example, points 100 m apart
  128. 5:10are still fairly strongly related while
  129. 5:12points 300 m apart may have almost no
  130. 5:16connection at all. With that rule in
  131. 5:18place, we can say precisely
  132. 5:20what a Gaussian process is. It's a
  133. 5:23probability distribution over functions
  134. 5:25with one defining property. Choose any
  135. 5:28finite set of input locations and the
  136. 5:31function values at those locations
  137. 5:33follow a multivariate Gaussian. The
  138. 5:36center of that Gaussian comes from a
  139. 5:37mean function, often chosen to be zero,
  140. 5:41while the covariance between every pair
  141. 5:43of values comes from the kernel.
  142. 5:46We can even see what this looks like
  143. 5:47before collecting any data. Take 200
  144. 5:50positions, calculate the covariance
  145. 5:53between every pair using the kernel, and
  146. 5:55then draw one sample from the resulting
  147. 5:57200 dimensional Gaussian. If we connect
  148. 6:01those sampled values, we get one
  149. 6:03possible curve. Draw again, and we get
  150. 6:06another. A short length scale produces
  151. 6:09curves that change quickly, while a long
  152. 6:11length scale produces smoother curves
  153. 6:14that drift more gradually. Different
  154. 6:16kernels change the character of the
  155. 6:18curves entirely. A periodic kernel
  156. 6:21produces repeating patterns, while a
  157. 6:23Matérn kernel allows rougher functions
  158. 6:25that can look more like real terrain.
  159. 6:28Choosing the kernel is therefore how we
  160. 6:30describe the kinds of functions we think
  161. 6:32are plausible before seeing any
  162. 6:35measurements. That collection of
  163. 6:37possibilities is the prior. Once
  164. 6:39measurements arrive, the probabilities
  165. 6:42of those possible functions begin to
  166. 6:44change.
  167. 6:45Suppose we drill one borehole at
  168. 6:47position zero. To keep the numbers
  169. 6:50simple, we'll measure gold content
  170. 6:52relative to the average for the area, so
  171. 6:54zero means average, and we'll use a
  172. 6:57signal variance of one with a length
  173. 6:59scale of 100 m. The borehole returns a
  174. 7:03value of two, meaning the rock there is
  175. 7:05well above average. Now, consider a
  176. 7:07point 100 m away.
  177. 7:09Before drilling the borehole, our belief
  178. 7:12about the values at these two positions
  179. 7:14formed that tilted Gaussian cloud with a
  180. 7:16correlation of about .6. Once we learn
  181. 7:20that the value at the first position is
  182. 7:22two, we're no longer interested in the
  183. 7:25whole cloud. We only care about the
  184. 7:27slice where the first value equals two.
  185. 7:30A slice through a multivariate Gaussian
  186. 7:33is still Gaussian, so the value at 100 m
  187. 7:36now has its own ordinary bell curve. Its
  188. 7:39mean is the correlation multiplied by
  189. 7:42the observed value, giving 6 * 2 or
  190. 7:45about 1.2. Its variance is 1 minus the
  191. 7:49square of that correlation, which comes
  192. 7:51to roughly .6. So, the prediction is
  193. 7:53centered around 1.2 with an uncertainty
  194. 7:56of roughly .8. The same calculation can
  195. 7:59be repeated anywhere along the ground.
  196. 8:01Right at the borehole, the correlation
  197. 8:03is 1, so the prediction matches the
  198. 8:06measured value exactly and the
  199. 8:08uncertainty falls to zero. Far away, the
  200. 8:11correlation approaches zero, so the
  201. 8:13prediction drifts back toward the prior
  202. 8:15average, and the uncertainty returns to
  203. 8:17what it was before the measurement. If
  204. 8:19we calculate that at every position, the
  205. 8:22mean curve rises toward the borehole
  206. 8:25value and gradually falls back toward
  207. 8:27zero on either side. The uncertainty
  208. 8:30band does the opposite. It narrows as we
  209. 8:33approach the measurement, closes
  210. 8:35completely at the borehole, and opens
  211. 8:37again as we move away. Now, add a second
  212. 8:40borehole at 200 m with a reading of
  213. 8:42minus one. The point at 100 m is now
  214. 8:45influenced by both measurements, one
  215. 8:48high and one low, so its predicted value
  216. 8:51moves somewhere between them. Its
  217. 8:53uncertainty also shrinks because we're
  218. 8:54no longer estimating it from only one
  219. 8:57side.
  220. 8:58This works for any number of boreholes
  221. 9:00because Gaussians have a particularly
  222. 9:02useful property. If a collection of
  223. 9:04values follows a multivariate Gaussian
  224. 9:07and we observe some of those values, the
  225. 9:09ones we haven't observed still follow
  226. 9:11another multivariate Gaussian. Its new
  227. 9:14mean and covariance can be calculated
  228. 9:17directly, so there's no need to search
  229. 9:19through possible curves or approximate
  230. 9:22the answer numerically. The prediction
  231. 9:24for the mean comes from three pieces.
  232. 9:27First, we calculate how strongly the new
  233. 9:29point is related to each borehole, which
  234. 9:32tells us how relevant each measurement
  235. 9:34should be. Then, we account for how
  236. 9:36strongly the boreholes are related to
  237. 9:38one another. So, nearby measurements
  238. 9:41that mostly repeat the same information
  239. 9:43don't get counted independently.
  240. 9:45Finally, we combine those relationships
  241. 9:48with the actual measurements. The result
  242. 9:50is a weighted combination of the
  243. 9:52observed values, where the weights
  244. 9:55depend both on how relevant each
  245. 9:57borehole is and how redundant it is with
  246. 9:59the others. In geostatistics, those are
  247. 10:02the kriging weights. The uncertainty is
  248. 10:05calculated in a similar way, starting
  249. 10:07from how uncertain we were before
  250. 10:10collecting any data and subtracting the
  251. 10:11uncertainty that the measurements have
  252. 10:13removed. One useful consequence is that
  253. 10:16the measured gold values themselves
  254. 10:19don't determine this uncertainty. Once
  255. 10:21the kernel is fixed, it depends on where
  256. 10:23the boreholes are located rather than
  257. 10:25what they found. That means we can ask
  258. 10:28how much a new borehole would reduce our
  259. 10:30uncertainty before drilling it. We don't
  260. 10:33know what value the borehole will return
  261. 10:35yet, but we already know how much
  262. 10:37information its location is expected to
  263. 10:39provide. Real measurements aren't
  264. 10:41perfect though, so we usually don't want
  265. 10:44to treat every observation as exact. If
  266. 10:46a borehole measurement contains noise,
  267. 10:49that uncertainty can be added directly
  268. 10:51into the covariance matrix. Once we do
  269. 10:53that, the fitted mean no longer has to
  270. 10:56pass exactly through every measurement,
  271. 10:59and the uncertainty no longer falls all
  272. 11:01the way to zero at the observed points
  273. 11:03because even a measurement taken there
  274. 11:05may contain some error. The settings of
  275. 11:08the kernel, including the length scale
  276. 11:10and signal variance, can also be learned
  277. 11:13from the data. For any particular
  278. 11:15choice, we can calculate how plausible
  279. 11:18the measurements would have been under
  280. 11:19the resulting Gaussian process.
  281. 11:22That quantity is called the marginal
  282. 11:24likelihood. If the length scale is much
  283. 11:27too long, the model expects functions
  284. 11:29that change very slowly, so a set of
  285. 11:32measurements that rises and falls
  286. 11:34quickly becomes unlikely. If the length
  287. 11:37scale is much too short, the model can
  288. 11:39explain almost any pattern, but it
  289. 11:42spreads probability across so many
  290. 11:44possible functions that the exact
  291. 11:47measurements we happen to observe are
  292. 11:49still not especially likely. Somewhere
  293. 11:51between those extremes is a value that
  294. 11:53explains the data without making the
  295. 11:56model unnecessarily flexible. Maximizing
  296. 11:59the marginal likelihood finds that
  297. 12:01balance automatically. Once those pieces
  298. 12:04are in place, the Gaussian process gives
  299. 12:06us both a prediction and an uncertainty
  300. 12:08around it. And that uncertainty can be
  301. 12:10used to decide where another measurement
  302. 12:13would be most valuable.
  303. 12:15That's the idea behind Bayesian
  304. 12:16optimization. Imagine training a large
  305. 12:19neural network and trying to choose a
  306. 12:21setting such as the learning rate, where
  307. 12:24each training run takes an entire day.
  308. 12:27Trying thousands of possibilities isn't
  309. 12:30realistic. So, every new experiment
  310. 12:32needs to teach us as much as possible.
  311. 12:35We can treat the network's final
  312. 12:37performance as an unknown function of
  313. 12:40the learning rate and fit a Gaussian
  314. 12:42process to the trials we've already run.
  315. 12:45At any new setting, the model gives us
  316. 12:48two things: an expected performance and
  317. 12:51an uncertainty around that expectation.
  318. 12:54Choosing the next experiment becomes a
  319. 12:56balance between exploiting what already
  320. 12:59looks good and exploring what we still
  321. 13:01know very little about. A learning rate
  322. 13:04with a high predicted score is
  323. 13:05attractive because it may already be
  324. 13:08close to the best setting, but a
  325. 13:10different region with a lower prediction
  326. 13:13and much greater uncertainty can also be
  327. 13:15worth testing because there may be
  328. 13:17something better hiding there. One
  329. 13:19common way to balance those two
  330. 13:21possibilities is the upper confidence
  331. 13:24bound. At each point, we take the
  332. 13:26predicted mean and add some multiple of
  333. 13:29the uncertainty. A point can therefore
  334. 13:31look promising because its expected
  335. 13:34value is high, because we're very
  336. 13:36uncertain about it, or because of some
  337. 13:38combination of the two. The next
  338. 13:41experiment is run wherever that total is
  339. 13:43largest. Early on, when very little has
  340. 13:47been measured, the uncertainty is large
  341. 13:49across much of the space, and the
  342. 13:51experiments tend to spread out. As more
  343. 13:54results arrive, uncertainty shrinks
  344. 13:57around the regions we've already tested,
  345. 13:59and attention gradually shifts toward
  346. 14:01the areas that appear most promising. In
  347. 14:04problems where every experiment is
  348. 14:06expensive, this can find a strong
  349. 14:08setting with far fewer trials than
  350. 14:10testing a dense grid of possibilities.
  351. 14:13These problems all share an important
  352. 14:15feature. Collecting each new measurement
  353. 14:18is expensive, so the number of
  354. 14:20observations tends to remain fairly
  355. 14:22small. That's also where Gaussian
  356. 14:24processes are most practical because
  357. 14:27their computational cost starts rising
  358. 14:29quickly as the amount of data grows.
  359. 14:32The main computational problem comes
  360. 14:34from the covariance matrix, which has
  361. 14:37one row and one column for every
  362. 14:39observation. Working with that matrix
  363. 14:42requires an amount of computation that
  364. 14:44grows roughly with the cube of the
  365. 14:46number of data points. So, increasing
  366. 14:49the data set by a factor of 10 can
  367. 14:51increase the main computational cost by
  368. 14:54about a factor of 1,000. That makes the
  369. 14:57exact method very attractive for
  370. 15:00hundreds or thousands of observations,
  371. 15:02but much harder to use when the data set
  372. 15:04reaches hundreds of thousands or
  373. 15:06millions. Larger applications usually
  374. 15:09rely on approximations, often by
  375. 15:11representing the full data set using a
  376. 15:14smaller collection of strategically
  377. 15:16chosen locations called inducing points.
  378. 15:19There's also a more fundamental
  379. 15:20limitation. Every prediction depends on
  380. 15:23the assumptions built into the kernel.
  381. 15:25If we choose a kernel that expects the
  382. 15:28function to vary smoothly, but the real
  383. 15:30world contains a sharp discontinuity,
  384. 15:33the model may smooth straight across it.
  385. 15:36A geological fault, for example, could
  386. 15:39cause an ore deposit to end abruptly,
  387. 15:42while a smooth kernel might continue the
  388. 15:44prediction across the boundary and still
  389. 15:47report fairly narrow uncertainty. So,
  390. 15:50the error bars aren't automatically
  391. 15:52trustworthy just because a Gaussian
  392. 15:54process produced them. They're
  393. 15:56meaningful only to the extent that the
  394. 15:58assumptions behind the model are
  395. 16:01reasonable. The number of input
  396. 16:03variables creates another difficulty.
  397. 16:05Along a single line or across a
  398. 16:08two-dimensional map, measurements can
  399. 16:10cover the space fairly well. As the
  400. 16:12number of dimensions grows, however, the
  401. 16:15amount of space grows with it, and
  402. 16:17observations become increasingly sparse.
  403. 16:20Points that once looked clearly close or
  404. 16:22far apart can also become harder to
  405. 16:25distinguish based on distance alone.
  406. 16:28Underneath all of the covariance
  407. 16:30matrices, kernels, and probability
  408. 16:33distributions, though, the central idea
  409. 16:35is simple. Instead of committing to one
  410. 16:38fitted curve, a Gaussian process keeps
  411. 16:40track of many functions that could
  412. 16:43plausibly explain the data. Near
  413. 16:45measurements, those possibilities are
  414. 16:47forced to agree, so the prediction
  415. 16:49becomes precise.
  416. 16:51Far from the data, they spread apart,
  417. 16:53and the uncertainty grows with them.
  418. 16:55Thank you for watching. If you enjoyed
  419. 16:57this video, please consider subscribing.

About this transcript

This page contains the full transcript of How Gaussian Processes Measure the Unknown by The Synthetic Mind, generated from the public captions YouTube serves with the video. The transcript has 2,586 words across 419 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.

What you can do with it

Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.

Free YouTube transcript tool

YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.