Post · 30 min read· pp. 719–733

How to do field-theoretic calculations

General references: (Mézard and Montanari 2009; Mei 2021)

When I was studying machine learning theory, I often encounter problems in high-dimensional probability and statistics, and here and there, I would meet with a confusing statement like “let’s do a field-theoretic calculation”. Field theory? I don’t see any gravitational wave or electromagnetic wave!

It turns out that “field-theoretic calculation” does mean something like a field, but in a highly abstracted form. It is not well-described in the literature, and it took me great effort to understand what is going on. The calculations are long, arduous, and filled with opportunities for mistakes.

Still, if you are going to do machine learning theory (as I am), then learning it is a must. This essay is a practical introduction to field-theoretic calculations through detailed examples, including Sanov’s theorem and the analysis of high-dimensional random vectors using overlap matrices. I aim for clarity, pointing out every pitfall that I have fallen into so that you don’t have to.

While the essay assumes familiarity with basic probability, calculus, and linear algebra, it aims to provide a self-contained and accessible introduction to the field. Readers are encouraged to actively engage with the examples, referring back to the provided recipe for field-theoretic calculations as needed.

The recipe of field-theoretic calculations.

Here is the reference. You should not read this directly. Instead, you should go directly to the examples below and refer back to this as you go along.

  1. To calculate: a massive integral of the form

∫⋯∫⏟N→∞, with constraint C(something)dNx\underbrace{\int\cdots\int}_{\text{$N \to \infty$, with constraint $C$}} (\text{something}) d^N x

  1. The constraint CC is handled by introducing a Dirac delta factor:

