I learned so much new math going over this tutorial on dynamical mean-field theory (DMFT) (not to be confused with DtMF). Here, I’ll try my best to document what I learned.
Linear Dynamical System with GOE Matrix
The setup is as follows:
where and the matrix is a symmetric Gaussian (GOE/Wigner) matrix: where and . Perhaps in another note, we’ll see how the same techniques used to analyze this system can be applied to a neural network. For now, with this setup, we’ll learn and apply some fancy math (functional derivatives and Taylor expansions, the cavity method, Gaussian processes, Fourier transforms, and a little bit of random matrix theory) to informally derive Wigner’s semicircle law.
Intuition for the system we’re modeling
The way to think about the system that the above differential equation is modeling is as a time evolving network of sites , interconnected and interacting according to the matrix , under some external influence (hereon called the source). Without any external influence (i.e., ), the sites undergo a somewhat boring evolution described in the next section.
The value of a specific site (at a specific time ) not only affects every other site as time moves forward, the signal propagates throughout the network and eventually returns to affect the value of at some later time . The insight in the DMFT derivation below is that as the number of sites goes to infinity, , the distinct sites become statistically equivalent through central limit theorem (CLT)-style arguments.
Power iteration
This mini-section is somewhat irrelevant to the actual DMFT, but it’s a useful exercise to think about what happens when . When , the differential equation becomes . The solution is simply an exponential:
Redefining variables such that , we see that
where is the eigenvector of corresponding to the minimum eigenvalue. This is essentially the continuous version of power iteration.
Towards a self-consistent equation
We start by manipulating the original differential equation to get an integral. Start by multiplying to both sides of the equation and cleverly applying the product rule.
Applying the fundamental theorem of calculus,
Finally, some algebra gets us to the form we want:
where if and if (Heaviside function). Using the Heaviside function allows us to set the upper limit of the integral to which will be useful later when applying a Fourier transform.
The cavity method
The more general and canonical way of deriving the self-consistent system of equations is through the MSRDJ path integral. Here, we’ll instead apply the cavity method, which leads to a more intuitive, albeit less formal, derivation. The following is a broad outline of how the cavity method will work:
- Consider adding a new site to the system, resulting in total sites.
- Derive an expression for the time evolution of the new site in the limit .
- Argue that as , all sites become statistically equivalent such that the expression for derived in step 2 is representative of how every site will evolve.
After we derive one expression for how every site will evolve, we’ll leverage the time-translation-invariance (TTI) given by the linearity of the system to apply a Fourier transform and learn some statistical properties of our symmetric Gaussian random matrix .
Let’s start by seeing what happens when we add a new site to the system:
where is the new random vector (the th element is a standard Gaussian variable ) connecting the new site to the rest of the network (we’re going to ignore for the most part, since it becomes irrelevant as gets very large). And describes the trajectory of the original sites in this new system with an additional th site in . Note that will be different from for any since the entire trajectory of is affected by the new site . The above equation makes it clear that
We can thus think of as the description of a system identical to only with a shifted source: .
We can also derive an expression for :
where we ignored the contribution of the term since its negligible compared to the contribution of , especially as . We want to substitute an expression for such that everything on the right-hand-side is written in terms of the original sites . And we want the terms on the right-hand-side to concentrate (CLT-style) as . To this end, we’re going to utilize what we found in the previous paragraph: that describes a system identical to only with a shifted source .
Functional derivatives and Taylor expansions
At this point, we’re going to have to introduce the first piece of heavy mathematical machinery: functional derivatives.
A functional takes as input a function and returns a scalar: . Crucially, the value of depends on the function value of for all inputs , i.e., the entire history of contributes to the value of . Going one step further, we can imagine also being a function (a function which takes as input another function is called an operator) such that for any fixed , is a functional. Our vector of sites is an example of an operator; it takes as input the source function and outputs a new function: . This is most apparent in the integral formulation of the equation:
Clearly the function depends on the value of for all (technically the Heaviside function means that the dependence isn’t this strict, but whatever).
If is an input to , can we differentiate with respect to it? Of course we can! The functional derivative is defined as the function that satisfies:
where is some function in the same function space as . Expanding the left-hand-side by the standard definition of a scalar derivative,
We can let to get a more concrete expression for :
Recall that . Plugging this into the definition of ,
We’re going to need this later…
Now equipped with the knowledge of functional derivatives, we’re ready to use a functional Taylor expansion to approximate as a perturbed version of . Recall that is with a perturbed input function where is the perturbation. Since the perturbation gets small as , we can approximate by Taylor expanding to first order:
where such that
Self-consistent equation
Plugging our first order Taylor approximation of into our equation for ,
The important observation here is that is a random vector with , statistically independent of (by construction). The noise term has scaling. Thus, by a CLT argument, it converges to a Gaussian process as : . This means that for any finite collection of times , the random vector is jointly Gaussian with covariance matrix , where
is the second-moment kernel of the hidden-unit features. The response term on the other hand, has scaling. The quadratic form in the response term can be decomposed as follows:
Intuitively, as , the off diagonal terms vanish () while the diagonal terms (i.e., the trace) concentrate ():
We refer to as the response function.
Putting it all together, we arrive at the self-consistent equation we’ve been building towards:
where the higher order terms vanish in the limit and we have self-averaging (by the law of large numbers) functions:
Since the matrix linking together all the sites is statistically invariant under permutation (and assuming the source vector is also permutation-invariant such that for any permutation matrix ), by symmetry, every other site will obey the same self-consistent equation above. Thus, we may do away with the 0 subscripts and be left with:
Observe that in the limit (a.k.a. the mean-field limit), the time evolution of any given site depends only on its own dynamics except through self-averaging functions and . This is the magic of DMFT.
Intuitively, at any given time , the noise term is feeding the site signal from all the other sites in the network. Because every other site is statistically indistinguishable from , the noise is colored by the statistics of . The response term is like a memory, incorporating the effect of the signal emitted by itself during some past time which later comes back to affect itself again. The response function determines how much the site’s past state affects the site at some future time .
Solving for the response function
Because of the linear nature of our system, we can exactly solve for the response function (it is more often the case that we cannot analytically solve for ; e.g., with neural networks). Let’s do that right now. Doing so will naturally lead us to the semicircle law.
Stacking scalar equations, we get the following vector equation:
Taking a functional derivative with respect to on both sides of the self-consistent equation,
Then, recalling that , we take the trace of both sides and multiply by to get an equation of only ‘s:
Now, recall that we actually solved for earlier:
This implies that
An important observation we can make about is that it’s time-translation invariant (TTI), i.e., the function value of only depends on the difference :
Rewriting our equation of ‘s from earlier,
where the causality-enforcing allows us to play fast and loose with the upper limit of the integral. Rewritten like this, it becomes clear that the integral term is a convolution. Consequently, the convolution theorem motivates us to solve the equation in the frequency domain through a Fourier transform.
Fourier transforming
Define the Fourier transform and inverse Fourier transform as follows:
Intuitively, the ‘s are pure frequency wave functions and the Fourier transform is performing an inner product to see how much the function lies in the frequency . Applying the Fourier transform to the left-hand-side,
by integration by parts. The Fourier transform of the delta function is simply 1. Applying the Fourier transform to the convolution,
and some algebra reveals a simple expression in the frequency domain:
Thus, in the frequency domain, we get the following simple equation:
The quadratic formula reveals that
Random matrix theorying
To extract statistical information about the matrix from the above expression for , we must first recognize that there exists a concrete connection between the time domain response function and the eigenvalue density --- has spikes at the eigenvalues of and integrates to 1. Recall that Since the trace of a matrix is equal to the sum of its eigenvalues,
Turning the discrete summation into an integral using ,
Now Fourier transforming back to the frequency domain,
Integrating the inner integral, we obtain an expression explicitly connecting with the eigenvalues of :
Now, to obtain an expression for in terms of , we will use a tool called the Sokhotski–Plemelj formula:
Plugging in the quadratic formula expression we got for from earlier, we get our final expression for the eigenvalue density of :
for . This is Wigner’s famous semicircle law!