AI & LLMs

t-SNE

A technique for visualizing high-dimensional data in 2D/3D by preserving which points are neighbors.

t-SNE (t-distributed Stochastic Neighbor Embedding) is a nonlinear dimensionality-reduction technique for visualizing high-dimensional data: it places points in 2D or 3D so that near neighbors in the original space stay near in the plot, revealing clusters. It is a go-to for eyeballing embeddings.

Worked example: project 768-dimensional word or image embeddings to 2D with t-SNE and similar items form visible clusters — a quick sanity check that your embeddings capture meaningful structure. Gotcha: t-SNE preserves LOCAL structure but distorts global structure — distances between clusters and cluster sizes are not meaningful, and results change with the “perplexity” setting and random seed — so use it for exploration only, never as model input or to draw quantitative conclusions; UMAP is often preferred for preserving more global structure.