passdrill
AI & LLM Engineering · RAG & Embeddings · Card 030/032 hard

A team wants the exact-term-matching efficiency of an inverted index (the same data structure BM25 relies on) but with better handling of vocabulary mismatch than raw keyword overlap provides, without giving up sparse indexing for a fully dense embedding index. SPLADE (Formal et al., 2021) produces a sparse vector for each query and document using a transformer, trained with explicit sparsity regularization. What does SPLADE's sparse vector actually represent, and why does it help with vocabulary mismatch?

  1. Each dimension corresponds to a document ID rather than a vocabulary term, so the vector directly lists which other documents are most similar to this one
  2. Each dimension corresponds to a term in the vocabulary, and the model assigns nonzero weight not only to terms that literally appear in the text but also to related terms it predicts are relevant (term expansion), so a document can still be matched on a query term it never literally contains, while the vector stays sparse enough to use the same efficient inverted-index infrastructure as BM25
  3. The vector has exactly one nonzero dimension representing the single most important word in the text, discarding every other term entirely
  4. Each dimension is a dense, uninterpretable float produced the same way a standard bi-encoder produces its embedding, and 'sparse' only describes how the vectors are stored on disk, not their content
Next card → Shuffle