Home/Models/med-ruri v3
Sentence Similarity · 70M–310M

med-ruri v3

An embedding model for searching Japanese medical text by meaning. It turns a question and a document into vectors in the same space, so you can pull the nearest ones. It's the retrieval backbone for in-house RAG and for building the Before/After dataset — a foundational part, really.

Apache-2.0 ModernBERT-Ja base 70M / 130M / 310M nDCG@10 0.53
0.53
In-house nDCG@10 (v1 was 0.42)
+0.11
Gain over v1 (+0.1104)
7
Published variants (size × base)
310M
Largest size; a 70M lightweight too
What

What it is

Ordinary keyword search can't find what it can't match character-for-character. In medicine the same thing gets written many different ways. You want to catch the gap between "anticoagulation" and "a blood thinner" by nearness in meaning. That's what an embedding model is for. The base here is ModernBERT-Ja, with medical text added on top to pull it toward clinical vocabulary and the particular phrasing of guidelines.

On its own this model isn't flashy. But the quality of the search that sits on top of it is almost entirely the quality of this one part. So it's the piece I put the most care into.

Metric

Accuracy climbing through training

In-house benchmark, nDCG@10
How much of the ground truth lands in the top 10. Higher is better.
0.45 0.50 v1 baseline 0.4244 0.5348

Every training step is logged in metrics_progress.json, and checkpoints for specific steps are reachable from the revision branches. These numbers are a relative comparison on my own benchmark, not an absolute head-to-head against other models.

Recipe

What v2 changed

v2 is the release where I closed, one by one, the gaps that showed up in real use.

  • Normalize the noise. Text pulled from PDFs carries broken characters, so I NFKC-normalize to clear the tokenizer junk.
  • Make search version-independent. Guidelines change their year with each revision. I strip the year from headers so the same query retrieves in both the old and new editions.
  • Don't reward recency alone. I deliberately mix in old-edition text as "tempting wrong answers," weighted 10×, so the model doesn't just float the newest documents to the top.
  • Keep the numbers stable. Weights held in FP32, with only the matmuls in TF32.
Usage

Usage (mind the prefixes)

There's one rule. Prefix queries with 「検索クエリ: 」 and documents with 「検索文書: 」. Drop them and accuracy drops noticeably.

from sentence_transformers import SentenceTransformer m = SentenceTransformer("genshiai-daichi/med-ruri-v3-310m-v2-from-med") q = m.encode("検索クエリ: 心房細動の抗凝固はいつ始める?") d = m.encode("検索文書: 弁膜症を伴わない心房細動では…") # rank documents by cosine similarity
Variants

Published variants

Sizes run from 70M to 310M. Each comes in two lineages: continued from the medical v1 model (from-med) and trained from plain Ruri (from-ruri). Pick 70M for speed, 310M for accuracy.

ModelSizeBaseDL/mo
med-ruri-v3-310m-v2-from-med310Mfrom-med678
med-ruri-v3-310m-v2-from-ruri310Mfrom-ruri130
med-ruri-v3-130m-v2-from-ruri130Mfrom-ruri
med-ruri-v3-70m-v2-from-med70Mfrom-med105
med-ruri-v3-70m-v2-from-ruri70Mfrom-ruri92
med-ruri-v3-310m (v1)310Mv1145
med-ruri-v3-70m (v1)70Mv1110
Related

Related

← Back to Models & Datasets