=ln⁡∫⋯∫⏟N→∞(something)×δ(n)(C′−C)=_{\ln} \underbrace{\int\cdots\int}_{\text{$N \to \infty$}} (\text{something}) \times \delta^{(n)}(C' - C)

where nn is the number of conditions within CC. For example, if the constraint says ∑ixi2=1\sum_i x_i^2 = 1, then n=1n=1. If the constraint also says ∑ijxixj=0\sum_{ij} x_ix_j = 0, then n=2n=2, and so on.

  1. Express the Dirac delta function as a Fourier transform using δ(n)(x)=1(2π)n∫Rne−ixλdλ\delta^{(n)}(x) = \frac{1}{(2\pi)^n}\int_{\mathbb{R}^n} e^{-i x \lambda} d\lambda, then exchange the order of integral.
  2. Put the inner integral into an exponent, and do some rewriting, resulting in something like

=ln⁡∫⋯∫⏟n(something unimportant)eNln⁡∫(⋯ )dNxdnλ=_{\ln} \underbrace{\int\cdots\int}_{\text{$n$}} (\text{something unimportant}) e^{N \ln \int(\cdots)d^N x} d^n\lambda

Define S[λ]:=−ln⁡∫(⋯ )dNxS[\lambda] := -\ln \int(\cdots)d^N x, which is sometimes called the field free energy.

  1. Argue, at large NN, the integral is dominated by the point where ∇S[λ]=0\nabla S[\lambda] = 0. This has many names: method of steepest descent, saddle point method, stationary point method, stationary-phase method, etc.
  2. Write down ∇S=0\nabla S = 0, and give it the fancy name of mean field equation.
  3. Solve the mean field equation to be some λ∗\lambda^*.
  4. Declare the result to be

=ln⁡e−NS[λ∗]=_{\ln} e^{-N S[\lambda^*]}

Here, we use the notation =ln⁡=_{\ln} to mean that they have the same exponential rate. That is, f(N)=ln⁡g(N)f(N) =_{\ln} g(N) means that

lim⁡N→∞1Nln⁡f=lim⁡N→∞1Nln⁡g\lim_{N \to \infty} \frac 1N \ln f = \lim_{N \to \infty} \frac 1N \ln g

Sanov’s theorem

Statement of Sanov’s theorem

Sanov’s theorem concerns the large deviation principle for IID samples from a multinomial distribution.

To see how Sanov’s theorem works, let’s consider an example. Say you are working at a dice factory, and your job is to quality-assure dices. An ideal dice should have all pi=1/6p_i = 1/6, and your job is to test that a given real dice has pi≈1/6p_i \approx 1/6. Since you are not able to observe pp directly, you can only throw the dice for NN rounds, and compute the empirical distribution p^\hat p from the outcomes x1,...,xNx_1, ..., x_N.

For example, if you threw it 7 times and you got every number once except 11 twice, then p^=(2/7,1/7,...,1/7)\hat p = (2/7, 1/7, ..., 1/7).

Because p^\hat p depends on the throws, it is itself a random variable. Intuitively, we should expect that p^\hat p converging to pp as N→∞N \to \infty. Sanov’s theorem states that it is exponentially unlikely for us to be far from the right answer, with the rate of exponential convergence depending on how far we are mistaken. The further p^\hat p is from pp, the faster we can eliminate that possibility.

Let’s state this more formally.

Define:

  • p1:np_{1:n} is a probability vector.
  • x1:Nx_{1:N} are IID samples from a multinomial distribution with probability vector p1:np_{1:n}.
  • p^\hat{p} is the empirical distribution derived from these samples.
  • Δn\Delta_n is the probability simplex.

As the number of samples NN approaches infinity, the probability of observing a specific empirical distribution p^\hat{p} within a closed subset A⊂ΔnA \subset \Delta_n is characterized by the Kullback-Leibler (KL) divergence DKL(p^∥p)D_{KL}(\hat{p} \| p) between the empirical distribution p^\hat{p} and the true distribution pp.

Formally stated:

Theorem 1 (Sanov)

lim⁡N→∞1Nln⁡Pr(p^∈A)=−inf⁡p^∈ADKL(p^∥p)\lim_{N \to \infty} \frac{1}{N} \ln Pr(\hat{p} \in A) = -\inf_{\hat{p} \in A} D_{KL}(\hat{p} \| p)

We can get an intuitive feel for Sanov’s theorem by the following video.

Let us fix n=3n = 3 and p=(0.2,0.3,0.5)p = (0.2, 0.3, 0.5). We set n=3n = 3 because Δ3\Delta_3 has two dimensions, which allows us to actually plot it.

If we sample for NN times from the multinomial distribution defined by pp, and plot the heatmap of the samples within Δ2\Delta_2 (shown as a black triangle), we notice that as N→∞N \rightarrow \infty, the distribution converges to a gaussian around the point (0.2,0.3,0.5)(0.2,0.3,0.5), with the contours converging in shape to ellipses, with radii converging as 1/N1 / \sqrt{N}.

Meanwhile, the separation between the discrete points converge as 1/N1 / N, and so the discrete multinomial distribution converges to a continuous gaussian distribution.

So, roughly speaking, we have approximately

Pr(p^)∝e−(p^−p)TNV(p^−p)Pr(\hat p) \propto e^{- (\hat p - p)^T NV (\hat p - p)}

for some covariance matrix VV that describes the shape of the ellipses.

▶ Video: https://yuxi.ml/sketches/posts/field-theory-how-to/figure/Sanov_convergence.webm

key frames

Now, if we boldly proceed, we would obtain

1Nln⁡Pr(p^)∼−(p^−p)TA(p^−p)\frac 1N \ln Pr(\hat p) \sim -(\hat p - p)^T A (\hat p - p)

This is not quite right, because for any finite NN, there are only finitely many possible p^\hat p. So generally Pr(p^)=0Pr(\hat p) = 0, and to fix this, instead of writing Pr(p^)Pr(\hat p), we should write Pr(p^∈A)Pr(\hat p \in A) for some closed subset A⊂ΔnA \subset \Delta_n.

Next, since given any two exponentially decaying functions f(N)∝e−kN,g(N)∝e−lNf(N) \propto e^{-kN}, g(N) \propto e^{-lN}, we have f≫gf \gg g iff k<lk < l, we only need to account for the least unlikely case:

lim⁡N1Nln⁡Pr(p^∈A)≈max⁡q∈A(−(q−p)TA(q−p))≈−min⁡q∈ADKL(q∥p)\lim_N \frac 1N \ln Pr(\hat p \in A) \approx \max_{q\in A} (-(q-p)^T A (q-p)) \approx - \min_{q\in A} D_{KL}(q \| p)

Any large deviation is done in the least unlikely of all the unlikely ways!

(Den Hollander 2008, 10)

Field-theoretic interpretation

We can interpret this problem through the lens of statistical physics. Imagine a system of NN identical particles. Each particle has nn degrees of freedom. The state of a particle can be one of the unit vectors in Rn\mathbb{R}^n. The problem is to find the distribution of the average state of all the particles.

The particles are completely independent of each other – no interaction whatsoever. This is a “no interaction field”. The only thing saving the example from irrelevance is that the particles are still influenced by something – an externally-imposed potential field, biasing the distribution of each particle’s state independently and identically (IID).

As typical in statistical mechanics, we suppose each particle is distributed according to the Boltzmann distribution with temperature 11. This then tells us that the potential field VV satisfies

pi=e−Vi/Zp_i = e^{-V_i}/Z

That is, we can write Vi=−ln⁡pi−ln⁡ZV_i = -\ln p_i - \ln Z where ZZ is a normalizing constant (partition function again).

The average energy per particle (order parameter) is then

Eˉ∑ipˉiVi=−∑ipˉiln⁡pi−ln⁡Z\bar E \sum_i \bar p_i V_i = -\sum_i \bar p_i \ln p_i - \ln Z

The minimum is at pˉi=pi\bar p_i = p_i, and if you have seen some statistical mechanics before, you would notice a pattern: a fluctuation in the average energy per particle should be proportional to e−N(Eˉ−Eˉmin)e^{-N(\bar E - \bar E_{min})}. This is not quite right, in the sense that Eˉ−Eˉmin\bar E - \bar E_{min} is not the rate function, but it converges to the rate function in a neighborhood of pp.

Field-theoretic calculation

This section is based on (Mézard and Montanari 2009, sec. 4.7).

We use field-theoretic techniques to compute the rate function, treating both the empirical distribution p^\hat{p} and the true distribution pp as fields over a finite set of points:

p:{1,2,...,n}→Rp: \{1, 2, ..., n\} \to \mathbb{R}

Noteformulate a constraint

We really want to write Pr(p^=q)Pr(\hat{p} = q), even though as we noted, this does not make sense. To fix this problem, we introduce an infinitesimal fudge factor of ϵ\epsilon.

That is, we want to know the probability of observing an empirical distribution p^\hat{p} within an infinitesimal neighborhood of a specific distribution qq:

Pr(p^=ϵq)Pr(\hat{p} =_{\epsilon} q)

where =ϵ=\epsilon means that p^i∈qi±ϵ\hat{p}_i \in q_i \pm \epsilon for each i=1,2,…,ni = 1, 2, \dots, n, or more roughly, that they are within an O(ϵ)O(\epsilon) distance of each other.

Thus, we can write the desired problem in the form of a constrained integral:

Pr(p^=ϵq)=∫RNρ(x)dNx(1[p^(x)=q])Pr(\hat p =_\epsilon q) = \int_{\mathbb{R}^N} \rho(x) d^N x \left( 1[\hat p(x) = q]\right)

Noteintroduce a Dirac delta

Next, we need to move the constraint from the integral domain to the integrand, in preparation for exchanging the order of integral. We do this by introducing a Dirac delta factor.

For any fixed tiny, but non-zero, ϵ\epsilon, we have

∫RNρ(x)dNx(1[p^(x)=q])=ln⁡∫RNρ(x)dNx(1[p^(x)=q]Vol(ball with radius ϵ))\int_{\mathbb{R}^N} \rho(x) d^N x \left( 1[\hat p(x) = q]\right) =_{\ln} \int_{\mathbb{R}^N} \rho(x) d^N x \left( \frac{1[\hat p(x) = q]}{\mathrm{Vol}(\text{ball with radius } \epsilon)}\right)

because even though 1[p^(x)=q]Vol(ball with radius ϵ)\frac{1[\hat p(x) = q]}{\mathrm{Vol}(\text{ball with radius } \epsilon)} is huge, it is still O(1)O(1), and lim⁡N→∞(huge but fixed)N=0\lim_{N\to\infty} \frac{(\text{huge but fixed})}{N} = 0.

=∫RNρ(x)dNxδ(n)(p^(x)−q)= \int_{\mathbb{R}^N} \rho(x) d^N x \delta^{(n)}(\hat p(x) - q)

Notedo a Fourier transform

Next, we do the Fourier transform of the Dirac delta factor. This step is mostly mechanical.

δ(n)(p^(x)−q)=δ(n)(Np^(x)−Nq)=∏k=1nδ(∑j=1N1[xj=k]−Nqk)=∏k=1n12π∫dλkeiλk(∑j=1N1[xj=k]−Nqk)=ln⁡∫dnλei∑k=1nλk(∑j=1N1[xj=k]−Nqk)\begin{aligned} \delta^{(n)} (\hat p(x) - q) &= \delta^{(n)} (N\hat p(x) - N q) \\ &= \prod_{k=1}^n \delta \left( \sum_{j=1}^N 1[x_j = k] - Nq_k \right) \\ &= \prod_{k=1}^n \frac{1}{2\pi} \int d\lambda_k e^{i\lambda_k \left( \sum_{j=1}^N 1[x_j = k] - Nq_k \right)} \\ &=_{\ln} \int d^n \lambda e^{i \sum_{k=1}^n \lambda_k \left( \sum_{j=1}^N 1[x_j = k] - Nq_k \right)} \end{aligned}

Noteexchange the order of integration

Now we exchange the order of integration.

Pr(p^=ϵq)=∫RNρ(x)dNx∫dnλei∑k=1nλk(∑j=1N1[xj=k]−Nqk)=∫dnλ∫RNρ(x)dNxei∑k=1nλk(∑j=1N1[xj=k]−Nqk)=∫dnλe−iN∑k=1nλkqk∫RNρ(x)dNxei∑j=1N∑k=1nλk1[xj=k]\begin{aligned} Pr(\hat p =_\epsilon q) &= {\color{red}\int_{\mathbb{R}^N} \rho(x) d^N x} {\color{red}\int d^n \lambda} e^{i \sum_{k=1}^n \lambda_k \left( \sum_{j=1}^N 1[x_j = k] - Nq_k \right)} \\ &= \int d^n \lambda \int_{\mathbb{R}^N} \rho(x) d^N xe^{i \sum_{k=1}^n \lambda_k \left( \sum_{j=1}^N 1[x_j = k] - Nq_k \right)} \\ &= \int d^n \lambda e^{-iN \sum_{k=1}^n \lambda_k q_k} \int_{\mathbb{R}^N} \rho(x) d^N x e^{i \sum_{j=1}^N \sum_{k=1}^n \lambda_k 1[x_j = k]} \\ \end{aligned}

Noteinner integral

The inner integral splits because of the independence of x1,...,xNx_1, ..., x_N.

∫RNρ(x)dNxei∑j=1N∑k=1nλk1[xj=k]=∏j=1N⟨ei∑k=1nλk1[xj=k]⟩xj\int_{\mathbb{R}^N} \rho(x) d^N x e^{i \sum_{j=1}^N \sum_{k=1}^n \lambda_k 1[x_j = k]} = \prod_{j=1}^N \langle e^{i \sum_{k=1}^n \lambda_k 1[x_j = k]}\rangle_{x_j}

where the angled bracket denotes a probability expectation, and the subscript xjx_j denotes what we are taking the expectation over. Because all xjx_j have the same distribution, it is equal to

⟨ei∑k=1nλk1[xj=k]⟩x1N=(∑k=1npkeiλk)N=eNln⁡(∑k=1npkeiλk)\langle e^{i \sum_{k=1}^n \lambda_k 1[x_j = k]}\rangle_{x_1}^N = \left(\sum_{k=1}^n p_k e^{i\lambda_k} \right)^N = e^{N \ln \left(\sum_{k=1}^n p_k e^{i\lambda_k} \right)}

Noteouter integral

Pr(p^=ϵq)=∫dnλe−iN∑k=1nλkqk+Nln⁡(∑k=1npkeiλk)=∫dnλeNS[λ]\begin{aligned} Pr(\hat p =_\epsilon q) &= \int d^n \lambda e^{-iN \sum_{k=1}^n \lambda_k q_k + N \ln \left(\sum_{k=1}^n p_k e^{i\lambda_k} \right)} \\ &= \int d^n \lambda e^{NS[\lambda]} \end{aligned}

where the field free energy is

S[λ]=ln⁡(∑k∈1:npkeiλk)−i∑k∈1:nλkqkS[\lambda] = \ln \left( \sum_{k\in 1:n}p_k e^{i \lambda_k}\right)-i\sum_{k\in 1:n} \lambda_k q_k

Notethe mean field equation

The dominant contribution to the integral arises from the saddle point of the action, which corresponds to the solution of the mean field equation

∇λS=0\nabla_{\lambda} S = 0

The mean field equation is solved by some λ∗\lambda^* satisfying:

{iλk∗=ln⁡(Cqk/pk)C=∑kpkeiλk∗\begin{cases} i\lambda_k^* = \ln(C q_k/p_k) \\ C = \sum_k p_k e^{i\lambda_k^*} \end{cases}

Unfortunately, it is difficult to solve this in closed form, but we are on a lucky break: plugging them back to S[λ∗]S[\lambda^*] gives us a clean solution:

Plugging those back to SS, we find that

S[λ∗]=−∑k=1nqkln⁡(qk/pk)=−DKL(q∥p)S[\lambda^*] = -\sum_{k=1}^n q_k \ln(q_k/p_k) = -D_{KL}(q\| p)

Conclusion

Pr(p^=ϵq)=ln⁡eNS[λ∗]=e−NDKL(q∥p)Pr(\hat p =_{\epsilon} q) =_{\ln} e^{NS[\lambda^*]} = e^{-ND_{KL}(q \| p)}

The reader who has never encountered this type of reasoning before may wonder why use such an indirect approach. It turns out that it is a very common formalism in statistical physics, where similar methods are also applied, under the name ‘field theory’, to continuous spaces X\mathcal X (some implicit discretization is then usually assumed at intermediate steps, and the correct definition of a continuum limit is often not obvious). In particular, the reader interested in the statistical-physics approach to optimization problems or information theory will often find this type of calculation in research papers. One of the advantages of this approach is that it provides a formal solution to a large variety of problems. The quantity to be computed is expressed in an integral form. In problems that have a ‘mean-field’ structure, the dimension of the space over which the integration is performed does not depend upon N. Therefore its leading exponential behaviour at large N can be obtained by saddle point methods. The reader who wants to get some practice with this approach is invited to ‘derive’ the various theorems and corollaries of this chapter in this way.

(Mézard and Montanari 2009, sec. 4.7)

Overlap matrix

Setup

We investigate the properties of a set of kk random vectors sampled uniformly from a high-dimensional sphere as the dimension NN approaches infinity. Let σ1,...,σk\sigma_1, ..., \sigma_k be these vectors, each belonging to RN\mathbb{R}^N with a norm of N\sqrt{N}, and let σ\sigma be the matrix formed by concatenating these vectors: σ=[σ1,...,σk]\sigma = [\sigma_1, ..., \sigma_k].

Since E[σ]=0E[\sigma] = 0, we focus on analyzing the variance of σ\sigma, divided by NN. Define the matrix Qˉ\bar{Q} as the normalized outer product of σ\sigma:

Qˉ:=σTσ/N=1N[σ1Tσ1σ1Tσ2⋯σ1Tσkσ2Tσ1σ2Tσ2⋯σ2Tσk⋮⋮⋱⋮σkTσ1σkTσ2⋯σkTσk]\bar Q := \sigma^T \sigma/N = \frac 1N \begin{bmatrix} \sigma_1^T\sigma_1 & \sigma_1^T\sigma_2 & \cdots &\sigma_1^T\sigma_k\\ \sigma_2^T\sigma_1 & \sigma_2^T\sigma_2 & \cdots &\sigma_2^T\sigma_k \\ \vdots & \vdots & \ddots & \vdots \\ \sigma_k^T\sigma_1 & \sigma_k^T\sigma_2 & \cdots & \sigma_k^T\sigma_k \end{bmatrix}

We know that Qˉ\bar{Q} is symmetric, has all entries within the range [−1,+1][-1, +1], and has diagonal entries equal to +1+1. Our goal is to uncover further properties of this matrix as NN becomes very large.

Let QQ be an arbitrary symmetric matrix with entries in the range [−1,+1][-1, +1] and with diagonal entries equal to +1+1. We aim to calculate the rate function SS that quantifies the probability of observing an empirical distribution Qˉ\bar{Q} that is close to QQ as N→∞N\to\infty:

Pr(Qˉ=ϵQ)=ln⁡e−NS[Q]Pr(\bar Q =_\epsilon Q) =_{\ln} e^{-NS[Q]}

More rigorously, we seek to determine:

lim⁡ϵ→0lim⁡N→∞1Nlog⁡Pr(Qˉ(σ)ij∈[Qij−ϵ,Qij+ϵ],∀i,j)\lim _{\epsilon \rightarrow 0} \lim _{N \rightarrow \infty} \frac{1}{N} \log Pr \left(\bar{Q}(\sigma)_{i j} \in\left[Q_{i j}-\epsilon, Q_{i j}+\epsilon\right], \forall i, j\right)

Field-theoretic interpretation

We can interpret this problem through the lens of statistical physics. Imagine a system of NN identical particles, each possessing kk degrees of freedom. For instance, the ii-th particle has degrees of freedom represented by (σ1,i,…,σk,i)(\sigma_{1, i}, \dots, \sigma_{k, i}).

These particles interact with each other equally, regardless of their spatial separation. This “infinite-range interaction” imposes a global constraint on the system, ensuring a form of “average kinetic energy conservation”. We express this constraint as:

∀j∈1:k,∑i∈1:Nσj,i2=N\forall j\in 1:k, \quad \sum_{i \in 1:N}\sigma_{j, i}^2 = N

To illustrate, if we consider σj,i\sigma_{j, i} as the type-jj velocity of the ii-th particle, then the constraint implies that the average type-jj kinetic energy per particle remains constant at 1/21/2, even as the number of particles increases.

Since Qˉj,j′=1N∑i∈1:Nσj,iσj′,i\bar{Q}_{j, j'} = \frac{1}{N} \sum_{i\in 1:N}\sigma_{j, i} \sigma_{j', i}, the matrix Qˉ\bar{Q} represents the average covariance between different types of velocities in this system.

Field-theoretic calculation

This section is based on (Mei 2021, lecture 8).

Noteformulate a constraint

To prepare for the introduction of the Dirac delta factor, we need to move the constraint from the integral domain to the integrand.

Pr(Qˉ=ϵQ)=Eσ[1[Qˉ(σ)−Q=ϵ0]]=Eσ[∏1≤i<j≤k1[Qˉi,j(σ)−Qi,j=ϵ0]]\begin{aligned} Pr(\bar Q =_\epsilon Q) &= \mathbb{E}_\sigma [1[\bar Q(\sigma) - Q =_\epsilon 0]]\\ &= \mathbb{E}_\sigma \left[\prod_{1 \leq i < j \leq k} 1[\bar Q_{i, j}(\sigma) - Q_{i, j} =_\epsilon 0]\right]\\ \end{aligned}

Notice well the interplay of two dimensions: The integral Eσ\mathbb{E}_\sigma is over a very large space, over all particles’ states, of dimension, so it has dimension ∼k2N\sim k^2 N. The constraint 1[Qˉ(σ)−Q=ϵ0]1[\bar Q(\sigma) - Q =_\epsilon 0] is on the average states of all particles, so it is over a small space of fixed dimensions ∼k2\sim k^2.

Again, we do that 1[x=ϵ0]≈δ(x)/ϵ1[x=_\epsilon 0] \approx \delta(x)/\epsilon trick again, and we get

Pr(Qˉ=ϵQ)=ln⁡Eσ[∏1≤i<j≤kδ(Qˉi,j(σ)−Qi,j=ϵ0)]Pr(\bar Q =_\epsilon Q) =_{\ln} \mathbb{E}_\sigma \left[\prod_{1 \leq i < j \leq k} \delta(\bar Q_{i, j}(\sigma) - Q_{i, j} =_\epsilon 0)\right]

Notice how we have the product ∏\prod over 1≤i<j≤k1 \leq i < j \leq k, because Qˉ,Q\bar Q, Q are both symmetric, with diagonal entries equal to +1+1. If we were to write something like ∏1≤i≤j≤k\prod_{1 \leq i {\color{red} \leq} j \leq k}, we would cause δ(Qˉi,i(σ)−Qi,i=ϵ0)\delta(\bar Q_{i, i}(\sigma) - Q_{i, i} =_\epsilon 0) to always be infinite, which does not work.

Noteformulate a constraint, take 2

It turns out we have not finished with the constraint yet. Back when we did Sanov’s theorem, because the particles are not interacting, we had to only formulate one constraint, a global one where p^=ϵq\hat p =_\epsilon q. In this case, the particles are interacting by the conservation of kinetic energy:

∀j∈1:k,1N∑i∈1:N∥σj∥22=1\forall j\in 1:k, \quad \frac 1N \sum_{i \in 1:N}\|\sigma_{j}\|_2^2 = 1

Let us go back to the start again:

Pr(Qˉ=ϵQ)=Eσ[1[Qˉ(σ)−Q=ϵ0]]=∫(NSN)kdσVol(NSN)k  1[Qˉ(σ)−Q=ϵ0]\begin{aligned} Pr(\bar Q =_\epsilon Q) &= \mathbb{E}_\sigma [1[\bar Q(\sigma) - Q =_\epsilon 0]] \\ &= \int_{(\sqrt N S^N)^k}\frac{d\sigma}{\mathrm{Vol}(\sqrt N S^N)^k} \; 1[\bar Q(\sigma) - Q =_\epsilon 0] \end{aligned}

The integral over (NSN)k(\sqrt N S^N)^k is uncomfortable. What to do? … That’s right, when the domain of integral is uncomfortable, we use a Dirac delta factor to move it into the integrand:

=∫RN×kδ(⋯ )dσ  1[Qˉ(σ)−Q=ϵ0]∫RN×kδ(⋯ )dσ= \frac{\int_{\mathbb{R}^{N \times k}} \delta(\cdots) d\sigma \; 1[\bar Q(\sigma) - Q =_\epsilon 0]}{\int_{\mathbb{R}^{N \times k}} \delta(\cdots) d\sigma}

where we must fill in the constraint of σ∈(NSN)k\sigma \in (\sqrt N S^N)^k into the δ(⋯ )\delta(\cdots). Now, σ∈(NSN)k\sigma \in (\sqrt N S^N)^k is equivalent to 1N∥σj∥2−1=0\frac 1N \|\sigma_{j}\|^2 - 1 = 0 for all j∈1:kj\in 1:k, so naturally, we should try ∏j∈1:kδ(1N∥σj∥2−1)\prod_{j\in 1:k} \delta\left( \frac 1N \|\sigma_{j}\|^2 - 1 \right), giving us

=∫RN×k∏j∈1:kδ(1N∥σj∥2−1)dσ  1[Qˉ(σ)−Q=ϵ0]∫RN×k∏j∈1:kδ(1N∥σj∥2−1)dσ= \frac{\int_{\mathbb{R}^{N \times k}} {\color{red} \prod_{j\in 1:k} \delta\left( \frac 1N \|\sigma_{j}\|^2 - 1 \right)} d\sigma \; 1[\bar Q(\sigma) - Q =_\epsilon 0]}{\int_{\mathbb{R}^{N \times k}} {\color{red} \prod_{j\in 1:k} \delta\left( \frac 1N \|\sigma_{j}\|^2 - 1 \right)} d\sigma}

Tipthe off-shell trick

Let’s take a moment to see what the trick is. The trick is this: We need to integrate something over the uniform distribution on (NSN)k(\sqrt N S^N)^k, but integrating over it is difficult, because we don’t have a convenient coordinate system over the sphere NSN\sqrt N S^N. So instead, we slightly thicken each sphere,[^1] and suddenly we can integrate over the real space RN×k\mathbb{R}^{N \times k}, for which we do have a good coordinate system:

Eσ∼Uniform((NSN)k)[something]=lim⁡ϵ↓0Eσ∼Uniform((NSNthickened by Nϵ)k)[something]\mathbb{E}_{\sigma \sim \mathrm{Uniform}((\sqrt N S^N)^k)} [\text{something}] = \lim_{\epsilon \downarrow 0} \mathbb{E}_{\sigma \sim \mathrm{Uniform}((\sqrt N S^N \text{thickened by }\sqrt N \epsilon )^k)} [\text{something}]

Now, since

σj∈NSNthickened by Nϵ  ⟺  ∥σj∥2−N∈±Nϵ  ⟺  1N∥σj∥2−1=ϵ0\sigma_j \in \sqrt N S^N \text{thickened by }\sqrt N \epsilon \iff \|\sigma_j\|^2 - N \in \pm N\epsilon \iff \frac 1N \|\sigma_j\|^2 - 1 =_\epsilon 0

we can write the constraint as 1(1N∥σj∥2−1=ϵ0)=δ(1N∥σj∥2−1)/ϵ1 \left( \frac 1N \|\sigma_j\|^2 - 1 =_\epsilon 0 \right) = \delta \left( \frac 1N \|\sigma_j\|^2 - 1 \right)/\epsilon.

1 If we return to our field-theoretic interpretation, then allowing σj\sigma_j to have norm N±Nϵ\sqrt N \pm \sqrt N \epsilon means that we are allowing the average type-jj kinetic energy to fluctuate a bit, even though it is exactly 11. Quantum field theorists call this off the (kinetic) energy shell, and if you ask, they might wave mysteriously in the air and speak of “virtual particles” and “Faddeev-Popov ghosts”.

Noteformulate a constraint, take 3

Again we must handle the constraint of 1[Qˉ(σ)−Q=ϵ0]1[\bar Q(\sigma) - Q =_\epsilon 0], but this time it’s different. Whereas before, we had to use [∏1≤i<j≤k1[Qˉi,j(σ)−Qi,j=ϵ0]]\left[\prod_{1 \leq i {\color{red} <} j \leq k} 1[\bar Q_{i, j}(\sigma) - Q_{i, j} =_\epsilon 0]\right], this time we have to use ∏1≤i≤j≤k\prod_{1 \leq i {\color{red} \leq} j \leq k}. Why? Because this time, we have set σ\sigma free from the cage of (NSN)k(\sqrt N S^N)^k, so the diagonal entries of Qˉ(σ)\bar Q(\sigma) are no longer forced to stay exactly +1+1. Thus, we have to do this instead:

=∫RN×k∏j∈1:kδ(1N∥σj∥2−1)dσ  1[Qˉ(σ)−Q=ϵ0]∫RN×k∏j∈1:kδ(1N∥σj∥2−1)dσ=ln⁡∫RN×k∏j∈1:kδ(1N∥σj∥2−1)dσ  ∏1≤s≤t≤kδ(Qˉs,t(σ)−Qs,t)∫RN×k∏j∈1:kδ(1N∥σj∥2−1)dσ\begin{aligned} &= \frac{\int_{\mathbb{R}^{N \times k}} \prod_{j\in 1:k} \delta\left( \frac 1N \|\sigma_{j}\|^2 - 1 \right) d\sigma \; 1[\bar Q(\sigma) - Q =_\epsilon 0]}{\int_{\mathbb{R}^{N \times k}} \prod_{j\in 1:k} \delta\left( \frac 1N \|\sigma_{j}\|^2 - 1 \right) d\sigma} \\ &=_{\ln} \frac{\int_{\mathbb{R}^{N \times k}} \prod_{j\in 1:k} \delta\left( \frac 1N \|\sigma_{j}\|^2 - 1 \right) d\sigma \; \prod_{1 \leq s {\color{red} \leq} t \leq k} \delta(\bar Q_{s, t}(\sigma) - Q_{s, t})}{\int_{\mathbb{R}^{N \times k}} \prod_{j\in 1:k} \delta\left( \frac 1N \|\sigma_{j}\|^2 - 1 \right) d\sigma} \\ \end{aligned}

Noteintroduce a Dirac delta

We have already done the Dirac deltas. To remind you,

Pr(Qˉ=ϵQ)=ln⁡∫RN×k∏j∈1:kδ(1N∥σj∥2−1)dσ  ∏1≤s≤t≤kδ(Qˉs,t(σ)−Qs,t)∫RN×k∏j∈1:kδ(1N∥σj∥2−1)dσPr(\bar Q =_\epsilon Q) =_{\ln}\frac{\int_{\mathbb{R}^{N \times k}} \prod_{j\in 1:k} \delta\left( \frac 1N \|\sigma_{j}\|^2 - 1 \right) d\sigma \; \prod_{1 \leq s \leq t \leq k} \delta(\bar Q_{s, t}(\sigma) - Q_{s, t})}{\int_{\mathbb{R}^{N \times k}} \prod_{j\in 1:k} \delta\left( \frac 1N \|\sigma_{j}\|^2 - 1 \right) d\sigma}

Actually, it is more convenient to scale the δ(1N∥σj∥2−1)\delta\left( \frac 1N \|\sigma_{j}\|^2 - 1 \right) both above and below the fraction to δ(∥σj∥2−N)\delta\left( \|\sigma_{j}\|^2 - N \right), and similarly scale the δ(Qˉs,t(σ)−Qs,t)\delta(\bar Q_{s, t}(\sigma) - Q_{s, t}) to δ(NQˉs,t−NQs,t)N\delta(N\bar Q_{s, t} - NQ_{s, t}) N, giving us

Pr(Qˉ=ϵQ)=ln⁡∫RN×k∏j∈1:kδ(∥σj∥2−N)dσ  ∏1≤s≤t≤kδ(Qˉs,t(σ)−Qs,t)∫RN×k∏j∈1:kδ(∥σj∥2−N)dσPr(\bar Q =_\epsilon Q) =_{\ln}\frac{\int_{\mathbb{R}^{N \times k}} \prod_{j\in 1:k} \delta\left( \|\sigma_{j}\|^2 - N \right) d\sigma \; \prod_{1 \leq s \leq t \leq k} \delta(\bar Q_{s, t}(\sigma) - Q_{s, t})}{\int_{\mathbb{R}^{N \times k}} \prod_{j\in 1:k} \delta\left( \|\sigma_{j}\|^2 - N \right) d\sigma}

where we have discarded the factor of N12k(k+1)N^{\frac 12 k(k+1)}, because it does not matter after taking 1Nln⁡(⋯ )\frac 1N \ln(\cdots).

Noteevaluate the numerator by field equation

Since this time we can’t do the inner integral easily, we will rush directly to the field equation. Don’t worry, as it will all come out correct in the end.

Do the Fourier transform of the Dirac delta factor, and exchange the order of integration. We first do the numerator.

=∫RN×kdσ∫1≤l≤k,  1≤i≤j≤kdλldqijei(∑1≤l≤kλl(σlTσl−N)+∑1≤i≤j≤kqij(σiTσj−NQij))=∫1≤l≤k,  1≤i≤j≤kdλldqij∫RN×kdσei(∑1≤l≤kλl(σlTσl−N)+∑1≤i≤j≤kqij(σiTσj−NQij))\begin{aligned} &= \int_{\mathbb{R}^{N \times k}} d\sigma \int_{1 \leq l \leq k, \; 1 \leq i \leq j \leq k} d\lambda_l dq_{ij} e^{i \left( \sum_{1 \leq l \leq k} \lambda_l (\sigma_l^T \sigma_l - N) + \sum_{1 \leq i \leq j \leq k} q_{ij} (\sigma_i^T \sigma_j - NQ_{ij}) \right)} \\ &= \int_{1 \leq l \leq k, \; 1 \leq i \leq j \leq k} d\lambda_l dq_{ij} \int_{\mathbb{R}^{N \times k}} d\sigma e^{i \left( \sum_{1 \leq l \leq k} \lambda_l (\sigma_l^T \sigma_l - N) + \sum_{1 \leq i \leq j \leq k} q_{ij} (\sigma_i^T \sigma_j - NQ_{ij}) \right)} \\ \end{aligned}

As before, we only need to find the “least unlikely of all unlikely ways”. That is, we only need to pick the least tiny of all tiny inner integrals. In other words, we need to find a stationary point where it has finally ceased being so tiny:

0=∇q,λ∫RN×kdσei(∑1≤l≤kλl(σlTσl−N)+∑1≤i≤j≤kqij(σiTσj−NQij))0 = \nabla_{q, \lambda}\int_{\mathbb{R}^{N \times k}} d\sigma e^{i \left( \sum_{1 \leq l \leq k} \lambda_l (\sigma_l^T \sigma_l - N) + \sum_{1 \leq i \leq j \leq k} q_{ij} (\sigma_i^T \sigma_j - NQ_{ij}) \right)}

Because we are seeking a stationary point, and we are already doing it physicists, it is no big problem if we seek stationary points over all of the complex plane. That is, we allow q,λq, \lambda to take not just real, but also complex values.[^2]

Then we can scale both by −i-i and get

∇q,λ∫RN×kdσe−(∑1≤l≤kλl(σlTσl−N)+∑1≤i≤j≤kqij(σiTσj−NQij))\nabla_{q, \lambda}\int_{\mathbb{R}^{N \times k}} d\sigma e^{- \left( \sum_{1 \leq l \leq k} \lambda_l (\sigma_l^T \sigma_l - N) + \sum_{1 \leq i \leq j \leq k} q_{ij} (\sigma_i^T \sigma_j - NQ_{ij}) \right)}

For cleaner notation, we define qji=qijq_{ji} = q_{ij}, and Λ=diag(λ1,…,λk)\Lambda = \mathrm{diag}(\lambda_1, \dots, \lambda_k). Noting that Qii=1Q_{ii} = 1 for all ii, we get

∇q,λ∫RN×kdσe−(∑ij(Λij+12qij)(σiTσj−NQij))\nabla_{q, \lambda}\int_{\mathbb{R}^{N \times k}} d\sigma e^{- \left(\sum_{ij} (\Lambda_{ij} + \frac 12 q_{ij}) (\sigma_i^T \sigma_j - NQ_{ij}) \right)}

Since the stationary point of this with respect to q,λq, \lambda is the same as the stationary point of this with respect to Λ+12q\Lambda + \frac 12 q, we need only

∇q∫RN×kdσe−(∑ij12qij(σiTσj−NQij))\nabla_{q}\int_{\mathbb{R}^{N \times k}} d\sigma e^{- \left(\sum_{ij} \frac 12 q_{ij} (\sigma_i^T \sigma_j - NQ_{ij}) \right)}

2 If you want justification, look up “the method of steepest descent” (Erdélyi 1956, sec. 2.5). Intuitively speaking, it is because when we are doing an integral like ∫Rdq(⋯ )\int_\mathbb{R}dq (\cdots), we are doing a path integral in the complex plane, and so we can deform the path integral in the complex plane and still get the same result. Thus, we can deform it so hard that it walks across a “mountain pass” in the complex plane, where the saddle-point of the mountain pass is where ∇q(⋯ )=0\nabla_q (\cdots) = 0 – i.e., a stationary point.

Noteevaluate the denominator by field equation

At this point, it’s easier to evaluate the denominator first.

The same argument given above applies to the denominator. If you are pressed for time, you can just take the previous derivation for the saddle point equation, and set q=0,Q=0q = 0, Q = 0. This gives the field equation

0=∇λ∫RN×kdσe−∑1≤l≤kλl(σlTσl−N)0 = \nabla_{\lambda}\int_{\mathbb{R}^{N \times k}} d\sigma e^{-\sum_{1 \leq l \leq k} \lambda_l (\sigma_l^T \sigma_l - N)}

Now, the integral is just a gaussian integral, and it factors, too!

∫RN×kdσe−∑1≤l≤kλl(σlTσl−N)=∏leNλl(∫Rdσe−λlσ2)N=eN∑l(λl−12ln⁡λl+12ln⁡π)\int_{\mathbb{R}^{N \times k}} d\sigma e^{-\sum_{1 \leq l \leq k} \lambda_l (\sigma_l^T \sigma_l - N)} = \prod_l e^{N \lambda_l} \left(\int_\mathbb{R}d\sigma e^{-\lambda_l \sigma^2} \right)^N = e^{N\sum_l (\lambda_l - \frac 12 \ln\lambda_l + \frac 12 \ln \pi)}

Its stationary point is eNk2(1+ln⁡2π)e^{N \frac k2 ( 1 + \ln 2\pi)}.

Noteevaluate the numerator, continued

Where we left off, we had to solve the field equation

0=∇qe12N∑ijqijQij∫RN×kdσe−∑ij12qijσiTσj0 = \nabla_{q}e^{\frac 12 N \sum_{ij}q_{ij}Q_{ij}} \int_{\mathbb{R}^{N \times k}} d\sigma e^{-\sum_{ij} \frac 12 q_{ij} \sigma_i^T \sigma_j}

The integral is just a gaussian integral, and it factors, too:

=∫RN×kdσe−12∑ijqijσiTσj=(∫Rkdσe−12∑ijqijσiσj)N=(2π)Nk/2det⁡(q)−N/2\begin{aligned} &= \int_{\mathbb{R}^{N \times k}} d\sigma e^{-\frac 12 \sum_{ij}q_{ij}\sigma_i^T \sigma_j} \\ &= \left(\int_{\mathbb{R}^{ k}} d\sigma e^{-\frac 12 \sum_{ij}q_{ij}\sigma_i \sigma_j}\right)^N \\ &= (2\pi)^{Nk/2}\det(q)^{-N/2} \end{aligned}

Taking the derivative, we observe that ∇qln⁡det⁡q=(q−1)T\nabla_q \ln \det q = (q^{-1})^T for an arbitrary matrix qq. However, as qq is constrained to be a symmetric matrix, we obtain

∂qij(⟨Q,q⟩−ln⁡det⁡(q))={Qij+Qji−(q−1)ij−(q−1)jii≠jQii−(q−1)iii=j\partial_{q_{ij}}(\braket{Q,q} - \ln\det (q)) = \begin{cases} Q_{ij}+ Q_{ji} - (q^{-1})_{ij} - (q^{-1})_{ji} & i\neq j \\ Q_{ii}- (q^{-1})_{ii} & i=j \end{cases}

Setting all derivatives to zero yields the solution q=(Q−1)T=Q−1q = (Q^{-1})^T = Q^{-1}. Notably, there exists only one stationary point within the entire multidimensional complex space.

We proceed to compute the numerator, resulting in

=exp⁡(N2(⟨Q−1,Q⟩+kln⁡(2π)−ln⁡det⁡Q−1))=exp⁡(N2(k+kln⁡(2π)+ln⁡det⁡Q))=\exp\left(\frac N2(\braket{Q^{-1}, Q} + k \ln(2\pi) - \ln \det Q^{-1})\right) = \exp\left(\frac N2(k+ k \ln(2\pi) + \ln \det Q)\right)

In summary, we have

Pr(Qˉ=ϵQ)=ln⁡exp⁡(N2(k+kln⁡(2π)+ln⁡det⁡Q))exp⁡(Nk2(1+ln⁡2π))=eNS[Q]Pr(\bar Q =_\epsilon Q) =_{\ln} \frac{\exp\left(\frac N2(k+ k \ln(2\pi) + \ln \det Q)\right)}{\exp\left({N \frac k2 ( 1 + \ln 2\pi)}\right)} = e^{N S[Q]}

where the rate function is

S[Q]=12ln⁡det⁡QS[Q] = \frac 12 \ln \det Q

Easy results

Now that you have gone through that effort learning field-theoretic calculations, enjoy some quick and simple results.

Asymptotics of spherical volumes

Let SN−1(r)S^{N-1}(r) be the sphere of radius rr in RN\mathbb{R}^N, then

∣SN−1(N)∣∼(2πe)N/2|S^{N-1}(\sqrt N)| \sim (2\pi e)^{N/2}

NoteProof

∣SN−1(N)∣=∫RNδ(xTx−N)dx=ln⁡∫RN∫Reiq(xTx−N)dqdx=∫Rdq  e−iqN[∫RNeiqxTxdx]=∫Rdq  e−iqN[∫Reiqx2dx]N=∫Rdq  e−iqN(eiπ/4π/q)N\begin{aligned} |S^{N-1}(\sqrt N)| &= \int_{\mathbb{R}^N} \delta(x^T x- N )dx \\ &=_{\ln} \int_{\mathbb{R}^N} \int_\mathbb{R}e^{iq(x^T x- N )} dqdx \\ &= \int_{\mathbb{R}} dq \; e^{-iqN} \left[\int_{\mathbb{R}^N} e^{iqx^T x} dx\right] \\ &= \int_{\mathbb{R}} dq \; e^{-iqN} \left[\int_{\mathbb{R}} e^{iqx^2} dx\right]^N \\ &= \int_{\mathbb{R}} dq \; e^{-iqN} (e^{i\pi/4}\sqrt{\pi/q})^N \\ \end{aligned}

Thus, 1Nln⁡∣SN−1(N)∣\frac 1N \ln |S^{N-1}(\sqrt N)| converges to the stationary point of

−iq+iπ4+12ln⁡π−12ln⁡q-iq + \frac{i\pi}{4} + \frac 12 \ln \pi - \frac 12 \ln q

which occurs at q∗=i/2q^* = i/2. Plugging it in, we obtain

1Nln⁡∣SN−1(N)∣→ln⁡2πe\frac 1N \ln |S^{N-1}(\sqrt N)| \to \ln\sqrt{2\pi e}

NoteProbabilistic interpretation

As is well-known, in high-dimensions, everything looks like a gaussian. Specifically, the standard gaussian distribution N(0,IN)\mathcal N(0, I_N) in RN\mathbb{R}^N space is strongly concentrated around the spherical shell of radius N\sqrt N, by the law of large numbers. Therefore, the log-surface area of SN−1(N)S^{N-1}(\sqrt N) converges to the entropy of the N(0,IN)\mathcal N(0, I_N), which is just NN times the entropy of N(0,1)\mathcal N(0, 1).

In more detail, we can sample from N(0,IN)\mathcal N(0, I_N) in two ways: Either directly sample NN standard normal variables independently, or sample a point on SN−1(N)S^{N-1}(\sqrt N), before shifting it along the radius by an independently sampled displacement. Both ways give us exactly the same entropy. Now, because the radius of x∼N(0,IN)x \sim \mathcal N(0, I_N) is distributed as the square-root of the chi-squared distribution χN2\chi^2_N, we have

r2=∥x∥2∼χN2≈N(N,2N)r^2 = \|x\|^2 \sim \chi^2_N \approx \mathcal N(N, 2N)

When NN is large, we can write r2≈N+2Nzr^2 \approx N + \sqrt{2N} z where z∼N(0,1)z \sim \mathcal N(0, 1), so r≈N+2−1/2zr \approx \sqrt N + 2^{-1/2}z. Therefore, the amount of radial displacement is roughly constant, and we have

Ent[N(0,IN)]≈ln⁡∣SN−1(N)∣+Ent[N(0,1/2)]\mathrm{Ent}[\mathcal N(0, I_N)] \approx \ln |S^{N-1}(\sqrt N)| + \mathrm{Ent}[\mathcal N(0, 1/2)]

… which turns out to be wrong. The issues are two: One, differential entropy is not scale-invariant! Specifically, the differential entropy of a uniform distribution on SN−1(r)S^{N-1}(r) is *smaller than that of SN−1(2r)S^{N-1}(2r) by ln⁡2N−1\ln 2^{N-1}. Therefore, the total entropy is in fact split as

Ent[N(0,IN)]=ln⁡∣SN−1(N)∣+(N−1)E(ln⁡rN)+Ent[r]\mathrm{Ent}[\mathcal N(0, I_N)] = \ln |S^{N-1}(\sqrt N)| + (N-1)\mathbb{E}\left(\ln\frac{r}{\sqrt{N}}\right) + \mathrm{Ent}[r]

Furthermore, to evaluate (N−1)E(ln⁡RN)(N-1)\mathbb{E}\left(\ln\frac{R}{\sqrt{N}}\right) accurately, we cannot approximate rr as N+2−1/2z\sqrt N + 2^{-1/2}z, because we are forced to expand to the quadratic term of the Taylor expansion, since the linear term averages to zero. Thus, we are forced to approximate rr also to second order, and this I don’t know how to do.

I believe that, if it is worked through correctly, we should get

1Nln⁡∣SN−1(N)∣=ln⁡2πe−ln⁡πN+O(N−2)\frac 1N \ln |S^{N-1}(\sqrt N)| = \ln\sqrt{2\pi e} - \frac{\ln\sqrt{\pi}}{N} + O(N^{-2})

since this is what Stirling’s approximation proves. But proving this is outsourced to the reader.

Cramér’s theorem

The most commonly used result from large deviation theory is Cramér’s theorem (Dembo and Zeitouni 2009, theorem 2.2.30).

Theorem 2 (Cramér) Given a vector function M:X→RmM: X \to \mathbb{R}^m and a distribution on XX, its rate function is the convex transform of its cumulant generating function:

IX(x):=sup⁡k∈Rm(⟨k,x⟩−ln⁡Ex[e⟨k,M(x)⟩])I_X(x) := \sup_{k \in \mathbb{R}^m}(\braket{k,x} - \ln \mathbb{E}_x[e^{\braket{k, M(x)}}])

That is, for any compact subset A⊂RmA \subset \mathbb{R}^m, the rate function over the whole subset is just the highest possible rate:

lim⁡N1Nln⁡Pr(1N∑i=1NM(xi)∈A)=sup⁡x∈A−IX(x)\lim_N\frac 1N \ln Pr\left(\frac 1N \sum_{i=1}^N M(x_i) \in A\right) = \sup_{x\in A} -I_X(x)

where x1,...,xNx_1, ..., x_N are IID samples from the same distribution.

NoteProof

It suffices to prove it for AA being really small, essentially just a single point, because we can then cut up the whole of AA into many pieces like that, and then run the result on each piece. The rate difference is such that only the highest rate can survive, as it races pass every other piece exponentially fast: N−1ln⁡(e−Na+e−Nb)→max⁡(−a,−b)N^{-1} \ln (e^{-Na} + e^{-Nb}) \to \max(-a, -b), and even if two pieces have the exact same rate, then their combined rate gains a negligible factor of N−1ln⁡2→0N^{-1}\ln 2 \to 0.

So, we once again repeat the same calculation:

Pr(1N∑i=1NM(xi)=ϵm)=ln⁡Ex[δ(m)(∑iM(xi)−Nm)] only m terms in the Dirac delta=Ex[∫Rmdqei⟨iq,∑iM(xi)−Nm⟩]Dirac delta Fourier transform=∫Rmdqe−N⟨iq,m⟩Ex[e⟨iq,M⟩]NIID assumption=∫RmdqeN(−⟨iq,m⟩+ln⁡Ex[e⟨iq,M⟩])\begin{aligned} Pr\left(\frac 1N \sum_{i=1}^N M(x_i) =_\epsilon m\right) &=_{\ln} \mathbb{E}_x \left[\delta^{(m)}\left(\sum_i M(x_i) - Nm\right)\right] & \text{ only $m$ terms in the Dirac delta}\\ &= \mathbb{E}_x \left[\int_{\mathbb{R}^m} dq e^{i\braket{iq, \sum_i M(x_i) - Nm}}\right] & \text{Dirac delta Fourier transform} \\ &= \int_{\mathbb{R}^m} dq e^{-N \braket{iq, m}}\mathbb{E}_x[e^{\braket{iq, M}}]^N& \text{IID assumption} \\ &= \int_{\mathbb{R}^m}dq e^{N(-\braket{iq, m} + \ln \mathbb{E}_x[e^{\braket{iq, M}}])} \end{aligned}

The last equation is again dominated by the stationary point. This would give us

=ln⁡statq∈CmeN(−⟨q,m⟩+ln⁡Ex[e⟨q,M⟩])=_{\ln}\mathrm{stat}_{q\in \mathbb C^m} e^{N(-\braket{q, m} + \ln \mathbb{E}_x[e^{\braket{q, M}}])}

We still don’t know which stationary point we should pick. However, in large deviation theory, we usually pick the global minimum, and most often, the global minimum is the unique stationary point in the real space. Assuming that, we have

1Nln⁡Pr(1N∑i=1NM(xi))→−sup⁡q∈Rm(⟨q,m⟩−ln⁡Ex[e⟨q,M⟩])\frac 1N \ln Pr\left(\frac 1N \sum_{i=1}^N M(x_i)\right) \to -\sup_{q\in \mathbb R^m} (\braket{q, m} - \ln \mathbb{E}_x[e^{\braket{q, M}}])

References

Dembo, Amir, and Ofer Zeitouni. 2009. Large Deviations Techniques and Applications. 2nd ed. 1998. 2nd printing 2009 edition. Berlin Heidelberg: Springer.

Den Hollander, Frank. 2008. Large Deviations. American Mathematical Society.

Erdélyi, Arthur. 1956. Asymptotic Expansions. 3. Courier Corporation.

Mei, Song. 2021. “STAT260: Mean Field Asymptotics in Statistical Learning.” 2021. https://www.stat.berkeley.edu/~songmei/Teaching/STAT260_Spring2021/index.html.

Mézard, Marc, and Andrea Montanari. 2009. Information, Physics, and Computation. Oxford Graduate Texts. Oxford: Oxford university press.