Singular Value Decomposition › Choosing Embedding Dimensions

Michael BrenndoerferUpdated March 21, 20264 min read
Language AI HandbookAll chapters
Part 3 of 67Distributional Semantics
Chapter 18Singular Value Decomposition › Choosing Embedding Dimensions
Reading section 5 of 14 · Choosing Embedding Dimensions · 4 minSection 5 of 14 · 4 min

Book contents

Section 5 of 14 · 4 min read

Singular Value Decomposition › Choosing Embedding DimensionsOne section · Sections in this chapter5 / 14 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

The most important hyperparameter in LSA is kk, the number of singular values to retain. The tradeoff is fundamental: too few dimensions and the representation cannot capture enough nuance in the vocabulary; too many and you retain noise rather than signal. Getting kk right matters more than almost any other architectural choice in the LSA pipeline.

The Singular Value Decay Curve

The primary diagnostic for choosing kk is a plot of the singular values in decreasing order, called a scree plot (the term comes from geology: "scree" is the debris that accumulates at the base of a cliff). The scree plot for a typical NLP co-occurrence matrix shows:

  • A rapid initial decline through the first handful of dimensions, representing the dominant semantic themes
  • A knee or elbow where the rate of decline slows substantially
  • A long, gradually declining or flat tail representing noise and idiosyncratic patterns

The optimal kk is often near the elbow. Values beyond the elbow add little signal and increasingly mix noise into the representations. For tasks where you want distinct separation of major topics, choosing kk at or before the elbow is conservative and effective. For tasks where finer distinctions matter, you may benefit from going beyond the elbow.

In practice, the scree plot provides a floor on kk (include all components up to the elbow) but does not give a sharp ceiling. The right answer is usually obtained by evaluating downstream task performance across a range of kk values, which leads to the empirical approach described below.

Empirical Guidance

Choosing kk by evaluating downstream task performance is the most reliable approach. Researchers have found consistent patterns across many experiments with NLP co-occurrence matrices:

  • Small vocabularies and small corpora benefit from small kk (50-100), because there are fewer distinct semantic dimensions to capture and the matrix is not large enough to support reliable estimation of many components
  • Large vocabularies with rich, diverse corpora can benefit from larger kk (300-500), especially when the target application requires distinguishing fine-grained semantic categories
  • The original LSA paper found 100-300 dimensions worked well for document similarity and word analogy tasks
  • Performance is often stable across a range of kk values, with a broad plateau rather than a sharp peak; a factor of 2 change in kk rarely produces dramatic differences

The key insight is that kk controls the bias-variance tradeoff. Small kk gives high bias (the embedding cannot distinguish closely related words or subtle semantic contrasts) but low variance (the representation is not affected by corpus-specific noise or sampling fluctuations). Large kk gives low bias but high variance (noise in the corpus leaks into the embedding dimensions). The optimal kk balances these two sources of error, and that balance point depends on the corpus size and the downstream task.

For practical recommendation: start with k=100k = 100 as a baseline, evaluate on your target task, and try k=50k = 50 and k=300k = 300 to understand the sensitivity. If your corpus is small (fewer than 1 million tokens), prefer smaller kk. If your corpus is large and your task requires fine-grained distinctions, larger kk is worth testing.

Explained Variance as a Guide

An alternative to the scree plot is to look at cumulative explained variance: what fraction of the total variance (sum of squared singular values) is captured by the first kk components? Common thresholds are 80-90% explained variance. In practice, the number of components needed to explain 80% of variance in a large NLP matrix can be surprisingly large, because language has many semantic dimensions. The cumulative variance curve often rises steeply at first and then flattens gradually, without a clean elbow. Using explained variance thresholds can push kk too high in large, diverse corpora.

Both the scree plot and cumulative variance are useful diagnostics, but neither should override direct measurement on your downstream task. The relationship between intrinsic dimensionality estimates and extrinsic task performance is not always predictable.