Learning That ClicksEpisode 7 / Blur & resolution ── escaping the local minimum

Reading evolution, learning, and mind through a single gradient

Blur it, and the terrain turns smooth Squint at the loss landscape ── blur it with a Gaussian kernel and the shallow valleys melt away,
leaving only the global basin standing out. We grasp what \(\nabla L_\sigma\) — the thing ES was computing last time — really is, and get a grip on σ, the "resolution dial."

Tools you'll need: gradient descent (Ep. 1), Gaussian smoothing (Ep. 6), a little expectation Key idea this time: \(L_\sigma(\theta)=\mathbb{E}_{\varepsilon\sim\mathcal N(0,\sigma^2 I)}\!\left[L(\theta+\varepsilon)\right]\)

In Episode 1 we honestly ruled that the blind ball, seeing only the slope beneath its feet, gets stuck in a shallow valley and can't climb out. Even if a deeper valley sits right next door, it can't tell ── that was the fate of gradient descent. Today we get a tool that loosens this weakness head-on. The watchword is "blur." Smooth away the fine bumps of the terrain, as if squinting, and the shallow valleys vanish, leaving only the truly deep basin. In the language of math, this is convolving the loss \(L\) with a Gaussian kernel. And this very operation is exactly what the evolution strategy ES from last time (Episode 6) was computing, without knowing it: \(\nabla L_\sigma\). The blur strength \(\sigma\) is the dial that sets the resolution at which the learner sees the terrain ── a single knob that brokers a deal between exploration and exploitation.

01Episode 1's unfinished business ── how do we cross a local minimum?

Let's review. Learning means lowering the loss \(L(\theta)\); the update rule is \(\theta\leftarrow\theta-\eta\nabla L(\theta)\). But points where \(\nabla L=0\) are not only the global minimum. Local minima ── dips where the ground beneath you is flat and so you stop, even though a deeper valley lies right next to you ── are everywhere. The blind ball cannot judge on its own whether the valley it's standing in is shallow or deep.

So what do we do? The naive idea is "if only it could see farther." But there's no god who takes in the whole landscape at a glance. So we flip the thinking around ── we remake the terrain itself into something easier to see. Smooth away the fine bumps, and the shallow dips fill in, leaving only the broad-stroke undulations. Doing this "smoothing" rigorously is what blurring = smoothing is.

02What blurring is ── convolution with a Gaussian kernel

To "blur" is to replace the value at each point \(\theta\) with a weighted average of the values in its neighborhood. Nearer points count more, farther points less. Using the Gaussian distribution \(p_\sigma(\varepsilon)=\dfrac{1}{(2\pi\sigma^2)^{n/2}}\exp\!\left(-\dfrac{\|\varepsilon\|^2}{2\sigma^2}\right)\) for these weights gives Gaussian smoothing. We write the smoothed loss as \(L_\sigma\).

Smoothed loss ── blurring L with a Gaussian kernel (the key idea this time)
$$L_\sigma(\theta)\;=\;(L * p_\sigma)(\theta)\;=\;\int L(\theta+\varepsilon)\,p_\sigma(\varepsilon)\,d\varepsilon\;=\;\mathbb{E}_{\varepsilon\sim\mathcal N(0,\sigma^2 I)}\!\left[L(\theta+\varepsilon)\right]$$

The three faces are the same thing. On the left is convolution \(*\) (the language of signal processing), in the middle is an integral (the weighted average itself), and on the right is an expectation ("jitter randomly around \(\theta\) with \(\mathcal N(0,\sigma^2 I)\) and average \(L\)"). The larger \(\sigma\) is, the wider the jitter, so the average draws in points from farther away and the terrain blurs more strongly. That expectation on the right ── you should recognize it. What ES was estimating with samples last time was precisely the gradient of this \(L_\sigma\), namely \(\nabla L_\sigma\).

