AbstractFor a sensorimotor network to generate adaptive behavior in the environment, the phases of the behavior must be appropriately timed. When the behavior is driven simply by the sensory stimuli from the environment, these can supply the timing. But when the behavior is driven by an internal "goal" that ignores and perhaps even opposes the immediate sensory stimuli, the timing must be generated internally by the network. We have modeled a realistic behavioral scenario that requires such internal timing.When the sea slug Aplysia feeds, it incrementally ingests long strips of seaweed, driven by ingestive stimuli emanating from the seaweed. But if, having ingested a strip, the animal fails to break the strip off the substrate, it must incrementally egest the entire strip again. To do this, it must ignore the inherent ingestiveness of the seaweed and generate the opposite, egestive behavior, driven by an internal egestive goal, for a length of time that is appropriate for the length of the strip to be egested.In previous work, we found that a differential-equation model of the Aplysia feeding network, with dynamics like those experimentally observed, performed this task extremely well. In this model, the goal-driven egestion was appropriately timed by a slowly decaying dynamical transient that "remembered" the time elapsed since the beginning of the egestion.We have now used genetic algorithms to evolve very simple artificial neural network controllers that perform the task equally well. But these networks time the egestion by a completely different mechanism. Their dynamics are characterized by discrete ingestive and egestive attractors, to which they switch in response to ingestive and egestive stimuli. However, the switch in behavior follows the switch in stimulus only with a considerable delay, during which the network continues to generate the old behavior. Existing always near an attractor, the network has no long-term memory. Instead, the switch in behavior finally occurs when a sufficiently high local stimulus density appears in the stochastic stimulus input stream. This complex event occurs rarely. To perform the task, the evolution of the network tunes its connection weights so that the switch requires a density that occurs, on average, about as often as the time that is required to egest the typical length of seaweed strip with which the network is evolved. Thus a simple memoryless network, aware of only the local stimulus, is nevertheless able to organize behavior over arbitrarily long time scales.