Robots Atlas>ROBOTS ATLAS
Architecture

Latent Space

1933ActivePublished: 13 July 2026Updated: 13 July 2026Published
Key innovation
The model represents data in a lower-dimensional, dense vector space in which geometry (distance, direction) carries semantic meaning - similar concepts sit close together, transformations are continuous, and vector arithmetic behaves like concept arithmetic.
Category
Architecture
Abstraction level
Building block
Operation level
InferenceSystem
Use cases
Semantic search and RAG - text embeddings as points in a shared latent space, retrieval by cosine similarityImage/video generation in latent space (Stable Diffusion, Runway Gen) - operating on 64x64x4 instead of 1024x1024x3Face editing / manipulation - traversal along 'smile', 'age', 'glasses' axes in the StyleGAN latentMultimodal alignment (CLIP) - images and texts in a shared latent space enabling zero-shot classificationTransfer learning - pretrained latent representations (ImageNet ResNet, BERT embeddings) as a foundation for fine-tuningAnomaly detection - data geometrically deviating from training clusters = potential anomalyRecommender systems - users and products in a shared latent space (matrix factorization, two-tower models)Robot policy learning in latent action space (Diffusion Policy, LatentSplat) - compressing hundreds of DoFMolecular generation - latent space of chemical compounds (MolVAE) - generating new drugs via samplingData compression and denoising - the classic autoencoder application (JPEG-XL contains a VAE component)

How it works

Latent space learning and usage process: (1) Encoder network - mapping from raw data (e.g. a 224×224×3 = 150K pixel image) to a latent vector z ∈ ℝᵈ (typically d=128-4096). In autoencoders and VAE this is an explicit encoder network; in Transformers - hidden states of successive layers; in GANs - the generator has the reverse direction (z → data), with the encoder trained separately; (2) Learning objective - the encoder learns so that z contains enough information to perform the task: reconstruction (autoencoder), prediction (classifier, LLM next-token), generation (VAE, diffusion), cross-modal matching (CLIP). Objectives force semantically similar inputs to yield nearby z; (3) Regularization - VAE imposes a Gaussian prior (KL divergence loss) so the space is smooth and sampleable. GANs enforce that z comes from a simple distribution (Gaussian, uniform). Without regularization the space can be 'shattered' - interpolation stops working; (4) Geometric operations in latent space: (a) similarity = cosine(z_a, z_b) - close = similar, (b) interpolation z_c = α·z_a + (1-α)·z_b - continuous transformation from a to b, (c) arithmetic z_king - z_man + z_woman ≈ z_queen - subtraction of semantic directions, (d) sampling z ~ N(0,I) - a new random sample, (e) directed traversal - finding feature 'axes' (smile, age, race in a face latent); (5) Decoder network - optional mapping z → raw data (for generative models: VAE decoder, diffusion decoder, GAN generator). LLMs do not have a decoder in the classic sense - hidden states are directly projected to dictionary logits.

Problem solved

Raw data (image pixels, text characters, audio samples) is high-dimensional, sparse, and does not reflect semantic structure - two images of the same cat differ in every pixel, though they are the 'same' concept. Classic hand-designed features (SIFT, HOG, TF-IDF) partially solved this problem but were rigid, domain-specific, and did not generalise. Latent Space solves this via a learned representation: the neural model itself discovers the optimal space structure where the 'meaning' of data becomes geometric - similar things close, different ones far, transformations continuous. This is the foundation of modern AI - without it, neither generative modelling (VAE, GAN, diffusion), nor semantic search (embeddings), nor transfer learning (pretrained representations), nor multimodal alignment (CLIP, image-text in a shared space) would exist.

Components

EncoderCompressing and abstracting data into a semantic representation

Neural network mapping raw data → latent vector z. Can be CNN (for image), Transformer (for text), RNN (for sequence), or a combination. For LLM: simply stacking Transformer layers produces increasingly rich latent representations in successive layers.

CNN encoder (ResNet, VGG)Standard for images - convolution+pooling reduces spatial, final layers form the latent.
Transformer encoder (BERT, ViT)Dominant since 2018 - self-attention compresses global context.
VAE encoder (probabilistic)Outputs μ and σ of q(z|x) distribution instead of a point - enables sampling.

Official

Latent vector zAtomic representation unit in the latent space

The output vector itself - representation of a data point in ℝᵈ. Dimension d is a key hyperparameter: 128 for classic word embeddings, 768 for BERT-base, 1536 for OpenAI text-embedding-3-small, 4096 for LLM Transformer hidden state.

