Modelresearch
SPLADE
Also called sparse lexical and expansion model.
Learns sparse term weights over the whole vocabulary from a masked language model, so learned expansions run on an inverted index.
SPLADE is a dual encoder whose vectors live in the vocabulary of a masked language model, about 30,000 terms, and are mostly zero. For each input token and each vocabulary term , the masked language model head gives a logit ; SPLADE turns these into one nonnegative weight per term, , and scores a query against a document by the inner product of their weight vectors. A term can get weight even if it does not occur in the text, which is a learned expansion, and the weights are learned, unlike the hand-made weights of BM25. Because the vectors are sparse and nonnegative, retrieval runs on an ordinary inverted index. The dual-encoder page covers dense vectors and nearest neighbor search; this page covers the sparse model: its weights, its cost on an inverted index, the regularizer that controls that cost, and a worked case. The language model and the quality of its weights are outside this page.
The machine
The model has four parts.
- An encoder with a vocabulary head. A masked language model reads the text and, for every input position , gives a logit for every vocabulary term , with for the BERT vocabulary used in the paper. In Equation (1) of Formal, Piwowarski and Clinchant (2021), , with the hidden state of token and the input embedding of term .
- Pooling. The weight of term for the text is , Equation (4). The ReLU makes most weights exactly 0, and the logarithm damps large logits. SPLADE v2 replaces the sum over by a maximum.
- A score. , the inner product of the two sparse vectors.
- An index. Each term with a nonzero document weight gets a posting list of (document, weight) entries. A query reads only the posting lists of its own nonzero terms.
Training minimizes , Equation (6): a softmax ranking loss over a positive and negatives, as in dense passage retrieval, plus a sparsity regularizer for each side. The regularizer is the FLOPS loss , where is the mean weight of term over the documents of a batch. The paper raises from 0 quadratically over the first 50,000 steps.
What it counts
The model counts the work of an inverted index: the number of postings read and multiplied for a query. If is the set of terms with nonzero query weight and is the number of documents with nonzero weight for term , an exact query by term-at-a-time accumulation reads postings. Dynamic pruning such as WAND and block-max WAND can skip postings that cannot reach the top , since all weights are nonnegative and each list has a known maximum.
Expansion has a cost: every extra term in a document lengthens one posting list, and every extra term in a query adds one list to read. A term that is active in a large fraction of the documents costs about postings each time a query uses it. The FLOPS regularizer pushes down , which is large exactly for such terms, more than a plain L1 penalty would. This is why it penalizes the mean weight squared rather than the sum.
A worked case. Take a vocabulary of five terms, cat, dog, pet, car and the, with the logits of all other terms negative. Document A has two tokens with the logits and over the five terms; document B has one token with ; the query has one token with .
| cat | dog | pet | car | the | |
|---|---|---|---|---|---|
| document A | 1.3610 | 0.4055 | 1.3762 | 0 | 0.9163 |
| document B | 0 | 0 | 0 | 1.2528 | 0.1823 |
| query | 0.3365 | 0.6419 | 0.9163 | 0 | 0 |
Each entry is the sum of over the tokens; for example, cat in document A is . The scores are and . Document A gets weight on "pet" and "dog" from its context, so the query matches it through the expanded terms. With max pooling, as in SPLADE v2, . For the batch , the FLOPS loss is , while the L1 norm of the two documents is . The query reads three posting lists, cat, dog and pet, each with one entry here; the list of "the" has two entries and is not read, since its query weight is 0. The softmax loss with A as the positive and B as the negative is .
Relation to other models
- BM25 and the vector space model. Also inner products of sparse vectors over terms, with weights from term frequencies and IDF. SPLADE learns the weights and can activate terms that the text does not contain.
- Pseudo-relevance feedback and document expansion. Classic expansion adds terms from retrieved documents at query time or from predicted queries at indexing time. SPLADE learns expansion inside the encoder, for both sides at once.
- Dense dual encoders. Same factorization of the score, but dense vectors of a few hundred dimensions need nearest neighbor indexes, while SPLADE vectors use an inverted index and have one interpretable dimension per term.
- ColBERT. Keeps many dense vectors per document; SPLADE keeps one sparse vector.
- Weighting without expansion. Restricting to the terms of the text gives a learned term weighting model; SPLADE is that plus expansion over the whole vocabulary.
Known results in the model
Exact retrieval on an inverted index. The score is , so it depends only on the posting lists of the query's nonzero terms. Accumulating over those lists gives the exact score of every document with at least one shared term, and every other document has score 0. Since all weights are nonnegative, the maximum of each list bounds its contribution, which is what WAND and block-max WAND need to skip documents and still return the exact top .
Saturation. Each token adds to term , which grows only logarithmically in the logit, so one confident token cannot give a term an unbounded weight. With sum pooling, a term that many tokens support grows with the number of tokens, like a term frequency; with max pooling it does not.
Sparsity is a trained property, not a guarantee. The ReLU gives exact zeros, but the number of nonzero entries depends on the weights and on and . Nothing in the model bounds the posting list lengths, so query cost must be measured on the collection.
Measured effectiveness. Formal, Piwowarski and Clinchant (2021), Table 1, report MRR@10 of 0.322 on the MS MARCO passage development set, against 0.184 for BM25 in their table. These are measurements.
References
- Thibault Formal, Benjamin Piwowarski and Stéphane Clinchant, SPLADE, sparse lexical and expansion model for first stage ranking, Proceedings of the 44th ACM SIGIR Conference, 2021, pp. 2288-2292; Equation (1) (the importance of vocabulary term j for input token i, from the masked language model head), Equation (4) (the document weight as a sum over tokens of log(1 + ReLU)), the dot product score, the FLOPS regularizer as a sum of squared mean weights, Equation (6) (the ranking loss plus the query and document regularizers), Table 1 (measured effectiveness)
- Thibault Formal, Carlos Lassance, Benjamin Piwowarski and Stéphane Clinchant, SPLADE v2, sparse lexical and expansion model for information retrieval, arXiv:2109.10086, 2021, the change from sum pooling to max pooling over the input tokens
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 669YF6 Edit this page History Report an error Markdown