English | 日本語
A Japanese learned sparse retrieval model built on sbintuitions/modernbert-ja-30m. It encodes text into sparse vectors in the same 65,536-dimensional feature space as mahiyama/sae-splade-ja-310m.
This model was trained for asymmetric retrieval in combination with sae-splade-ja-310m. Queries are encoded with this model, and documents are encoded with sae-splade-ja-310m. Document indexes built with sae-splade-ja-310m can be used as-is. Because queries are encoded on every search, this step is done with a small model. On CPU, query encoding takes about one-sixth of the time that sae-splade-ja-310m takes. For even faster inference on CPU, an ONNX export of the query encoding of this model is also available at mahiyama/sae-splade-ja-30m-onnx.
| Property | Value |
|---|---|
| Base model | sbintuitions/modernbert-ja-30m |
| Architecture | Transformer + SAETopKPooling (Top-K SAE encoding and max pooling) |
| Parameters | About 54M (base model about 37M, output layer about 17M) |
| Output dimensions | 65,536 (the number of SAE features shared with sae-splade-ja-310m) |
| Maximum input length | 8,192 tokens (trained with up to 1,024 tokens) |
| Similarity | Dot product |
| Intended document encoder | mahiyama/sae-splade-ja-310m |
| Framework | SparseEncoder in sentence-transformers (tested with 6.2.0) |
Each output dimension of sae-splade-ja-310m corresponds to a feature learned by a sparse autoencoder (SAE). Its output layer is an SAE encoder (65,536 × 768) that keeps only the 16 features with the largest values for each token and takes the maximum of each feature over the whole text.
This model passes the final-layer hidden states (256 dimensions) of modernbert-ja-30m through the same SAE encoder as sae-splade-ja-310m. During training, a linear projection from 256 to 768 dimensions was inserted, and the weights of the SAE encoder were kept frozen. In the released weights, this projection is folded into the SAE encoder, forming a single 65,536 × 256 matrix. The per-token top-16 selection and max pooling are computed in the same way as in sae-splade-ja-310m.
In the intended usage, queries are encoded with encode_query of this model, and documents are encoded with encode_document of sae-splade-ja-310m. Because both outputs are vectors in the same 65,536-dimensional space, scores can be computed by dot product.
from sentence_transformers import SparseEncoder
# Encode queries with this model and documents with sae-splade-ja-310m
query_model = SparseEncoder("mahiyama/sae-splade-ja-30m", trust_remote_code=True)
document_model = SparseEncoder("mahiyama/sae-splade-ja-310m", trust_remote_code=True)
# Queries: "What is the capital of Japan?", "What is machine learning?"
queries = [
"日本の首都はどこですか",
"機械学習とは何ですか",
]
# Documents: on Tokyo (the capital of Japan), Kyoto (an ancient capital), and machine learning
documents = [
"東京は日本の首都であり、政治と経済の中心地である。",
"京都は古都として知られ、神社仏閣が多くある。",
"機械学習は人工知能の一分野で、データからパターンを学習する手法である。",
]
# Encode into 65,536-dimensional sparse tensors
q_emb = query_model.encode_query(queries)
d_emb = document_model.encode_document(documents)
# Compute similarity scores by dot product
scores = query_model.similarity(q_emb, d_emb)
print(scores)
Documents can also be encoded with encode_document of this model. However, as shown in the evaluation results below, retrieval accuracy drops significantly compared to encoding documents with sae-splade-ja-310m.
As loaded, the model keeps only the top 40 dimensions of a query and the top 400 dimensions of a document, setting the rest to 0, to reduce the cost of retrieval (the same default values as sae-splade-ja-310m). The output still has 65,536 dimensions. This top-k limit is applied by encode_query and encode_document, but not by encode. The evaluation results below were obtained with this setting.
The limit can be removed after loading by changing attributes of the output layer.
pooling = query_model[-1] # Output layer (SAETopKPooling)
# 0 removes the limit
pooling.query_top_k = 0
pooling.document_top_k = 0
nDCG@10 was measured on the 11 retrieval tasks of JMTEB v2 lite (named JMTEB-lite(v1) in MTEB). The evaluation settings are the same as in the sae-splade-ja-310m model card. Documents were encoded with up to 8,192 tokens, and queries were not truncated. The top 1,000 results for each query were scored in the same way as in MTEB. MultiLongDocRetrieval uses the dev split, and all other tasks use the test split.
Three configurations were evaluated by varying which model encodes queries and documents. Each column name has the form "query encoder / document encoder", where 30m is this model and 310m is sae-splade-ja-310m.
| Task | 30m / 310m | 310m / 310m | 30m / 30m |
|---|---|---|---|
| JaqketRetrievalLite | 75.11 | 79.72 | 51.33 |
| MrTyDiJaRetrievalLite | 52.84 | 55.66 | 26.57 |
| JaGovFaqsRetrieval | 73.59 | 76.47 | 64.32 |
| NLPJournalTitleAbsRetrieval.V2 | 97.45 | 97.58 | 96.79 |
| NLPJournalTitleIntroRetrieval.V2 | 96.81 | 97.48 | 96.38 |
| NLPJournalAbsIntroRetrieval.V2 | 99.00 | 99.25 | 99.20 |
| NLPJournalAbsArticleRetrieval.V2 | 99.66 | 99.66 | 99.56 |
| JaCWIRRetrievalLite | 78.63 | 82.37 | 68.50 |
| MIRACLJaRetrievalLite | 66.98 | 68.99 | 28.80 |
| MintakaRetrieval | 20.96 | 22.70 | 17.97 |
| MultiLongDocRetrieval | 47.26 | 48.95 | 48.70 |
| Average | 73.48 | 75.35 | 63.46 |
| Avg. non-zero dimensions (query / document) | 40.0 / 301.1 | 40.0 / 301.1 | 40.0 / 189.4 |
The average difference from 310m / 310m is -1.87 points (95% confidence interval [-2.20, -1.53]) for 30m / 310m and -11.88 points (95% confidence interval [-12.44, -11.32]) for 30m / 30m. Confidence intervals were computed by query-level bootstrapping. For 30m / 30m, performance drops substantially on three tasks in particular: MIRACL, Mr.TyDi, and JAQKET.
The table below compares this model with published results on the average nDCG@10 over the 7 tasks shared by JMTEB v2 lite and JMTEB v2 (JaGovFaqs, the four NLP Journal tasks, Mintaka, and MultiLongDocRetrieval). A selection of models is shown. The published results were measured under each model's own settings (input prefixes, maximum input length, and so on), which differ from the settings used for this model.
| Model | Type | 7-task average | Source |
|---|---|---|---|
| cl-nagoya/ruri-v3-130m | Dense | 78.40 | Link |
| mahiyama/sae-splade-ja-310m | Sparse | 77.44 | |
| cl-nagoya/ruri-v3-70m | Dense | 77.01 | Link |
| cl-nagoya/ruri-v3-30m | Dense | 76.80 | Link |
| mahiyama/splade-ja-310m-v2 | Sparse | 76.53 | Link |
| mahiyama/sae-splade-ja-30m (30m / 310m) | Sparse | 76.39 | |
| Qwen/Qwen3-VL-Embedding-2B | Dense | 76.37 | Link |
| hotchpotch/bekko-embedding-v1-a25m | Dense | 75.50 | Link |
| mahiyama/sae-splade-ja-30m (30m / 30m) | Sparse | 74.70 | |
| BAAI/bge-m3 | Dense | 74.50 | Link |
| microsoft/harrier-oss-v1-270m | Dense | 72.48 | Link |
Dense models in the table encode queries and documents with the same model. As in the JMTEB v2 lite table, the parentheses in the two rows for this model show "query encoder / document encoder". The 30m / 310m row has the same computational cost for document encoding as sae-splade-ja-310m.
The time to encode a single query was measured on CPU. For both this model and sae-splade-ja-310m, only the query encoding computation (up to the top 40 dimensions) was exported to ONNX and timed with ONNX Runtime. PyTorch was not timed.
| Query encoder | File size | 1 thread | 4 threads |
|---|---|---|---|
| This model (ONNX, fp32) | 215 MB | 2.46 ms | 2.20 ms |
| This model (ONNX, base model in INT8) | 184 MB | 2.27 ms | 1.92 ms |
| sae-splade-ja-310m (ONNX, fp32) | 1,463 MB | 15.18 ms | 17.19 ms |
| sae-splade-ja-310m (ONNX, base model in INT8) | 755 MB | 9.93 ms | 9.43 ms |
Values are medians and do not include tokenization time (about 0.05 ms). The measurement used ONNX Runtime 1.31.1 on a Mac mini (Apple M6) and encoded, one at a time, 500 queries randomly sampled from the 11 retrieval tasks of JMTEB v2 lite (29.7 tokens on average). The ONNX model for sae-splade-ja-310m was created for comparison and is not released. The 90th percentile values are reported in the model card for mahiyama/sae-splade-ja-30m-onnx.
The model was trained in two stages using sae-splade-ja-310m as a teacher. The weights of the teacher sae-splade-ja-310m and the SAE encoder were frozen, and only the base model and the projection (256 to 768 dimensions) of this model were updated. All training was done on a single NVIDIA RTX PRO 6000 Blackwell Server Edition GPU (Google Colab).
The training data was created from the training data of sae-splade-ja-310m. No new data was added. See the sae-splade-ja-310m model card for the list of datasets and counts.
Given the same input text, the model was trained to bring the projected hidden states of the 30m model close to the final-layer hidden states of sae-splade-ja-310m. The loss is the sum of two terms:
Because the SAE keeps only the top 16 features for each token, even if the error in the hidden states is small, the set of retained features can still differ from the teacher. Term 2 is designed to align this set with the teacher.
There were 1,551,330 input texts, broken down as follows:
| Setting | Value |
|---|---|
| Learning rate | 3e-4 (linear decay, warmup over the first 5%) |
| Optimizer | AdamW (weight decay 0.01) |
| Batch size | 256 |
| Max sequence length | 1,024 tokens |
| Projection initialization | Values computed by least squares |
| Epochs | 1 (6,060 steps) |
| Training time | About 24 minutes |
This stage used the stage 2 training data of sae-splade-ja-310m (200,296 tuples, each with a query, a positive, and 5 negatives). It was trained to bring the score distribution when queries are encoded with this model closer to the score distribution when both queries and documents are encoded with sae-splade-ja-310m. Document vectors were pre-encoded with sae-splade-ja-310m (top 400 dimensions).
The loss is the sum of three terms:
No limit was placed on the number of non-zero dimensions for queries during training.
| Setting | Value |
|---|---|
| Learning rate | 5e-5 (linear decay, warmup over the first 5%) |
| Optimizer | AdamW (weight decay 0.01) |
| Batch size | 32 queries (1 positive and 5 negatives per query) |
| Max sequence length | 1,024 tokens for queries |
| Distillation temperature | 2.0 (same for student and teacher) |
| Epochs | 1 (6,260 steps) |
| Training time | About 6 minutes |
The data used for training was derived from the training data of sae-splade-ja-310m. Queries and relevant documents used in the JMTEB v2 lite evaluation were removed from the training data of sae-splade-ja-310m. The removal procedure is described in the sae-splade-ja-310m model card.
Training settings (loss formulation, learning rate, and so on) were selected based on results on NanoJMTEB-v2. Because the queries in NanoJMTEB-v2 are a subset of the queries in JMTEB v2 lite, the aforementioned JMTEB v2 lite results include the queries used to select the settings. Excluding those queries changes the average nDCG@10 for 30m / 310m from 73.48 to 73.24.
The model weights are released under the MIT License. The base model, sbintuitions/modernbert-ja-30m, and mahiyama/sae-splade-ja-310m, from which the output layer's SAE encoder was taken, are also released under the MIT License.
However, the training data includes the following data that require attention. This applies to both the training data of this model and the training data of the teacher sae-splade-ja-310m.
If you use this model, especially for commercial purposes, please take these points into account and make your own judgment at your own responsibility.
model.safetensors 147 MB1_SAETopKPooling/model.safetensors 67 MBsbintuitions/modernbert-ja-30m