INEncoder input
OUTContinuous vector in ℝᵈ, typically d=128-4096
Distance / Similarity MetricDefinition of semantic geometry

Function defining 'closeness' in latent space - most commonly cosine similarity (for normalised) or Euclidean distance (for non-normalised). Choice impacts how the model interprets 'similarity'. Cosine ignores magnitude, Euclidean does not.

Official

Prior Distribution (in VAE/GAN)Enables sampling and smooth interpolation

Distribution to which we regularise the latent space (typically N(0,I) Gaussian). Critical for generative modelling - from a known prior one can easily sample new points and decode them to raw data. In classic (deterministic) autoencoders, the lack of a prior yields 'holes' in the space.

Official

Decoder (optional)Reconstruction or generation from the latent

Network mapping z → raw data. Present in autoencoders, VAE, diffusion, GAN. Absent in representational models (BERT embeddings, CLIP encoder) where the latent space itself is the goal (retrieval, classification).

Official

Implementation

Implementation pitfalls
Curse of dimensionality for retrievalMedium

In high-dimensional spaces (d>1000) all points are 'far from each other' - cosine similarity compresses around the mean, nearest neighbours lose interpretability.

Fix:Post-hoc dimensionality reduction (PCA, UMAP for visualisation), Matryoshka embeddings (2024) - hierarchical d reduction, product quantization for ANN.
Latent space collapse (mode collapse in GAN, posterior collapse in VAE)High

Latent space can 'collapse' - the generator ignores z dimensions (uses only a few), or the decoder ignores z entirely and generates from the prior. Symptom: little-varied generations.

Fix:Beta-VAE (KL regularization), Wasserstein GAN (loss with gradient penalty), diverse batching, warmup schedules for KL loss.
Entanglement - one dimension encodes many featuresMedium

In most latent spaces a single dimension does not correspond to one semantic feature - they are entangled. Makes interpretation and targeted editing hard.

Fix:Disentangled representations (beta-VAE with β>>1, FactorVAE), InfoGAN, learning explicit axes (StyleGAN W space).
Domain shift between encoder and downstream taskMedium

A pretrained encoder (e.g. BERT on Wikipedia) yields weaker latent for a specialised domain (medical, legal, code). Cosine similarity does not preserve domain relations.

Fix:Domain-specific fine-tuning (BioBERT, LegalBERT, CodeBERT), specialised encoders (Voyage AI for verticals), MTEB benchmark for selection.
Storage cost at scaleLow

1M documents × 3072-dim float32 embeddings = 12 GB. 100M = 1.2 TB. Storage becomes the dominant cost of RAG infrastructure.

Fix:Quantization (INT8, PQ, binary embeddings), Matryoshka embeddings (adaptive d), disk-backed vector DBs, tiered storage (hot/cold).

Evolution

Original paper · 1933 · Journal of Educational Psychology 24(6-7): 417-441 (PCA formalisation - first latent space) · Harold Hotelling
Analysis of a Complex of Statistical Variables into Principal Components
Harold Hotelling
1933
Harold Hotelling formalises PCA - the first latent space
Inflection point

Principal Component Analysis - a linear method for finding a lower-dimensional representation of high-dimensional data. Foundation of the latent space concept.

1988
Bourlard & Kamp - autoencoders (nonlinear latent space)

Publication shows that neural networks can learn nonlinear dimensionality reduction - foundation for modern autoencoders.

2006
Hinton & Salakhutdinov - Deep Autoencoders (Science)
Inflection point

Science publication showing deep autoencoders discover semantic data structure better than PCA. Neural representation learning renaissance.

2013
Mikolov et al. - word2vec (linguistic latent arithmetic)
Inflection point

First publicly demonstrated 'king - man + woman ≈ queen' - latent space arithmetic. Popularises the notion of embeddings in NLP.

2013
Kingma & Welling - Variational Autoencoder (VAE)
Inflection point

arXiv 1312.6114 - probabilistic latent space with Gaussian prior, enables sampling and smooth interpolation. Foundation of generative modelling.

2014
Goodfellow et al. - GANs (adversarial latent space)
Inflection point

Latent z ~ N(0,I) mapped to photorealistic images by a generator adversarially trained against a discriminator. New approach to generative latent.

2015
Radford et al. - DCGAN (visual latent space arithmetic)

