AI Glossary / Natural language and speech / Intermediate
Latent semantic analysis
Definition
Latent semantic analysis, or LSA, represents relationships among terms and documents by reducing a term - document matrix to a smaller set of numerical dimensions, commonly through truncated singular value decomposition. It uses patterns of word occurrence across documents to construct a lower-dimensional representation. When used for indexing and retrieval, the approach is often called latent semantic indexing, or LSI.
What it means
Two documents can discuss related subjects while using different words. A simple exact-word comparison may miss that relationship. LSA looks at broader patterns in a collection: terms that occur in similar document contexts can contribute to shared numerical directions.
Latent means that these directions are derived from the data rather than supplied as named categories. They are not automatically human-readable topics, verified facts, or a model's conscious understanding. A useful representation can improve some comparisons while discarding distinctions that another task needs. Its quality depends on the collection, preprocessing, weighting, retained dimension count, and evaluation task.
How it works
Start with a matrix whose rows represent terms and columns represent documents, or the transposed convention. Entries contain counts or weights such as TF - IDF. Singular value decomposition factors the matrix into components with associated strengths called singular values.
Keeping the largest k singular components produces a rank-k approximation and corresponding compact vectors. Queries and new documents can be mapped into a compatible space for similarity comparisons. The reconstructed approximation still has the original matrix's row and column dimensions; reduced rank is not the same as physically deleting vocabulary rows.
Choosing k creates a tradeoff. Too much reduction can collapse meaningful distinctions, while retaining many dimensions reduces the compression. New vocabulary and changing document patterns can also require refitting rather than indefinitely projecting into an old space. A fitted representation should be evaluated on the intended retrieval or analysis task, not only on reconstruction quality.
Three practical examples
1. Document search: A team compares queries and documents in an LSA space to investigate whether related wording improves retrieval beyond a lexical baseline.
2. Corpus exploration: Analysts use compact document vectors to examine broad groupings, then read representative documents before assigning human labels to the patterns.
3. Classification features: A text classifier uses reduced vectors as inputs, with preprocessing and the reduction fitted on the training data and evaluated on held-out examples.
Think of it this way
Think of compressing a detailed map into a few dominant routes. The simplified view may reveal broad connections, but it can omit a small road that matters to one traveler. LSA similarly retains strong numerical patterns while losing information. The analogy does not imply that singular components correspond to real roads or neatly labeled semantic topics.
Worked example
Use an original three-term, three-document count matrix. Let the rows be valve, pump, and poem, with values [2, 1, 0], [1, 2, 0], and [0, 0, 1]. Thus the first two documents share the equipment terms in different proportions, while the third contains only poem in this simplified vocabulary.
The singular values are 3, 1, and 1. Keeping only the largest produces the rank-one reconstruction with rows [1.5, 1.5, 0], [1.5, 1.5, 0], and [0, 0, 0]. The first two documents become indistinguishable in this approximation, and the third loses its representation entirely.
The original matrix's sum of squared entries is 11. The retained squared singular value is 9, giving 9/11, approximately 81.8%, of that squared magnitude. The squared reconstruction error is 2. This is not 81.8% semantic accuracy: the poem document has disappeared despite the apparently substantial retained magnitude. The arithmetic was checked numerically. A zero reduced vector also needs explicit handling before cosine similarity is computed.
Illustrative case study
Fictional case: An archive tests LSA to organize maintenance notes and a small collection of literary materials. A strongly compressed representation groups common maintenance vocabulary effectively but gives poor results for the smaller collection.
The team evaluates query results by content type, compares several dimension settings, and inspects the source documents. It considers separate indexing choices where the mixed collection does not serve users well. The compact representation is treated as a candidate tool rather than evidence that minority topics are unimportant. This case reports no real benchmark score or business gain.
Common misconceptions and mistakes
Do not confuse LSA with latent Dirichlet allocation or probabilistic latent semantic analysis. Those are different methods, even though their names refer to latent structure. LSA's singular components need not be nonnegative or interpretable as topic probabilities.
Another mistake is equating retained matrix magnitude with task quality or understanding. The worked example shows how strong compression can erase a small but meaningful part of a collection. Also avoid assuming that all word meanings are resolved by one static representation: context-sensitive ambiguity remains a challenge, and bag-of-words inputs discard word order.
Business use
Businesses should compare LSA with a relevant baseline on actual search, grouping, or prediction tasks. Record preprocessing, term weighting, dimension count, and fitting data. Review performance on rare topics as well as dominant ones. If the corpus changes, assess whether the fitted space still represents new material adequately. Compact vectors are useful when their practical benefit outweighs lost distinctions and maintenance cost.
People also ask
Are the latent dimensions automatically named topics?
No. They are numerical directions and may require cautious human interpretation.
Does reducing rank remove vocabulary rows?
Not necessarily. The reconstructed matrix has the original shape, while its effective dimensionality is reduced.
Is a high retained-magnitude percentage enough to choose k?
No. The task may depend on information that the approximation discards.
Check your understanding
Why is 81.8% not a semantic-accuracy score in the worked example?
Answer: It measures retained squared matrix magnitude, while the reduction merges two documents and erases the third's distinct content.
Related terms
- Singular value decomposition
- Dimensionality reduction
- Cosine similarity
- Rank
- term–document matrix
- TF–IDF
- latent semantic indexing
- vector-space model
Learn next
Recompute the toy example using a less aggressive retained rank and examine which distinctions return. Then compare retrieval judgments with reconstruction statistics on a small corpus. Keep the fitting data separate from evaluation examples and document how zero vectors are handled.
More in Natural language and speech
- Labiodental consonants - Labiodental consonants are speech sounds produced with a constriction involving the lower lip and upper front teeth.
- Language engineering - Language engineering is the practical discipline of designing, building, evaluating, and maintaining systems that process human language.
- Language resource - A language resource is an organized collection of language or speech data, or machine-readable descriptions of language, that people can use in language...
- Latent semantic mapping - Latent semantic mapping, or LSM, is a framework for representing discrete items as vectors in a smaller continuous space, using patterns across a collection...
- Lateral sound - A lateral sound is a speech sound produced with airflow passing around one or both sides of the tongue rather than through an open central channel.
- Lemma - A lemma is the canonical or dictionary-style form used to represent a set of related word forms.
Sources
Primary textbook source: Manning, Raghavan, and Schütze, Introduction to Information Retrieval, latent semantic indexing section: https://nlp.stanford.edu/IR-book/html/htmledition/latent-semantic-indexing-1.html . The low-rank representation, query mapping, and update limitations were read. The three-by-three matrix and numerical check are original, not the textbook's worked example; no real corpus performance is claimed.
Previous: Latent diffusion Next: Latent semantic mapping