A 1983 neurobiological theory of dreaming, called reverse learning, holds that while sleeping, and mainly during REM sleep cycles, your neocortex reviews these neural connections and dumps the unnecessary ones.