The Vector Space Model

Ranked retrieval by representing documents and queries as weighted term vectors and scoring documents by their similarity to the query. Zones and weighted zone scoring, TF-IDF, cosine similarity, efficient scoring with an inverted index, weighting variants, the formal constraints a term weighting should satisfy, and document-to-document similarity.

The Boolean model answers a query with a set: a document matches or it does not. For the thesis student's query arctic AND climate AND warming, it returned two of the four Arctic sentences and gave no credit at all to the others, including the one about warmer winters in Europe. A searcher facing a set must keep tuning the query until the set is a manageable size. A system can instead score every document by how well it matches, and return the best matches first.

The vector space model does exactly that. Every document receives a score, and documents are returned in order of it. A long list is no problem, because the best matches come first, and a document that matches only part of the query still appears, ranked below those that match more.

The model rests on one representational idea. A document is a vector with one dimension for every term in the vocabulary. Its value in each dimension is a weight saying how important that term is to the document. A query is a vector in the same space, and documents are ranked by the angle between their vectors and the query's. Two problems follow, and the rest of the topic solves them:

  • Choosing the weights. The usual choice is TF-IDF, which rewards terms that occur often in a document and rarely in the collection.
  • Computing similarity for millions of documents in a fraction of a second. Scores are accumulated from the inverted index, touching only documents that share a term with the query.

Here is the route. First, zones take one step beyond Boolean matching. Then TF-IDF weights each term, cosine similarity compares vectors by angle, and an inverted index makes scoring fast. Finally four articles refine and test the model.

The articles share one running example: four short documents and the query best car insurance. The documents are a car-insurance headline, a car review, an auto-insurance page that never says car, and a page about car loans. A reader would want the headline and the auto-insurance page, and each article shows what its idea changes about how the four are ranked. TF-IDF weighting builds the count matrix and weights. Cosine similarity normalizes and scores them, with a demo for editing the documents and the weighting schemes. The variants score the collection under eight schemes, and computing vector scores traces both evaluation orders on its postings, after first returning to the Arctic sentences. The constraints on term weighting test five of the schemes on documents built from the headline. Finding similar documents compares the four documents with each other, and the limits applies relevance feedback to them.

Gerard Salton and his colleagues developed the model in the SMART system over the 1960s and 1970s (see the history). Its weighting ideas remain in use. The term frequency and inverse document frequency components of TF-IDF reappear, in refined form, in BM25. The geometry of vectors and angles reappears in the dense embeddings of neural retrieval.

Articles

Before vectors

  • Zones and weighted zone scoring: a match in a title can count for more than one in the body, and the weights can be learned. Metadata fields and parametric search, zone indexes, scoring by which parts of a document match, and learning the zone weights from relevance judgments by least squares.

The model

  • TF-IDF weighting: a term's weight in a document is its count there times the rarity of the term in the collection. Term frequency and the bag-of-words view, inverse document frequency, and their product as a term weight.
  • Cosine similarity: a query is compared with documents of different lengths by the angle between their vectors. Documents and queries as vectors, why angle beats distance, length normalization, the dot product and distance for vectors that are not normalized, the geometry of many dimensions, and worked comparisons.
  • Computing vector scores: a whole collection is scored by reading only the postings of the query's terms. Scoring with postings lists and accumulators, precomputed document lengths, selecting the top results with a heap, and the approximate shortcuts measured on Cranfield.

Refinements

  • Variants of TF-IDF weighting: the components of a weighting scheme and their names. Sublinear term frequency, maximum term frequency normalization, the SMART notation for weighting schemes, and pivoted length normalization.
  • Constraints on term weighting: six formal conditions a reasonable scoring function should satisfy (Fang, Tao, and Zhai, 2004), what the published analyses found for pivoted normalization, Okapi and the Dirichlet prior, and which of the conditions this topic's own schemes satisfy.
  • Finding similar documents: the most similar pairs in a collection cost a number of comparisons that grows with the square of its size. Comparing every pair, sparse-matrix and inverted-index methods, and benchmarks from my course assignment, which is stated and solved on the running example.
  • Strengths and limits of the vector space model: the model fails where its assumption of unrelated terms fails. The independence assumption, vocabulary mismatch, Rocchio relevance feedback, and the model's descendants.
  • Term statistics explains the distributions of term frequency and document frequency that TF-IDF builds on.
  • Evaluation measures whether one ranking is better than another, which is needed to compare weighting schemes.
  • Probabilistic retrieval derives a weighting similar to TF-IDF from the probability of relevance.

Course materials

My document similarity system for the course is HW03 on GitHub. It finds the most similar pairs of documents in a collection under three weighting schemes, with standard, parallel, and sparse-matrix implementations.

References

  • Manning, C. D., Raghavan, P., and Schütze, H. (2008). Introduction to Information Retrieval, chapters 6–7. Cambridge University Press. record · 102 pages
  • Salton, G., Wong, A., and Yang, C. S. (1975). A vector space model for automatic indexing. Communications of the ACM, 18(11), 613–620. record · 3 pages
  • Fang, H., Tao, T., and Zhai, C. (2004). A formal study of information retrieval heuristics. In Proceedings of SIGIR 2004, 49–56. record · 3 pages
  • Salton, G., and Buckley, C. (1988). Term-weighting approaches in automatic text retrieval. Information Processing and Management, 24(5), 513–523. record · 3 pages

Reviewed: verified, 16 Nov 2026 · citations checked, 16 Nov 2026 · editorial review, 16 Nov 2026 · 4 revisions