🩵 SSE: Stable Static Embedding for Retrieval MRL Bilingual version (English & Japanese) 🩵
A lightweight, faster and powerful embedding model
🩵 SSE: Stable Static Embedding for Retrieval MRL バイリンガルバージョン(英語&日本語) 🩵
軽量、高速かつ強力な埋め込みモデル
Performance Snapshot
Our SSE model achieves NDCG@10 = 0.5073 on NanoBEIR EN and NDCG@10 = 0.4511 on NanoBEIR JA — slightly outperforming the popular language-specific static-retrieval-mrl-en-v1 (0.5032) and static-embedding-japanese (0.4487) while using half the dimensions (512 vs 1024)! 💫 Plus, we're ~2× faster in retrieval thanks to our compact 512D embeddings and Separable Dynamic Tanh.
パフォーマンスの簡易解説
このモデルは NanoBEIR_en(英語文書検索タスク)において、NDCG@10 = 0.5073を達成し、かつ、NanoBEIR_ja(日本語文書検索タスク) において NDCG@10 = 0.4511 を達成しました。
このスコアは他の言語特化の静的埋め込みモデル( static-retrieval-mrl-en-v1 (0.5032)、static-embedding-japanese (0.4487)など )を上回るパフォーマンスです。
さらに、次元数を半分(512 vs 1024)に抑えています。
次元数の削減と、Separable Dynamic Tanh により、環境によっては検索速度は 約2倍高速 になっています。
| Model | NanoBEIR EN NDCG@10 | NanoBEIR JA NDCG@10 | Dimensions | Parameters | Speed Advantage | License |
|---|---|---|---|---|---|---|
| SSE Retrieval MRL Bilingual | 0.5073 ✨ | 0.4511 ✨ | 512 | ~50M 🪽 | ~2x faster retrieval (ultra-efficient!) | Apache 2.0 |
static-retrieval-mrl-en-v1 |
0.5032 | - | 1024 | ~33M | baseline | Apache 2.0 |
static-embedding-japanese |
- | 0.4487 | 1024 | ~34M | baseline | MIT |
🩵 Why Choose SSE Retrieval MRL? 🩵
✅ Higher NDCG@10 than other static embedding models in both Japanese and English
✅ Only ~50M parameters
✅ 512D native output — richer than 1024D models, yet half the size of static-retrieval-mrl-en-v1 and static-embedding-japanese
✅ Matryoshka-ready — smoothly truncate to 256D/128D/64D/32D with graceful degradation
✅ Apache 2.0 licensed — free for commercial & personal use
✅ CPU-optimized — runs faster on edge devices & modest hardware
🩵 SSE Retrieval MRL を選ぶ理由 🩵
✅ 日本語・英語の両言語で他の静的埋め込みモデルを超える高い性能(NDCG@10)
✅ 約50M のパラメータのみ
✅ 次元数512の出力 — 次元数1024のモデルよりも豊かな表現力を持ち、static-retrieval-mrl-en-v1やstatic-embedding-japanese の 半分のサイズ
✅ Matryoshka 対応 — 256/128/64/32 に簡単に切り替えられ、性能の緩やかな低下を実現
✅ Apache 2.0 ライセンス — 商用・個人利用ともに可能
✅ CPU 最適化 — エッジデバイスや限られたハードウェアでも高速に動作
🩵 Model Details 🩵
| Property | Value |
|---|---|
| Model Type | Sentence Transformer (SSE architecture) |
| Max Sequence Length | ∞ tokens |
| Output Dimension | 512 (with Matryoshka truncation down to 32D!) |
| Similarity Function | Cosine Similarity |
| Language | English & Japanese |
| License | Apache 2.0 |
🩵 モデル詳細 🩵
| プロパティ | 値 |
|---|---|
| モデルタイプ | Sentence Transformer (SSE アーキテクチャ) |
| 最大シーケンス長 | 無制限 |
| 出力次元 | 512 (Matryoshka により 次元数32 まで削減可能!) |
| 類似度関数 | コサイン類似度 |
| 言語 | 英語&日本語 |
| ライセンス | Apache 2.0 |
I used below tokenizer.
tokenizerは下記を使用させていただきました。
llm-jp/hf-fast-tokenizer-v22b2
SentenceTransformer(
(0): SSE(
(embedding): EmbeddingBag(96867, 512, mode='mean')
(dyt): SeparableDyT()
)
)
🩵 Mathematical formulations 🩵
Dynamic Tanh Normalization (DyT) enables magnitude-adaptive gradient flow for static embeddings. For input dimension x, DyT computes with learnable parameters. The gradient of x is:
For saturated dimensions |x| > 1 yields exponential decay suppressing gradients as For non-saturated dimensions |x| << 1 , preserves near-constant gradients This magnitude-dependent gating attenuates learning signals from noisy, large-magnitude dimensions while maintaining full gradient flow for stable, informative dimensions—providing implicit regularization that enhances generalization without explicit hyperparameters.
🩵 数学的背景 🩵
このモデルは静的埋め込みモデルの汎化性能を向上させるために、オリジナルのアーキテクチャである、SSE: Stable Static Embeddingを採用しています。 SSEは、EmbeddingBagとSeparable Tanh Normalizationから構成されます。 Dynamic Tanh Normalization (DyT) は、静的埋め込みにおいて、強度適応型勾配流を可能にします。入力次元 x に対して、DyT は以下のように計算されます。
ここで、a, b, c は学習可能なパラメータです。 すると、x の勾配は以下の通りになります。
飽和した次元 |x| > 1 の場合
は指数関数的な減衰をもたらします。
これにより勾配が抑制され、
となります。
対して、非飽和の次元 |x| << 1 の場合、
ほぼ一定の勾配を維持します。
この強度依存型のゲートは、ノイズが多く大きな成分を持つ次元からの学習信号を減衰させつつ、安定した情報を有する次元については勾配流を維持します。これは明示的なハイパーパラメータなしで、表現空間の汎化性能を高める暗黙的な正則化を可能にします。
🩵 Evaluation Results (NanoBEIR English) / 評価結果(NanoBEIR 英語) 🩵
| Dataset | NDCG@10 | MRR@10 | MAP@100 |
|---|---|---|---|
| NanoBEIR Mean | 0.5073 ✨ | 0.5563 | 0.4207 |
| NanoClimateFEVER | 0.3239 | 0.4045 | 0.2612 |
| NanoDBPedia | 0.5647 | 0.7321 | 0.4262 |
| NanoFEVER | 0.6450 | 0.5790 | 0.5514 |
| NanoFiQA2018 | 0.3374 | 0.3838 | 0.2766 |
| NanoHotpotQA | 0.6897 | 0.7505 | 0.6177 |
| NanoMSMARCO | 0.4463 | 0.3621 | 0.3740 |
| NanoNFCorpus | 0.2844 | 0.4456 | 0.1071 |
| NanoNQ | 0.4851 | 0.4217 | 0.4186 |
| NanoQuoraRetrieval | 0.8554 ✨ | 0.8540 | 0.8202 |
| NanoSCIDOCS | 0.3376 | 0.5482 | 0.2566 |
| NanoArguAna | 0.3941 | 0.3154 | 0.3279 |
| NanoSciFact | 0.6185 | 0.5977 | 0.5881 |
| NanoTouche2020 | 0.6123 | 0.8369 | 0.4432 |
🩵 Evaluation Results (NanoBEIR Japanese) / 評価結果(NanoBEIR 日本語) 🩵
| Dataset | NDCG@10 | MRR@10 | MAP@100 |
|---|---|---|---|
| NanoBEIR Mean | 0.4511 ✨ | 0.5141 | 0.3772 |
| NanoClimateFEVER | 0.2979 | 0.4005 | 0.2353 |
| NanoDBPedia | 0.5429 | 0.7633 | 0.4059 |
| NanoFEVER | 0.5133 | 0.4643 | 0.4661 |
| NanoFiQA2018 | 0.3174 | 0.3669 | 0.2619 |
| NanoHotpotQA | 0.5000 | 0.5672 | 0.4234 |
| NanoMSMARCO | 0.4372 | 0.3865 | 0.4022 |
| NanoNFCorpus | 0.2866 | 0.5185 | 0.1177 |
| NanoNQ | 0.3987 | 0.3500 | 0.3527 |
| NanoQuoraRetrieval | 0.7944 ✨ | 0.8100 | 0.7685 |
| NanoSCIDOCS | 0.3153 | 0.5127 | 0.2322 |
| NanoArguAna | 0.3721 | 0.2873 | 0.2990 |
| NanoSciFact | 0.6216 | 0.5904 | 0.5804 |
| NanoTouche2020 | 0.4662 | 0.6656 | 0.3589 |
🩵 How to use? / 使い方 🩵
import torch
from sentence_transformers import SentenceTransformer
# load (remote code enabled)
model = SentenceTransformer(
"RikkaBotan/stable-static-embedding-fast-retrieval-mrl-bilingual-ja-en",
trust_remote_code=True,
device="cuda" if torch.cuda.is_available() else "cpu",
)
# inference
sentences = [
"Stable Static embedding is interesting.",
"SSE works without attention."
]
with torch.no_grad():
embeddings = model.encode(
sentences,
convert_to_tensor=True,
normalize_embeddings=True,
batch_size=32
)
# cosine similarity
# cosine_sim = embeddings[0] @ embeddings[1].T
cosine_sim = model.similarity(embeddings, embeddings)
print("embeddings shape:", embeddings.shape)
print("cosine similarity matrix:")
print(cosine_sim)
🩵 Retrieval usage / 検索用使用例 🩵
import torch
from sentence_transformers import SentenceTransformer
# load (remote code enabled)
model = SentenceTransformer(
"RikkaBotan/stable-static-embedding-fast-retrieval-mrl-bilingual-ja-en",
trust_remote_code=True,
device="cuda" if torch.cuda.is_available() else "cpu",
)
# inference
query = "What is Stable Static Embedding?"
sentences = [
"SSE: Stable Static embedding works without attention.",
"Stable Static Embedding is a fast embedding method designed for retrieval tasks.",
"Static embeddings are often compared with transformer-based sentence encoders.",
"I cooked pasta last night while listening to jazz music.",
"Large language models are commonly trained using next-token prediction objectives.",
"Instruction tuning improves the ability of LLMs to follow human-written prompts.",
]
with torch.no_grad():
embeddings = model.encode(
[query] + sentences,
convert_to_tensor=True,
normalize_embeddings=True,
batch_size=32
)
print("embeddings shape:", embeddings.shape)
# cosine similarity
similarities = model.similarity(embeddings[0], embeddings[1:])
for i, similarity in enumerate(similarities[0].tolist()):
print(f"{similarity:.05f}: {sentences[i]}")
🩵 Training Hyperparameters / 学習時のハイパーパラメータ 🩵
Non-Default Hyperparameters / デフォルトと異なる設定
Stage 1
eval_strategy: stepsper_device_train_batch_size: 1536gradient_accumulation_steps: 10learning_rate: 0.1adam_epsilon: 1e-10num_train_epochs: 2lr_scheduler_type: cosinewarmup_ratio: 0.01bf16: Truedataloader_num_workers: 4batch_sampler: no_duplicates
Stage 2
eval_strategy: stepsper_device_train_batch_size: 3072gradient_accumulation_steps: 6learning_rate: 0.03adam_epsilon: 1e-10num_train_epochs: 1lr_scheduler_type: cosinebf16: Truedataloader_num_workers: 4batch_sampler: no_duplicates
🩵 Training Datasets / 学習データセット 🩵
We learned from 29 datasets.
下記の29個のデータセットを使用しました。
| Dataset |
|---|
squad |
trivia_qa |
allnli |
pubmedqa |
hotpotqa |
miracl |
mr_tydi |
msmarco |
msmarco_10m |
msmarco_hard |
mldr |
s2orc |
swim_ir |
paq |
nq |
scidocs |
hpprc_emb__auto-wiki-nli-triplet |
hpprc_emb__jqara |
hpprc_emb__jagovfaqs |
hpprc_emb__jsquad |
hpprc_emb__jaquad |
hpprc_emb__mkqa-triplet |
hpprc_llmjp-kaken |
hpprc_msmarco_ja |
hpprc_emb__auto-wiki-qa-nemotron |
mldr_ja |
mrtydi_ja |
miracl_ja |
mmarco_ja |
mmarco_ja_hard |
hpprc_wiki |
All trained with MatryoshkaLoss — learning representations at multiple scales like Russian nesting dolls!
MatryoshkaLossを用いて学習を行っています。
🩵 Training results / 学習結果 🩵
Stage 1 (Pre-training / 事前学習)
Training loss
NanoBEIR_ja NDCG@10
Stage 2 (Fine-tuning / 微調整)
Training loss
NanoBEIR_ja NDCG@10
🩵 About me / 作成者:六花牡丹(りっかぼたん) 🩵
Japanese independent researcher having shy and pampered personality. Twin-tail hair is a charm point. Interested in nlp. Usually using python and C.
おっとりで甘えん坊な研究者見習い。 言語モデルに関するものが主な研究分野です。 お仕事のご依頼・登壇依頼・執筆依頼に関しては、下記までご連絡ください。
X(Twitter): https://twitter.com/peony__snow
🩵 Acknowledgements / 謝辞 🩵
The author acknowledge the support of Saldra, Witness and Lumina Logic Minds for providing computational resources used in this work.
I thank the developers of sentence-transformers, python and pytorch.
I thank all the researchers for their efforts to date.
I thank Japan's high standard of education.
And most of all, thank you for your interest in this repository.
このモデルの学習のための計算リソースの一部は、Saldraさん、Witnessさん、Lumina Logic Minds社から提供いただきました。貴重なサポートに感謝いたします。
sentence-transformers、python、pytorchを使用させていただきました。 作成・メンテンナンスしてくださっている皆様に感謝いたします。
何よりも、このモデルにご興味を持ってくださりありがとうございます。
🩵 Citation / 引用 🩵
BibTeX
Sentence Transformers
@inproceedings{reimers-2019-sentence-bert,
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
author = "Reimers, Nils and Gurevych, Iryna",
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
month = "11",
year = "2019",
publisher = "Association for Computational Linguistics",
url = "https://arxiv.org/abs/1908.10084",
}
MatryoshkaLoss
@misc{kusupati2024matryoshka,
title={Matryoshka Representation Learning},
author={Aditya Kusupati and Gantavya Bhatt and Aniket Rege and Matthew Wallingford and Aditya Sinha and Vivek Ramanujan and William Howard-Snyder and Kaifeng Chen and Sham Kakade and Prateek Jain and Ali Farhadi},
year={2024},
eprint={2205.13147},
archivePrefix={arXiv},
primaryClass={cs.LG}
}
MultipleNegativesRankingLoss
@misc{henderson2017efficient,
title={Efficient Natural Language Response Suggestion for Smart Reply},
author={Matthew Henderson and Rami Al-Rfou and Brian Strope and Yun-hsuan Sung and Laszlo Lukacs and Ruiqi Guo and Sanjiv Kumar and Balint Miklos and Ray Kurzweil},
year={2017},
eprint={1705.00652},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
Datasets used to train RikkaBotan/stable-static-embedding-fast-retrieval-mrl-bilingual-ja-en
Space using RikkaBotan/stable-static-embedding-fast-retrieval-mrl-bilingual-ja-en 1
Collection including RikkaBotan/stable-static-embedding-fast-retrieval-mrl-bilingual-ja-en
Papers for RikkaBotan/stable-static-embedding-fast-retrieval-mrl-bilingual-ja-en
Matryoshka Representation Learning
Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks
Efficient Natural Language Response Suggestion for Smart Reply
Evaluation results
- Cosine Accuracy@1 on NanoClimateFEVER_jaself-reported0.260
- Cosine Accuracy@3 on NanoClimateFEVER_jaself-reported0.480
- Cosine Accuracy@5 on NanoClimateFEVER_jaself-reported0.600
- Cosine Accuracy@10 on NanoClimateFEVER_jaself-reported0.700
- Cosine Precision@1 on NanoClimateFEVER_jaself-reported0.260
- Cosine Precision@3 on NanoClimateFEVER_jaself-reported0.173
- Cosine Precision@5 on NanoClimateFEVER_jaself-reported0.136
- Cosine Precision@10 on NanoClimateFEVER_jaself-reported0.088
- Cosine Recall@1 on NanoClimateFEVER_jaself-reported0.133
- Cosine Recall@3 on NanoClimateFEVER_jaself-reported0.231
- Cosine Recall@5 on NanoClimateFEVER_jaself-reported0.284
- Cosine Recall@10 on NanoClimateFEVER_jaself-reported0.356
- Cosine Ndcg@10 on NanoClimateFEVER_jaself-reported0.298
- Cosine Mrr@10 on NanoClimateFEVER_jaself-reported0.401
- Cosine Map@100 on NanoClimateFEVER_jaself-reported0.235
- Cosine Accuracy@1 on NanoDBPedia_jaself-reported0.680
- Cosine Accuracy@3 on NanoDBPedia_jaself-reported0.820
- Cosine Accuracy@5 on NanoDBPedia_jaself-reported0.880
- Cosine Accuracy@10 on NanoDBPedia_jaself-reported0.940
- Cosine Precision@1 on NanoDBPedia_jaself-reported0.680






