In this New York Times article, Carl Zimmer discusses recent sleep research:
"Scientists have offered a number of ideas about the primordial function of sleep. Dr. Tononi believes that it originally evolved as a way to allow neurons to recover from a hard day of learning. "When you're awake you learn all the time, whether you know it or not," he said.
Learning strengthens some connections between neurons, known as synapses, and even forms new synapses. These synapses demand a lot of extra energy, though. "That means that at the end of the day, you have a brain that costs you more energy," Dr. Tononi said. "That's where sleep would kick in."
He argues that slow waves weaken synapses through the night. "If everything gets weaker, you still keep your memories, but overall the strength goes down," he said. "The next morning you gain in terms of energy and performance."