From Classical Probabilistic Latent Variable Models to Modern Generative AI: A Unified Perspective