Task Complexity, Interactive
← text notes · Achille, Paolini, Mbeng & Soatto, The Information Complexity of Learning Tasks, their Structure and their Distance. Six widgets. Each one recomputes, in your browser, the same formulas as the scripts in code/.
1. The structure function of random labels
N labels drawn uniformly from |Y| classes. S(t) is the lowest loss reachable with a model of complexity at most t nats. No model can go below the line N ln|Y| − t, since L + K ≥ C(D) ≈ N ln|Y|. The paper's Example 3.5 reaches the line by memorising ⌊t / ln|Y|⌋ points. That works when an oracle numbers the inputs. Without one, the model must also be told which inputs it memorised: ln C(N, m) more nats. Searching over 2t random labelings reaches the line in the large-deviation limit. The right panel adds βt, and its minimum is what the Lagrangian Cβ selects.
2. A double well: the β-minimiser jumps
One weight w with pre-distribution P = N(0, 3²) and post-distribution Q = N(µ, σ²); N = 50. The loss per sample has a wide shallow basin at w = 1 and a narrow deep one at w = 3.5. For each β the page minimises Cβ = N·EQ[loss] + β·KL(Q‖P) over a grid of (µ, σ). Right: the structure function S(t) = min {N·EQ loss : KL ≤ t}, its convex hull, and the line of slope −β that touches it at the optimum. Anneal starts from the global optimum at β = 20 and lowers β to the slider's value, taking ε-local steps (the best grid point within distance ε in (µ, σ)) until they stop moving.
3. Information per weight direction
With P = N(0, λ²I) and the optimal Gaussian Q, each eigen-direction of the Hessian H = N·F carries ½ g(s) nats, where s = λ²h/β and g(s) = log(1+s) − s/(1+s). A flat direction (h = 0) carries nothing. Theorem 5.4 keeps only the large-s form ½(log s − 1). Summed, that is ½ log|F| + ½ k log λ² plus a "O(1)" of ½ k log(N/β) − k/2. The spectrum here has k = 40 directions, with per-sample Fisher eigenvalues j−α, and the last few set to exactly zero.
4. Figure 1, taken apart
The paper's estimated distance matrix, transcribed: entry (row j, column i) is d(task i → task j). If the optimal solutions are unique, Definition 6.1 gives d(i→j) − d(j→i) = Ij − Ii: the antisymmetric part must be a difference of one number per task. The page fits that number, ci = mean over j of [d(j→i) − d(i→j)], and shows what is left.
5. The task distance, solved exactly
Linear-Gaussian regression with k inputs and three weight blocks: shared ws, and one block per task. Task i predicts x·(ws + wi), and the index in D1 ⊔ D2 picks the block. P = N(0, λ²I), noise variance 1, and population design X⊤X = N·I. The optimal Q is the posterior, so the information is exact: I = ‖µ‖²/(2λ²) + ½ Σ g(λ²h/β). The first term depends on the labels. The second, the log-det term, depends only on which directions the data curve and how many samples do it. Task 1's true weights are u1 = e1, and task 2's are u2 = r(cos θ e1 + sin θ e2).
6. The PAC-Bayes bound against β and λ
Theorem 5.5 (McAllester): for β > ½ and a loss in [0, 1], Ltest(Q) ≤ [L̂(Q) + β(KL(Q‖P) + ln 1/δ)/N] / (1 − 1/(2β)). For a loss bounded by Lmax, the condition becomes β > Lmax/2. Left: the multiplier 1/(1 − Lmax/(2β)), with the band where Figure 2's transitions happen. Right: the bound against the prior width λ. The KL at the optimal Gaussian Q uses the spectrum of widget 3 (k = 40 directions, α = 2, no flat ones), with ‖w*‖² = k and a fixed training Gibbs error of 0.15.