We propose that the critical function of sleep is to prevent
uncontrolled neuronal feedback while allowing rapid responses and
prolonged retention of short-term memories.
The goal of learning is optimal behavior, and this sometimes requires the integration of sensory stimuli that are widely separated in time.
At a neuronal level, this corresponds to persistent activity in local networks.
Unfortunately, when a network exhibits persistent activity, small changes in the parameters or conditions can lead to runaway oscillations.
Thus, the very changes that improve the processing performance of the network can put it at risk of runaway oscillation.
To prevent this, stimulus-dependent plasticity should only be permitted when there is a margin of safety around the current network parameters.
We propose that a critical role of sleep is to establish a margin of safety by exposing the network to a variety of conditions and inputs, observing for erratic behavior, and -adjusting the parameters accordingly.
During wakefulness this margin of safety is gradually consumed, ultimately requiring refreshment by another period of sleep.
When sleep is not possible, an emergency mechanism comes into play to prevent runaway oscillations;
this is done at the expense of processing efficiency, and constitutes tiredness.
We contend that this theory matches the phenomenology of sleep and tiredness.
It also makes a number of novel testable predictions.