Connection to Episode 6 ── ES was descending the "blurred terrain" In Episode 6 we showed that the update direction of the evolution strategy ES equals \(\nabla L_\sigma(\theta)=\dfrac{1}{\sigma^2}\,\mathbb{E}_{\varepsilon}\!\left[\varepsilon\,L(\theta+\varepsilon)\right]\) (Stein's identity for the Gaussian). In other words, ES was rolling ── without differentiating ── not on the raw terrain \(L\) but on the terrain \(L_\sigma\) pre-blurred by \(\sigma\). Whereas BP computes the raw \(\nabla L\), what ES computes is always \(\nabla L_\sigma\) ── the perturbation width \(\sigma\) is itself "the resolution at which the terrain is seen." Today we put this \(\sigma\) center stage.

03The three properties of blurring ── why the corners come off

The convolution \(L_\sigma=L*p_\sigma\) has three properties that are the key to escaping local minima.

(1) It becomes arbitrarily smooth. Even if \(L\) is jagged (has points where it can't be differentiated), the Gaussian kernel \(p_\sigma\) can be differentiated infinitely many times. In a convolution you can shift the differentiation onto the smooth side ── \(\nabla^k L_\sigma = L * \nabla^k p_\sigma\) ── so \(L_\sigma\) becomes infinitely differentiable (\(C^\infty\)). Blurring rounds off every corner of the terrain.

(2) Shallow local minima disappear. Averaging over the neighborhood makes thin ridges and shallow dips cancel out and level off. The larger \(\sigma\) is, the wider the range of the average, so the shallowest valleys go first, and in the end only the broad-stroke basin remains. The shallow valley that trapped the ball in Episode 1 gets filled in by blurring.

(3) As \(\sigma\to0\), it returns to the original. When \(\sigma\to0\) the Gaussian kernel collapses into a delta function (\(p_\sigma\to\delta\)), and the averaging range shrinks to a single point, so \(L_\sigma\to L\). Turn the blur to zero and the terrain returns to the raw \(L\). This "can-return" property later becomes the foundation of annealing.

Try it ── "blur" a quadratic by hand

Smoothing the simplest terrain L(θ)=θ² (1D)

$$L_\sigma(\theta)=\mathbb{E}\!\left[(\theta+\varepsilon)^2\right]=\mathbb{E}\!\left[\theta^2+2\theta\varepsilon+\varepsilon^2\right]=\theta^2+2\theta\underbrace{\mathbb{E}[\varepsilon]}_{0}+\underbrace{\mathbb{E}[\varepsilon^2]}_{\sigma^2}=\theta^2+\sigma^2$$

Blurring adds only the constant σ². The gradient doesn't move

$$\nabla L_\sigma(\theta)=2\theta=\nabla L(\theta)$$

Blur a quadratic and the whole terrain simply lifts by \(\sigma^2\); the shape doesn't change. The gradient \(2\theta\) is unchanged regardless of \(\sigma\) ── which is why, for a quadratic, ES's gradient estimate (Stein's identity) becomes a special case that matches the raw gradient \(\nabla L\) exactly. But this is a miracle only because it's a quadratic. On a terrain with several valleys, blurring changes the shape itself ── it melts the shallow valleys. Let's see that in the next figure.

04σ is resolution ── the exploration–exploitation dial

\(\sigma\) is not merely a technical parameter. It is the "resolution" at which the learner (or evolution) sees the terrain. Squint and you see the broad-stroke undulations; peer closely and you see the details ── \(\sigma\) is the dial for that focus adjustment.

The trade-off σ decides
$$\underbrace{\text{large }\sigma}_{\text{hazy big picture}}\;\longleftrightarrow\;\underbrace{\text{small }\sigma}_{\text{sharp detail}}$$

Large \(\sigma\) (exploration). The terrain blurs strongly, the shallow local minima vanish, and the global basin floats up. So the ball escapes shallow valleys and can grasp, in broad strokes, "which region is low." The price is that the true optimum blurs ── the bottom of \(L_\sigma\) generally shifts away from the bottom of the raw \(L\).

Small \(\sigma\) (exploitation). The terrain approaches the raw \(L\), so the optimum is accurate. The price is that all the fine valleys become visible ── you get caught in the nearest local minimum right away.

Look broadly and you won't lose your way but your aim is loose; look closely and your aim is accurate but you fall into traps. This tug-of-war is the exploration–exploitation trade-off. So then ── start large, gradually shrink, right? That's annealing, coming up next.

05Give it a try ── watch the shallow valleys melt

The terrain \(L(\theta)\) below has three valleys. The center is a deep valley (the global minimum), and the left and right are shallow valleys (local minima). The thin curve is the raw \(L\), the thick curve is the blurred \(L_\sigma\). Drag the \(\sigma\) slider to the right and \(L_\sigma\) is recomputed by a numerical convolution that takes the Gaussian-weighted sum over the neighborhood at each grid point, melting the valleys away shallowest-first. With "Roll the ball," you can also watch which basin a ball descending on \(L_\sigma\) settles into.

Figure: a multimodal loss L(θ)=0.10θ²−0.70cos(2.4θ)−0.06θ (thin line) and the same blurred with a Gaussian kernel, Lσ(θ) (thick line). Raise σ and the shallow valleys vanish into a single basin ── with large σ the ball reaches the global basin
raw terrain L(θ) blurred terrain Lσ(θ) ball (descending on Lσ) minima of Lσ

As you raise \(\sigma\), the shallow left and right valleys vanish first, and eventually the terrain becomes a single gentle basin (the number of minima goes \(3\to1\)). In this state, roll the ball from the right edge and it slides into the global basin undisturbed by the valleys along the way ── the shallow valley it couldn't escape in Episode 1 has been filled in by blurring. Note, though, that with too large a \(\sigma\) the bottom of \(L_\sigma\) shifts from center and no longer matches the raw optimum.

06Annealing ── σ from large to small, and on to cosmology

The standard move for getting the best of both exploration and exploitation is annealing. First grasp the global basin with a large \(\sigma\), then gradually lower \(\sigma\) to refine. By property (3), \(L_\sigma\to L\) as \(\sigma\to0\), so in the end you can converge to the bottom of the raw terrain ── the true optimum. Early on you pick the correct basin in broad strokes; late on you settle in and hit the bottom. It's exactly the same idea as annealing metal, cooling it gradually from a high temperature to reduce crystal defects.

Bridge to Cosmology That Clicks ── σ is a "temperature" and a "grain size" Notice here that \(\sigma\) behaves like a temperature. High \(\sigma\) = high temperature = broad exploration; low \(\sigma\) = low temperature = settling to a point. The sister series "Cosmology That Clicks" viewed the universe as a computer with finite resources, reread temperature as an update rate, and drew a picture in which, in an expanding universe, the resolution grows finer with time like \(c\cdot t=\text{const}\). The same picture is here too ── \(\sigma\) is a finite resolution, and seeing the terrain infinitely finely is (given the cost of samples) not possible. The resolution \(\sigma\) at which life sees the terrain is the very grain size of that computer. Annealing (lowering \(\sigma\)) is the learning version of the process by which the universe cools and raises its resolution. Next time we push on to the actual entity that runs this computation at planetary scale.
◇ ◇ ◇

07The verdict ── what blurring can and can't do

Blurring (smoothing) is a powerful practical technique for escaping local minima, but it's no free lunch. Let's rule honestly.

QuestionGaussian smoothing's answerVerdict
Can it escape shallow local minima? Yes. Raise \(\sigma\) and the shallow valleys melt, and the global basin floats up Yes
Is what it finds the optimum of the raw terrain \(L\)? No. At finite \(\sigma\), \(L_\sigma\neq L\) and the position of the bottom shifts (smoothing bias) shifts at finite σ
Even so, can it reach the true optimum? Yes. Anneal toward \(\sigma\to0\) and \(L_\sigma\to L\). But the sample (cost) increases yes if annealed
The honest line ── blurring has no free lunch either

Blurring is a practical technique for escaping local minima, but there's a price. At large \(\sigma\), the true optimum shifts (\(L_\sigma\neq L\)). This can be recovered by annealing to \(\sigma\to0\) ── but a large \(\sigma\) increases the variance of the samples, and so the number of samples needed for a gradient estimate of the same accuracy, that is, the computational cost, goes up. The "freedom to escape shallow valleys" can only be bought in exchange for cost. There is no free lunch.

Even so, this "\(\sigma\) = resolution" viewpoint connects directly to the spine of the series ── life sees, learns, and evolves on the terrain with finite energy (= finite samples). Infinite resolution can't be bought. So then, what is the entity actually running this computation at planetary scale? Next time, we'll name that protagonist.

Practice problems (solvable with this episode's formulas alone)
  1. Find \(L_\sigma(\theta)\), the smoothing of \(L(\theta)=\theta^2+3\theta+5\) (1D) by the Gaussian kernel \(\mathcal N(0,\sigma^2)\). Does the gradient \(\nabla L_\sigma\) match the raw \(\nabla L\)?
    See the answer
    \(L_\sigma(\theta)=\mathbb{E}[(\theta+\varepsilon)^2+3(\theta+\varepsilon)+5]=(\theta^2+\sigma^2)+3\theta+5=L(\theta)+\sigma^2\). It lifts by the constant \(\sigma^2\) only. The gradient is \(\nabla L_\sigma=2\theta+3=\nabla L\), which matches ── for functions that are quadratic (or lower), smoothing does not change the gradient.
  2. A certain 1D terrain has three valleys of differing depth. As you increase \(\sigma\) from \(0\), do they vanish "shallowest-first" or "deepest-first"? Give the reason too.
    See the answer
    Shallowest-first. A local minimum vanishes when the barrier surrounding it (the local maximum) is leveled by blurring and the valley fills in. A shallow valley has a small height difference from its barrier, so it is leveled and vanishes first, at a small \(\sigma\). The deeper and wider the basin, the larger the \(\sigma\) it survives to. You can check this by raising \(\sigma\) in the figure.
  3. Why is annealing (lowering \(\sigma\) from large to small) better than a fixed, medium \(\sigma\)? Explain using properties (2) and (3).
    See the answer
    Early on, the large \(\sigma\) makes shallow valleys vanish by property (2), so you can pick the correct global basin (exploration). Late on, at \(\sigma\to0\), property (3) gives \(L_\sigma\to L\), so you can converge to the true bottom of that basin (exploitation). With a fixed \(\sigma\), too large shifts the bottom (bias) and too small gets caught in shallow valleys ── you can't have both. By taking time to lower \(\sigma\), you obtain exploration and exploitation in sequence.

Episode 7 summaryBlur it, and the shallow valleys melt

The weakness of local minima (Ep. 1) is loosened by "blurring" the terrain (STEP 01). Blurring is convolution with a Gaussian kernel, \(L_\sigma=L*p_\sigma=\mathbb{E}_\varepsilon[L(\theta+\varepsilon)]\), and this is the very terrain of the \(\nabla L_\sigma\) that ES was computing last time (STEP 02). Blurring has three properties ── (1) it becomes infinitely differentiable, (2) shallow local minima vanish, (3) it returns to \(L\) as \(\sigma\to0\) (STEP 03). For a quadratic, smoothing doesn't change the gradient (only a constant \(\sigma^2\) is added), a special case where Stein's estimate matches the raw gradient (calc). \(\sigma\) is the resolution = the exploration–exploitation dial: large is the big picture, small is precise (STEP 04). In the figure, raising \(\sigma\) takes the minima from \(3\to1\) (STEP 05). With annealing (\(\sigma\) large→small) you can grasp the global basin and then refine, and \(\sigma\) resonates with cosmology as temperature and grain size (STEP 06). But a finite \(\sigma\) shifts the bottom, and a large \(\sigma\) eats variance = cost ── no free lunch (STEP 07).

Blurring gave the blind ball the freedom to "squint." But that resolution can only be bought with finite energy. This viewpoint of "seeing and learning on the terrain with finite resources" expands at last to planetary scale next time ── to the vast learning computer that life runs.

This document is Episode 7 of the "Learning That Clicks" series, a reading piece for high-schoolers and undergraduates interested in physics, math, and AI. The smoothed loss \(L_\sigma=L*p_\sigma=\mathbb{E}_{\varepsilon\sim\mathcal N(0,\sigma^2 I)}[L(\theta+\varepsilon)]\), the fact that Gaussian convolution makes its target infinitely differentiable (\(\nabla^k L_\sigma=L*\nabla^k p_\sigma\)), the fact that \(L_\sigma\to L\) as \(\sigma\to0\) since \(p_\sigma\to\delta\), the fact that smoothing a quadratic \(L_\sigma(\theta)=\theta^2+\sigma^2\) leaves the gradient unchanged, and \(\nabla L_\sigma(\theta)=\sigma^{-2}\,\mathbb{E}_\varepsilon[\varepsilon\,L(\theta+\varepsilon)]\) (Stein's identity for the Gaussian, Ep. 6) are all established mathematics. "The shallower a local minimum, the smaller the \(\sigma\) at which it vanishes first" is a qualitative tendency for general smooth multimodal functions; strictly, it depends on the barrier height and valley width. The terrain in this article's figure, \(L(\theta)=0.10\theta^2-0.70\cos(2.4\theta)-0.06\theta\), is an illustrative model, and the positions and depths of the minima and the \(\sigma\) values at which they vanish are numerical guides. The \(L_\sigma\) in the figure is computed by a numerical convolution that normalizes the Gaussian-weighted sum \(\sum_k L(\theta+k\Delta)\exp(-(k\Delta)^2/2\sigma^2)\) at each grid point. The correspondence of annealing to temperature and resolution, and the connection to "Cosmology That Clicks," are offered as functional and conceptual analogies. ── To print, use your browser's "Print" and "Save as PDF" (in the print version the slider and answers are static/hidden).

Print / PDF: ⌘+P (Ctrl+P on Windows). On screen, move "Blur strength σ" to melt the shallow valleys, and use "Roll the ball" to watch a ball descend on Lσ. "See the answer" opens the solutions.