Skip to content
Edit this page

What do you want to do?

A way into the documentation from the task or the problem at hand. Every row names the page to read and, where there is one, the command or the function that does it.

Get to know sparse retrieval

You want to Read Use
understand what a sparse vector is and why one would use it What is learned sparse retrieval?
see how training differs from a dense model's Coming from dense models
choose between the methods Methods at a glance
see one work, with nothing trained Quickstart, step 1 examples/use_retriever.py --sae ...
look up a term Glossary

Train a retriever

Your situation Read Use
SPLADE training ends with empty vectors, or with dense ones Build a retriever on the vocabulary, what happened here build_vocabulary_encoder(shift="auto", fan_out=...)
the encoder is a ModernBERT the same; plain SPLADE pooling started dense on the ModernBERT encoders tried here --head vocab --shift auto --fan-out 16
you do not know which regulariser weight, scale or temperature to take Read the start before training --diagnose ROWS
you want the published settings of a method Recipes @examples/train_retriever/recipes/NAME.args
you have scores from a cross-encoder Train a retriever ContrastiveWithDistillation, --margin-mse-weight, --soft-label-weight
the encoder was saved without its language-model head Build a retriever on the vocabulary, or an SAE head, which needs none muscari graft-head
the vectors must fit a budget Evaluate a retriever, Train a retriever --caps 64/256, MatryoshkaCaps
queries must be encoded faster A smaller encoder for queries --query-model
punctuation and symbols show up in the vectors More options --noise-tokens mask
the backbone is a decoder language model Decoder language models the recipe splare
you want the shortest script that trains Examples examples/train_vocabulary_head.py, examples/train_sae_head.py

Work with an SAE

You want to Read Use
train an SAE on your encoder and your texts Train an SAE muscari train-sae
know whether an SAE is good enough Evaluate and inspect an SAE muscari eval-sae, muscari probe-sae
use an SAE trained with another tool, or one published for a language model Use an SAE trained elsewhere muscari import-sae
use the SAE this project publishes Build a retriever on an SAE build_sparse_encoder("tkhshtsh0917/modernbert-ja-310m-sae-65k")
see what a latent fires on Evaluate and inspect an SAE muscari inspect-sae
see why two texts match Why two texts match shared_latents
deal with latents that are active in every text Latents that are active everywhere --masked-latents, masked_latents
rank with an SAE and no retrieval training Through the encoder's own head, Latent Terms muscari probe-sae
understand how SAE training works here How it works, Differences from the sources

Evaluate and compare

You want to Read Use
evaluate any SparseEncoder, at several vector sizes Evaluate a retriever muscari eval-retriever --caps ...
know whether two models differ, given seeds and queries Evaluate a retriever muscari compare-runs
know what this project has measured, and under which conditions Measurements
know what is tested and what is not What is verified
find the files a run writes Files a run writes

What muscari does not do

  • Build or serve an index. A model trained here is a Sentence Transformers SparseEncoder; index it with the helper functions of that library or with your search engine.
  • Encode queries without a model. Sentence Transformers has that configuration; muscari adds nothing to it.
  • Train on several GPUs, or read a dataset in streaming mode.
  • Promise a recipe's results. A recipe copies a source's settings; the measurements say what happened with them here.