I theorise that dreams are more garbled than we realise, filled with pseudo-language and incoherent vague impressions, and ambiguous images, and that memories of dreams are actually post-hoc reconstructions formed at the point of waking, and are not to be trusted. So maybe in the dream there was a sense of a presence and a nearby blob with appendages that could be a hand, but with uncountable fingers, and it could also be an octopus, and it moves restlessly around: on waking, this resolves into a much more sensible memory of a person waving a hand.
The similarity of things observed in dreams to AI is then because both procedures involve constructing coherence out of noise. "Gradient descent" or something, I wouldn't really know about that. Pareidolia.