Kinds of learning
Dimensionality Reduction and Representation Discovery
Understand compression, projection, embeddings, and visualization as representation choices with specific preservation goals and failure modes.
By the end you can
- Explain why high-dimensional data can be compressed into lower-dimensional representations
- Distinguish reconstruction, variance, neighborhood, and task-oriented preservation goals
- Recognize the limits of two-dimensional visualizations
- Evaluate a representation using both internal and downstream evidence
Reduction asks what information may be discarded
A dimensionality-reduction method maps many measured variables into fewer coordinates. The new coordinates may compress redundancy, expose factors, speed downstream models, or support visualization.
Every reduction sacrifices information. The question is not whether the map is smaller. It is which relationships the map preserves and which it distorts — and, for at least one of those relationships, exactly what the preservation costs.
Visual
Different methods preserve different notions of structure
Preservation goals conflict. That is why no low-dimensional representation is universal. Reconstruction retains enough information to approximately recover the original observation. Variance preserves directions with large spread under a linear projection. Neighborhood keeps selected local relationships close in the new space. Task signal retains what a later prediction, retrieval, or control objective needs. A method optimizing one of these is not thereby serving the others.
One of the four goals has an exact, proved price. Take n points in any Euclidean space. They can be mapped into k dimensions with every pairwise distance preserved to within a factor of (1 ± ε), provided k ≥ 4(ε²/2 − ε³/3)⁻¹ ln n. That is the Johnson–Lindenstrauss lemma, in the form Dasgupta and Gupta proved. The remarkable part of the bound is what is missing from it. Here k depends on log n and on ε only. It does not depend on the original number of features at all. Ten thousand columns or ten million: the dimensions you need to hold all pairwise distances to within 1 ± ε are set by how many points you have and how much distortion you will accept.
And the price cannot be haggled down. In 2016 Larsen and Nelson proved a matching lower bound of m = Ω(ε⁻² lg n). “This lower bound matches the upper bound given by the Johnson-Lindenstrauss lemma,” they write. No cleverer map, linear or not, does better. This is what a preservation goal looks like when it is stated precisely enough to be settled: a named quantity, an exchange rate in dimensions, and a proof that the rate is the best available. The other three goals in this lesson have no such receipt. Arguments about them are settled by measurement, not by theorem.
- 01
Reconstruction
Retain enough information to approximately recover the original observation.
- 02
Variance
Preserve directions with large spread under a linear projection.
- 03
Neighborhood
Keep selected local relationships close in the new space.
- 04
Task signal
Retain information useful for a later prediction, retrieval, or control objective.
Example
Why teams reduce dimensions
One mathematical operation can serve very different practical purposes. Two results show the range.
Two coordinates out of half a million can locate a European on a map. Novembre and colleagues ran principal component analysis on 3,000 European individuals genotyped at over half a million DNA sites, and published the result in Nature in 2008. The first two linear coordinates reproduce the map of Europe. They reproduce it closely enough to place a person on it. The paper says: “Using a multiple-regression-based assignment approach, one can place 50% of individuals within 310 km of their reported origin and 90% within 700 km of their origin.” Two years later an independent group reproduced the effect with panels of only 500 or 1,000 selected SNPs, still predicting individual origin to within a few hundred kilometres. When a reduction is keeping something real, this is what it looks like: an external, checkable quantity recovered from the new coordinates.
Compression can also be a dial rather than a fixed choice. In 2022 Kusupati and colleagues published Matryoshka Representation Learning: one embedding whose leading prefixes are themselves usable representations. They report up to 14× smaller embedding size at the same ImageNet-1K accuracy, and up to 14× real-world speed-ups for large-scale retrieval. The technique is in production. Google's Gemini embedding models are trained with it, and the Gemini API documentation tells the caller what that buys: “By default, both models output a 3072-dimensional embedding, but you can truncate it to a smaller size without losing quality to save storage space.” You pick 3,072, 1,536 or 768 dimensions at call time. A reduction decision has moved out of the research paper and into an API parameter a reader can go and use today.
- Sensor monitoring: summarize hundreds of correlated channels before anomaly review.
- Document retrieval: map texts into embeddings where semantically related items are nearby, at a dimension the caller chooses — Gemini embedding models emit 3,072 dimensions that may be truncated to 1,536 or 768.
- Image search: compress visual content into vectors suitable for nearest-neighbor lookup; Matryoshka Representation Learning reports up to 14× smaller embeddings at the same ImageNet-1K accuracy and up to 14× real-world speed-ups.
- Genomics: explore broad variation while reducing measurement redundancy — two principal components of 3,000 European individuals, genotyped at over half a million DNA sites, place 50% of them within 310 km of their reported origin, and an independent group recovered the same geography from panels of only 500 or 1,000 selected SNPs.
- Visualization: project a sample into two dimensions to generate hypotheses — with the caution the next two sections earn.
- Modeling: reduce noise or computation before a simpler downstream estimator.
Comparison
Linear summaries and nonlinear maps answer different questions
The method family changes which relationships are easy to preserve and interpret.
A linear projection represents every coordinate as a weighted combination of original features. It is often easier to inspect, and it supports reconstruction and variance analysis. It cannot unfold every curved structure, and it is sensitive to scaling. It is what recovered the map of Europe from half a million genotyped sites.
A nonlinear embedding allows a curved or local map into fewer dimensions. It can reveal local manifolds. But global geometry may distort, parameters affect the picture, and the axes are rarely directly interpretable.
A task-trained representation learns a space for a downstream objective. It preserves target-relevant signal, may discard other useful information, can encode target bias, and requires protected downstream tests.
Linear projection
Represents every coordinate as a weighted combination of original features.
- Often easier to inspect
- Supports reconstruction and variance analysis
- Cannot unfold every curved structure
- Sensitive to scaling
Nonlinear embedding
Allows a curved or local map into fewer dimensions.
- Can reveal local manifolds
- Global geometry may distort
- Parameters affect the picture
- Axes are rarely directly interpretable
Task-trained representation
Learns a space for a downstream objective.
- Preserves target-relevant signal
- May discard other useful information
- Can encode target bias
- Requires protected downstream tests
Key idea
A beautiful two-dimensional map is not a proof of clusters
The failure modes of local visualization methods are not a suspicion. They were demonstrated on controlled synthetic data, where the right answer is known in advance. How to Use t-SNE Effectively, published in Distill in 2016, built point clouds whose true structure its authors had chosen themselves, then showed what t-SNE does to them.
Cluster sizes come out equalised. The algorithm expands dense clusters and contracts sparse ones, so a big blob on the screen is not a big group in the data. Distances between well-separated clusters may carry no information at all. Section 3 of the article puts it flatly: “The basic message is that distances between well-separated clusters in a t-SNE plot may mean nothing.” And purely random Gaussian point clouds — data with no clusters in it whatsoever — produce dramatic-looking clumps at low perplexity. A reader shown that last picture without its caption would report groups that do not exist.
Chari and Pachter later put numbers on the same distortion, measuring 4- to 200-fold inflation of the ratio of maximum to minimum pairwise distance in 2D embeddings of single-cell data. Use several seeds, parameter settings, and complementary views. Confirm any substantive claim with original-space analysis or external evidence.
A projection is a lens for investigation, not a photograph of hidden reality.
Case
An embedding shaped like an elephant scores as well as UMAP
The distortion has been measured. Chari and Pachter, in PLOS Computational Biology in 2023, reported that two-dimensional t-SNE and UMAP embeddings of single-cell genomic data kept little of the original neighborhood structure. Average Jaccard distance to the ambient-space neighbors ran consistently above 0.7. The ratio of largest to smallest pairwise distance was inflated 4- to 200-fold. Then they built what they called Picasso embeddings: the same data forced into an arbitrary outline, an elephant among them. Those pictures score comparably to t-SNE and UMAP on the usual preservation metrics. A layout that can be an invented animal and still pass the test is not evidence for a cluster.
Comparison
How to evaluate a lower-dimensional space
Evaluation depends on why the representation was created. Reconstruction evidence measures how much original information can be recovered. It is useful for compression, but it may preserve irrelevant detail, is sensitive to feature scaling, and guarantees no task utility. Neighborhood evidence checks whether meaningful nearby relationships survive. It suits retrieval and local exploration, though the choice of neighborhood matters, global distortion can hide inside it, and it needs a domain-relevant notion of similarity. Downstream evidence tests the representation in a separate task or decision. It connects the features to practical use, requires protected evaluation, can expose lost signal, and may overfit if repeatedly tuned.
The third column now has a public, sized instrument. The Massive Text Embedding Benchmark, published in 2022, spans 8 embedding tasks over 58 datasets and 112 languages, and it benchmarked 33 models across all of them. Its abstract states the result that this lesson's preservation-goals section only asserts: “We find that no particular text embedding method dominates across all tasks.” A representation good for semantic similarity is not thereby good for clustering, retrieval or reranking. It took 33 models over 58 datasets to say so with evidence rather than intuition.
Production APIs have absorbed the finding. Google's Gemini embeddings API exposes a task_type parameter. The interface asks the caller which task the vector is for, because the vector should differ depending on the answer.
Reconstruction evidence
Measure how much original information can be recovered.
- Useful for compression objectives
- May preserve irrelevant detail
- Sensitive to feature scaling
- Does not guarantee task utility
Neighborhood evidence
Check whether meaningful nearby relationships survive.
- Useful for retrieval and local exploration
- Choice of neighborhood matters
- Can hide global distortion
- Needs domain-relevant similarity
Downstream evidence
Test the representation in a separate task or decision.
- Connects features to practical use
- Requires protected evaluation
- Can expose lost signal
- May overfit if repeatedly tuned
Analogy
Choosing a map for a journey
A traveller selects a city map. A subway map preserves station order, a road map preserves streets, and a topographic map preserves elevation. None preserves everything.
Dimensionality reduction follows the same principle of purpose-driven distortion. A printed map stays fixed. A learned representation shifts with the data, the training objective, and the random initialization.
A useful representation preserves the relationships needed for the next task.
Steps
Audit a representation before trusting the picture
Treat the space as a model. A lower-dimensional space carries assumptions and needs evaluation.
First, name the purpose: compression, visualization, retrieval, denoising, or prediction. Second, prepare the inputs. Review scaling, missingness, sparsity, and dominant nuisance variables. Third, define preservation explicitly — reconstruction, variance, neighborhoods, or task signal — because only the first of these comes with a proved exchange rate in dimensions. Fourth, test perturbations. Vary samples, seeds, dimensions, and reasonable method settings, since random Gaussian clouds can clump convincingly at low perplexity. Fifth, inspect correspondences. Trace points and neighborhoods back to original examples. Sixth, validate downstream: measure whether the representation helps the intended use without contaminating evaluation.
1. Name the purpose
State whether the goal is compression, visualization, retrieval, denoising, or prediction.
2. Prepare the inputs
Review scaling, missingness, sparsity, and dominant nuisance variables.
3. Define preservation
Choose reconstruction, variance, neighborhoods, or task signal explicitly.
4. Test perturbations
Vary samples, seeds, dimensions, and reasonable method settings.
5. Inspect correspondences
Trace points and neighborhoods back to original examples.
6. Validate downstream
Measure whether the representation helps the intended use without contaminating evaluation.
An embedding is not a dictionary of meaning
Nearby vectors indicate similarity according to the data and objective that produced the space. That is a narrower claim than it sounds. Proximity does not guarantee shared cause, moral equivalence, or human-understood semantics.
Embedding geometry can also encode frequency, language, culture, and collection bias, and a national measurement agency has quantified what that does to a fixed distance threshold. In December 2019 NIST ran 18.27 million images of 8.49 million people through 189 mostly commercial algorithms from 99 developers. The finding concerns false positives: the rate at which two different people's face vectors fall inside the same match threshold. The executive summary of that report states it in one line: “Across demographics, false positives rates often vary by factors of 10 to beyond 100 times.” In the higher-quality application photos the rate was highest for West and East African and East Asian faces, and lowest for Eastern European faces. False negatives varied by factors below 3. The U.S. Commission on Civil Rights restated the same finding in its September 2024 report.
One threshold, one embedding space, and an error rate that differs by two orders of magnitude depending on whose face is in it. Document the training context before treating vector distance as a universal meaning measure.
Case
Word vectors that track the 2015 occupation statistics at ρ = 0.90
How much of that context survives in the geometry has been measured. Off-the-shelf GloVe vectors, trained on 840 billion tokens of Common Crawl text, carry documented human biases from the Implicit Association Test literature: flowers over insects, European-American over African-American names, female names with family words rather than career words. Caliskan and colleagues reported that in Science in 2017, using an association test on the vectors themselves.
They then checked the same vectors against labor statistics. The strength of an occupation word's association with female gender tracked the share of women in that occupation across 50 occupations in the 2015 US Bureau of Labor Statistics data at ρ = 0.90, p < 10⁻¹⁸. For androgynous first names against 1990 census data, ρ = 0.84. The distances were reading the world accurately, including the parts nobody chose.
Key takeaways
- Dimensionality reduction chooses which information and relationships to preserve in a smaller space. For pairwise distance the price is a proved one: k ≥ 4(ε²/2 − ε³/3)⁻¹ ln n dimensions, with a matching lower bound of Ω(ε⁻² lg n).
- Reconstruction, variance, neighborhood, and task objectives can favor different representations; across 8 tasks, 58 datasets and 33 models, no text embedding method dominated all of them.
- Two-dimensional projections are exploratory views with unavoidable distortion: t-SNE equalises cluster sizes, can render between-cluster distances meaningless, and clumps purely random Gaussian data at low perplexity.
- Evaluation should match the representation's intended use and include perturbation tests over seeds, parameters and subsamples, because an embedding forced into the outline of an elephant scores comparably to t-SNE and UMAP.
- Embedding distance reflects the data and objective, not universal human meaning: NIST measured false-positive rates varying by factors of 10 to beyond 100 across demographic groups at one threshold.
- A reduction that is keeping something real can be checked against the outside world — two principal components of half a million DNA sites place 50% of individuals within 310 km of their reported origin.