Latent Space
An abstract multi-dimensional space containing feature values that a machine learning model cannot interpret directly but uses to understand relationships.
How it works
When a neural network processes an input, it creates intermediate representations at each layer — dense vectors that compress and abstract the input information. These intermediate representations form the latent space. In an autoencoder, the latent space is the bottleneck representation. In a diffusion model, images are encoded into a compressed latent space before the denoising process occurs (Latent Diffusion Models). The geometry of the latent space encodes semantic relationships: similar inputs cluster together.
Why it matters
The latent space is where a model 'thinks.' Understanding the structure of latent spaces is key to understanding what a model has learned. In generative models, interpolating through latent space produces smooth transitions between concepts. In anomaly detection, unusual inputs produce latent vectors far from the normal cluster. Controlling the latent space is how techniques like fine-tuning, LoRA, and ControlNet steer generative models toward specific outputs.