the electrophysiological study of sleep in small invertebrates is complicated. insects go through circadian rhythms of activity and passivity but some do not seem to have a homeostatic sleep need. insects do not seem to exhibit rem sleep. however, fruit flies appear to sleep, and systematic disturbance of that state leads to cognitive disabilities. there are several methods of measuring cognitive functions in fruit flies. a common method is to let the flies choose whether they want to fly through a tunnel that leads to a light source, or through a dark tunnel. normally, flies are attracted to light. but if sugar is placed in the end of the dark tunnel, and something the flies dislike is placed in the end of the light tunnel, the flies will eventually learn to fly towards darkness rather than light. flies deprived of sleep require a longer time to learn this and also forget it more quickly. if an arthropod is experimentally kept awake longer than it is used to, then its coming rest period will be prolonged. in cockroaches that rest period is characterized by the antennae being folded down and by a decreased sensitivity to external stimuli. sleep has been described in crayfish, too, characterized by passivity and increased thresholds for sensory stimuli as well as changes in the eeg pattern, markedly differing from the patterns found in crayfish when they are awake. in honeybees, it has been suggested they could be able to dream.