After a period of heavy use, hard disks tend to get 'fragmented'. Data gets written all over random parts of the disk, and it gets inefficient to keep track of it all.
That's why you need to run a defragmentation program occasionally. Ideally, you do this overnight, while you're asleep, so it doesn't stop you from using the computer.
A new paper from some Stanford neuroscientists argues that the function of sleep is to reorganize neural connections - a bit like a disk defrag for the brain - although it's also a bit like compressing files to make more room, and a bit like a system reset: Synaptic plasticity in sleep: learning, homeostasis and disease
The basic idea is simple. While you're awake, you're having experiences, and your brain is forming memories. Memory formation involves a process called long-term potentiation (LTP) which is essentially the strengthening of synaptic connections between nerve cells.
Yet if LTP is strengthening synapses, and we're learning all our lives, wouldn't the synapses eventually hit a limit? Couldn't they max out, so that they could never get any stronger?
Worse, the synapses that strengthen during memory are primarily glutamate synapses - and these are dangerous. Glutamate is a common neurotransmitter, and it's even a flavouring, but it's also a toxin.
Too much glutamate damages the very cells that receive the messages. Rather like how sound is useful for communication, but stand next to a pneumatic drill for an hour, and you'll go deaf.
So, if our brains were constantly forming stronger glutamate synapses, we might eventually run into serious problems. This is why we sleep, according to the new paper. Indeed, sleep deprivation is harmful to health, and this theory would explain why.
The authors argue that during deep, dreamless slow-wave sleep (SWS), the brain is essentially removing the "extra" synaptic strength formed during the previous day. But it does so in a way that preserves the memories. A bit like how defragmentation reorganizes the hard disk to increase efficiency, without losing data.
One possible mechanism is 'synaptic scaling'. When some of the inputs onto a given cell become stronger, all of the synapses on that cell could weaken. This would preserve the relative strength of the different inputs while keeping the total inputs constant. It's known that synaptic scaling happens in the brain, although it's not clear whether it has anything to do with sleep.
There are other theories of the restorative function of sleep, but this one seems pretty plausible. It stands in contrast to the idea that sleep is purely a form of inactivity designed to save energy, rather than being important in itself.
What this paper doesn't explain, and doesn't try to, is dreaming, REM sleep, which is very different to slow-wave sleep. REM is not required for life, so long as you get SWS, and some animals don't have REM, but they all have SWS, although in some animals, only one side of the brain has it at a time.
So it makes sense, but what's the evidence? There's quite a bit - but, it all comes from very simple animals, like flies and fish.
The pictures above show that, in various parts of the brain of the fruit fly, measures of synaptic strength are increased in flies that have been awake for some time, compared to recently rested ones. In general, synapses increase during the wake cycle and then return to baseline during sleep.
There's similar evidence from fish. But the authors admit that no-one has yet shown that the same is true of any mammals - let alone humans.
I'd say that this is important, because the fly brain is literally a million times smaller than ours. Synaptic overgrowth could be a more serious problem for a fly because they just have fewer neurons to play with. Sleep may have evolved to prune extra connections in primitive brains, and then shifted to playing a very different role in ours.
Wang G, Grone B, Colas D, Appelbaum L, & Mourrain P (2011). Synaptic plasticity in sleep: learning, homeostasis and disease. Trends in Neurosciences PMID: 21840068