Banner
    All Minds Are Real-Time Control Systems
    By Samuel Kenyon | January 25th 2013 12:36 AM | 18 comments | Print | E-mail | Track Comments
    About Samuel

    Software engineer, AI researcher, interaction designer (IxD), actor, writer, atheist transhumanist. My blog will attempt to synthesize concepts...

    View Samuel's Profile
    I conjecture that all minds are real-time control systems.



    In this post I will explain what that means and why it seems to be true.

    Creatures and Real-Time Systems

    Consider, if you will, artificial creatures that exist in either the real world or some model thereof. These [ro]bots do not know the environment beforehand, at least not all of it. Sure they may know and learn some universal traits of the environment. But there will always be changes.

    And those changes can happen quickly. Meanwhile the creature itself can move very quickly. Even if it doesn't want to move, it may be moved. Or it may fall down. All of these interactions are happening in a range of speeds dictated by physics.

    An artificial creature that lives just in a software simulation could have a lot of freedom as far as time spent thinking before reacting. This freedom is not necessarily available in reality.

    In software land, it's quite easy to make a program that responds much slower than an animal to events. And any system, be it software or a mix of hardware and software, can get fouled up temporarily and miss a deadline. In fact, that's the normal state of affairs for a lot of the computing devices you interact with on a daily basis.

    Does your desktop or laptop computer or tablet or phone respond to every one of your interactions instantly and consistently? Of course not. Cheap general-purpose consumer computing devices and operating systems (e.g. Linux, Windows, Darwin) are slower or faster depending on what else they are processing and what other networks/systems they are waiting on. They are at best soft real-time.

    The consequence of a missing a deadline on a soft real-time system is merely annoying the fuck out of the user. But for other applications, such as patient heart-rate monitoring, aircraft jet engine control, car airbag deployment, offshore drilling platform positioning, etc. we have hard real-time systems.

    The consequence of missing a hard real-time deadline could be fatal to either the system or to various humans involved. Or as Payton and Bihari [1] put it, "A timing constraint is hard if small violations of the constraint result in significant drops in a computation's value."

    The Stubborn Real World

    It has been pointed out that "the real world stubbornly refuses to operate faster than real time” [2]. Likewise, the real world stubbornly refuses to operate slower than real time.

    Imagine a four-legged "intelligent" robot which does not respond reliably or quickly enough for its real-world timing constraints. You walk over to it while it is walking, touch it, and it falls over. That doesn't seem to be very intelligent or useful. Try tipping over a cat while it's walking.



    Now imagine balancing on one foot. Try it. If you can't do this, then you need to practice. There are machines that can do similar things, and they all involve feedback control loops. In other words, measuring where your body is and correcting the position of your various body parts so you don't have an unfortunate interaction with the floor. But this correction loop has to run at the right speed. If it slows down, it gets out of whack and you're flailing wildly around to keep balance. Anything more out of whack and the next stop is Floor via the wonderful free transportation system known as gravity.

    So, real-time control means that the system reacts in a timely fashion, where "timely" relates to a real world context, not in software land.

    Or to put it another way: All systems have constraints on various resources and correct behaviors. But real-time systems cannot waste great wads of time in order to satisfy the other constraints [1].

    Danger and Mystery

    From the viewpoint of control theory, intelligence might be defined as a knowledgeable “helmsman of behavior”. --James S. Albus [3]
    Environments are dangerous and unpredictable. For one thing there's agents, such as humans, cats, insects, etc. wandering about. There are all the inanimate objects in an environment like chairs and rocks and tumbleweeds. And the agents are always moving the inanimate objects around and changing them, taking them away, introducing new things.

    Large inanimate objects, such as walls and buildings often change slowly, but sometimes relatively big objects are changing and moving such as doors and windows. Or the creature may be changing position fast relative to one of those big objects, such as a bird flying into a building.

    And then there's the weird fact that the bodies of meat machines (aka biological organisms) are always changing. The most obvious phase is of course the baby growing into an adult. Of course, you might argue that's a slow change. Perhaps it's not enough to warrant a real-time control system.

    But we still have all those things happening around the body like people talking, fierce creatures attacking, cars careening down the street, etc. And there's also all that internal subconscious upkeep going on. Biological bodies, as well as many electromechanical machines, are constantly keeping track of and updating their vital survival needs. In animals this is called homeostasis.

    Homeostasis means that the creature keeps its internal environment stable. This is typically accomplished with various feedback control mechanisms.

    All of these considerations--interacting with the real world, interacting with other creatures, internal self-maintenance--seem to imply that the mind is a real-time control system.

    Layers

    Argument: But surely only part of the mind is a real-time control system. Our higher mental capacities like language, social interaction, conscious reflection, planning, reasoning, arguing on blogs, etc. are seemingly uncoupled from the real time nature of the lower quick-reactive support system.

    In fact, one might prefer to think in terms of a simplified layered architecture in which the lower layer is real-time (and perhaps itself split between hard real-time and soft real-time). The upper layer contains all those capacities of mind which aren't real-time.


    A cognitive architecture in which the higher layer is not real-time.


    However, as Albus [3] has proposed, an engineered mind may have response time constraints throughout the entire hierarchy that are due to the nature of real-time control systems. In his example, you start at the bottom servo layer with a 30 millisecond short term memory or planning horizon (sensory sample and output update intervals of 3 milliseconds). Every layer going up has an approximate order of magnitude increase in time scale. Level 2 is 300 milliseconds memory and planning with a 30 millisecond detection and command interval, Level 3 is 3 seconds with 300 milliseconds intervals, and so on until you get to Level 7 in which the time scale is for an entire day.


    Real-time control layers of a cognitive architecture (adapted from [3]).

    Another consideration is that the pressures of real-world time constraints could result in high frequency "dumb" reactions being better for a creature than low frequency "smart" decisions:
    For example, it may be necessary to avoid a hazard before there is time to assess all possible paths for avoidance. Such actions may be suboptimal when considered in the absence of time constraints. However, when time is taken into account, these actions may be the best possible under the given circumstances. Taking the time to assess the alternatives may leave no time to execute the best alternative once it is found [1].
    So...at the very least there is a real-time control layer in all minds. For the more intelligent minds like humans, the real-time reaction requirements may time-constrain the higher layers. Slower but smarter assimilation and decision-making is often trumped by reliable fast ignorant behaviors in real-world contexts.

    References

    [1] D.W. Payton&T.E. Bihari, "Intelligent Real-Time Control of Robotic Vehicles," COMMUNICATIONS OF THE ACM, August 1991, Vo1.34, No.8.

    [2] S. Thrun, J. Canny, S. Russell&P. Norvig, Artificial Intelligence: A Modern Approach, 2nd Ed. Prentice Hall, 2002.

    [3] J.S. Albus, "Outline for a Theory of Intelligence," IEEE TRANSACTIONS ON SYSTEMS, MAN, AND CYBERNETICS, VOL. 21, NO. 3, MAY/JUNE 1991.

    Comments

    MikeCrow
    Of course it is, the only other option is that behind the curtain there's a magical operator.
    Never is a long time.
    That would appear to be self-evident to the point of triviality so I would assume that Samuel is trying to convey something more subtle than a simple "is it/isn't it?" answer...

    But what? :) 

    SynapticNulship
    It may be self-evident, and yet how many AI projects in the past 60 years actually take real-time control into account?
    As far as I can tell, cybernetics disappeared last century. To be fair, it seems that some of cybernetics was integrated into computer science as well as cognitive science--namely the concept of all thought and control as information which can be expressed in any substrate. Also that the information can be decoupled from any energy-using mechanisms like sensors and effectors and the computational devices themselves that move information around. But a cybernetics idea (or at least cybernetics style) that may have been abandoned from the sciences is what I said in this post, that minds are real-time control systems and that may have a role in the design of the entire mental architecture.
    Gerhard Adam
    It seems that part of what you're describing is the role of learning, experience, and "belief systems".  I use the latter term to simply represent a framework around which data is organized in our brains.

    In other words, as we grow and develop we begin to map the environment constructing a framework of data that we will use to assess the outside world against what we are doing in it.  As a result, instead of having to analyze every situation, we can deal with the exceptions. 

    However, it is also necessary to recognize that brains aren't simply "real-time" systems, but also predictive systems.  In other words, when we are in motion, or engaged in an activity, we have to be capable of anticipating what's happening, or going to happen, based on our movement within that same environment.

    An example that always strikes me is in going through airports, where there are moving walkways [or even escalators].  If they are not working, it is always a jarring experience as you have to quickly adjust to the fact that the walkway or escalator is NOT actually moving, while your mind anticipated that it would be.   Similarly walking up or down a non-moving escalator always feels awkward compared to simply taking stairs.  This suggests that we are having to specifically compensate for the fact that our brain is attempting to predict our required motions based on coordinating it with the escalator, while we have to consciously override that process to ensure we don't fall.

    Anyway, part of the point in bringing up belief systems, and prediction is that when we look at the analysis our brain performs, we also tend to ignore the fact that most of it deals with exception handling, rather than verification of the obvious.  So, once we have mapped our environment, we relegate most of that to expected, well-known behavior patterns and basically ignore it, letting lower level subsystems deal with it, unless something unusual occurs.

    Sorry, I'm just rambling now.
    Mundus vult decipi
    MikeCrow
    I think of "playing catch", and once learned, the level of computation when compared to how you'd get a robot to play catch is, impressive.
    When my kids were just able to sit, I'd sit on the floor and roll a ball back and forth with them. Later it involved throwing a nerf ball, but at an age that highlights how wrong our robots are, or how stunningly brilliant our brains are, which is also not limited to humans, as my dog can do it as well.
    Never is a long time.
    Gerhard Adam
    Actually your dog is also an interesting example, which illustrates how important our brain mapping is.  If you were to try and replicate your dog's behavior [i.e. catching a ball in your mouth, or a frisbee] it would be a very difficult task, whereas most dogs can do this with minimal practice.

    In my view, it is a prime illustration of how well our respective brains map our bodies, positions/motions, and provide predictive capability in our environment.
    Mundus vult decipi
    MikeCrow
    And in both cases it's a learned behavior, neither human infant, or puppy have these skills when born.

    Though, I might be convinced they're just not expressed until later, but is there even a difference between them?
    Never is a long time.
    SynapticNulship
    I would be careful in assuming that your outsider prediction model of a phenomenon is actually implemented within the agent.
    For instance, imagine your dog is next to you. You throw a frisbee; the dog runs after it, jumps and catches it. Does the dog's mind predict where the frisbee was going to end up before you throw it? How about right after you throw it? What if the wind changes the course of the frisbee abruptly? It seems to me that "prediction" is a model forced onto that system by you. The dog's mind may in fact just be correcting the differences between goals and currently measured positions. Feedback loops.
    Gerhard Adam
    Certainly there's feedback loops, but it also involves prediction, since the body must be poised to respond at some point in the future.  This is precisely why we can see misses occurring, because the action occurs, despite being out of position.  If we consider that no response can be instantaneous, and it seems that the consensus is that the brain is already anticipating an action a few hundred milliseconds in advance, then prediction is a requirement.

    The dog's mind doesn't accurately predict in advance, but the dog does respond to cues of what's about to happen.  That's why you can try to fake the dog out, and he doesn't commit to running after it, until he's confirmed that you actually threw it.  Although the dog will generally start to move, but stop after he detects that you didn't actually throw it.

    It's like trying to catch a baseball.  Once the ball is in the air, we can use whatever feedback loops we need to try and position ourselves, but to what end?  We have to try and match our position with our prediction of the ball's trajectory.  In fact, that's precisely the process used when a pitcher tries to strike out a batter.  The point is to try and make the batter make an erroneous prediction, base on being fooled into thinking that the ball will follow a particular path.
    Mundus vult decipi
    MikeCrow
    And imaging the code required to get a robot arm to make that catch.

    This also leads me to point out what I think is one of the flaws to most existing robots and AI, is visual feedback loops.
    Never is a long time.
    Gerhard Adam
    Yes, but I think it's more fundamental than that.  Even if we have our eyes closed, we have a complete sense of our body and orientation in space.  This is because our brain already possesses a map of our body.  It "knows" about our arms, legs, etc. so that this particular level of feedback is constantly giving our brain updates about ourselves/bodies, even if we aren't doing anything at all. 

    This is one of the arguments about phantom limb syndrome, as when that body mapping persists even if the limb is no longer present.  Again, this indicates that our body already has a pre-conceived map [learned from experience, etc.] and "predictive" information about ourselves, and simply verifies this based on external information, so that small adjustments can be made without having to analyze each step.

    This also suggests a much more distributed type of processing occurring throughout the nervous system, so that many of these physical elements can be controlled somewhat independently [or with at least superficial involvement] of the brain itself.
    Mundus vult decipi
    Thor Russell
    There is considerable evidence that neurons fire in anticipation of input, which sounds more like prediction than just realtime control. Anyway this sounds like the beginning of your ideas on intelligence etc, obviously just realtime control can't explain everything. How is your decision to write this blog post built up from or composed of real-time control elements?
    Thor Russell
    Thor Russell
    Thats a bit ironic, your "ramblings" about prediction and exception handling sound a reasonable bit like the memory prediction framework theory of intelligence. When your predictions are not met, then that draws your attention. Whatever else is involved in intelligence, the concept of prediction surely has a place.
    Thor Russell
    Gerhard Adam
    I'm sure that's true, but [as I'm sure you know] my problems invariably come with the term "intelligence" and what precisely is meant by that concept.  For example, I can easily see the role of making "predictions" in the behavior of my dogs and horses, although it is equally clear that the concept of "intelligence" doesn't have as precise a correlation/designation.
    Mundus vult decipi
    John Hasenkam
    Homeostasis means that the creature keeps its internal environment stable. This is typically accomplished with various feedback control mechanisms.
    I don't like the concept homeostasis because biological processes are in constant movement. Regulation via mainly circadian cycles involves a constant shifting of a wide range of physiological agents that impact on cognition at various levels. It is a wonderthat we maintain a stable representation in a constantly changing internal milieu. So there is dynamic homeostasis occurring. 



    If there is a state where homeostasis occurs it is cell senescence: which is sort of like half way to death, a final desperate protective measure to ensure cell repair mechanisms have a chance at repairing damage. Stasis is death and there is now evidence that senescent cells release mediators which promote inflammation. As a recent study on dementia concluded, his raises serious questions about the wisdom of preventing apoptosis. It might be better let those cells die. But I digress. 


    I liken this dynamism to a concept in modern fighter aircraft design, first seen in the F16. Dynamic instability: it allows much more rapid response. I suspect that it is easier to have a biological system in constant flux than in a constant state, that this may have evolved because it allows quicker responses. This may also be relevant to why neurons keep bubbling away at certain frequencies.  
    However, as Albus [3] has proposed, an engineered mind may have response time constraints throughout the entire hierarchy that are due to the nature of real-time control systems.
    The CNS has both quick response and slow response capacity. Sensory input can be responded too at the brainstem level or more slowly by inputs and the relevant responses in the frontal lobes. 



    Last week I  watching a lecture by Sapolsky and he made the comment that even the Lateral geniculate nucleus has a connection to the amygdala. The LGN is a midway nucleus for the optic nerve. It has been speculated that the paradox of how cortically induced blindness will result in conscious blindness but not unconscious blindness(Nicholas Humphrey's chimps) is explained by the LGN function. It is speculated that the LGN forms a 'sketch pad' image of the visual inputs which are sufficient for detecting certain objects out there. The term is "blindsight


    My personal experience may relate to this LGN business. I am almost completely blind in my right eye, with only a sliver of vision in the right peripheral field of that eye. Normally I have no conscious awareness of the vision in my right eye but occasionally I receive a "flash signal" that very quickly draws my attention. Typically a danger signal, it comes out of the blue and catches me by surprise. I do not consciously see the object until it comes into the field of my left eye. Salience - our perceptions are conditioned to respond very quickly to certain inputs, bypassing any further analysis higher up the cognitive network. IIRC, in The Emotional Brain, LeDoux mentions about fast and slow responses of the amygdala. 


    I suggest real time responses are one network of potential responses that under certain conditions takes precedence, and possibly even prevents, any slower responses. Having ridden a very fast motorcycle very quickly for a number of years this half blind man can assure you that there are times when there is no time to think. 


    One of the more intriguing findings regarding learning is how initially the neocortex is invoked but as we become more skilled neocortical activity declines and the function is shifted downwards; which presumably allows more rapid responses from the sensory inputs. Practice of skills promotes faster reaction time because the function is shifted to lower brain regions which can respond more quickly. For highly skilled behaviors though I suspect neocortical function is always involved. Thus as a study some years ago concluded: if you want to become expert 10,000 hours of practice will do the trick, but only if that practice constantly involves stretching your existing capacity. I suspect AI fails to account for this shifting of function to the real time response processes. 








    MikeCrow
    Having ridden a very fast motorcycle very quickly for a number of years this half blind man can assure you that there are times when there is no time to think.
    You have to rely on your body to just "do", Normally I'd call this "muscle memory", but I don't know what it really is, but there's definitely a point where you can do things without having to think about what you're doing (like catching a ball), you just react.
    I think this is why sports bikes are not good for beginners to learn on, they're so competent at such high speeds, by the time you
    figure out you have a problem you're way over your head, if you have to think your way out of it, you're quite possibly already dead.
    Never is a long time.
    Gerhard Adam
    ... I don't know what it really is, but there's definitely a point where you can do things without having to think about what you're doing (like catching a ball), you just react.
    It isn't just not having to think about what you're doing, but that thinking about it actually interferes with your ability.  This is one of the reasons why so much practice is required, because conscious thought is often simply interference that prevents the desired action from occurring.  This is quite common in things like music, where the more you think about what you're doing, the greater the likelihood that you're going to make a mistake, or be unable to respond quickly enough.

    In my view, many of the skills that animals have occur because they don't "know" how complicated something may be, so they simply do it without inhibition.  The role of practice in humans is to circumvent or "override" the inhibitory mechanisms of the brain, so that they don't interfere.
    Mundus vult decipi
    MikeCrow
    Excellent point, I agree.
    I have the motorcycle skills down, but boy do I struggle trying to learn to play the guitar.
    Never is a long time.