Views
No views yet
[0, 6, 11] from naver/splade-v3-doc).static_query_weights.pt). At query time, terms are looked up directly from a learned static token weight table requiring 0 GPU executions and 0 neural forward passes.log1p(ReLU(logits)).max() document-side pooling generating weighted vocabulary posting lists for static inverted indexes.best_proxy checkpoint maximizing top-1 ranking performance while maintaining sparsity budget targets.Akshat131/splade-multi-static-doc) using the following command:1python -m modal run --detach pruningscript.py::train_pruned_static_student \
2 --run-name combined_beir_v1 \
3 --scored-file-name train_multi_static_teacher_scores.jsonl \
4 --student-checkpoint "pruned_inits/pruned_3layer_init" \
5 --checkpoint-name pruned_multi_static_3layer_final \
6 --epochs 4 \
7 --learning-rate 3.5e-5 \
8 --static-query-learning-rate 1e-3 \
9 --distill-temperature 10.0 \
10 --margin-mse-weight 0.8 \
11 --target-doc-active-dims 140.0 \
12 --target-query-active-dims 80.0 \
13 --lambda-doc-flops 1.5e-5 \
14 --lambda-query-l1 1e-8 \
15 --sparsity-zero-fraction 0.10--distill-temperature 10.0) and MarginMSE loss (--margin-mse-weight 0.8) aligning score margins between positive and hard-negative document pairs.--static-query-learning-rate 1e-3) allowing fast adaptation of non-linear IDF weights for technical documentation syntax.--sparsity-zero-fraction 0.10) followed by quadratic FLOPS regularization (1.5e-5), preventing dimensional collapse while enforcing target active dimensions (T_doc = 140.0).combined_beir / my_eval_dataset)| Metric | NEW Trained 3-Layer Model | Previous Model (Akshat131/static-splade-trained-pruned) | Previously Used Model (Arvind0101/static-query-splade-code-docs) |
|---|---|---|---|
| NDCG@10 | 0.5019 (combined) / 0.4119 (my_eval) | 0.3887 | 0.3838 |
| MRR@10 | 0.6653 (combined) / 0.5423 (my_eval) | 0.5204 | 0.5161 |
| Recall@10 | 0.4786 | 0.4563 | 0.4473 |
| Recall@100 | 0.7091 | 0.6945 | 0.6866 |
BEIR SciFact)| Metric | NEW Trained 3-Layer Model | Previous Model (Akshat131/static-splade-trained-pruned) | Previously Used Model (Arvind0101/static-query-splade-code-docs) |
|---|---|---|---|
| NDCG@10 | 0.5815 | 0.5518 | 0.5690 |
| MRR@10 | 0.5576 | 0.5134 | 0.5273 |
| NDCG@5 | 0.5656 | 0.5325 | 0.5394 |
| NDCG@100 | 0.6218 | 0.5892 | 0.5997 |
1import torch
2from transformers import AutoTokenizer, AutoModelForMaskedLM
3from huggingface_hub import hf_hub_download
4
5repo_id = "Akshat131/splade-multi-static-pruned-v2"
6
7# 1. Load Tokenizer & Document Encoder
8tokenizer = AutoTokenizer.from_pretrained(repo_id)
9doc_encoder = AutoModelForMaskedLM.from_pretrained(repo_id)
10
11# 2. Load Static Query Weights for Inference-Free Query Scoring
12weights_path = hf_hub_download(repo_id=repo_id, filename="static_query_weights.pt")
13static_weights = torch.load(weights_path, map_location="cpu")["static_query_weights"]
14
15# Query scoring requires 0 forward passes:
16query_str = "how to drop NaN missing values in array"
17query_tokens = tokenizer(query_str)["input_ids"]
18query_vector = {token_id: static_weights[token_id].item() for token_id in set(query_tokens)}