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.
Accuracy climbing through training
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.
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 (mind the prefixes)
There's one rule. Prefix queries with 「検索クエリ: 」 and documents with 「検索文書: 」. Drop them and accuracy drops noticeably.
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.
| Model | Size | Base | DL/mo |
|---|---|---|---|
| med-ruri-v3-310m-v2-from-med | 310M | from-med | 678 |
| med-ruri-v3-310m-v2-from-ruri | 310M | from-ruri | 130 |
| med-ruri-v3-130m-v2-from-ruri | 130M | from-ruri | — |
| med-ruri-v3-70m-v2-from-med | 70M | from-med | 105 |
| med-ruri-v3-70m-v2-from-ruri | 70M | from-ruri | 92 |
| med-ruri-v3-310m (v1) | 310M | v1 | 145 |
| med-ruri-v3-70m (v1) | 70M | v1 | 110 |