Informal notes

Singular Learning Theory: Basics

These are informal notes I originally sketched on my iPad while reading a variety of sources on SLT, starting primarily with Zach Furman's lectures at the Iliad intensive in Berkeley in August 2026; any errors are mine, or transcription errors by Claude, which I asked to turn my handwritten notes and figures into this interactive page, so there may also be some notational clashes. Since I spent so much time writing these notes, this transcription is primarily meant for self-reference, and I'm making it public in case it is helpful to anyone else. Much of it may be rewriting things that seem obvious, but that is just the way I wrote stuff down explicitly and thought about things.

Siddharth Setlur · September 2026
DefinitionIntuitionExampleRemarkLooking aheadDerivation (click to expand)

Notation

SymbolMeaningComment
$\X$sample space of training datameasurable space
$x$single training datum$x\in\X$
$q(x)$true distribution, unknownprobability density on $\X$
$\Dn=\{x_1,\dots,x_n\}$dataset of size $n$ drawn i.i.d. from $q$training data
$n$sample size
$W\subset\R^d$parameter space, $W$ compactthe collection of weights of a transformer, e.g. attention, MLP etc.
$w$$w\in W$a specific choice of parameter, e.g. a setting of the attention and MLP weights in a transformer
$d$$\dim W$
$\pw$for each $w\in W$, a distribution on $\X$. Called a model.p.d.f. on $\X$ for each parameter $w$. The map $w\mapsto\pw$ is the parameter–function map.
$\varphi(w)$prior on $W$density on $W$
$s(x,w)=\gr_w\log p(x|w)$score, the gradient of the log-likelihoodvector in $\R^d$. A function of $x$ and $w$!
$I(w)$Fisher information at $w\in W$see
$L_n(w)=\sum_{i=1}^n\log p(x_i|w)$log-likelihood of $\Dn$ at parameter $w$random function on $W$. (Watanabe's $L_n(w)$ is the average negative log-likelihood, $-\frac1n L_n(w)$ in our notation.)
$\ell(w)=\E_q[\log p(x|w)]$ $=\int_\X\log p(x|w)\,q(x)\dd x$population log-likelihooddeterministic function on $W$. $\ell(w)$ is purely theoretical, since $q$ is unknown.
$K(w)=\KL(q\,\|\,\pw)$population lossdeterministic on $W$. The loss landscape of $W$. This function's geometry is our object of study.
$K_n(w)=\frac1n\sum_{i=1}^n\log\frac{q(x_i)}{p(x_i|w)}$empirical lossrandom on $W$, $\E[K_n]=K$
$\Wz=\argmin_w K(w)$optimal parameter set
$\eps$KL-sublevel threshold
$V(\eps)=\int_{K(w)<\eps}\varphi(w)\dd w$volume function
$\lambda$real log canonical threshold (RLCT)
$m$multiplicity of $\lambda$see
$\Zn=\int_W\prod_{i=1}^n p(x_i|w)\,\varphi(w)\dd w$ $=\prod_{i=1}^n p(x_i|x_1,\dots,x_{i-1})$evidence, marginal likelihoodThis is the distribution of each datum given the context seen so far, updating from the prior one datum at a time: $Z_1=p(x_1)$, $Z_2=p(x_2|x_1)\,p(x_1)$, $Z_3=p(x_3|x_1,x_2)\,p(x_2|x_1)\,p(x_1)$, …
$\Fn=-\log\Zn$ $=-\sum_{i=1}^n\log p(x_i|x_1,\dots,x_{i-1})$free energy
$S_n=-\frac1n\sum_{i=1}^n\log q(x_i)$ $=-\frac1n\log\big(\prod_{i=1}^n q(x_i)\big)$entropy of the true distributionrandom, a property of $q$
$S=-\E_q[\log q(x)]$population entropy$S_n\to S$ as $n\to\infty$
$\pi\in[0,1]$mixture weight
$\beta$inverse temperature
$\Znz=\dfrac{\Zn}{\prod_{i=1}^n q(x_i)}$ $=\int_W e^{-nK_n(w)}\varphi(w)\dd w$normalized evidence, $\Zn$ relative to the truthsee $S_n$ above and
Remarkwhich quantities depend on $q$
  • $\ell,\ K,\ K_n,\ S_n$ depend explicitly on the true distribution $q$.
  • $L_n$ depends on $q$ only implicitly (the data are drawn from $q$).
  • $p(x|w),\ \varphi(w),\ W$ are all independent of $q$.

Note that

$$-\frac1n L_n(w) = K_n(w) + S_n ,$$

since

$$\begin{aligned} \text{LHS}:\ -\frac1n L_n(w) &= -\frac1n\sum_{i=1}^n\log p(x_i|w)\\ \text{RHS}:\ K_n(w)+S_n &= \frac1n\sum_{i=1}^n\log\frac{q(x_i)}{p(x_i|w)} - \frac1n\sum_{i=1}^n\log q(x_i)\\ &= \frac1n\sum_{i=1}^n\Big(\cancel{\log q(x_i)} - \log p(x_i|w) - \cancel{\log q(x_i)}\Big)\\ &= -\frac1n\sum_{i=1}^n\log p(x_i|w) = \text{LHS}. \end{aligned}$$

So $K_n(w)$ is basically $L_n(w)$ up to $S_n$, which does not depend on the model, only on $q$.

The Learning Problem

Setup. A learning problem is a triple $(p,q,\varphi)$:

DefinitionRealizable

There exists $w\in W$ such that $\pw=q(\cdot)$. Equivalently,

$$\Wz:=\{w\in W\mid K(w)=0\}\neq\emptyset .$$

A Bayesian learning machine outputs a distribution on $W$, having seen a dataset $\Dn$:

$$p(w|\Dn)=\frac{\prod_{i=1}^n p(x_i|w)\,\varphi(w)}{\displaystyle\int_W\prod_{i=1}^n p(x_i|w')\,\varphi(w')\dd w'} .$$

The numerator is the likelihood function on $W$. Note that here we vary $w$ and not $x$.

Remark$p(x|w)$ has two slots
  1. Hold $w$ fixed and vary $x$. This yields a distribution on $\X$:
    $$w\longmapsto \pw \qquad\text{and}\qquad \int_\X p(x|w)\dd x = 1 .$$
    This is the parameter–function map.
  2. Hold $x$ fixed and vary $w$:
    $$w\longmapsto p(x|w)\ \text{ for fixed }x,\qquad\text{but}\qquad \int_W p(x|w)\dd w\neq 1 ,$$
    so this is not a distribution on $W$.

We are interested in the loss landscape, i.e. what happens when we vary $w$? What does the geometry look like?

Looking aheadwhy we bother; repeated from

One of the payoffs of building this machinery is that it may offer an explanation for phenomena we see in deep learning, like phase transitions (which are not explained by regular models). Caution: this assumes SGD shares characteristics with Bayesian learning. Completely heuristic, as far as I know.

The loss landscape factorizes

$$W\xrightarrow{\ \Psi\ }\text{Dist on }\X\xrightarrow{\ \eta\ }\R_{\ge 0},\qquad w\longmapsto \pw\longmapsto \KL(q\,\|\,p).$$

Now note that $K(w)=\KL(q\,\|\,\pw)$ trivially factorizes as

$$K = \eta\circ\Psi .$$

$\Psi$ takes $w$ and gives a distribution. $\eta$ measures how far this distribution is from $q$.

Intuitionpulling back the bowl

$\eta$ gives a nice bowl on $\mathrm{Dist}(\X)$ with a unique minimum at $q(x)$. We then pull this bowl back via $\Psi$, which might be degenerate. See :

$$\Wz=\Psi^{-1}(q)=\{w\in W\mid \Psi(w)=q\}.$$
Parameter space W — shaded: {K < ε}, red: W₀ = Ψ⁻¹(q)
Space of distributions on X — level sets of KL(q ‖ ·)
The KL bowl on the space of distributions (right; unique minimum at $q$, dotted level sets) and its pullback to parameter space via $\Psi$ (left). Move $\eps$ to see the level set $\KL(q\|\cdot)=\eps$ on the right and its pullback $\{K<\eps\}$ on the left. $\Wz=\Psi^{-1}(q)$ need not be a point.

The posterior in terms of $K_n$

Derivationposterior in terms of $K_n$expand

Recall $K_n(w)=\frac1n\sum_i\log\frac{q(x_i)}{p(x_i|w)}$. Then

$$e^{nK_n(w)} = e^{\sum_i\log\frac{q(x_i)}{p(x_i|w)}} = \prod_i e^{\log\frac{q(x_i)}{p(x_i|w)}} = \prod_i\frac{q(x_i)}{p(x_i|w)} ,$$

so

$$\prod_i p(x_i|w) = e^{-nK_n(w)}\prod_i q(x_i).$$

Also recall $\Znz=\int_W e^{-nK_n(w)}\varphi(w)\dd w = \Zn\big/\prod_{i=1}^n q(x_i)$. So

$$\int_W\prod_i p(x_i|w')\,\varphi(w')\dd w' = \int_W e^{-nK_n(w')}\prod_i q(x_i)\,\varphi(w')\dd w' = \Znz\cdot\prod_{i=1}^n q(x_i) ,$$

which gives

$$\boxed{\;p(w|\Dn)=\frac{e^{-nK_n(w)}\,\cancel{\prod_i q(x_i)}\,\varphi(w)}{\Znz\cdot\cancel{\prod_{i=1}^n q(x_i)}} = \frac{e^{-nK_n(w)}\,\varphi(w)}{\Znz}\;}$$

A Bayesian learning machine averages over the posterior:

$$\boxed{\;p(x|\Dn)=\int_W p(x|w)\,p(w|\Dn)\dd w\;}$$

The Log-Likelihood and First Geometry

The score (the $w$-derivative of $\ell$)

DefinitionScore
$$s(x,w)=\gr_w\log p(x|w)\in\R^d .$$

For a fixed $x\in\X$, $w\mapsto\log p(x|w)$ is a smooth function on $W$ and $s$ is its gradient. $s(x,w)$ varies with the data, so it is a random vector.

Mean zero property. We have

$$\E_{\pw}[s(x,w)]=0 .$$
Derivationmean zero propertyexpand

Indeed (the same $w$ is required in both places!)

$$\begin{aligned} \E_{\pw}[s(x,w)] &= \int_\X s(x,w)\,p(x|w)\dd x \\ &= \int_\X \gr_w\big(\log p(x|w)\big)\,p(x|w)\dd x \\ &= \int_\X \frac{\gr_w p(x|w)}{\cancel{p(x|w)}}\,\cancel{p(x|w)}\dd x \\ &= \gr_w\int_\X p(x|w)\dd x = \gr_w(1)=0 , \end{aligned}$$

where the last line is measure theory magic to swap $\int$ and $\gr$.

Intuitiona model cannot learn from its own samples

Sample from $p$ and compute the score of $p$ using those samples. The average of these scores is $0$ (the individual scores are not small, only their mean is). You cannot train a model on its own data: zero gradient.

Population loss and $K$

Recall

$$\ell(w)=\E_q[\log p(x|w)]=\int_{x\in\X}\log p(x|w)\,q(x)\dd x ,$$
$$\begin{aligned} K(w)=\KL(q\,\|\,\pw) &= \int_\X q(x)\log\frac{q(x)}{p(x|w)}\dd x\\ &= \underbrace{\int_\X q(x)\log q(x)\dd x}_{\E_q[\log q(x)]} - \underbrace{\int_\X q(x)\log p(x|w)\dd x}_{\E_q[\log p(x|w)]\,=\,\ell(w)} , \end{aligned}$$

so

$$\ell(w) = -K(w) + \underbrace{\E_q[\log q(x)]}_{\text{constant in }w,\text{ killed by }\gr_w} = -K(w) - S .$$

Hence

$$\gr_w\ell(w)=-\gr_w K(w)\qquad\text{and}\qquad \argmin_w K(w)=\argmax_w\ell(w),$$

and

$$\gr_w\ell(w)=\E_q[s(x,w)],\qquad \gr^2_w\ell(w)=\E_q\big[\gr_w^2\log p(x|w)\big].$$
Intuitionsame landscape

It is the same landscape over $w$: the loss landscape $\ell(w)$ is the same as the landscape $K(w)$, except inverted and translated. The curvature of the log-likelihood is minus the curvature of the KL bowl.

Relating empirical and population quantities

Recall :

$$\begin{array}{ccccl} -\dfrac1n L_n(w) & = & K_n(w) & +\ S_n & \quad\text{(empirical)}\\[6pt] \Big\downarrow{\scriptstyle n\to\infty} & & \Big\downarrow{\scriptstyle n\to\infty} & \Big\downarrow{\scriptstyle n\to\infty} & \\[6pt] -\ell(w) & = & K(w) & +\ S & \quad\text{(population)} \end{array}$$
Intuitionwhy we study $K_n$ and $L_n$

We want to study $K(w)$ but can't, due to its explicit dependence on $q$. So instead we study $K_n$, which as $n\to\infty$ approaches $K$ in expectation. $K_n(w)$ also has a $q$ dependence, but only implicitly, and it is $L_n(w)$ up to a constant that is independent of $w$ and fully determined by $q$. So studying $L_n(w)$ as $w$ wiggles is equivalent to studying $K_n(w)$ as $w$ wiggles.

$K(w)$ vanishes up to second order

Let $W\subset\R^d$ be the parameter space. Consider

$$f(\delta)=\KL\big(p(x|w)\,\|\,p(x|w+\delta)\big).$$

Taylor expand in $\delta$ at $\delta=0$. Denote $p_w=\pw$ and $p_{w+\delta}=p(\,\cdot\,|w+\delta)$:

$$f(\delta)\approx \underbrace{f(0)}_{\KL(p_w\|p_w)=0} + \delta^\top\gr_\delta f(\delta)\big|_{\delta=0} + \tfrac12\,\delta^\top\gr^2_\delta f(\delta)\big|_{\delta=0}\,\delta + O(\delta^3).$$
Derivationthe first-order term vanishesexpand
$$\begin{aligned} \gr_\delta f(0) &= \gr_\delta\KL(p_w\,\|\,p_{w+\delta})\big|_{\delta=0} = \gr_\delta\int_\X p(x|w)\log\frac{p(x|w)}{p(x|w+\delta)}\dd x\,\Big|_{\delta=0}\\ &= \underbrace{\gr_\delta\E_{p(x|w)}[\log p(x|w)]\big|_{\delta=0}}_{=0\text{ since there is no }\delta\text{ dependence}} - \gr_\delta\E_{p(x|w)}[\log p(x|w+\delta)]\big|_{\delta=0}\\ &= -\E_{p(x|w)}\big[\gr_\delta\log p(x|w+\delta)\big|_{\delta=0}\big] \qquad\text{(some measure theory nonsense)}\\ &= -\E_{p(x|w)}\big[s(x,w+\delta)\big|_{\delta=0}\big] = -\E_{p(x|w)}[s(x,w)] = 0 \end{aligned}$$

by the mean zero property , since the $w$'s match.

Therefore

$$f(\delta)\approx\tfrac12\,\delta^\top\gr^2_\delta f(\delta)\big|_{\delta=0}\,\delta + O(\delta^3).$$

We call

$$\gr^2_\delta f(\delta)\big|_{\delta=0} = I(w) = -\E_{\pw}\big[\gr^2_w\log p(x|w)\big]$$

the Fisher information matrix. If $p=q$, i.e. $w=\ws$, then $-\E_q[\gr^2_w\log p(x|\ws)]=\gr^2_w K(\ws)$ (see ).

Fisher Information

DefinitionFisher information

Let $w\in W$.

$$I(w):=\E_{\pw}\big[s(x,w)\,s(x,w)^\top\big] = -\E_{\pw}\big[\gr^2_w\log p(x|w)\big] .$$

The first form is the variance of the score $s(x,w)=\gr_w\log p(x|w)$, i.e. the expected variance of the gradients of the log-likelihood. The second form is the expected curvature of the log-likelihood.

ExampleBernoulli

Consider training data $q(x)\sim\mathrm{Ber}(1/4)$, $W\subset[0,1]$, and suppose $w\in W$. Then

$$p(x|w)=w^x(1-w)^{1-x},\quad x\in\{0,1\},\qquad \log p(x|w)=\log w^x+\log(1-w)^{1-x}=x\log w+(1-x)\log(1-w).$$

Then the gradient with respect to $w$ at the true parameter $w_0=1/4$ is

$$\Big[\gr_w\log p(x|w)\Big]_{w=1/4}=\Big[\frac{x}{w}-\frac{1-x}{1-w}\Big]_{w=1/4} =\frac{x}{1/4}-\frac{1-x}{3/4}=4x-\frac{4(1-x)}{3} =\begin{cases}-\frac43 & x=0\\ 4 & x=1\end{cases}$$

Now

$$\begin{aligned}\E\Big[\big[\gr_w\log p(x|w)\big]_{w=1/4}\Big]&=\int_\X\big[\gr_w\log p(x|w)\big]_{w=1/4}\,p(x|w)\dd x\\ &=\Big(-\frac43\Big)\Big(\frac34\Big)+(4)\Big(\frac14\Big)=-\frac{12}{12}+\frac44=0\end{aligned}$$

as expected. But the variance of the score is

$$\Big(\frac14\Big)4^2+\frac34\Big(\frac43\Big)^2=\boxed{\frac{16}{3}} .$$

Alternatively we can consider the curvature of the expected log-likelihood:

$$\E[\log p(x|w)]=\int\log p(x|w)\,q(x)\dd x=\log p(0|w)\cdot\frac34+\log p(1|w)\cdot\frac14=\frac34\log(1-w)+\frac14\log w .$$

Now the curvature of this with respect to $w$, evaluated at $1/4$, is

$$\begin{aligned} \Big[\gr^2_w\E[\log p(x|w)]\Big]_{1/4} &= \gr_w\Big[-\frac{3}{4(1-w)}+\frac{1}{4w}\Big] =\Big[-\frac{3}{4(1-w)^2}-\frac{1}{4w^2}\Big]_{w=1/4}\\ &= -\frac{3}{4\cdot(3/4)^2}-\frac{1}{4\cdot(1/4)^2} = -\frac{\cancel 3}{\cancel 4}\cdot\frac{\cancel 4\cdot 4}{\cancel 3\cdot 3}-\frac{1}{\cancel 4}\times\cancel 4\times 4\\ &= -\frac43-4=\boxed{-\frac{16}{3}} . \end{aligned}$$

Geometry of Fisher

Consider the setting $\ws\in\Wz$, so that $p(x|\ws)=q(x)$. Then recall

$$I(\ws)=\gr^2_w K(\ws).$$
Derivation$I=\gr^2K$ on $\Wz$expand
$$\begin{aligned}\gr^2_w K(\ws) &= -\gr^2\ell(\ws) = -\gr^2_w\E_q\big[\log p(x|\ws)\big]\\ &= -\E_q\big[\gr^2_w\log p(x|\ws)\big] \qquad\text{(dominated convergence, assumed)} .\end{aligned}$$

But $q(\cdot)=p(\,\cdot\,|\ws)$, so this is

$$-\E_{p(\cdot|\ws)}\big[\gr^2_w\log p(x|\ws)\big]\overset{\text{def}}{=} I(\ws).$$

On $\Wz$, $I(w)$ is the curvature of $K$. Consequently (recall from that the first two terms vanish)

$$K(\ws+u)=\tfrac12\,u^\top\gr^2_w K(\ws)\,u+O(\|u\|^3)=\tfrac12\,u^\top I(\ws)\,u+O(\|u\|^3).$$

Geometrically, consider $\{w\in W\mid K(w)<\eps\}$. This is an ellipsoid

$$\{u : u^\top I(w)\,u = 2\eps\}$$

whose semi-axes have lengths $\sqrt{2\eps/\kappa_j}$, determined by the eigenvalues $\kappa_j$ of $I$. ($I(w)$ is positive semi-definite, so all eigenvalues are $\ge 0$.) See .

The contour $K(w)=\eps$ near $\ws$ is an ellipsoid whose semi-axes have lengths $\sqrt{2\eps/\kappa_j}$. The large eigenvalue $\kappa_1$ gives a short axis; the small eigenvalue $\kappa_2$ gives a long, flat direction. Slide $\kappa_2$ to $0$ to see the axis run off.
Intuitionloss budget

Start at $\ws=0$, where $K(\ws)=0$. I give you a loss budget of $\eps$, i.e. I allow $K$ to be up to $\eps>0$. If you perturb $\ws$ in the eigenvector direction corresponding to $\kappa_1$, you will not go far before $K(\ws+u)>\eps$, so the volume of distributions with loss below $\eps$ in that direction is small!

Perturbing in the $\kappa_2$ direction, you can go far before $K(\ws+u)>\eps$, so there is a big volume of distributions with loss below $\eps$ in that direction.

A flat direction!

Looking aheadrepeated from

Seeing more data concentrates the posterior mass, but if you have flat directions the mass remains spread out (unlike the regular case, where you kill posterior mass uniformly, like a bowl).

Singular and Regular Models

DefinitionRegular / Singular

A model is regular if

  1. $w\mapsto\pw$ is injective on $W$;
  2. $I(w)>0$ for all $w\in W$.

Otherwise the model is singular.

Note that $I(w)\ge 0$ for all $w$; (2) is a strictness claim. When $I(w)=0$, it indicates flatness in $K$.

Derivation$I(w)=0$ means a flat directionexpand

Indeed, let $w\in\Wz$. Then as discussed earlier ()

$$\begin{aligned} K(w+tv)&\approx\tfrac{t^2}{2}\,v^\top\gr^2_w K(w)\,v \overset{\text{since }w\in\Wz}{=}\tfrac{t^2}{2}\,v^\top I(w)\,v\\ &=\tfrac{t^2}{2}\,\E_{\pw}\big[v^\top s(x,w)\,s(x,w)^\top v\big] =\tfrac{t^2}{2}\,\E_{\pw}\big[(v\cdot s(x,w))^2\big]. \end{aligned}$$

If $I(w)=0$, then

$$v^\top I(w)\,v=\E_{\pw}\big[(v\cdot s(x,w))^2\big]=0\iff v\cdot s(x,w)=0 .$$

Moving $w$ in the direction $v$ does not change the log-likelihood, i.e. it is a degenerate direction in the loss landscape.

Looking aheadrepeated from

Phase transitions require $\lambda$ to vary. You cannot see them in regular models, where $\lambda=d/2$ is constant.

Three simple examples of different kinds of degeneracies ().

  1. Redundant parameterization. Let $W=[-1,1]^2$, $w\mapsto p(\,\cdot\,|a,b)=\N(a+b,1)$, $q=\N(0,1)$. Then the direction $v=\binom{1}{-1}$ has $v\cdot s\equiv 0$. Indeed
    $$\Wz=\{w\mid K(w)=0\}=\{a+b=0\},$$
    so moving along $\binom{1}{-1}$ has no effect. This degeneracy is fixed by just quotienting out the redundant parameter, though.
  2. Reparameterization. Consider $W=[-1,1]$, $p(x|w)=\N(w^3,1)$, $q\sim\N(0,1)$. Again
    $$\Wz=\{w\in W\mid K(w)=0\}=\{w^3=0\}.$$
    But $\frac{\partial}{\partial w}w^3=3w^2$, which is $0$ at $w=0$, so $I(0)=0$. Simply setting $u=w^3$ removes this degeneracy, though.
  3. Genuine singularities. A degenerate fibre structure with no rescue via smooth transformations. This is where we want to focus!
(1) μ = a+b
(2) K = ½w⁶ vs ½w²
(3) μ = ab
Hover a contour panel to read off $K(a,b)$.
Three kinds of degeneracy. (1) $\mu=a+b$: $\Wz$ is the line $a+b=0$, and $v=(1,-1)$ is a flat direction. (2) $\mu=w^3$: $K=\tfrac12 w^6$ is flatter than quadratic at $0$, so $I(0)=0$, but $u=w^3$ undoes it. (3) $\mu=ab$: $\Wz$ is the axes cross, a genuine singularity at the origin.

Examples of singularities

Setup. Throughout, $q\sim\N(0,1)$, $W=[-1,1]^2$, $\varphi$ uniform, and

$$w\longmapsto p(x|w)=\N(\mu(w),1).$$

The parameter–function map just takes $w$, computes $\mu(w)$, some function of $w$, and uses it as the mean of $\N(\mu,1)$. Therefore

$$K(w)=\tfrac12\big(\mu(w)\big)^2 .$$
Example1: Regular baseline

Here set $W=[-1,1]$ (not $[-1,1]^2$) and $\mu(w)=w$ (the identity). Then

$$K(w)=\tfrac12 w^2,\qquad \Wz=\{w\in W\mid K(w)=0\}=\{0\}.$$

Now

$$\log p(x|w)=\log\frac{1}{\sqrt{2\pi}}\exp\Big(\frac{-(x-w)^2}{2}\Big)=\log\frac{1}{\sqrt{2\pi}}-\frac{(x-w)^2}{2},$$
$$\gr_w\log p(x|w)=x-w,\qquad \gr^2_w\log p(x|w)=-1 ,$$

so

$$I(w)=-\E_{\pw}\big[\gr^2_w\log p(x|w)\big]=-\E_{\pw}[-1]=1 .$$

Since (1) $w\mapsto\N(w,1)$ is injective and (2) $I(w)>0$, the model is regular.

Example2: Symmetric

Go back to $W=[-1,1]^2$ and set $\mu(a,b)=ab$. Then

$$K\big((a,b)\big)=\tfrac12 a^2b^2,\qquad \Wz=\{(a,b):\tfrac12 a^2b^2=0\}=\{ab=0\}=\{a=0\}\cup\{b=0\}$$

(the axes cross; ).

$$\log p(x|a,b)=\log\frac{1}{\sqrt{2\pi}}\exp\Big(\frac{-(x-ab)^2}{2}\Big)=\log\frac{1}{\sqrt{2\pi}}-\frac{(x-ab)^2}{2},$$
$$\gr\log p(x|a,b)=\begin{pmatrix}\gr_a\log p(x|a,b)\\ \gr_b\log p(x|a,b)\end{pmatrix} =\begin{pmatrix}(x-ab)(b)\\ (x-ab)(a)\end{pmatrix}=\begin{pmatrix}xb-ab^2\\ xa-a^2b\end{pmatrix},$$
$$\gr^2\log p(x|a,b)=\begin{pmatrix}-b^2 & x-2ab\\ x-2ab & -a^2\end{pmatrix}.$$

Then $I(a,b)=-\E_{p(x|a,b)}\big[\gr^2\log p(x|a,b)\big]$, and we only need

$$\E_{p(x|a,b)}[x-2ab]=\underbrace{\E_{p(x|a,b)}[x]}_{p\sim\N(ab,1)}-\underbrace{\E_{p(x|a,b)}[2ab]}_{\text{constant in }x}=ab-2ab=-ab ,$$

which gives

$$I(a,b)=\begin{pmatrix}b^2 & ab\\ ab & a^2\end{pmatrix}.$$

Now $I(0,0)=0$, so we have a singularity. If we did

$$K\big(\tbinom00+v\big)\approx\tfrac12 v^\top I\tbinom00\,v=0,$$

this would clearly be false, since off the axes $K\big(\tbinom ab\big)\neq 0$. So there must be some direction of change, e.g. $v=\binom11$. This lives in higher order, unseen by $I$!

Note though that for points on the axes but not at $(0,0)$, $I$ still works. Take e.g. $(a_0,0)$ with $a_0\neq 0$. Then

$$I\tbinom{a_0}{0}=\begin{pmatrix}0&0\\0&a_0^2\end{pmatrix}\neq 0,$$

so

$$K\tbinom{a_0+\delta}{b}\approx\tfrac12(\delta,\,b)\begin{pmatrix}0&0\\0&a_0^2\end{pmatrix}\binom{\delta}{b}=\tfrac12(\delta,\,b)\binom{0}{a_0^2 b}=\tfrac12 a_0^2b^2 .$$

Perturbing $\binom{a_0}{0}$ to $\binom{a_0+\delta}{b}$ causes a loss of $\approx\tfrac12 a_0^2b^2$. $I(w)$ can be used everywhere away from the origin to approximate $K(w+u)$, since it sees everything up to quadratic order and $K$ is not flatter than quadratic away from $(0,0)$!

Example3: Asymmetric

Same setup as , except $\mu(a,b)=ab^2$, so

$$K(a,b)=\tfrac12 a^2b^4 .$$

$\Wz$ is unchanged and is $\{ab=0\}=\{a=0\}\cup\{b=0\}$. But now

$$\log p(x|a,b)=\log\frac{1}{\sqrt{2\pi}}\exp\Big(\frac{-(x-ab^2)^2}{2}\Big)=\log\frac{1}{\sqrt{2\pi}}-\frac{(x-ab^2)^2}{2},$$
$$\gr\log p(x|a,b)=\begin{pmatrix}(x-ab^2)(b^2)\\ (x-ab^2)(2ab)\end{pmatrix}=\begin{pmatrix}xb^2-ab^4\\ 2xab-2a^2b^3\end{pmatrix},$$
$$\gr^2\log p(x|a,b)=\begin{pmatrix}-b^4 & 2xb-4ab^3\\ 2xb-4ab^3 & 2xa-6a^2b^2\end{pmatrix}.$$

The entries that depend on $x$ are

$$\begin{aligned} \E_{p(x|a,b)}[2xb-4ab^3]&=2b\,\E_{p(x|a,b)}[x]-4ab^3=2b\cdot ab^2-4ab^3=-2ab^3,\\ \E_{p(x|a,b)}[2xa-6a^2b^2]&=2a\,\E[x]-6a^2b^2=2a\cdot ab^2-6a^2b^2=-4a^2b^2 , \end{aligned}$$

so

$$I(a,b)=-\E_{p(x|a,b)}\big[\gr^2\log p(x|a,b)\big]=\begin{pmatrix}b^4 & 2ab^3\\ 2ab^3 & 4a^2b^2\end{pmatrix}.$$

$\Wz$ is still the same axes cross, but the behaviour differs on $a=0$ versus $b=0$. In particular:

  1. Let $\big\{\tbinom ab\in W\mid a=0,\ b=b_0\neq 0\big\}\subset\Wz$. Then
    $$I(0,b_0)=\begin{pmatrix}b_0^4&0\\0&0\end{pmatrix}\neq 0\qquad\text{for all }b_0\neq 0 .$$
    So just as in on the $a$-axis, we can (for $a$ and $\delta$ small) write
    $$K\Big(\tbinom{a}{b_0+\delta}\Big)\approx\tfrac12(a,\,\delta)\begin{pmatrix}b_0^4&0\\0&0\end{pmatrix}\binom{a}{\delta} =\tfrac12(a,\,\delta)\binom{ab_0^4}{0}=\tfrac12 a^2b_0^4 .$$
    The eigenvalues are $\kappa_1=b_0^4$ (moving along $a$) and $\kappa_2=0$ (moving along $b$), so $I$ has rank $1$. You can move in the $b$ direction as much as you want, but not in the $a$ direction. An unbounded cylinder! Moving in $a$ is a quadratic volume loss. The only degeneracy is the flat direction in $b$.
  2. Contrast this with $b=0$. Let $\big\{\tbinom ab\in W\mid a=a_0\neq 0,\ b=0\big\}\subset\Wz$. Then
    $$I(a_0,0)=\begin{pmatrix}0&0\\0&0\end{pmatrix}=0\qquad\text{for all }a_0 .$$
    Here $I(a_0,0)$ fails to approximate what happens when you move away from $a_0$, since trivially $\tfrac12 v^\top I\tbinom{a_0}{0}v=0$. However, if we actually compute (for $\delta,b$ small)
    $$K(a_0+\delta,\,b)\approx\tfrac12 a_0^2b^4 ,$$
    so moving off $b=0$, $K$ grows quartically. But $I$ only sees quadratic terms, so it falsely reports $0$!! This is why we want $\lambda$, the LLC.

Note what this means: there is an asymmetry. You can move further from the $b$ axis without growing $K$ much than from the $a$ axis. Growth in $a$ is quadratic, growth in $b$ is quartic. See and .

contours of K; shaded {K < ε}
Vol(ε) = fraction of W with K < ε (log–log)
Sublevel sets $\{K<\eps\}$ for and . Left: tubes around the axes cross $\Wz$. For $K=\tfrac12 a^2b^4$ the tube around the $b=0$ axis is fat (quartic growth in $b$) and the tube around $a=0$ is thin (quadratic growth in $a$). Right: the volume of $\{K<\eps\}$ under the uniform prior, computed numerically, with reference slopes $\eps^{1/2}$ and $\eps^{1/4}$; compare , and see for why the asymmetric case gives $\lambda=\tfrac14$.
(set $\eps = 1/n$)
surviving width vs ε
surviving width at ε = 1/n
How much more extreme $\eps^{1/4}$ is than $\eps^{1/2}$. Left: surviving width against $\eps$ for a quadratic direction ($\eps^{1/2}$) and a quartic direction ($\eps^{1/4}$). Right: the same with $\eps=1/n$ (cf. ).

RLCT and LLC

We saw in that $I(w)$ fails to estimate $K$ near $\ws$ when there are degeneracies (flat directions that grow slower than quadratically). Instead we consider the volume of the sublevel set

$$\{w\in W\mid K(w)<\eps\}.$$
Looking aheadrepeated from

$\lambda\log n$ is a penalization for complexity due to parameters. In the regular case this is constant at $\lambda=d/2$. The idea is that low $\lambda$ means more flatness, which means more posterior volume, which means more parameters achieve the optimum loss.

Some intuition

Recall that the posterior mass is ()

$$p(w|\Dn)\propto e^{-nK_n(w)}\varphi(w).$$

In what follows we replace $K_n$ by $K$. In general $n(K_n-K)=O_p(\sqrt n)$, but relative finite variance makes it $O_p(1)$ on the set $\{K\lesssim 1/n\}$, which is the only region that matters below.

Now observe that if $K(w)>1/n$, then $e^{-nK(w)}<e^{-n\cdot\frac1n}=e^{-1}$. Indeed, as $K(w)$ increases, $e^{-nK(w)}\to 0$. Conversely, as $K(w)\to 0$, $e^{-nK(w)}\to 1$.

Intuitionwhere the posterior mass lives

Essentially, the mass is nontrivial only when

$$K(w)\lesssim\frac1n .$$

Now let $\ws\in\Wz$ and consider a unit vector $u\in\R^d$ and $t<\delta$ small. The question we've been asking over and over again is: what does $K(\ws+tu)$ look like? When $I(\ws)$ is non-degenerate we can use it to estimate this up to order 2, but as we saw, this fails if $K$ vanishes up to order 2 but still contains quartic or higher terms. Now from above,

$$nK(t)\lesssim 1\iff K(t)\lesssim\frac1n .$$

Say $K(t)\approx\tfrac12\kappa t^2$. (This is a direction that would work with $I(w)$, since it is quadratic, and $\kappa$ would be the eigenvalue.) Then

$$\tfrac12\kappa t^2\le\frac1n\iff \boxed{\|t\|\le\sqrt{\frac{2}{\kappa n}}} .$$

In , at a point $(a_0,0)$ on the $b=0$ axis, moving off the axis in the $b$ direction,

$$K(t)\approx\tfrac12\kappa t^4\iff\boxed{\|t\|\le\Big(\frac{2}{\kappa n}\Big)^{1/4}} .$$

How big can $\|t\|$ be so that $K(t)\le\eps$?

$K(t)$ growthSurviving width at level $\eps$Surviving width at $\eps=1/n$Contribution to $\lambda$
$t^2$ (quadratic in $t$)$\eps^{1/2}$$n^{-1/2}$$1/2$
$t^4$ (quartic)$\eps^{1/4}$$n^{-1/4}$$1/4$
$t^{2k}$$\eps^{1/2k}$$n^{-1/2k}$$1/2k$
$K\equiv 0$$O(1)$$O(1)$$0$
Contribution of a direction to $\lambda$, by the order at which $K$ grows along it.

Some remarks.

  1. Column 1 measures the following. Consider a unit vector $u$ and $K(\ws+tu)$. Then we're interested in the set $\{t : K(\ws+tu)<\eps\}$. Now say
    $$K(\ws+tu)\approx\tfrac12\kappa t^{2k}<\eps\iff |t|<\underbrace{\Big(\frac{2\eps}{\kappa}\Big)^{1/2k}}_{\text{width}},$$
    the width of the interval that $t$ can move along before $K(\ws+tu)$ exceeds $\eps$. Now if you multiply the widths across all directions you get the volume $V(\eps)$. At a point where $K$ decouples into a sum over directions, $K\approx\sum_j c_j t_j^{2k_j}$,
    $$\mathrm{width}_j\propto\eps^{1/2k_j}\ \Longrightarrow\ \Vol(\eps)\propto\prod_{j=1}^d\eps^{1/2k_j}\propto\eps^{\sum_j 1/2k_j} ,$$
    and $\lambda=\sum_j\frac{1}{2k_j}$ is just this exponent. Note that the unit vectors are the eigenbasis in the regular case.
  2. Regular means $K(\ws+tu)\approx\tfrac12\kappa t^2$ for all $u$. Note that you might have regular and degenerate directions, e.g. (asymmetry), where at $\ws=(0,b_0)$ the direction $\binom10$ is regular but $\binom01$ is degenerate.
  3. If a model is regular, then every direction $u$ contributes $\tfrac12$ to $\lambda$. There are $\dim W=d$ directions, so
    $$\lambda=d\cdot\tfrac12=\frac d2 .$$
    A singular model has at least one direction where the contribution to $\lambda$ is $<\tfrac12$. So for singular models
    $$\lambda<\frac d2 .$$
Cautionwhen the product rule applies

Multiplying widths, as in , assumes the constraints in the different directions decouple. That holds when $K$ is a sum, $K\approx\sum_j c_j t_j^{2k_j}$: you need every $t_j$ small (an AND). It fails when $K$ is a product, $K\approx c\prod_j t_j^{2k_j}$: you only need the product small (an OR), and then you take a minimum, not a sum:

$$K\approx\sum_j c_j t_j^{2k_j}\ \Rightarrow\ \lambda=\sum_j\frac{1}{2k_j},\qquad K\approx c\prod_j t_j^{2k_j}\ \Rightarrow\ \lambda=\min_j\frac{1}{2k_j}.$$

At the origin of , $K=\tfrac12 a^2b^2$, the sum rule would give $0+0=0$, but the direct integration in gives $\lambda=\tfrac12$. At a generic point of a stratum of $\Wz$ the sum rule does work: at $(a_0,0)$ in it gives $0+\tfrac12=\tfrac12$. The global $\lambda$ is then the minimum over the strata of $\Wz$. For this gives $\lambda=\min\big(\tfrac14\text{ at }(a_0,0),\ \tfrac12\text{ at }(0,b_0)\big)=\tfrac14$, which is what shows numerically.

RLCT

DefinitionRLCT

Let $\eps>0$. Define the volume

$$\Vol(\eps)=\int_{K(w)<\eps}\varphi(w)\dd w\ \propto\ \eps^{\lambda}\Big(\log\frac1\eps\Big)^{m-1} .$$

$\lambda$ is the real log canonical threshold and $m$ its multiplicity [Wat09, Ch. 6].

Intuition

Intuitively, this is literally what we described above ().

ExampleRLCT of the symmetric axes example

Consider the symmetric axes example (), where $w=(a,b)\mapsto p(x|a,b)=\N(ab,1)$. Let $\eps>0$. Then

$$K(w)<\eps\iff\tfrac12 a^2b^2<\eps\iff |ab|<\underbrace{\sqrt{2\eps}}_{\text{call this }c}.$$

Note the symmetry in $(a,b)$, i.e. $|ab|=|-ab|=|a\cdot(-b)|=|(-a)(-b)|$, so we need only consider $(a,b)\in[0,1]^2$. Now

$$\Vol(\eps)=\int_{\{|ab|<c\}\cap[-1,1]^2}\varphi(w)\dd w=4\int_{\{|ab|<c\}\cap[0,1]^2}\varphi(w)\dd w =4\int_0^1\min\Big(1,\frac ca\Big)\dd a ,$$

since for fixed $a\in[0,1]$ (with $a,b$ positive) $|ab|<c\iff b<c/a$, so the region is $b\in[0,\min(1,c/a)]$. Evaluating,

$$4\int_0^1\min\Big(1,\frac ca\Big)\dd a=4\Big(\int_0^c 1\dd a+\int_c^1\frac ca\dd a\Big)=4c\Big(1+\log\frac1c\Big) \propto\eps^{1/2}\log\frac1\eps\quad\Longrightarrow\quad\lambda=\tfrac12,\ m=2 .$$

(Here $\varphi$ uniform means $\varphi\equiv\tfrac14$ on $[-1,1]^2$; the constant does not affect the scaling.) Compare the numerical curve in .

Summary.

ObjectWhat it seesWhat it misses
$I(w)$the coefficient of the order 2 term at a pointdirections flatter than quadratic
$\operatorname{rank}I(w)$the number of non-degenerate directions, i.e. the number of directions that are not flat up to order 2the difference between flat and degenerate, i.e. everything quartic counts as degenerate and would give rank $0$
$\lambda_U$the volume scaling over $U$
What each object sees.

Free Energy

The free energy formula

Recall

$$\Zn=\int_W\prod_{i=1}^n p(x_i|w)\,\varphi(w)\dd w=p(\Dn),\qquad \Fn=-\log\Zn .$$

$\Dn$ is the training data, e.g. pairs $x$ and $y$; $p(\Dn)$ has the $w$-dependence integrated out. $\Fn$ measures how surprised $p$ is by $\Dn$.

Core result.

$$\boxed{\;\Fn=nS_n+\lambda\log n-(m-1)\log\log n+O_p(1)\;}$$

Here $nS_n$ is model independent, $S_n=-\frac1n\sum_{i=1}^n\log q(x_i)$ being the entropy of the data; $\lambda$ is the RLCT and $m$ its multiplicity. This is Watanabe's Main Theorem 6.2 [Wat09, Ch. 6] (in the realizable case). The statement in exactly this form, $F=nL_n(w_0)+\lambda\log n-(m-1)\log\log n+R_n$ with $R_n$ converging in law, is Theorem 2 of [Wat13]; there $L_n(w_0)$ is Watanabe's average negative log-likelihood, which equals $S_n$ when the truth is realizable.

Intuitionreading the free energy formula
  • $\Fn$ low is good: the posterior settles on low loss.
  • $S_n$ is completely determined by the data: the entropy of $\Dn$.
  • $\lambda\log n$ is a penalization for complexity due to parameters. In the regular case this is constant at $\lambda=d/2$. The idea is that low $\lambda$ means more flatness, which means more posterior volume, which means more parameters achieve the optimum loss (note that here we assume the model is realizable, so the optimum is $K(\ws)=0$).
  • $(m-1)$: the multiplicity accounts for multiple degeneracies, which means more flatness, which means more posterior mass near the optimum; we subtract it off since it lowers the free energy.
RemarkBIC
$$\Fn=nS_n+\frac d2\log n$$

is the standard Bayesian Information Criterion, which is what happens in the regular case.

Local RLCT

In all of the above we worked globally on $W$. Now we go local. Take $U\subset W$.

DefinitionLocal quantities
$$\hat K_n(U)=\min_{w\in U}K_n(w),\qquad\text{the best empirical loss with parameters in }U;$$
$$\lambda_U=\text{the RLCT restricted to }U .$$

Its volume scaling tells you how much posterior mass lies within $\eps$ of the minimum.

$$\Fn(U)=n\hat K_n(U)+\lambda_U\log n+O(\log\log n) .$$

The first term measures how well you fit the data, something like a measure of accuracy on the training data. Low $\lambda_U$ means more posterior volume near the optimum (more degenerate or flat directions). See [LLC23] for the local learning coefficient.

Intuitionimportant: flat directions keep the posterior spread out

Seeing more data concentrates the posterior mass, but if you have flat directions the mass remains spread out (unlike the regular case, where you kill posterior mass uniformly, like a bowl). and show exactly this: shrink $\eps$ (think $\eps=1/n$) and the tube around the flat direction barely narrows.

Phase transitions

One of the payoffs of building this machinery is that it may offer an explanation for phenomena we see in deep learning, like phase transitions (which are not explained by regular models).

Caution

This assumes SGD shares characteristics with Bayesian learning. Completely heuristic, as far as I know.

Consider $U_1$ and $U_2$, basins of separated local minima, so that each region's minimum is interior and $\lambda_U$ is well-defined (cutting $W$ arbitrarily would put the minimum on a boundary). Then by

$$\Fn(U_1)-\Fn(U_2)\approx n\big(\hat K_n(U_1)-\hat K_n(U_2)\big)+\big(\lambda_{U_1}-\lambda_{U_2}\big)\log n .$$

A transition requires the two terms to have opposite signs: one region fits worse but is flatter, the other fits better but is stiffer. Then the $\log n$ term dominates at small $n$ and the linear term overtakes it, with the crossover at

$$n^*\,\Delta\hat K=|\Delta\lambda|\log n^* .$$

See . Note that $\hat K_n$ is random, so $n^*$ is a random variable, not a fixed threshold. Note also that different components of $\Wz$ always have $\Delta\hat K=0$, so they give a drift, not a transition; the two axes in are exactly this case.

The linear term $n\Delta\hat K$ against the logarithmic term $|\Delta\lambda|\log n$, and the crossover $n^*$ of .
RemarkNote

Phase transitions require $\lambda$ to vary. You cannot see them in regular models, where $\lambda=d/2$ is constant.

Next time: Estimating $\lambda_U$, the local learning coefficients. Developmental interpretability: using $\hat\lambda_U$ as observables.

References

  1. [Wat09]S. Watanabe. Algebraic Geometry and Statistical Learning Theory. Cambridge Monographs on Applied and Computational Mathematics 25, Cambridge University Press, 2009. RLCT and multiplicity via the zeta function, Chapter 6; the free energy asymptotics, Main Theorem 6.2.
  2. [Wat13]S. Watanabe. A widely applicable Bayesian information criterion. Journal of Machine Learning Research 14 (2013), 867–897. jmlr.org Theorem 2: $F=nL_n(w_0)+\lambda\log n-(m-1)\log\log n+R_n$.
  3. [LLC23]E. Lau, Z. Furman, G. Wang, D. Murfet, S. Wei. The Local Learning Coefficient: A Singularity-Aware Complexity Measure. arXiv:2308.12108, 2023. Local RLCT $\lambda(\ws)$ as a volume-scaling exponent; the local free energy $F_n(B)=nL_n(\ws)+\lambda(\ws)\log n+o_p(\log\log n)$.
  4. [Car23]L. Carroll. Distilling Singular Learning Theory (DSLT), sequence of posts, LessWrong / AI Alignment Forum, 2023. lesswrong.com
  5. [Fur24]Z. Furman. Singular learning theory: exercises. Timaeus blog / LessWrong, 30 August 2024. timaeus.co