Information in the Weights, Interactive

← text notes · Achille, Paolini & Soatto, Where is the Information in a Deep Neural Network? Four widgets: the Information Lagrangian and its exact minimiser, what temperature does and does not do to flat against sharp minima, the paper's Figure 3 toy rerun in your browser, and which Fisher the activations actually see. Everything is computed on the page.

1. The Information Lagrangian in one dimension

One weight w, a loss with two wells, and a code P = N(0, λ²). The page minimises Cβ(Q) = EQ[L] + β KL(Q‖P) exactly. The minimiser is the Gibbs distribution Q* ∝ P·e−L/β, computed on a grid. It is drawn against two Gaussians centred at the deeper minimum: the corrected Laplace approximation, with variance β/(h + β/λ²), and Proposition 2.5 as printed, with (β/2)/(h + β/2λ²). The right panel traces the optimal (rate, distortion) pairs over β. The Information in the Weights is the rate. The curve's slope at the current point is −β, so the rate is also d(min C)/dβ.

loss L(w) (scaled)code PGibbs Q* (exact optimum)Laplace, correctedProposition 2.5 as printed
Things to try. With a small β, the Gibbs curve and the corrected Laplace curve coincide, and the printed formula is visibly too narrow, about √2 times. Raise β and the optimum starts to spill into the other well. No Gaussian can follow that, and the readout shows the Gaussians' Lagrangian falling behind. Make the right well shallow in curvature but slightly higher, then raise β: the Gibbs mass moves to the flat well. That is the free energy L + (β/2) log h at work. Set the lift to 0 and the two wells share mass in the ratio √(h2/h1) at every small β.

2. Flat and sharp minima under temperature

Overdamped Langevin dynamics dw = −V′(w) dt + √(2T) dW settles into the Gibbs density e−V/T. For two wells, the Eyring–Kramers law (Proposition 2.8) says the time to leave a well is (2π/|λ1|)·√(|V″saddle|/V″min)·eΔV/T. The curvature sits in a prefactor that does not involve T. So when the wells are equally deep, the share of time spent in the sharp one is about √(hflat/hsharp) at every temperature. Temperature only matters through a difference in depth.

V(w)Gibbs density at Tshare in the sharp well, exactLaplace: √(hf/hs)·e−(Vs−Vf)/T share
With the lift at 0, drag T across its whole range: the green curve on the right is flat. The Kramers law gives isotropic noise no extra preference for flat minima at higher temperature when the minima are equally good, which is the usual case at zero training loss. Now lift the flat well a little. Low T sends everything to the sharp, deeper well, and high T moves mass into the flat one. That trade of loss against volume is what the free energy L + (T/2) log|H| encodes.

3. The Figure 3 toy, taken apart

This is the paper's experiment, as rebuilt in code/sgd_toy.py but smaller. A dataset is 100 draws from N(μ, 1) with μ ~ U[−0.8, 0.8], and the model predicts φ(θ). The zigzag φ has 20 linear pieces, steep near 0 and shallow outside, and each piece sweeps [−1, 1], so each holds one global minimum with the same loss. The page runs 120 datasets × 8 runs for 20 000 steps (learning rate 10−4), snaps each run to the minimiser of the piece it ends in, and computes three quantities. The first is the paper's estimator: one Gaussian N(θ*, 1/F) per run, KL to the pooled mixture. The second is I(θ; D), with the runs of a dataset averaged out first (the piece probabilities are pooled over datasets with similar μ, to avoid small-sample bias). The third is H(piece), the entropy of which piece a run reaches.

final θ, this runplain GD (B = 100), same startlog Fisher of each piece
share of runs per piece (0 = steepest)share of the width (isotropic Gibbs)
Press run. It takes a second or two.
Run B = 100, then B = 1. The paper's estimator falls, which is the paper's Figure 3 (centre). But I(θ; D) does not fall at all, and may even rise. The whole drop is in the last column, estimator − I(θ; D), which is H(piece | D): the entropy of which equivalent minimum a run reaches once the data are known. Every piece carries the same 1.5 nats about the data, because in φ-coordinates every Gaussian N(θ*, 1/(N s²)) becomes N(x̄, 1/N) whatever the slope s. The estimator counts which equivalent minimum the seed led to as information. Switch to Langevin and the steep pieces keep their share at every temperature (from the wide start, which is already width-proportional). Only SGD, whose noise scales with the slope, empties them.

4. Which Fisher do the activations see?

This is Definition 3.1 in the smallest possible case. Two weights, one activation z = x·(j1w1 + j2w2), with the readout direction J = (j1, j2) at an angle you choose, scaled by the input size |x|. Weight noise n ~ N(0, βF−1) is the ellipse on the left. It reaches the activation as variance σz² = β·x²·J F−1J⊤, the shadow of the ellipse on the readout line. The information the activation carries about the input scales with the precision 1/σz². Proposition 3.2 as printed uses x²·J F J⊤/β instead.

weight noise β F⁻¹ (1σ)readout direction Jits shadow ±σ_z/|x|
At ρ = 0 and angle 0 the two formulas agree. Raise ρ towards 1 with the readout on w1. The ellipse stretches along the redundant direction, the shadow grows, and the true precision falls like 1 − ρ² (a Schur complement). The printed formula does not move, because it only sees F11. Now drag |x|: doubling the input quarters the true precision (bigger input, bigger noise in z) and quadruples the printed one. Both do scale the same way when you shrink the whole Fisher, which is why the paper's qualitative claim (i) survives.