My apologies for the previous response. Dreaming is generally the last step in the sleeping process, which can be observed by heightened hippocampus activity and rapid eye movement (REM). 
We still don't know exactly why humans dream, or if dreams are useful. But we do know that in the very young populations, dreaming helps support neural development.
I hope this helped!
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence