Skip to content
Edit this page

Use an SAE trained elsewhere

muscari import-sae wraps a Top-K SAE trained elsewhere in muscari's format, so that eval-sae, inspect-sae, probe-sae and the retrieval head can use it. The source must be one safetensors file with muscari's tensor names and shapes (encoder.weight, encoder.bias, decoder.weight, decoder.bias), which the model card of mahiyama/modernbert-ja-310m-sae documents for that SAE. muscari keeps the decoder bias folded into encoder.bias; --fold-decoder-bias folds it for a file that keeps the raw encoder bias. --normalize-inputs records that the SAE was trained on activations scaled to unit length. The columns and prompts given with --column only tell the evaluation commands how to read texts.

muscari import-sae --weights sae.safetensors --k 16 \
  --base-model sbintuitions/modernbert-ja-310m --max-seq-length 512 \
  --column "anc:query=検索クエリ: " --column "pos:document=検索文書: " \
  --out runs/imported-sae