AIFeed

The learning theory-many body correspondence: Part 2

Summary

Introduction In the previous post in this series we built up the simplest foundations for our many-body theory by looking at models whose natural units were bits and the loss was the zero-one loss. At the end of that post we claimed that the construction we gave is sufficiently general and can be applied to models where bits are not the natural smallest unit (and even models where we want to actually treat variables as actual reals). In this post we are going to make this more precise, so in later posts we see can what useful stuff the theory actually gives us. To get some idea for what we are going to do, let's consider a simple example. Namely, suppose we have a simple linear regression model which takes in a single scalar and outputs a single scalar , with the one learnable parameter. Assume then that our system has finite precision so every value is specified to some finite decimal precision, and let be the smallest value we can represent in our machine. For any scalar our system e…

Original text(via LessWrong)

Introduction

In the previous post in this series we built up the simplest foundations for our many-body theory by looking at models whose natural units were bits and the loss was the zero-one loss. At the end of that post we claimed that the construction we gave is sufficiently general and can be applied to models where bits are not the natural smallest unit (and even models where we want to actually treat variables as actual reals). In this post we are going to make this more precise, so in later posts we see can what useful stuff the theory actually gives us.

To get some idea for what we are going to do, let's consider a simple example. Namely, suppose we have a simple linear regression model which takes in a single scalar and outputs a single scalar , with the one learnable parameter. Assume then that our system has finite precision so every value is specified to some finite decimal precision, and let be the smallest value we can represent in our machine. For any scalar our system encodes it as some bit-string in . In the previous post, the implied geometry is kind of weird, because then has immediate single bit flip neighbors, flipping a single bit could in theory jump arbitrarily far away, and learning dynamics become very weird and inefficient. This is not what we do in reality. Instead, we know that inherits a natural metric from so it does not have neighbors, it simply has , those being . This gives us a neighbor graph which is just a line, and then the equivalent of bit descent from the previous post becomes gradient descent on this line. So, how do we use this to generalize the notions from the previous post?

The atomic basis of learning

Generalizing from the example above, suppose our program is given by bits. Suppose we can partition the program bits into blocks with , and write , so our hypothesis space is . The idea here is that our blocks represent some type of unit we care about, like a float, an integer, what have you. That is, it is how we have chosen to encode the parameters of our program. So let's suppose each block represents a value in some space . Each block then has a decode map , so we can write the program in the decoded space as .

Note then that we can equip each with a graph encoding which values count as adjacent. We denote its graph Laplacian as . Its eigenpairs are orthonormal in ( is the uniform measure), with and . Now this definition sort of says we equip the space with a geometry of our choosing. There are really 3 natural choices one can make for this geometry and they are actually all meaningfully different.

First is the parameter space geometry where we make parameters neighbors based on some norm in the parameter space. Second is the function space geometry which actually collapses a lot of stuff by considering distance between the functions the parameters actually compute. Finally, there's the learning geometry which is induced by a learning algorithm which tells us what parameters an algorithm perceives as close. We mostly focus on the first here, but these are all valid choices.

Whichever we pick, each block gets a geometry. But how do we get the geometry of the combination of blocks? We are going to give a definition below, then unpack it as what it is saying is likely not immediately obvious.

The parameter geometry on programs (resp. function space and learning) is the Cartesian product graph . A move changes one atom's value along one edge of its internal graph. Its Laplacian is , with eigenfunctions and eigenvalues for multi-indices .

What is this thing? A good chunk of this post is going to be spent unpacking this.

The graph laplacian

The graph laplacian is both a mathematically simple object and a conceptually weird one. Take a graph, put a number on every node, and apply (degree matrix minus adjacency matrix):

which you can also write it as

So it is, in essence, how much the value at that point sticks out from its neighbors. This isn't too bad. What are the eigenstuffs then? Note that a "function on the graph" is just a list of node values, so it's a vector with one entry per node. The function space is every possible way of assigning a value to each node of the graph. Pretending we are in real space for a second, this is:

Because is real and symmetric, the spectral theorem guarantees it has orthonormal eigenvectors. Every function can then be written uniquely as

This basis is special, as it is effectively a generalization of the Fourier basis. This basis on special classes of graphs is exactly the Fourier basis but some graphs aren't well-behaved enough for that, but most of the properties of Fourier carry over. Eigenvalues are like frequencies, and the eigenvectors are still essentially just Fourier modes.

Atomic orbitals

We refer to the as the atomic orbitals of the algorithm. What are these though? The first thing to say is that the orbital is a function , so evaluated at the block's current value it is just a real number. The more useful picture is to take all of a block's orbitals at once, so that each value gets a feature vector So this is a change of basis for the blocks into the (pseudo)-Fourier basis given by the neighbor graph.

Now note that each block gets its own vector . The program is their outer product, This is basically the bit-spin trick we did in the previous post, so now every function of the program is linear with respect to this outer-product:

In the current construction the distribution over parameters is uniform (changing this gives structures which we will examine in coming posts) so for those familiar with quantum mechanics, this is basically a pure product state!

This implies that most of what we did in the previous post carries over directly when we select the correct geometry. However, before moving on we must address two things. First is the loss function, and second is how this relates to instances where we take everything to be earnestly real.

