Blogs / Why Per-Token Vectors Make a Search Index Large

Why Per-Token Vectors Make a Search Index Large

What the post says about multi-vector models, the storage arithmetic and the idea of merging similar vectors.

  • Learning
  • 1 min read

For: Learners new to embedding search.

One vector per token

Multi-vector models such as ColBERT instead keep a collection of contextual token vectors, allowing different parts of a query to match different parts of a document.[1]

Multi-vector embedding models give each query token its own opportunity to find a match in a document.[1]

Why it adds up

This makes them wonderfully expressive for search, but those document vectors add up quickly.[1]

A corpus with millions of documents can contain hundreds of millions of vectors![1]

At 4 bits per residual coordinate, 200 vectors of 128 dimensions require 12.8 KB of quantized residuals per document, or 12.8 GB across a million documents.[1]

Pooling each document to 50 vectors reduces that to 3.2 GB, at the same dimensionality and precision.[1]

200 vectors of 128dimensions12.8 GB across a milliondocumentsPooled to 50 vectors3.2 GB, same dimensionalityand precision
How much storage does the post compute before and after pooling to 50 vectors?

The idea of merging similar vectors

Token pooling makes these representations smaller by merging similar token vectors.[1]

The more aggressively I compress them, however, the easier it becomes to lose something useful.[1]

Sources

  1. Token Pooling-Aware Training for Multi-Vector Embedding Models (huggingface.co · checked )

More articles