Shows that GAN latent interpolation (faces) and arithmetic (glasses + man - glasses = man without glasses) work on images as they do on text.

2019
BERT (Devlin et al.) - contextual embeddings

Contextualized embeddings - the same word has different latents depending on context. Standard NLP embeddings.

2021
CLIP (Radford et al., OpenAI) - shared multimodal latent
Inflection point

Images and texts in a shared latent space via contrastive learning. Foundation for many multimodal models (DALL-E, Stable Diffusion cross-attention).

2022
Latent Diffusion / Stable Diffusion - mass adoption of latent space
Inflection point

Rombach et al. show that operating in VAE latent (64x64x4) instead of pixels (512x512x3) gives 8x speedup while retaining quality. Latent space enters mainstream consumer AI.

Hyperparameters (configurable axes)

Latent dimensionality (d)Critical

Key hyperparameter. Higher d = more informational capacity and better quality, but higher memory and downstream compute cost.

128-384Classic word embeddings (word2vec, GloVe). Small capacity, trivially cheap.
768-1024BERT-base, classic text embeddings (OpenAI ada, text-embedding-3-small). Production standard.
1536-3072OpenAI text-embedding-3-large, Gemini embeddings, Claude embeddings. High retrieval quality.
4096-16384LLM hidden states (GPT, Llama). Not directly served, but the latents through which the LLM 'thinks'.
Encoder architectureCritical

Type of network mapping data to latent. Impacts data type, representation quality, and cost.

CNN (ResNet, EfficientNet)Standard for images, captures local patterns well.
Transformer (BERT, ViT, GPT)Dominant since 2018 - global context via self-attention.
RNN/LSTM/GRUTemporal sequences - less used today, replaced by Transformers.
Hybrid (CNN backbone + Transformer head)CLIP ViT-L, DINOv2 - best for vision tasks.
Training objectiveCritical

Defines how the latent space is shaped. Different objectives yield fundamentally different spaces.

Reconstruction (autoencoder)Latent contains enough information to reconstruct the input.
Predictive (LLM next-token)Latent encodes context needed to predict the next token.
Contrastive (CLIP, SimCLR)Semantically similar inputs close, different ones far - best for retrieval.
Variational (VAE)Prior regularisation enables sampling.
Adversarial (GAN)Generator vs discriminator - latent compatible with photorealistic generation.
Distance metricHigh

Definition of 'closeness' in latent space. The choice has serious implications for downstream tasks.

Cosine similarityStandard for text embeddings - ignores magnitude, only direction.
Euclidean (L2)Classic geometry - used in face embeddings, molecular latent.
Dot productStandard for recommender systems - includes magnitude.
Manhattan (L1) / Chebyshev (L∞)Rare - specific use cases (grid-based, categorical).

Computational complexity

Time complexity: O(f_encoder) + O(d) per operation. Space complexity: O(d) per data point.

Compute bottleneck

Encoder forward pass

The encoder forward pass itself (CNN, Transformer) is typically O(1000-10000x) more compute than any latent space operation. Compressing d=4096 → 128 by training a smaller encoder is a significant quality-vs-cost tradeoff.

Depends on
Rozmiar encoderaWymiar latent dBatching

Execution paradigm

Primary mode
Dense

In a classic encoder all weights are active for every input (dense). Sparse latent space (top-k active dimensions) is a rarer specialisation - experiments with Sparsecoders.

Activation pattern
All paths active
Additional modes
Sparse
Routing mechanism

The latent space itself has no routing - it is a static vector space. Routing appears only in models built on top (MoE - routing between experts, RAG - routing between documents).

Parallelism

Parallelism level
Fully parallel

Latent space operations (similarity search, arithmetic) are trivially parallel - massively GPU-parallelizable. Vector database ANN queries leverage GPU for batch retrieval.

Scope
TrainingInferenceAcross devices
Constraints
!RNN encoder is sequential (H_t depends on H_{t-1}), CNN and Transformer are fully parallel.

Hardware requirements

Primary

Encoder network (Transformer, CNN) is dense matmul - GPU Tensor Cores give a 5-10x speedup. Batching multiple inputs into one forward pass exploits full SM width.

Good fit

Retrieval over vectors (cosine, ANN) works great on CPU with SIMD (AVX-512). FAISS has optimised CPU kernels - often the choice for self-hosted vector DBs.

Good fit

Google TPUs (v4, v5, Trillium) handle Transformer encoders well - used by Google for their own embeddings (Gecko, textembedding-gecko).