Team Ai
Modelpublic

rasyosef/splade-mini

sourceHugging Facemitupdated 5mo agoView on Hugging Face
5likes4.5kdownloads
Model Card

SPLADE-Mini

This is a SPLADE sparse retrieval model based on BERT-Mini (11M) that was trained by distilling a Cross-Encoder on the MSMARCO dataset. The cross-encoder used was ms-marco-MiniLM-L6-v2.

This tiny SPLADE model is 6x smaller than Naver's official splade-v3-distilbert while having 85% of it's performance on the MSMARCO benchmark. This model is small enough to be used without a GPU on a dataset of a few thousand documents.

  • โ€”Collection: https://huggingface.co/collections/rasyosef/splade-tiny-msmarco-687c548c0691d95babf65b70
  • โ€”Distillation Dataset: https://huggingface.co/datasets/yosefw/msmarco-train-distil-v2
  • โ€”Code: https://github.com/rasyosef/splade-tiny-msmarco

Performance

The splade models were evaluated on 55 thousand queries and 8.84 million documents from the MSMARCO dataset.

Size (# Params)MRR@10 (MS MARCO dev)
BM25-18.0--
rasyosef/splade-tiny4.4M30.9
rasyosef/splade-mini11.2M34.1
rasyosef/splade-small28.8M35.4
naver/splade-v3-distilbert67.0M38.7

Usage

Direct Usage (Sentence Transformers)

First install the Sentence Transformers library:

bash
pip install -U sentence-transformers

Then you can load this model and run inference.

python
from sentence_transformers import SparseEncoder

# Download from the ๐Ÿค— Hub
model = SparseEncoder("rasyosef/splade-mini")
# Run inference
queries = [
    "common law implied warranty",
]
documents = [
    'The law recognizes two basic kinds of warrantiesimplied warranties and express warranties. Implied Warranties. Implied warranties are unspoken, unwritten promises, created by state law, that go from you, as a seller or merchant, to your customers.',
    'An implied warranty is a contract law term for certain assurances that are presumed in the sale of products or real property.',
    'The implied warranty of fitness for a particular purpose is a promise that the law says you, as a seller, make when your customer relies on your advice that a product can be used for some specific purpose.',
]
query_embeddings = model.encode_query(queries)
document_embeddings = model.encode_document(documents)
print(query_embeddings.shape, document_embeddings.shape)
# [1, 30522] [3, 30522]

# Get the similarity scores for the embeddings
similarities = model.similarity(query_embeddings, document_embeddings)
print(similarities)
# tensor([[22.4364, 22.7160, 21.7330]])

<!--

Direct Usage (Transformers)

<details><summary>Click to see the direct usage in Transformers</summary>

</details> -->

<!--

Downstream Usage (Sentence Transformers)

You can finetune this model on your own dataset.

<details><summary>Click to expand</summary>

</details> -->

<!--

Out-of-Scope Use

List how the model may foreseeably be misused and address what users ought not to do with the model. -->

Model Details

Model Description

  • โ€”Model Type: SPLADE Sparse Encoder
  • โ€”Base model: prajjwal1/bert-mini
  • โ€”Maximum Sequence Length: 512 tokens
  • โ€”Output Dimensionality: 30522 dimensions
  • โ€”Similarity Function: Dot Product <!-- - Training Dataset: Unknown --> <!-- - Language: Unknown --> <!-- - License: Unknown -->

Model Sources

Full Model Architecture

SparseEncoder(
  (0): MLMTransformer({'max_seq_length': 512, 'do_lower_case': False, 'architecture': 'BertForMaskedLM'})
  (1): SpladePooling({'pooling_strategy': 'max', 'activation_function': 'relu', 'word_embedding_dimension': 30522})
)

More

<details><summary>Click to expand</summary>

Evaluation

Metrics

Sparse Information Retrieval
MetricValue
dot_accuracy@10.5018
dot_accuracy@30.8286
dot_accuracy@50.9194
dot_accuracy@100.9746
dot_precision@10.5018
dot_precision@30.2839
dot_precision@50.191
dot_precision@100.1026
dot_recall@10.4868
dot_recall@30.8148
dot_recall@50.9096
dot_recall@100.9709
dot_ndcg@100.7457
dot_mrr@100.6749
dot_map@1000.6708
queryactivedims22.585
querysparsityratio0.9993
corpusactivedims174.852
corpussparsityratio0.9943

<!--

Bias, Risks and Limitations

What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model. -->

<!--

Recommendations

What are recommendations with respect to the foreseeable issues? For example, filtering explicit content. -->

Training Details

Training Dataset

Unnamed Dataset
  • โ€”Size: 1,000,000 training samples
  • โ€”Columns: <code>query</code>, <code>positive</code>, <code>negative1</code>, <code>negative2</code>, and <code>label</code>
  • โ€”Approximate statistics based on the first 1000 samples: | | query | positive | negative1 | negative2 | label | |:--------|:---------------------------------------------------------------------------------|:------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------|:-----------------------------------| | type | string | string | string | string | list | | details | <ul><li>min: 4 tokens</li><li>mean: 9.01 tokens</li><li>max: 29 tokens</li></ul> | <ul><li>min: 22 tokens</li><li>mean: 80.48 tokens</li><li>max: 247 tokens</li></ul> | <ul><li>min: 18 tokens</li><li>mean: 79.27 tokens</li><li>max: 213 tokens</li></ul> | <ul><li>min: 17 tokens</li><li>mean: 75.56 tokens</li><li>max: 190 tokens</li></ul> | <ul><li>size: 2 elements</li></ul> |
  • โ€”Samples: | query | positive | negative1 | negative2 | label | |:-----------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------------------------------------------| | <code>friendly home health care</code> | <code>Medicare Evaluation of the Quality of Care. The quality of care given at Friendly Care Home Health Services is periodically evaluated by Medicare. The results of the most recent evaluation period are listed below to help you compare home care agencies in your area. More Info.</code> | <code>Every participant took the same survey so it is a useful way to compare Friendly Care Home Health Services to other home care agencies.</code> | <code>It covers a wide range of services and can often delay the need for long-term nursing home care. More specifically, home health care may include occupational and physical therapy, speech therapy, and even skilled nursing.</code> | <code>[1.2647171020507812, 9.144136428833008]</code> | | <code>how much does the xbox elite controller weigh</code> | <code>How much does an Xbox 360 weigh? A: The weight of an Xbox 360 depends on the different model purchased, with an original Xbox 360 or Xbox 360 Elite weighing 7.7 pounds with a hard drive and a newer Xbox 360 Slim weighing 6.3 pounds. An Xbox 360 without a hard drive weighs 7 pounds.</code> | <code>How much does 6 xbox 360 games/cases weigh? How much does an xbox 360 elite weigh (in the box)? How much does an xbox 360 weigh? im going to fedex one? I am considering purchasing an Xbox 360, or a Playstation 3...</code> | <code>1 You can only upload videos smaller than 600 MB. 2 You can only upload a photo (png, jpg, jpeg) or video (3gp, 3gpp, mp4, mov, avi, mpg, mpeg, rm). 3 You can only upload a photo or video. Video should be smaller than <b>600 MB/5 minutes</b>.</code> | <code>[4.903870582580566, 18.162578582763672]</code> | | <code>what county is norfolk, ct in</code> | <code>Norfolk, Connecticut. Norfolk (local /หˆnษ”หrfษ”หrk/) is a town in Litchfield County, Connecticut, United States. The population was 1,787 at the 2010 census.</code> | <code>Norfolk Historic District. The Norfolk Historic District was listed on the National Register of Historic Places in 1979. Portions of the content on this web page were adapted from a copy of the original nomination document. [โ€ ] Adaptation copyright ยฉ 2010, The Gombach Group. Description.</code> | <code>Terms begin the first day of the month. Grand Juries, 1st and 3rd Wednesday of each month. Civil cases set by agreement of counsel and consent of the court; scheduling orders are mandatory in most cases. Civil and Criminal trials begin at 9:30 a.m.</code> | <code>[12.4237699508667, 21.46290397644043]</code> |
  • โ€”Loss: <code>SpladeLoss</code> with these parameters:
json
  {
      "loss": "SparseMarginMSELoss",
      "document_regularizer_weight": 0.12,
      "query_regularizer_weight": 0.2
  }

Training Hyperparameters

Non-Default Hyperparameters
  • โ€”eval_strategy: epoch
  • โ€”per_device_train_batch_size: 64
  • โ€”per_device_eval_batch_size: 64
  • โ€”learning_rate: 4e-05
  • โ€”num_train_epochs: 4
  • โ€”lr_scheduler_type: cosine
  • โ€”warmup_ratio: 0.025
  • โ€”fp16: True
  • โ€”load_best_model_at_end: True
  • โ€”optim: adamwtorchfused
All Hyperparameters

<details><summary>Click to expand</summary>

  • โ€”overwrite_output_dir: False
  • โ€”do_predict: False
  • โ€”eval_strategy: epoch
  • โ€”prediction_loss_only: True
  • โ€”per_device_train_batch_size: 64
  • โ€”per_device_eval_batch_size: 64
  • โ€”per_gpu_train_batch_size: None
  • โ€”per_gpu_eval_batch_size: None
  • โ€”gradient_accumulation_steps: 1
  • โ€”eval_accumulation_steps: None
  • โ€”torch_empty_cache_steps: None
  • โ€”learning_rate: 4e-05
  • โ€”weight_decay: 0.0
  • โ€”adam_beta1: 0.9
  • โ€”adam_beta2: 0.999
  • โ€”adam_epsilon: 1e-08
  • โ€”max_grad_norm: 1.0
  • โ€”num_train_epochs: 4
  • โ€”max_steps: -1
  • โ€”lr_scheduler_type: cosine
  • โ€”lr_scheduler_kwargs: {}
  • โ€”warmup_ratio: 0.025
  • โ€”warmup_steps: 0
  • โ€”log_level: passive
  • โ€”log_level_replica: warning
  • โ€”log_on_each_node: True
  • โ€”logging_nan_inf_filter: True
  • โ€”save_safetensors: True
  • โ€”save_on_each_node: False
  • โ€”save_only_model: False
  • โ€”restore_callback_states_from_checkpoint: False
  • โ€”no_cuda: False
  • โ€”use_cpu: False
  • โ€”use_mps_device: False
  • โ€”seed: 42
  • โ€”data_seed: None
  • โ€”jit_mode_eval: False
  • โ€”use_ipex: False
  • โ€”bf16: False
  • โ€”fp16: True
  • โ€”fp16_opt_level: O1
  • โ€”half_precision_backend: auto
  • โ€”bf16_full_eval: False
  • โ€”fp16_full_eval: False
  • โ€”tf32: None
  • โ€”local_rank: 0
  • โ€”ddp_backend: None
  • โ€”tpu_num_cores: None
  • โ€”tpu_metrics_debug: False
  • โ€”debug: []
  • โ€”dataloader_drop_last: False
  • โ€”dataloader_num_workers: 0
  • โ€”dataloader_prefetch_factor: None
  • โ€”past_index: -1
  • โ€”disable_tqdm: False
  • โ€”remove_unused_columns: True
  • โ€”label_names: None
  • โ€”load_best_model_at_end: True
  • โ€”ignore_data_skip: False
  • โ€”fsdp: []
  • โ€”fsdp_min_num_params: 0
  • โ€”fsdp_config: {'minnumparams': 0, 'xla': False, 'xlafsdpv2': False, 'xlafsdpgrad_ckpt': False}
  • โ€”fsdp_transformer_layer_cls_to_wrap: None
  • โ€”accelerator_config: {'splitbatches': False, 'dispatchbatches': None, 'evenbatches': True, 'useseedablesampler': True, 'nonblocking': False, 'gradientaccumulationkwargs': None}
  • โ€”deepspeed: None
  • โ€”label_smoothing_factor: 0.0
  • โ€”optim: adamwtorchfused
  • โ€”optim_args: None
  • โ€”adafactor: False
  • โ€”group_by_length: False
  • โ€”length_column_name: length
  • โ€”ddp_find_unused_parameters: None
  • โ€”ddp_bucket_cap_mb: None
  • โ€”ddp_broadcast_buffers: False
  • โ€”dataloader_pin_memory: True
  • โ€”dataloader_persistent_workers: False
  • โ€”skip_memory_metrics: True
  • โ€”use_legacy_prediction_loop: False
  • โ€”push_to_hub: False
  • โ€”resume_from_checkpoint: None
  • โ€”hub_model_id: None
  • โ€”hub_strategy: every_save
  • โ€”hub_private_repo: None
  • โ€”hub_always_push: False
  • โ€”hub_revision: None
  • โ€”gradient_checkpointing: False
  • โ€”gradient_checkpointing_kwargs: None
  • โ€”include_inputs_for_metrics: False
  • โ€”include_for_metrics: []
  • โ€”eval_do_concat_batches: True
  • โ€”fp16_backend: auto
  • โ€”push_to_hub_model_id: None
  • โ€”push_to_hub_organization: None
  • โ€”mp_parameters:
  • โ€”auto_find_batch_size: False
  • โ€”full_determinism: False
  • โ€”torchdynamo: None
  • โ€”ray_scope: last
  • โ€”ddp_timeout: 1800
  • โ€”torch_compile: False
  • โ€”torch_compile_backend: None
  • โ€”torch_compile_mode: None
  • โ€”include_tokens_per_second: False
  • โ€”include_num_input_tokens_seen: False
  • โ€”neftune_noise_alpha: None
  • โ€”optim_target_modules: None
  • โ€”batch_eval_metrics: False
  • โ€”eval_on_start: False
  • โ€”use_liger_kernel: False
  • โ€”liger_kernel_config: None
  • โ€”eval_use_gather_object: False
  • โ€”average_tokens_across_devices: False
  • โ€”prompts: None
  • โ€”batch_sampler: batch_sampler
  • โ€”multi_dataset_batch_sampler: proportional
  • โ€”router_mapping: {}
  • โ€”learning_rate_mapping: {}

</details>

Training Logs

EpochStepTraining Lossdot_ndcg@10
1.0156259.31470.7353
2.0312507.52670.7429
3.0468756.32890.7457

Framework Versions

  • โ€”Python: 3.11.13
  • โ€”Sentence Transformers: 5.0.0
  • โ€”Transformers: 4.53.3
  • โ€”PyTorch: 2.6.0+cu124
  • โ€”Accelerate: 1.9.0
  • โ€”Datasets: 4.0.0
  • โ€”Tokenizers: 0.21.2

<!--

Glossary

Clearly define terms in order to be accessible across audiences. -->

<!--

Model Card Authors

Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction. -->

<!--

Model Card Contact

Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors. --> </details>

Citation

bibtex
@misc{alemneh2025splademini,
  author = {Yosef Worku Alemneh},
  title  = {SPLADE-Mini},
  year   = {2025},
  url    = {https://huggingface.co/rasyosef/splade-mini},
  note   = {Hugging Face model repository}
}