Many studies have shown sleeping on it has benefits. In one study subjects were asked to convert a string of digits into a different string by applying two principles. No one was told about a third secret rule that could provide a shortcut to the answer. One group went to sleep for eight hours following the training. The second group remained awake all night. The third group was trained the next morning and remained awake for eight hours before being re-tested. The group that went to sleep following the training was twice as likely to gain insight and use the secret rule.
We process and stabilize memory during sleep. Different learning occurs at different stages of sleep. We appear to process and consolidate facts during Slow Wave Sleep (SWS). We process more complex and emotionally charged information during rapid eye movement (REM) sleep.