Modelintro
Vector space model
Also called VSM, term vector model.
Represents documents and queries as weighted term vectors and ranks documents by the cosine of the angle to the query.
The vector space model represents each document and each query as a vector with one coordinate for each term of the vocabulary, whose value is a weight of the term, most often a tf-idf weight. It ranks the documents by the cosine similarity of their vectors to the query vector. A document that contains only some of the query terms still gets a score, so the model ranks partial matches, which the Boolean model cannot do. The model comes from the SMART system of Gerard Salton, and the paper of Salton, Wong and Yang (1975) is its usual reference.
The machine
Vectors. Let be the vocabulary of a collection of documents. A document is the vector with coordinate for each term , and when does not occur in . A query is a vector of the same kind. Each vector is sparse: a document has a nonzero coordinate only for its own terms.
Score. The score of for is the cosine of the angle between the two vectors,
and the answer is the list of documents with in decreasing order of score, ties broken by increasing document id. Only the terms of the query contribute to the sum.
Weights. The SMART notation names a weighting by three letters for the document and three for the query: term frequency, document frequency and normalization (see tf-idf). The standard scheme lnc.ltc uses, with :
- document: for , no idf, cosine normalization;
- query: , cosine normalization.
Evaluation. An engine stores , or , in each posting and the norm once for each document. It reads the posting lists of the query terms, adds the products into one accumulator for each document, divides by the norms and keeps the best scores. This is term-at-a-time evaluation. The cost is for the sums and to select the top of scored documents with a heap.
Example. Take query q1 = "sorted array search" on the toy collection of the information retrieval pages, with and lnc.ltc weights. The document frequencies are 4 for sorted, 3 for array and 2 for search. The query weights are , and , the query norm is , and the normalized weights are 0.3779 for sorted, 0.5347 for array and 0.7558 for search.
Document is "binary search finds a key in a sorted array". It has 8 distinct terms, "a" twice and the others once, so its weights are for "a" and 1 for the other seven. Its norm is . It holds all three query terms once, so
| rank | document | query terms in it | norm | score |
|---|---|---|---|---|
| 1 | sorted, array, search | 2.9483 | 0.5659 | |
| 2 | sorted (twice), array | 3.1133 | 0.3297 | |
| 3 | sorted, array | 3.1623 | 0.2886 | |
| 4 | search | 3.1623 | 0.2390 | |
| 5 | sorted | 3.0636 | 0.1234 |
For the numerator is . Document holds only "search" and still ranks above , which holds only "sorted", because "search" is in fewer documents and so has a higher idf. On q2 = "posting list merge" the order is (0.4146), then and with the same score 0.3415, so comes first by id, then (0.2031).
What it counts
- A ranked list. The output is an order of the documents, measured by ranked measures such as precision at k, mean average precision and nDCG.
- Postings and accumulators. The time is the number of postings of the query terms that are read, plus the cost of selecting the top . The extra memory is one accumulator for each document that has a nonzero score.
- Index space. One weight, or one term frequency, for each posting, and one norm for each document.
Relation to other models
- Boolean model. With 0-1 weights and a threshold in place of a ranking, the score says only which query terms a document contains. The extended Boolean -norm model of Salton, Fox and Wu sits between the two.
- Probabilistic models. A BM25 score is also a sum over the query terms of a query weight times a document weight, so it is an inner product of two sparse vectors. Its document weight is a saturating function of with its own length correction, and it has no cosine normalization. The vector space model has no notion of relevance as a random event; its weights come from practice.
- Length normalization. Cosine normalization makes long documents score too low compared with their rate of relevance. Pivoted length normalization tilts the normalization to correct this.
- Relevance feedback. The Rocchio algorithm moves the query vector toward the mean vector of the relevant documents and away from the non-relevant ones. It needs the vector view.
- Latent semantic analysis. In the term space the vectors of "car" and "automobile" are orthogonal, so a query with one word gives a score of 0 to a document with only the other. Latent semantic analysis maps the vectors into a low-rank space where such terms are close.
- Dense vectors. Neural retrieval keeps the geometry and replaces the sparse term vectors by learned dense vectors, as in dual-encoder retrieval. Finding the top by inner product is then maximum inner product search.
Known results in the model
- The query norm does not change the order. is the same positive number for every document, so dividing by it changes all scores by one factor. Engines often skip it.
- Cosine and distance agree on unit vectors. If , then , so ranking by decreasing cosine is ranking by increasing Euclidean distance.
- Sums of term scores allow pruning. The score is a sum of contributions of single terms, each with an upper bound that can be stored with its posting list. This is what lets WAND, MaxScore and the threshold algorithm find the exact top without scoring every document.
- Space density. Salton, Wong and Yang (1975) observed that an indexing vocabulary works better when it spreads the document vectors apart, and they used the change in the average similarity of documents to judge the value of a term for indexing.
- Bias of the cosine. Singhal, Buckley and Mitra (1996) showed on TREC data that the probability of retrieval under cosine normalization falls faster with document length than the probability of relevance does, which is the reason for pivoting.
References
- Gerard Salton, Anita Wong and Chung-Shu Yang, A vector space model for automatic indexing, Communications of the ACM 18(11), 613 to 620, 1975, documents as vectors of term weights, similarity of vectors, and the density of the document space as a measure of the quality of an indexing vocabulary
- Christopher D. Manning, Prabhakar Raghavan and Hinrich Schuetze, Introduction to Information Retrieval, Cambridge University Press, 2008, Chapter 6 (Section 6.3 on the vector space model and cosine similarity, Section 6.4 on variant weighting functions and the SMART notation)
- Ricardo Baeza-Yates and Berthier Ribeiro-Neto, Modern Information Retrieval, second edition, Addison-Wesley, 2011, Chapter 3 (modeling, the vector model)
- Amit Singhal, Chris Buckley and Mandar Mitra, Pivoted document length normalization, Proceedings of SIGIR 1996, 21 to 29, cosine normalization favors short documents over their probability of relevance
Where this leads
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W4 complete |
|
Tag H57VVG Edit this page History Report an error Markdown