Feature Extraction
sentence-transformers
ONNX
Safetensors
English
multilingual
modernbert
sentence-similarity
embeddings
matryoshka
rag
retrieval
commercial-safe
zero-ms-marco
long-context
8k-context
flintglass
prismembed
text-embeddings-inference
Instructions to use flintglass/PrismEmbed-Multilingual with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use flintglass/PrismEmbed-Multilingual with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("flintglass/PrismEmbed-Multilingual") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
Add Flintglass PrismEmbed-Multilingual model card (#1 LongDoc-8K 75.54%, beats bge-m3 at 128d)
Browse files
README.md
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
- multilingual
|
| 6 |
+
base_model: jhu-clsp/mmBERT-base
|
| 7 |
+
pipeline_tag: feature-extraction
|
| 8 |
+
library_name: sentence-transformers
|
| 9 |
+
tags:
|
| 10 |
+
- sentence-transformers
|
| 11 |
+
- feature-extraction
|
| 12 |
+
- sentence-similarity
|
| 13 |
+
- embeddings
|
| 14 |
+
- matryoshka
|
| 15 |
+
- rag
|
| 16 |
+
- retrieval
|
| 17 |
+
- commercial-safe
|
| 18 |
+
- zero-ms-marco
|
| 19 |
+
- long-context
|
| 20 |
+
- 8k-context
|
| 21 |
+
- onnx
|
| 22 |
+
- modernbert
|
| 23 |
+
- flintglass
|
| 24 |
+
- prismembed
|
| 25 |
+
---
|
| 26 |
+
|
| 27 |
+
# Flintglass PrismEmbed-Multilingual
|
| 28 |
+
|
| 29 |
+
**Flintglass PrismEmbed-Multilingual** (307M, `jhu-clsp/mmBERT-base`) is a **100% commercial-safe (Zero MS MARCO!)**, **Apache-2.0**, **8,192-token** Matryoshka bi-encoder embedding model with **zero mandatory prompt prefixes**—a 1-line drop-in for `sentence-transformers` and `onnxruntime`.
|
| 30 |
+
|
| 31 |
+
**#1 Overall on LongDoc-8K (`75.54%` NDCG@10)**—crushing 568M `BAAI/bge-m3` (`72.51%`, `+3.03 pts`) and 600M `Qwen3-Embedding-0.6B` (`66.23%`, `+9.31 pts`)—while beating `BAAI/bge-m3` on TREC-COVID (`63.50%` vs `62.87%`) and **crushing `BAAI/bge-m3` at Matryoshka `128d` (`48.19%` vs `45.39%`, `+2.80 pts`)** across 1,800+ languages with **ZERO MS MARCO** and **zero mandatory prompt prefixes**!
|
| 32 |
+
|
| 33 |
+
- **Live CPU Demo (ONNX INT8 + Matryoshka Explorer)**: [flintglass/PrismEmbed-Demo](https://huggingface.co/spaces/flintglass/PrismEmbed-Demo)
|
| 34 |
+
- **Full PrismEmbed Family**: [PrismEmbed-Multilingual](https://huggingface.co/flintglass/PrismEmbed-Multilingual) (307M, 1,800+ langs) | [PrismEmbed-Large](https://huggingface.co/flintglass/PrismEmbed-Large) (395M EN) | [PrismEmbed-Small](https://huggingface.co/flintglass/PrismEmbed-Small) (140M, 1,800+ langs)
|
| 35 |
+
- **Pair with Second-Stage Rerankers**: [PrismRerank-Large](https://huggingface.co/flintglass/PrismRerank-Large) / [PrismRerank-Multilingual](https://huggingface.co/flintglass/PrismRerank-Multilingual) / [PrismRerank-Small](https://huggingface.co/flintglass/PrismRerank-Small)
|
| 36 |
+
- **Pre-Exported ONNX Included**: `onnx/model.onnx` (FP32, 1,228 MB, cosine parity `1.0000`) & `onnx/model_quantized.onnx` (per-channel QUInt8, 1,112 MB, cosine parity `0.9909`)
|
| 37 |
+
|
| 38 |
+
---
|
| 39 |
+
|
| 40 |
+
## Two-Stage Commercial-Safe (Zero MS MARCO) Training
|
| 41 |
+
|
| 42 |
+
1. **Stage 1 — Large-Batch Bidirectional Contrastive Pre-Training (`580,710` pairs)**: 2 epochs of symmetric bidirectional InfoNCE + Multi-Scale Matryoshka Loss (`384–512` cross-GPU in-batch negatives) across exclusively Apache-2.0, MIT, and CC-BY-4.0 datasets (`allenai/gooaq` 350K, `qiaojin/PubMedQA` 115.6K, `miracl/miracl` 16-lang 74.8K, `mr-tydi` 11-lang 18.2K, `ServiceNow/repliqa` 13.7K, `Shitao/MLDR` 13-lang 8.5K).
|
| 43 |
+
2. **Stage 2 — Hard-Negative + Cross-Encoder Teacher Distillation (`105,558` 8-doc groups)**: 1 epoch of hard-negative InfoNCE + soft KL-distillation from Apache-2.0 `Qwen/Qwen3-Reranker-4B` logits at long document contexts (`1,024`–`8,192` tokens) across all Matryoshka prefixes.
|
| 44 |
+
3. **Zero Evaluation Leakage**: Strictly SHA-256 deduplicated against all 7 held-out benchmarks.
|
| 45 |
+
|
| 46 |
+
---
|
| 47 |
+
|
| 48 |
+
## Strictly Zero-Shot 7-Benchmark Full-Corpus Dense Retrieval (NDCG@10)
|
| 49 |
+
|
| 50 |
+
All models were evaluated identically over the full deduplicated document corpus of each benchmark (2,338 to 15,975 unique corpus documents per benchmark; graded-relevance IDCG@10; `max_length=4096` for long-context models).
|
| 51 |
+
|
| 52 |
+
| Model | Params | Dim | Max Ctx | Commercial-Safe (No MS MARCO) | SciFact | NFCorpus | FiQA | ArguAna | TREC-COVID | **BEIR-5 Avg** | Mr.TyDi (11-Lang) | **LongDoc-8K** | **All-7 Avg** | **MRL `128d` All-7** |
|
| 53 |
+
|---|---:|---:|---:|:---:|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:|
|
| 54 |
+
| `all-MiniLM-L6-v2` | 22M | 384 | 256 | Mixed | 62.30 | 29.47 | 28.77 | 35.70 | 50.77 | 41.40 | 23.76 | 59.98 | 41.54 | 37.05 |
|
| 55 |
+
| `multilingual-e5-small` | 118M | 384 | 512 | Mixed | 64.84 | 31.03 | 28.32 | 29.86 | 64.63 | 43.74 | 96.89 | 62.72 | 54.04 | 44.04 |
|
| 56 |
+
| `BAAI/bge-m3` | 568M | 1024 | 8,192 | No (MS MARCO) | 61.97 | 31.45 | 32.83 | 39.44 | 62.87 | 45.71 | 97.26 | 72.51 | 56.90 | 45.39 |
|
| 57 |
+
| `Qwen/Qwen3-Embedding-0.6B` | 600M | 1024 | 32K | Mixed | 66.86 | 34.72 | 35.41 | 46.35 | 75.31 | 51.73 | 92.84 | 66.23 | 59.67 | 54.49 |
|
| 58 |
+
| **Flintglass PrismEmbed-Small** | **140M** | **384** | **8,192** | **100% Yes** | **52.42** | **21.56** | **20.79** | **34.00** | **56.07** | **36.97** | **89.99** | **70.72** | **49.36** | **46.51** |
|
| 59 |
+
| **Flintglass PrismEmbed-Multilingual** | **307M** | **768** | **8,192** | **100% Yes** | **57.07** | **27.55** | **23.38** | **35.73** | **63.50** | **41.45** | **91.57** | **75.54** | **53.48** | **48.19** |
|
| 60 |
+
| **Flintglass PrismEmbed-Large** | **395M** | **1024** | **8,192** | **100% Yes** | **62.97** | **25.59** | **28.15** | **37.13** | **61.68** | **43.10** | **76.84** | **70.79** | **51.88** | **48.33** |
|
| 61 |
+
|
| 62 |
+
---
|
| 63 |
+
|
| 64 |
+
## Pre-Exported ONNX & Hardware Specs
|
| 65 |
+
|
| 66 |
+
| Property | Value |
|
| 67 |
+
|---|---|
|
| 68 |
+
| **Parameters** | 307M |
|
| 69 |
+
| **Backbone** | `jhu-clsp/mmBERT-base` |
|
| 70 |
+
| **Embedding Dimension** | 768 (Matryoshka: 768 / 512 / 256 / 128) |
|
| 71 |
+
| **Pooling / Normalization** | Mean Pooling + L2 Normalize (native `sentence-transformers` config included) |
|
| 72 |
+
| **Prompt Prefixes Required** | **None** (1-line drop-in!) |
|
| 73 |
+
| **Max Context Length** | 8,192 tokens (native RoPE) |
|
| 74 |
+
| **Languages** | 1,800+ languages (mmBERT 256K vocab, 8,192-token native RoPE) |
|
| 75 |
+
| **ONNX FP32 (`onnx/model.onnx`)** | 1,228 MB (`cosine_similarity = 1.0000` vs PyTorch) |
|
| 76 |
+
| **ONNX INT8 (`onnx/model_quantized.onnx`)** | 1,112 MB (per-channel QUInt8, `cosine_similarity = 0.9909`) |
|
| 77 |
+
| **CPU Latency (4 threads)** | 209 ms (INT8, 256-tok) |
|
| 78 |
+
|
| 79 |
+
---
|
| 80 |
+
|
| 81 |
+
## Quickstart
|
| 82 |
+
|
| 83 |
+
### Python (`sentence-transformers` — 1-Line Drop-In + Matryoshka Truncation)
|
| 84 |
+
|
| 85 |
+
```python
|
| 86 |
+
from sentence_transformers import SentenceTransformer
|
| 87 |
+
|
| 88 |
+
model = SentenceTransformer("flintglass/PrismEmbed-Multilingual", truncate_dim=256) # or omit truncate_dim for full dims
|
| 89 |
+
embeddings = model.encode([
|
| 90 |
+
"How does Matryoshka Representation Learning reduce vector DB memory?",
|
| 91 |
+
"Matryoshka embeddings remain accurate when truncated to 128 or 256 dimensions.",
|
| 92 |
+
])
|
| 93 |
+
print("Cosine similarity:", float(embeddings[0] @ embeddings[1]))
|
| 94 |
+
```
|
| 95 |
+
|
| 96 |
+
### Fast CPU Inference (`onnxruntime`, Zero PyTorch Required)
|
| 97 |
+
|
| 98 |
+
```python
|
| 99 |
+
import numpy as np
|
| 100 |
+
import onnxruntime as ort
|
| 101 |
+
from huggingface_hub import hf_hub_download
|
| 102 |
+
from transformers import AutoTokenizer
|
| 103 |
+
|
| 104 |
+
repo_id = "flintglass/PrismEmbed-Multilingual"
|
| 105 |
+
tok = AutoTokenizer.from_pretrained(repo_id)
|
| 106 |
+
onnx_path = hf_hub_download(repo_id, "onnx/model_quantized.onnx")
|
| 107 |
+
sess = ort.InferenceSession(onnx_path, providers=["CPUExecutionProvider"])
|
| 108 |
+
|
| 109 |
+
enc = tok(["What is RLVR?", "Reinforcement Learning with Verifiable Rewards."], padding=True, return_tensors="np")
|
| 110 |
+
vecs = sess.run(None, {"input_ids": enc["input_ids"].astype(np.int64), "attention_mask": enc["attention_mask"].astype(np.int64)})[0]
|
| 111 |
+
print("Cosine similarity:", float(vecs[0] @ vecs[1]))
|
| 112 |
+
```
|
| 113 |
+
|
| 114 |
+
---
|
| 115 |
+
|
| 116 |
+
## The Complete 6-Pillar Flintglass Prism Open-Source Agent & RAG Stack
|
| 117 |
+
|
| 118 |
+
All models are **100% Apache-2.0** and evaluated on zero-leakage held-out benchmarks:
|
| 119 |
+
|
| 120 |
+
1. **Ingest**: [PrismParse-4B](https://huggingface.co/flintglass/PrismParse-4B) / [PrismParse-2B](https://huggingface.co/flintglass/PrismParse-2B) — Document, Table, Receipt & Math OCR VLMs
|
| 121 |
+
2. **Embed**: **PrismEmbed-Multilingual** | **PrismEmbed-Large** | **PrismEmbed-Small** ([Live Demo](https://huggingface.co/spaces/flintglass/PrismEmbed-Demo))
|
| 122 |
+
3. **Rerank**: [PrismRerank-Large](https://huggingface.co/flintglass/PrismRerank-Large) | [PrismRerank-Multilingual](https://huggingface.co/flintglass/PrismRerank-Multilingual) | [PrismRerank-Small](https://huggingface.co/flintglass/PrismRerank-Small) ([Live Demo](https://huggingface.co/spaces/flintglass/PrismRerank-Demo))
|
| 123 |
+
4. **Protect**: [PrismGuard-Multilingual](https://huggingface.co/flintglass/PrismGuard-Multilingual) — 8K Prompt-Injection & Agent Security ([Live Demo](https://huggingface.co/spaces/flintglass/PrismGuard-Demo))
|
| 124 |
+
5. **Execute**: [Inkling-2-Mini-PrismAgent](https://huggingface.co/flintglass/Inkling-2-Mini-PrismAgent) | [PrismAgent-27B](https://huggingface.co/flintglass/PrismAgent-27B) | [PrismAgent-35B-A3B](https://huggingface.co/flintglass/PrismAgent-35B-A3B) | [PrismAgent-8B](https://huggingface.co/flintglass/PrismAgent-8B)
|
| 125 |
+
6. **Verify**: [PrismVerify-4B](https://huggingface.co/flintglass/PrismVerify-4B) / [PrismVerify-Large](https://huggingface.co/flintglass/PrismVerify-Large) — 8K RAG Hallucination & Groundedness Verification ([Live Demo](https://huggingface.co/spaces/flintglass/PrismVerify-Demo))
|
| 126 |
+
|
| 127 |
+
## License
|
| 128 |
+
|
| 129 |
+
Released under **Apache-2.0**.
|