The Seductive Power of a Pretty Picture
Let’s be honest: t-SNE (t-distributed Stochastic Neighbor Embedding) is a rockstar of dimensionality reduction. It takes datasets with hundreds of features—impossible for a human to visualize—and projects them down into a simple 2D chart. The algorithm’s
goal is to preserve local structure, meaning points that are close together in the original, high-dimensional space should remain close together on the 2D plot. When it works, it feels like magic. Distinct, island-like clusters emerge from a sea of data, suggesting we’ve discovered meaningful groups. It’s visually satisfying and provides a powerful, intuitive way to begin exploring a complex dataset, from genomics to machine learning model outputs. This is its great strength, but it’s also the source of a massive misunderstanding.
The Detail Everyone Gets Wrong
Here's the critical detail most engineers and data scientists skip: The relative sizes of the clusters and the distances between them on a t-SNE plot are almost always meaningless. Let that sink in. You might see a big, sprawling cluster and a small, tight one and conclude the first group is more diverse or numerous. You’d likely be wrong. You might see two clusters far apart and one pair close together, and assume the distant clusters are more dissimilar. You’d be wrong again. This is not a small quirk; it’s a fundamental feature of how the algorithm works. t-SNE is not a faithful map of your data landscape; it's a distorted funhouse mirror that’s excellent at showing you who your immediate neighbors are, but tells you nothing about the global geography.
Why Your Eyes Are Lying to You
So why does t-SNE create this illusion? The algorithm has a built-in mechanism that messes with your perception of space. By design, it adapts to the density of the data in different regions. It actively expands dense clusters and contracts sparse ones to make them more visible. This density equalization is a feature, not a bug, as it helps reveal the separation of groups. But a side effect is that all clusters tend to end up looking roughly the same size in the final visualization, regardless of their actual size or variance in the original data space. Furthermore, t-SNE's use of a Student's t-distribution in the low-dimensional space is great for separating dissimilar points (avoiding the "crowding problem"), but it completely gives up on preserving the large-scale distances between them. It prioritizes keeping neighbors together, and once two groups are determined to be separate, the algorithm doesn't care how separate they become in the final plot.
How to Use t-SNE Correctly
This doesn't mean t-SNE is useless. It’s an incredible exploratory tool, as long as you follow a few rules. First, treat it as a tool for identifying local structure and confirming the existence of groups, not for measuring them. Ask: "Are there clusters?" not "How big are these clusters or how far apart are they?" Second, always run t-SNE multiple times with different settings for its main hyperparameter, "perplexity." Perplexity roughly defines the number of neighbors each point considers. If your clusters vanish or radically change shape at different perplexity values (the recommended range is usually 5 to 50), what you're seeing might just be an artifact of the algorithm, not a true pattern in your data. Finally, never use the output of t-SNE as input for a downstream modeling task like clustering. Its sole purpose is visualization and hypothesis generation.