Beyond the zero–one loss

In the previous post we focused on the zero–one loss on a single output bit. That was a convenient choice because the zero–one loss on a output is affine in the output, , and that one fact is behind most of the clean formulas we got. So what actually carries over when we move to a different loss? The short version is that almost all of it survives. If you write the loss in the right coordinates, it splits into a part that is linear in the labels, which behaves exactly like the zero–one loss, and a part that doesn't depend on the labels at all, which is new.

It turns out that most losses we use share a certain structure: they are the negative log-likelihood of an exponential family. As before, write for the output of the program on input , except that is now a real number or a vector (truncated to finite precision) rather than a spin. The loss is of exponential-family form if, up to terms depending only on the labels, for a convex log-partition function , where is the sufficient statistic of the label . In this form is the natural parameter of the family.

Equivalently, is a Bregman divergence written in dual coordinates. Taking , the convex conjugate, and as the mean parameter, we have , and is the label-only constant we drop. A table below contains the common culprits:

LossNatural parameter
Squared errorthe output
Binary cross-entropylogit
Categorical cross-entropylogitsone-hot
logitstarget distribution
Zero–one on outputsthe spin output

Source and self-energy

Define the output table on , using the product orbitals and the product measure (we will eventually want to change this but for now it is sufficient): This is the direct generalization of , and like it, it is label-free: a property of the model and the inputs only. For it is exactly the covariance between the output and the mode . (For vector-valued outputs, each is a vector in .) The empirical loss splits as

The source term is our old formalism with replaced by : compared with from before. Same table, same column sums, labels contracted along the data index. The zero–one loss is the case where is constant, so is a constant and the source term is the whole story.

As in the previous post, we can lay out as a table with one row per data point and one column per mode (again leaving out the constant column , which only shifts averages). The vertical rules group the columns by inter-atomic order : first the modes that involve a single atom, then those involving pairs of atoms, and so on.

Each entry says how strongly the output on depends on the mode (for vector-valued outputs, each entry is a vector in ). Exactly as before, reading down the columns and contracting with the labels gives the source couplings , and reading across the rows gives the data coupling, since by orthonormality .

To see that this really is the same object, take every atom to be a single bit. Then , its graph is a single edge, and each atom has exactly one nonconstant orbital, . Every is then or , so is just the indicator of a set of bits , , and the table collapses to the one from the previous post. The only thing that changes in general is that an atom can have many orbitals, so the single-atom block has one column per nonconstant orbital of each atom rather than one column per bit.

An aside about getting continuous

In a lot of theory work, people work with continuous parameters. But our theory here is very much discrete, but we can actually move to continuous space if we wanted (there are a few ways to do this), but it turns out we don't in general need to do this. The short version is that the continuous picture is the limit of the discrete one as the precision goes to zero. For well-behaved models you never actually need to take that limit, because there is a characteristic scale below which nothing interesting happens.

Let's go back to the single-weight example from the start. With finite precision, lives on a grid of spacing on some interval , and its neighbour graph is a path. The path happens to be one of the graphs whose Laplacian we can diagonalize exactly. With grid points , the orbitals are

So the discrete orbitals are exactly the continuum ones, the cosine eigenfunctions of , just sampled at the grid points. The only thing the grid changes is the frequencies, and it only changes them appreciably near the grid scale . The entries of the table are then just Riemann sums of the corresponding continuum integrals. Because the geometry on programs is a product of the atomic geometries, the same thing happens atom by atom: on a box, and the table , the source couplings and the data coupling all converge to their continuum versions. For those with a physics background, this is the usual story of a lattice regularization and its continuum limit, with a UV cutoff at and an IR cutoff at . For the exact grid computation see Strang's paper on the DCT. For the much harder case of general graphs converging to continuum Laplacians, which is what you'd want for something like the function-space geometry, see García Trillos, Gerlach, Hein and Slepčev and Calder and García Trillos. However, these get weird for singular models. This would be more of a problem but for reasonably well behaved functions we can kind of avoid this problem.

Recall that in the orbital basis for an output we have (using the rescaled Laplacian , so that each has units of frequency squared)

Their ratio defines a length scale, , which is just one over the typical frequency of . A simple inequality then tells you how much of can live above any cutoff frequency :

So at most a fraction of the structure sits at frequencies above . So we can say something is well-behaved in this way when the roughness stays bounded as . When that holds, refining the grid only adds modes carrying vanishing weight. Any grid with already gets essentially everything right, and you only need roughly orbitals per atom. As a bonus, a frequency cutoff also caps the inter-atomic order: every atom a mode touches contributes at least to , so forces . So as long as our models are reasonably smooth in their real continuous geometry there is some finite truncation which captures basically all the structure we care about.

Conclusion

We have shown here that our methods from the previous post reasonably extend to most actual models and loss functions of interest in a natural way. In the next post we are going to actually start doing interesting things with this!

The text above was extracted automatically from the source page and may miss images, tables or code blocks. The original is authoritative.

Published by LessWrong
This site only summarises and aggregates; copyright stays with the original author. Headlines and summaries follow the source — where they differ, the original wins.
Read the original ↗