Most animals, and probably most living organisms, exhibit a circadian rest-activity rhythm. It is possible that sleep may have evolved from rest to allow more flexibility within this rather rigid rhythm of rest and activity. Researchers think that sleep arose to allow organisms to conserve and restore their energy. All mammals and birds sleep, as defined by the typical changes in brain waves associated with sleep. Reptiles also display changes in brain-wave states that correlate with changes in behavior, but scientists have not unambiguously demonstrated the existence in reptiles of the two sleep states (rapid-eye-movement sleep and non-rapid-eye movement sleep) that are found in mammals and birds. For amphibia and fish, it is possible to make a behavioral definition of sleep-like states, although not many species have been investigated.
For invertebrates, it is possible to identify elements--such as body position, arousal threshold, muscle activity and heart rate--that allow us to differentiate rest from sleep. Particularly in insects, but also in the scorpion and some crustaceans, researchers have identified a rest state that is similar to sleep.
In addition to a circadian component, sleep in vertebrates is characterized by a homeostatic component: sleep is regulated in its intensity as a function of the duration of previous wakefulness. Experiments have elicited a homeostatic response to some hours of "rest deprivation" in scorpions and several cockroach species--that is, they were more restful during recovery. This finding indicates that regulatory aspects of sleep may be present in invertebrates as well. Further back in the evolutionary tree, the existence of a sleep state has been described only anecdotally (for example, in cephalopods (squids and octopi) and aplysia ("sea hair" molluscs). The presence or absence of a true sleep state among these creatures remains to be investigated scientifically.
It seems that the elementary features which characterize sleep in its most evolved state--as it is found in mammals and birds--are already present even in very primitive organisms. At all phylogenetic levels, scientists are faced with the challenge of identifying exactly what aspects of the organism are "restored" during sleep. Once these are found, we may be able to provide a meaningful answer to the question of whether unicellular organisms (bacteria, for instance) sleep.