Brainstorm 4 – squishing hyperspace
April 28, 2010 20 Comments
Ok, back to work. I wanted to expand on what I was saying about the cortex as a map of the state of the world, before I get onto the topic of associations.
Imagine the brain as a ten-million-dimensional hypercube. Got that?
Hmm, maybe I should backtrack a bit. Let’s suppose that the brain has a total of ten million sensory inputs and motor outputs (each one being a nerve fiber coming in from the skin, the retina, the ear, etc., or going out to a muscle or gland). For sake of argument (and I appreciate the dangers in this over-simplification), imagine that each nerve signal can have one of 16 amplitudes. Every single possible experience that a human being is capable of having is therefore representable as a point in a ten-million-dimensional graph, and since we have only 16 points per axis we need only 16 raised to the power of ten million points to represent everything that can happen to us (including all the things we could possibly do to the world, although we probably need to factor in another few quadrillion points to account for our internal thoughts and feelings).
(If you’re not used to this concept of phase space, imagine that the brain has only two inputs and one output. A three-dimensional graph would therefore be enough to represent every possible combination of those values: the value of input 1 is a distance along the X-axis, input 2 is along the Y-axis and the output value is along the Z-axis. Where these three lines meet is the point that represents this unique state. A change of state is represented by an arrow connecting two points. Everything that can happen to that simplified brain – every experience and thought and reaction it is capable of – can be described by points, lines and surfaces within that space. It’s a powerful way to think about many kinds of system, not just brains. OK, so now just expand that model and imagine it in 10,000,000-dimensional space and you’re in business!)
Er, so that’s quite a big number. If each point were represented by an atom, the entire universe would get completely lost in some small dark corner of this space and never be seen again. Luckily for us, no single human being ever actually experiences more than an infinitesimal fraction of it. When did you last stand on one foot, scratching your left ear, looking at a big red stripe surrounded by green sparkles, whistling the first bar of the Hallelujah Chorus? Not lately, I’m guessing. So we only need to represent those states we actually experience, and then only if they turn out to be useful in some way. Of course we don’t immediately know whether they’re going to turn out useful, so we need a way to represent them as soon as we experience them and then forget them again if they turn out to be irrelevant.
Thus far, this is the line of thinking that I used when I designed the Creatures brains. Inside norns, neurons wire themselves up to represent short permutations of input patterns as they’re experienced, and then connect to other neurons representing possible output patterns. Pairs of neurons equate to points in the n-dimensional space of a norn’s brain, but only a small fraction of that possible space needs to be represented in one creature’s lifetime. These representations fade out unless they get reinforced by punishment or reward chemicals, and the neural network learns to associate certain input patterns with the most appropriate output signal. All these experiences compete with each other for the right to be represented, such that only the most relevant remain and old memories are wiped out if more space is needed. There’s also an implicit hierarchy in the representations (due to the existence of simpler permutations) that allows the norns to generalize – they have a hunch about how to react to new situations, based on previous similar ones.
There’s a great deal more complexity to the Norns’ brains than this and I managed to solve some quite interesting problems. I’m not sure that anyone else has designed such a comprehensive artificial brain and actually made it work, either before or in the 18 years since. But nevertheless, basically this design was a pile of crap. For one thing, there was no order to this space. Point 1,2,3 wasn’t close to point 1,2,4 in the phase space – the points were just in a list, essentially, and there was no geometry to the space. The creatures’ brains were capable of limited generalization because of the hierarchy (too long a story for now) but I really wanted generalization to fall out of the spatial relationships: If you don’t know what to do in response to situation x,y,z, try stimulating the neighboring points, because they represent qualitatively similar situations and you may already have learned how best to react to them. The sum of these “recommendations” is a good bet for how to react to this novel situation. Sometimes this won’t be true, in fact, and that requires the brain to draw boundaries between things that are similar and yet require different responses (a toy alligator is very similar to a real one, and yet…). This is called categorization (and comes in two flavors: perceptual and functional – my son Chris did his PhD on functional categorization). Anyway, basically, we need the n-dimensional phase space to be collapsed down (or projected) into two dimensions (assuming the neural network is a flat sheet), such that representations of similar situations end up lying near to each other.
(At this point, some of you may be astute enough to ask: why collapse n dimensions down to two at all? The human cortex is a flat sheet, so biology has little choice, but we can represent any number of dimensions in a computer with as much ease as two. This is true, but only in principle. In practice, computers are nowhere near big enough to hold a massively multi-dimensional array of 16 elements per dimension (say we only need a mere one hundred dimensions – that’s already 2×10^111 gigabytes!), so we have to find some scheme for collapsing the space while retaining some useful spatial relationships. It could be a list, but why not a 2D surface, since that’s roughly what the brain uses and hence we can look for hints from biology?)
There is no way to do this by simple math alone, because to represent even three dimensions on a two-dimensional surface, the third dimension needs to be broken up into patches and some contiguity will be lost. For instance, imagine a square made from 16×16 smaller squares, each of which is made from 16 stripes. This flattens a 16x16x16 cube into two dimensions. But although point 1,1,2 is close to point 1,1,3 (they’re on neighboring stripes), it’s not close to point 1,2,2, because other stripes get in the way. You can bring these closer together by dividing the space up in a different way, but that just pushes other close neighbors apart instead. Which is the best arrangement as far as categorization and generalization are concerned? One arrangement might work best in some circumstances but not others. When you try to project a 16x16x16x16x16x16x16-point hypercube into two dimensions this becomes a nightmare.
The real brain clearly tries its best to deal with this problem by self-organizing how it squishes 10,000,000 dimensions into two. You can see this in primary visual cortex, where the 2D cortical map is roughly divided up retinotopically (i.e. matching the two-dimensional structure of the retina, and hence the visual scene). But within this representation there are whorls (not stripes, although stripes are found elsewhere) in which a third and fourth dimension (edge-orientation and direction of motion) are represented. Orientation is itself a collapsing down of two spatial dimensions – simply recording the angle of a line instead of the set of points that make it up (that’s partly what a neuron does – it describes a spatial pattern of inputs by a single point). Here we see one of the many clever tricks that the brain uses: The visual world (at least as far as the change-sensitive nature of neurons is concerned) is made up of line segments. Statistically, these are more common than other arbitrary patterns of dots. So visual cortex becomes tuned to recognize only these patterns and ignore all the others (at least in this region – it probably represents textures, etc. elsewhere). The brain is thus trying its best, not only to learn the statistical properties and salience of those relatively few points its owner actually visits in the ten-million-dimensional world of experience, but also to represent them in a spatial arrangement that best categorizes and associates them. It does this largely so that we don’t have to learn something all over again, just because the situation is slightly different from last time.
So, finding the best mechanism for projecting n-dimensional space into two or three dimensions, based on the statistics and salience of stimuli, is part of the challenge of designing an artificial brain. That much I think I can do, up to a point, although I won’t trouble you with how, right now.
I will just mention in passing that there’s a dangerous assumption that we should be aware of. The state space of the brain is discrete, because information arrives and leaves via a discrete number of nerve fibers. The medium for representing this state space is also discrete – a hundred billion neurons. HOWEVER, this doesn’t mean the representation itself is discrete. I suspect the real brain is so densely wired that it approximates a continuous medium, and this is important for a whole host of things. It’s probably very wrong to implicitly equate one neuron with one point in the space or one input pattern. Probably the information in the brain is stored holistically, and each neuron makes a contribution to multiple representations, while each representation is smeared across many (maybe very many) neurons. How much I need to, or can afford to, take account of this for such a pragmatic design remains to be seen. It may be an interesting distraction or it may be critical.
Anyway, besides this business of how best to represent the state space of experience, there are other major requirements I need to think about. In Creatures, the norns were reactive – they learned how best to respond to a variety of situations, and when those situations arose in future, this alone would trigger a response. They were thus stimulus-response systems. Yeuch! Nasssty, nassty behaviourist claptrap! Insects might (and only might) work like that, but humans certainly don’t (except in the more ancient parts of our brains). Probably no mammals do, nor birds. We THINK. We have internal states that change over time, even in the absence of external changes. Our thoughts are capable of linking things up in real-time, to create routes and plans and other goal-directed processes. Our “reactions” are really pre-actions – we don’t respond to what’s just happened but to what we believe is about to happen. We can disengage from the world and speculate, hope, fear, create, invent. How the hell do we do this?
Well, the next step up, after self-organizing our representations, is to form associations between them. After that comes dynamics – using these associations to build plans and speculations and to simulate the world around us inside the virtual world of our minds. This post has merely been a prelude to thinking about how we might form associations, how these relate to the underlying representations, what these associations need to be used for, and how we might get some kind of dynamical system out of this, instead of just a reactive one. I just wanted to introduce the notion of state space for those who aren’t used to it, and talk a little about collapsing n-dimensional space into fewer dimensions whilst maximizing utility. Up until now I’ve just been bringing you up to speed. From my next post onward I’ll be feeling my own way forward. Or maybe just clutching at straws…