RUNLOCALAIv38
->Will it run?Best GPUCompareTroubleshootStartLearnPulseModelsHardwareToolsBench
Run check
RUNLOCALAI

Independently operated catalog for local-AI hardware and software. Hand-written verdicts. Source-cited claims. Reproducible commands when we have them.

OP·Fredoline Eruo
DIR
  • Models
  • Hardware
  • Tools
  • Benchmarks
TOOLS
  • Will it run?
  • Compare hardware
  • Cost vs cloud
  • Choose my GPU
  • Prompting kits
  • Quick answers
REF
  • All buyer guides
  • Learn local AI
  • Methodology
  • Glossary
  • Errors KB
  • Trust
EDITOR
  • About
  • Author
  • How we make money
  • Editorial policy
  • Contact
LEGAL
  • Privacy
  • Terms
  • Sitemap
MAIL · MONTHLY DIGEST
Get monthly local AI changes
Monthly recap. No spam.
DISCLOSURE

Some links on this site are affiliate links (Amazon Associates and other first-class retailers). When you buy through them, we earn a small commission at no extra cost to you. Affiliate links do not influence our verdicts — there are cards we rate highly that we don't have affiliate relationships with, and cards that sell well that we refuse to recommend. Read more →

© 2026 runlocalai.coIndependently operated
RUNLOCALAI · v38
Glossary / Classical ML algorithms / t-SNE
Classical ML algorithms

t-SNE

t-SNE (t-distributed Stochastic Neighbor Embedding) is a dimensionality reduction technique used to visualize high-dimensional data (like embeddings from a local LLM) in 2D or 3D scatter plots. It preserves local structure: points that are close in the original high-dimensional space stay close in the low-dimensional projection. Operators encounter t-SNE when analyzing model outputs or embedding clusters—for example, plotting sentence embeddings from a local model to see how different prompts cluster. t-SNE is computationally expensive (O(n²)) and non-deterministic; results vary with the perplexity parameter. It's not used for inference, only offline analysis.

Deeper dive

t-SNE works by converting high-dimensional Euclidean distances into conditional probabilities that represent similarities, then minimizing the Kullback-Leibler divergence between those distributions in high and low dimensions. The key parameter is perplexity (roughly the effective number of neighbors), typically set between 5 and 50. Lower perplexity emphasizes local structure; higher perplexity considers more global structure. t-SNE is stochastic—each run produces a different embedding, so operators should run multiple times to confirm patterns. It scales poorly beyond ~10,000 points; for larger datasets, UMAP is often preferred. In local AI workflows, t-SNE is applied to embedding vectors (e.g., from sentence-transformers or LLM hidden states) to inspect how the model organizes semantic concepts. It's a diagnostic tool, not part of the runtime pipeline.

Practical example

An operator extracts 768-dimensional embeddings from a local sentence-transformer model (e.g., all-MiniLM-L6-v2) for 5,000 customer support queries. Running t-SNE with perplexity=30 in Python (sklearn.manifold.TSNE) reduces each embedding to 2D. The resulting scatter plot reveals clusters: billing questions form one group, technical issues another. This helps the operator decide whether a simple classifier can route queries without a full LLM call.

Workflow example

In a local AI workflow, after generating embeddings with sentence-transformers or extracting hidden states from a Hugging Face model, the operator runs t-SNE offline in a Jupyter notebook: from sklearn.manifold import TSNE; tsne = TSNE(n_components=2, perplexity=30); X_2d = tsne.fit_transform(embeddings). The resulting 2D points are plotted with matplotlib to inspect cluster separation. This is a one-time analysis step—never part of the serving pipeline due to high latency.

Reviewed by Fredoline Eruo. See our editorial policy.

Buyer guides
  • Best GPU for local AI →
  • Best laptop for local AI →
  • Best Mac for local AI →
When it doesn't work
  • CUDA out of memory →
  • Ollama running slowly →
  • ROCm not detected →