Wiki Foundations3 Concepts and Frameworks of AI
3.5 Latent Space and Representation Learning
The Inner World of Machines: From Representation to Latent Space#
As mentioned in Chapter 1, connectionism (artificial neural networks) drew inspiration from the logic of neuronal activity in biological brains, aiming to create artificial intelligence by emulating the brain’s structure and function. Since the release of GPT-4, the rapid rise of large models has shown that machine intelligence can increasingly approach human-level performance.
Yet a fundamental debate persists: are these models merely acting as “stochastic parrots,” or do they, to some extent, genuinely understand language and the content they generate?
Beneath this debate lies a deeper question for artificial intelligence: Can a machine build its own internal “world model”?
A world model is an internal simulation of reality formed within an intelligent system—one that enables it to predict the future, plan actions, and grasp cause and effect.
The human brain undoubtedly possesses this capability. When we see a cup tipped over, even before it hits the floor, we can already simulate the ensuing scene in our minds.
This predictive power indicates that the brain houses a structured internal mechanism for representing and manipulating the external world. To understand how machines might acquire a similar mechanism, we must first examine how such internal models are realized in biological organisms.
How Humans “Model” the World in the Brain#
Human understanding of the world stems from internal representations that are continually constructed and updated in the brain.
When our sensory systems receive external stimuli (light, sound, odor, etc.), the brain does not store raw signals; instead, it converts them into activity patterns across populations of neurons.
Neurons encode stimulus features—such as brightness, orientation, pitch, or chemical composition—through spike timing, firing frequency, and population dynamics.
In neuroscience, this conversion process is known as Neural Coding, and these neuronal firing patterns constitute the brain’s internal representations of external information.
For instance, neurons in the primary visual cortex (V1) exhibit selectivity for edges of specific orientations, while “place cells” in the hippocampus fire when an animal enters a specific location, forming an internal map of space.
Crucially, these representations are dynamic: drawing on past experience, the brain continually generates hypotheses about the external world and uses incoming sensory signals to correct prediction errors.
Predictive Coding describes precisely this mechanism—the world we perceive is the product of an ongoing interplay between our internal models and external sensory inputs.
The “Inner World” of AI: The Digital Counterpart of Representation#
As digital computers, AI models re-enact this process in a different physical substrate.
When we train a model on thousands or millions of images, texts, or audio clips, it does not simply memorize every image or sentence verbatim; rather, as its parameters update, it learns stable, predictable relational structures across the data.
As training error decreases, the model gradually forms a statistical, abstract “understanding” of the world: distinct activation patterns across artificial neurons (or parameter weights) come to encode salient features of the input data.
In computer vision models, for example, lower-layer units respond to edges and colors, while deeper layers progressively respond to whole shapes and semantic objects; in language models, vector representations across layers capture implicit syntactic dependencies and semantic associations between words.
These learned numerical patterns of weights and activations form a digital representational system through which AI models make sense of the world.
Although the physical substrates differ—biological representations are carried by neural spike trains, whereas AI representations exist as numerical vectors and tensors—their functional roles are remarkably similar: both transform the external world into internally manipulable forms, driven by a core loop of prediction and error correction.
Once trained, the patterns and structures learned by a model are compressed into an abstract, multi-dimensional vector space known as Latent Space.
Within this space, every data sample corresponds to a point (vector), where semantically or structurally similar samples cluster together and distinct categories naturally separate.
This is the machine’s “inner world”—an nascent world model organized through mathematical and digital structure. It stores the core regularities and features distilled from data, serving as the internal frame of reference from which the model reasons, judges, and generates.
King - Man + Woman ≈ Queen further illustrates how semantic relationships are translated into geometric directions in latent space. Right: An experiment from the seminal Seq2Seq paper (see our RNN chapter) demonstrates that even when sentences differ in surface phrasing (such as active vs. passive voice), expressions with similar meanings (e.g., "I was given a card by her" lies much closer to "She gave me a card" than to "I gave her a card") project to nearby points in latent space—confirming that latent space encodes abstract semantics rather than superficial syntax.
What Is Actually Hidden Inside “Latent Space”?#
Etymologically, latent means “hidden” or “not directly observable.”
The term first emerged in statistics and psychometrics to describe variables that cannot be measured directly but can be inferred from observable outcomes.
In 1969, psychometrician Fumiko Samejima used the term latent ability in her research: we cannot directly measure a person’s reading comprehension with a physical ruler, but we can estimate it from test scores. Such an inferred, unobservable quantity is a latent variable.
With the rise of probabilistic modeling and machine learning, researchers formalized this concept into latent variable models, eventually giving rise to modern generative frameworks such as Variational Autoencoders (VAEs).
As for space, in mathematics it denotes a set equipped with formal structure. When data points are mapped into this space, distances and directions between points encode relationships, similarities, and differences.
Yet the sheer complexity of the real world means that “similarity” and “difference” cannot be captured in a flat 2D plane or even the 3D physical space we inhabit; instead, a latent space may span hundreds or thousands of dimensions, forming an abstract mathematical manifold.
Because we cannot perceive its geometry directly through our senses, we rely on mathematical tools and dimensionality-reduction visualizations to probe its structure.
(Note: Any 2D or 3D scatter plot of a latent space is merely a coarse, low-dimensional projection approximating the true high-dimensional geometry.)
This is precisely why it is called latent space: it exists, yet lies beyond direct sensory observation.
We now know that latent space is a high-dimensional vector space that serves as the mathematical form of a model’s internal world.
This naturally raises the next question: where do these high-dimensional vectors come from? Who decides their “coordinate axes” and “orientations”—in other words, where does a model’s “worldview” come from?
From Feature Engineering to Representation Learning: Who Defines the Model’s “Worldview”?#
In the early days of machine learning, the world a model saw was defined entirely by humans.
Researchers analyzed the problem, hand-crafted relevant features, and fed them into an algorithm. For images, we extracted edges and textures; for text, we counted word frequencies and constructed n-grams.
For example, to train a classifier to distinguish “cats” from “dogs” in 100 \times 100 grayscale images, engineers would first compute edge orientations and texture histograms across local patches, concatenating these summary statistics into a numerical vector such as [0.12, 0.08, 0.03, …].
The model never truly “saw” the raw pixels of the image; it merely searched for a decision boundary within this human-curated list of numbers.
In other words, the coordinate axes of early models’ latent spaces were pre-defined by humans—which dimensions existed and which features mattered were hard-coded in advance.
The limitation of this approach was obvious: whenever the task or data distribution shifted, human experts had to redesign the features from scratch. The machine was not learning the structure of the world; it was merely executing rules within a human-prescribed schema.
Deep learning changed this paradigm fundamentally.
Rather than relying on hand-crafted features, deep neural networks automatically learn how to describe the world directly from raw data across multiple hierarchical layers.
Returning to the “cat vs. dog” example: we no longer need to instruct the model to inspect ear shapes or fur textures. Starting from raw pixels, the network progressively distills the discriminative information layer by layer.
Neurons in the lowest layers respond to simple edges and color gradients; intermediate layers combine these into local parts and motifs; deeper layers capture high-level abstract concepts such as facial structure and posture.
Ultimately, this hierarchy of abstractions crystallizes into a set of high-dimensional vectors discovered by the model itself—its learned internal representation.
This is the essence of Representation Learning1: enabling models to autonomously discover stable, computable ways of expressing data.
Put simply, the heart of deep learning is representation learning—machines no longer depend on human-engineered features, but instead construct their own internal “coordinate systems” for understanding the world directly from data.
How Training Paradigms Shape Latent Space#
If a model’s latent space emerges from its training process, do different training paradigms sculpt different internal worlds?
The answer is a resounding yes.
Different training paradigms act like distinct “modes of cognition,” governing how a model organizes the world inside its latent space.
Supervised Learning: Drawing Boundaries with Labels#
In supervised learning, every training sample comes with an explicit ground-truth label.
By minimizing classification error, the model pulls samples of the same class together while pushing different classes apart.
Consequently, the resulting latent space exhibits a sharply partitioned geometry: “cats” form one cluster, and “dogs” form another.
While highly efficient for discriminative classification, such a space often lacks global continuity. The model learns how to tell categories apart, but may not capture the smooth morphological continuum between a “house cat” and a “tiger,” nor the hierarchical relationship between a “tree” and a “forest.”
Self-Supervised Learning: Discovering Structure from the Data Itself#
Can a machine still learn when no human labels are provided?
Self-supervised learning answers: not only can it learn, it can learn far deeper representations.
Rather than relying on external annotations, self-supervised methods exploit the intrinsic structure of raw data to create pretext tasks—forcing the model to infer how the data is put together and, by extension, the generative regularities of the world.
Classic examples include:
- MAE (Masked Autoencoder): By masking out large portions of an image and training the model to reconstruct the missing pixels, MAE forces the network to learn what parts constitute an object and how local details relate to the global whole. Instead of memorizing discrete labels for “cat” or “dog,” it learns the structural grammar of cat-like and dog-like forms.
- Autoregressive / Context Prediction Objectives (Word2Vec, GPT): By predicting surrounding context words or the next token in a sequence, the model internalizes the syntactic, semantic, and relational structure of language.
The latent space sculpted by self-supervised learning is smoother, more richly structured, and far more transferable.
Because it captures the underlying organizational logic of the data rather than task-specific decision boundaries, a single self-supervised latent space can simultaneously support classification, retrieval, reasoning, and generation.
However, real-world data distributions are complex, high-entropy, and noisy, with meaningful signal often buried beneath vast amounts of surface redundancy.
Enabling models to extract invariant, stable structures amidst high noise remains one of the central quests of representation learning.
What Makes a “Good” Latent Space?#
Consider the perspective articulated by Ilya Sutskever:
“A good representation = a compressed, predictive model of the world.”
At its core, intelligence is the compression and modeling of statistical regularities in the world.
If this holds true, then a good latent space should be a minimal, sufficient description of the world’s stable structure.
Such a space exhibits three defining properties:
- Compression: Capturing the most essential patterns using the least amount of information.
- Continuity (Smoothness): Placing similar samples near one another so that continuous variations in the real world trace smooth trajectories in latent space.
- Predictiveness: Moving along specific directions in the space corresponds to meaningful, interpretable transformations in the real world.
When a latent space possesses these properties, complex real-world problems simplify into clean geometric operations: distinct concepts align along different axes, and related entities naturally organize into hierarchical clusters.
This means the model has not merely memorized the training data, but has internalized the organizational logic connecting them.
Ultimately, both biological brains and artificial neural networks are striving toward the same goal: simulating an infinitely complex external world using a finite internal structure.
Beneath this lies a fundamental principle from information theory (such as the Information Bottleneck): representation learning seeks the optimal trade-off between compressing the input and preserving predictive power.
If the latent space is too constrained, vital information is discarded and predictive power collapses; if it is too vast and unconstrained, the model simply memorizes raw inputs along with their noise, failing to abstract.
A good latent space sits precisely at the sweet spot between the two: it discards the incidental and retains the essential.
The human brain is remarkable, and latent space is remarkable in much the same way.
So, what can we actually do inside a latent space?
The answer is simulate and predict the world: it is when we perform prediction and planning in abstract embedding space—rather than raw pixel space—that a world model truly comes alive.
Take Google DeepMind’s Dreamer series (widely regarded as a pioneering world model for robotics): it pairs an observation-to-latent representation model with a latent dynamics model to “roll out the future” entirely inside latent space—performing imaginative planning and policy optimization before closing the loop with real-world execution.
Likewise, today’s frontier image and video generation models perform their sampling and temporal evolution inside compressed latent spaces (a topic we will explore further in the chapter on Diffusion Models).
The next time you hear researchers in the AI community debating “world models,” you will know the foundational substrate they are talking about.
Epilogue#
In artificial intelligence, a representation is the intermediate computational structure formed by a model—the structured internal expression into which raw data is transformed so that it can be operated upon and reasoned over.
A compact vector or an efficient tensor activation pattern is precisely how a model encodes external reality.
By now, readers may appreciate why understanding AI requires computational thinking: from neural coding in the biological brain to representation learning in silicon machines, the scientific quest to understand intelligence has continually mirrored itself across these two domains.
How data and information are represented ultimately determines the extent to which a machine can “compute” the world.
This chapter has laid out the foundational principles of representation and latent space in general AI, setting the stage for our next step into GeoAI—where we will ask how geographic space itself can be represented and learned.
To bridge into spatial representation learning, we close with a classic passage from O’Keefe and Nadel’s The Hippocampus as a Cognitive Map:
SPACE plays a role in all our behaviour. We live in it, move through it, explore it, defend it. We find it easy enough to point to bits of it: the room, the mantle of the heavens, the gap between two fingers, the place left behind when the piano finally gets moved. — O’Keefe & Nadel, *The Hippocampus as a Cognitive Map* (1978, p. 5)
Author & References#
Ph.D. candidate (Class of 2022) at the Department of Urban Spatial Information Engineering, Shenzhen University.
Research interests: GeoAI, Geospatial Tokenization, Human Mobility Generation, and Geospatial Data Representation Learning.
This chapter was authored by Fei Huang with assistance from AI tools (ChatGPT, Gemini). Several illustrations used in the text are adapted from public online sources.
The cover illustration was generated using Jimeng AI (即梦 AI) with the following prompt:
Multiple exposure, blue color palette, reflection, illustration, abstract animation, background filled with neurons, numbers flowing all around, faintly visible, back view of a robot in the foreground, gradient stretching from the bottom-left corner to the right side of the robot, flowing digits appearing and fading, numbers floating beside the robot beneath a gradient starry sky.
References#
-
Learning to Generate Reviews and Discovering Sentiment (OpenAI Sentiment Neuron)
-
CS231n: Understanding and Visualizing Convolutional Neural Networks
-
In this chapter, we use representation to refer both to the internal form in which information is encoded within a cognitive or computational system and to the machine learning paradigm of Representation Learning. As defined by Bengio, Courville, and Vincent (2013) in IEEE Transactions on Pattern Analysis and Machine Intelligence: “representation learning, i.e., learning representations of the data that make it easier to extract useful information when building classifiers or other predictors.” ↩