Brainstorm 6: All change
May 3, 2010 13 Comments
In my last Brainstorming session I was musing on associations and asked myself what is being associated with what, that enables a brain to make a prediction (and hence perform simulations). A present state is clearly being associated with the state that tends to follow it, but what does that mean? It’s obvious for some forms of information but a lot less obvious for others and for the general case. Learning that one ten-million-dimension vector tends to follow another is neither practical nor intelligent – it doesn’t permit generalization, which is essential. Something more compact and meaningful is happening.
If the brain is to be able to imagine things, there must be a comprehensive simulation mechanism, capable of predicting the future state in any arbitrary scenario (as long as it’s sufficiently familiar). If I imagine a coffee cup in my hand and then tilt my imaginary hand, the cup falls. I can even get a fair simulation of how it will break when it hits the floor. If I imagine myself talking to someone, we can have a complete conversation that matches the kinds of thing this person might say in reality – I have a comprehensive simulation of their own mind inside mine. It’s comparatively easy to see how a brain might predict the future position of a moving stimulus on the retina, but a lot less obvious how this more general kind of simulation works. Coffee cups don’t have information about how they fall built into their properties, nor do they fall on a whim. Somehow it’s the entirety of the situation that matters – the interaction of cup and hand – and knowledge of falling objects in general (as well as the physical properties of pottery) somehow gets transferred automatically into the simulation as needed.
Pierre-Simon Laplace once said: “An intellect which at a certain moment would know all forces that set nature in motion, and all positions of all items of which nature is composed … the future just like the past would be present before its eyes.” In other words, if you know the current state of the universe precisely then you can work out its state at any time in the future. He wasn’t entirely right, as it happens – if Laplace was himself that intellect, then he would also be part of the universe, and so the act of gathering the data would change some of the data he needed to gather. He could never have perfect knowledge. And we know now that the most infinitesimal inaccuracy will magnify very rapidly until the prediction is out of whack with reality. But even so, in practical terms determinism works. If our artificial brain knew everything it was capable of knowing about the state of its region of the universe (in other words, the value of a ten-million-dimensional vector) then it would have enough knowledge to make a fair stab at the value of this vector a short while later. If that weren’t true, intelligence wouldn’t be possible.
But Laplace had a very good point when he mentioned “all forces that set nature in motion.” It’s not just the state of the world that matters, but the rate and direction of change. It’s an interesting philosophical question, how an object can embody a rate of change at an instant in time (discuss!). It has a momentum, but that’s dodging the issue. Nevertheless, change is all-important, and real brains are far more interested in change than they are in static states. In fact they’re more-or-less blind to things that don’t change – quite literally. If you can hold your eyes perfectly still when focusing on a fixed point, you’ll go temporarily blind in a matter of seconds! Try it – it’s not easy but it can be done with practice and it’s quite startling.
Getting preoccupied with recognizing objects, etc. fails to help me with this question of prediction, and vision is misleading because it’s essentially a movement-detection system that has been heavily modified by evolution to make it possible to establish facts about things that aren’t moving. The static world is essentially transformed into a moving one (e.g. through microsaccades) before being analyzed in ways we don’t understand and may never be able to, unless we understand how change and prediction are handled more generally. So how about our tactile sense? Maybe that’s a good model to think about for a while?
Ok, I’ll start with a very simple creature – a straight line, with touch sensors along its surface. If I touch this creature with my finger one of the sensors will be triggered (because its input has changed), but will soon become silent again as the nerve ending habituates. At this point the creature can make a prediction, but not a very useful one: my finger might move left or it might move right. It can’t tell which at first, but if my finger starts to move left, it can immediately predict where it’s going to go next. It’s easy to imagine a neuron connected to a pair of adjacent sensors, which will fire when one sensor is triggered before the other.
Eureka! We have a prediction neuron – it knows that the third sensor in the line is likely to be triggered shortly. In fact we can imagine a whole host of these neurons, tuned to different delays and hence sensitive to speed. Each one can make a prediction about which other sensors are likely to be touched within a given period. We can imagine each neuron feeding some kind of information back down to the sensor that it is predicting will be touched. The neurons have a memory of the past, which they can compare to the present in order to establish future trends. The more abstract this memory, the more we can describe it as forming our present context. Context is all-important. If you’ve ever woken from a general anesthetic, you’ll know that it takes a while to re-establish a context – who you are, where you are, how you got there – and until you have this you can’t figure out what’s likely to happen next.
So far, so good. We have a reciprocal connection of the kind that seems to be universal in the brain. We can imagine a further layer of neurons that listen to these simpler neurons and develop a more general sense of the direction and speed of movement, which is less dependent on the actual location of the stimulus. By the time we get a few layers deep, we have cells that can tell us if the stroking of my finger is deviating from a straight line (well, we could if my simplified creature wasn’t one-dimensional!).
But what’s the point of feeding back this information to the sensory neurons themselves? The first layer of cells is telling specific sensory neurons to expect to be touched in a few milliseconds. Big deal – they’ll soon find out anyway. Nevertheless, two valuable pieces of information come out of this prediction:
Firstly, if a sensory neuron is told to expect a touch and it doesn’t arrive, we want our creature to be surprised. Things that just behave according to expectations can usually be safely ignored, and we only want to be alerted to things that don’t do what we were expecting. Surprise gives us a little shock – it causes a bunch of physiological responses. We may get a little burst of adrenaline, to prepare us in case we need to act, and our other sensory systems get alerted to pay more attention to the source of the unexpected change (this is called an “orienting response”). Neurons higher up in the system are thus primed and able to make decisions about what, if anything, to do about this unexpected turn of events. The shock will ripple up the system until something finally knows what to do about that sort of thing. Most of the time this will be an unconscious response (like when we flick an insect off our arm) but sometimes nothing will know how to deal with this, and consciousness needs to get in on the act.
Secondly, once we have a hunch about where the stimulus is going to show up next, we can start to look further ahead to where it is likely to be heading. The more often our low-level predictions are confirmed, the more confident we can be, and the more time we’ve had in which to make this ripple of predictive activity travel ahead of the stimulus, to figure out what might happen in a few moments’ time. Perhaps my finger is stroking along the creature towards a tender spot that will hurt it; perhaps it’s moving in the other direction, towards the creature’s mouth, where it has a hope of eating my finger. Pain or pleasure get predicted, and behavior results whenever one or the other seems likely.
We have to presume that all of this stuff wires itself up through experience – by association. The first layer of sensory neurons learns when the sensor it is associated with is about to be touched, by understanding statistical relationships between the states of neighboring sensors. These first-level neurons presumably cooperate and compete with each other to ensure that each one develops a unique tuning and all possible circumstances get represented (this is exactly homologous, IMHO, to what happens in primary visual cortex, with edge-orientation/motion-sensitive neurons). The higher layers, which make longer-term predictions, learn to associate certain patterns of movement with pain or pleasure. The most abstract layers are presumably capable of learning that certain responses maximize pleasure or minimize pain.
Leaving aside the question of how these responses get coordinated, we now have a complete behavioral mechanism. And it’s NOT a stimulus-response system. The behavior is being triggered by predictions of what is about to happen, not what has just happened (this is a moot point and you may object that the system is still responding to the past stimuli, but I think an essential threshold has been crossed here and it’s fair to call this an anticipatory mechanism).
It’s clear that somehow the prediction needs to be compared to reality, and surprise should be generated if they don’t match, and it’s clear that predictions need to be able to associate themselves with reward. Somehow predictions also need to take part in servo action – actions are goal-directed, and hence are themselves predictions of a future state. Comparing what your sensors predict is going to happen, to what you intend to happen, is what allows you to make anticipatory changes and bring reality into line with your intentions. I need to think about that a bit, though.
But what about the ability to use this predictive mechanism to imagine possible futures? We presumably now have the facility to imagine a high-level construct, such as “let’s suppose I’m feeling someone stroke my skin” and actually feel the stroke occurring, as these higher-level neurons pass down their predictions to lower levels at which individual touch sensors are told to expect/pretend they’ve been stimulated. Although obviously this time we shouldn’t be surprised when nothing happens! The surprise response needs to be suppressed, and somehow the predictions ought to stand in for the sensations. That has implications for the wiring and all sorts of questions remain unresolved here.
It’s much harder, though, to see how we can assemble an entire context in our heads – the hand and the coffee cup, say. Coffee cups only fall when hands drop them. Dropping something only occurs when a hand is placed at a certain set of angles. A motor action is associated with a visual change, but only in a particular class of contexts, and the actual visual change is also highly context-dependent: If a cup was in your hand, that’s what you’ll see fall. Remarkably, if you imagine holding a little gnome in your hand instead, what you’ll see is a falling gnome, not a falling cup, even if you’ve never actually dropped a minuscule fantasy creature before in your life! In fact your imaginary gnome may even surprise you by leaping to safety! Somehow the properties of objects are able to interact in a highly generalizable way, and these interactions can trigger mental imagery, which eventually trickles down to the actual sensory system as if they’d really occurred (there are several lines of evidence to suggest that when we imagine something we “see” it using the same parts of our visual system that would be active if we’d really seen it).
Somehow the brain encodes cause and effect, at many levels, in a generalizable way. Complex chains of inference occur when we mentally decide to rotate our hand and see what happens to the thing it was holding, and the ability to make these inferences must arise from statistical learning that is designed to predict future states from past ones.
And somehow I have to come up with just such a general scheme, but at a level of abstraction suitable for a game. My creatures are not going to be covered in touch sensors or see the world in terms of moving colored pixels. It’s a shame really, because I understand these things at the low level – it’s the high level that still eludes me…
P.S. This post got auto-linked to a post on the question of why we can’t tickle ourselves (I’m assuming you’re not schizophrenic here, or you won’t know what I’m talking about, because you can!). We can’t tickle ourselves because our brain knows the difference between things we do and things that get done to us (self/non-self determination). If we try to tickle ourselves, we predict there will be a certain sensation and this prediction is used to cancel out the actual sensation. It’s pretty important for an organism to differentiate between things it does to the world and things the world does to it (bumping into something feels the same as being bumped into, but the appropriate responses are different). So here’s another pathway that requires anticipation, and another example of the brain as a simulation engine.