I had a dream, that made me think that dreams work in some way like GANs. There are two components in the brain, playing a "game", and the game is creative but also adversarial.
My dream was mundane: I was walking around the house of a childhood friend, and I needed to sort out my backpack - but everything was dark. In the living room I tried turning on the light, but the lightbulb must have been dead. I could see a dim fragment of dawn through one window. No matter. Into the other room. In that room I couldn't find the light switch. It really should have been there - but then, it's an old house, maybe it's in an odd location. I fumbled around various parts - I could feel the wall, the door-frame, but definitely no light switch.
Now - here's what I suggest about the dreaming state. There are two components: an "agent", the first-person me trying to get my goal done, and a "generator", an unconscious part generating this very fragmentary sensory/conceptual world for the dreamer to move around in. As in a GAN, it's the adversarial nature of it that makes it creative. Adversarial means the two components have different and conflicting aims. So what might those aims be?
The agent has perhaps the same goals I would if I were awake. In the world I thought I was in, I needed to sort things out, work out what was going on, and who knows, maybe even get stuff done. I suspect that the agent is also responsible for that event where you suddenly wake from a dream: if the agent realises what's going on, or gets too emotional, these things give the agent the boost to wake - the agent is designed fundamentally not to "want" to be in a dream, because it wants to control and understand what's going on.
The generator, fundamentally, wants us not to wake up. The generator's goal is to keep us busy until we fall out of REM sleep back into deep sleep. There must be some sort of credibility negotiation though: my dream didn't keep sending me back and forth between the same rooms and the same broken lightbulbs - it had to move the plot onwards, at least a little, so that my agent self didn't catch on - "Hey, wait a minute, this is a dream!"
In my dream, I went back to the first room. Someone was there. I was sort of dizzy, but I managed to get the light from my phone on, and it was someone's auntie sitting on the sofa. The light wasn't very good and I was somehow not controlling it very well. I could see the outline of a woman with quite a big hairdo, and her features didn't line up consistently, but I just put that down to my poor perception. It seems to me that my generator was at the limit of what it could be bothered to generate. It couldn't flood the room with light, and it couldn't generate a clear enough person for me to know what to say to them. Or - the generator was being deliberately ambiguous, keeping me asleep without setting itself up for having to generate even more plot.
When we have anxiety dreams, or dreams that seem to be "processing" daytime events, I would previously have assumed that the unconscious (here, the generator) is bringing them in. In this interpretation it seems to me plausible that the generator is just playing its usual game, while the agent is the one bringing our daytime issues in - recalling and trying to deal with something, while the generator hurries to keep up, generating scenery and characters that do/don't fit the theme.
When I was younger my dreams had more energy, chaos and imagination to them. Probably because my "ego" had the same characteristics; but probably also my generator. I do still sometimes have vivid sensory dreams - I'm not sure how that fits with the account I've given here, which basically says that a grown-up's unconscious would generally have learnt to be ambiguous and evasive as a way to distract the dreamer enough to stay asleep!