Study Vault Search notes, aliases and full text
Graph
TopicDBISAI-written · not yet proofread

Latent Semantic Indexing

Latent semantic indexing ranks documents with a rank-k approximation of the term-document matrix computed by singular value decomposition, so that a query also matches documents that share no term with it.

Concepts#

  1. Singular Value Decompositionfactorisation A=USVA = USV into column-orthonormal UU, diagonal SS and row-orthonormal VV; truncation gives the best rank-kk approximation start here
  2. LSI Rankingscores documents with the rank-kk approximation Ak=UkSkVkA_k = U_k S_k V_k instead of AA

How it fits together#

Starting point. In the vector space model the term-document matrix A∈Rm×nA \in \mathbb{R}^{m \times n} (mm terms, nn documents) scores all documents for a query vector q∈Rmq \in \mathbb{R}^m at once as q⊤Aq^\top A. A document only gets a score from the terms it shares with the query.

Factorise, then truncate. The SVD writes A=USVA = USV with U∈Rm×rU \in \mathbb{R}^{m \times r}, S∈Rr×rS \in \mathbb{R}^{r \times r} and V∈Rr×nV \in \mathbb{R}^{r \times n}, where rr is the rank of AA. Some exams write A=USV⊤A = U S V^\top instead, so check which convention the task uses. Keeping the k≤rk \le r largest singular values gives Ak=UkSkVkA_k = U_k S_k V_k, the best rank-kk approximation of AA. Each of the kk dimensions is a latent concept: UkU_k maps terms to concepts, SkVkS_k V_k maps documents to concepts.

Ranking. LSI Ranking replaces AA by AkA_k. The three ways of computing the scores (approximated matrix q⊤Akq^\top A_k, query in concept space, document expansion q⊤UkUk⊤Aq^\top U_k U_k^\top A) give the same scores, because Ak=UkUk⊤AA_k = U_k U_k^\top A. They differ in what is precomputed and in cost. AkA_k is dense even if AA is sparse, so the factors are stored instead of AkA_k.

The linear algebra the exams test.

  • Rank: rr is the number of linearly independent rows (or columns) of AA, hence the number of nonzero singular values and the largest useful kk. Typical tasks: argue the rank of a small matrix, change few entries to lower or raise it.
  • Orthonormality: U⊤U=IrU^\top U = I_r and VV⊤=IrV V^\top = I_r, but UU⊤U U^\top and V⊤VV^\top V are in general not identity matrices (only when r=mr = m resp. r=nr = n).
  • Recovering a factor: from A=USVA = USV and U⊤U=IrU^\top U = I_r follows U⊤A=SVU^\top A = SV, hence V=S−1U⊤AV = S^{-1} U^\top A; the singular values follow from AA⊤=US2U⊤A A^\top = U S^2 U^\top.
  • Dimension check for every NumPy expression: (1×m)(m×k)(k×k)(k×n)=1×n(1 \times m)(m \times k)(k \times k)(k \times n) = 1 \times n, one score per document.

Choosing kk. Small kk merges more terms into one concept (more recall for synonyms, less precision). k=rk = r gives back AA and plain vector-space ranking.

Key Formulas#

  • SVD: A=USVA = USV, U⊤U=IrU^\top U = I_r, VV⊤=IrVV^\top = I_r (Singular Value Decomposition)
  • Rank-kk approximation: Ak=UkSkVk=UkUk⊤AA_k = U_k S_k V_k = U_k U_k^\top A (Singular Value Decomposition)
  • LSI scores: q⊤Akq^\top A_k (LSI Ranking)
  • Recovering VV: V=S−1U⊤AV = S^{-1} U^\top A

Exercises & Exam Questions#

SuccessSolution

Multiply A=USVA = USV from the left by U⊤U^\top. Column-orthonormality gives U⊤U=IrU^\top U = I_r, so U⊤A=SVU^\top A = SV. The diagonal entries of SS are the rr nonzero singular values, so SS is invertible, and multiplying by S−1S^{-1} gives S−1U⊤A=VS^{-1} U^\top A = V. Full solution: DBIS Exam WS2223 (not published).

Exam occurrences#

ExamTaskPointsSubtasks
DBIS Exam WS1314 (not published)Task 4.3–4.410 of 20rank of a term-document matrix, effect of duplicating documents (with k-means)
DBIS Exam WS1516 (not published)Task 520tf.idf term-document matrix, query similarities as a matrix product, matrix_mult
DBIS Exam WS1617 (not published)Task 520show VV row-orthonormal, compute SS, rank and adding a column, L2 normalisation
DBIS Exam WS1718 (not published)Task 520compute UU and SS of a 2×42 \times 4 matrix, compute_V
DBIS Exam WS1819 (not published)Task 520rank with argument, change entries to rank 2 / rank 1, is_row_orthonormal
DBIS Exam WS1920 (not published)Task 5.15which of U⊤UU^\top U, UU⊤UU^\top is always the identity
DBIS Exam WS2122 (not published)Task 5.110top(q, U, S, V, k): top document with the rank-kk approximation
DBIS Exam WS2223 (not published)Task 5.1–5.215top(q, A, U, k) with document expansion, prove V=S−1U⊤AV = S^{-1}U^\top A

Lectures#

  • Not lectured in WS 25/26. The material comes from the past exams of the predecessor course Information Retrieval (see the course CLAUDE.md).

Search

Type In
↑ ↓ move ↵ open ⇥ next section Ctrl↵ results page Prefix # to search text only