A latent space is the abstract internal space in which a machine learning model represents data as compressed numerical vectors. The model maps each input to a point in this space, and inputs with similar meaning tend to lie close together. The space usually has fewer dimensions than the original data, so it can be seen as a representation that retains only the data's essential features.
The concept is especially important in generative modeling: variational autoencoders, GANs, and diffusion models generate new images or text by sampling or manipulating points in a latent space. The vector space produced by embedding models is another example, and in large language models the term is also used for the space of the model's internal hidden states.