Technical Overview
cl‑nagoya/ruri‑base is a Japanese‑focused sentence‑transformer model that converts arbitrary Japanese text into a 768‑dimensional embedding vector. It is built on top of the ruri‑pt‑base BERT‑style transformer and adds a pooling layer that aggregates token embeddings into a single sentence representation. The model is optimized for sentence‑similarity and feature‑extraction tasks, making it ideal for semantic search, clustering, and downstream classification in the Japanese language.
Key capabilities include:
- Supports up to 512 tokens per input (the underlying transformer can handle longer sequences, but the pooling layer is configured for 512).
- Outputs 768‑dimensional vectors that work directly with cosine similarity, the default similarity function for the model.
- Leverages the
クエリ:prefix for query‑side texts and文章:for passage‑side texts, a convention that improves cross‑encoder performance on Japanese retrieval benchmarks. - Provides a ready‑to‑use Sentence‑Transformers pipeline, allowing one‑line loading and inference.
Architecture highlights:
- Backbone: BERT‑style transformer (12 layers, 768 hidden size) pre‑trained on Japanese corpora.
- Pooling: Mean‑token pooling (no CLS token, no max pooling) – the most effective strategy for semantic similarity in Japanese.
- Framework: Implemented with
sentence‑transformers3.0.0 andtransformers4.x, compatible with PyTorch 1.13+.
Intended use cases range from building bilingual search engines to clustering news articles, from recommendation systems that need Japanese semantic similarity to fine‑tuning for domain‑specific retrieval tasks. Because the model is released under an Apache‑2.0‑compatible license (see the Licensing section), it can be integrated into commercial products with minimal legal friction.
Benchmark Performance
Ruri‑base is evaluated on the JMTEB benchmark suite, which aggregates a variety of Japanese semantic‑similarity tasks (retrieval, STS, classification, reranking, clustering, and pair‑classification). The model achieves an overall JMTEB average score of 71.91, with sub‑scores of 69.82 for retrieval, 82.87 for STS, and 75.58 for classification. These numbers place ruri‑base ahead of many multilingual baselines (e.g., LaBSE, multilingual‑E5) and very close to the latest Japanese‑specific models such as Ruri‑Small and Ruri‑Large.
Why JMTEB matters: it reflects real‑world performance on Japanese sentence‑level tasks, covering both supervised and unsupervised settings. High retrieval scores indicate that the embeddings can be used directly for semantic search without additional re‑ranking, while strong STS scores show reliable similarity judgments for downstream clustering or recommendation pipelines.
Compared to the older sup‑simcse‑ja‑base (68.56 avg.) and the multilingual intfloat/multilingual‑e5‑base (70.12 avg.), ruri‑base’s 71.91 average demonstrates a clear advantage for Japanese‑only applications, especially when the model size (111 M parameters) offers a good trade‑off between speed and accuracy.
Hardware Requirements
Ruri‑base contains 111 M parameters and produces 768‑dimensional embeddings. For inference, the model comfortably fits into a single modern GPU with at least 4 GB of VRAM when processing a batch of up to 32 sentences (512 tokens each). Larger batch sizes or longer sequences (up to the 8192‑token limit of the v3 family) will require 6‑8 GB VRAM.
- Recommended GPU: NVIDIA RTX 3060 (12 GB) or higher; RTX 2070 (8 GB) is sufficient for modest workloads.
- CPU: Any x86‑64 CPU with AVX2 support; a minimum of 8 GB RAM is advised for loading the model and handling tokenization.
- Storage: The model files (safetensors) total roughly 350 MB. Including the tokenizer and configuration files, allocate ~500 MB of disk space.
- Performance: On a RTX 3060, encoding 1 000 short sentences (~30 tokens each) takes under 2 seconds (≈ 0.5 ms per sentence). Cosine similarity computation is negligible compared to the transformer forward pass.
Use Cases
Ruri‑base shines in any scenario that requires Japanese semantic similarity:
- Semantic Search: Index a corpus of Japanese documents and retrieve the most relevant passages using cosine similarity.
- Duplicate Detection: Identify near‑duplicate news articles, product descriptions, or user‑generated content.
- Clustering & Topic Modeling: Group large sets of sentences or short paragraphs into thematic clusters for market analysis.
- Recommendation Systems: Match user queries (prefixed with
クエリ:) to item descriptions (文章:) for personalized content delivery. - Fine‑tuning: Use the base embeddings as a starting point for domain‑specific tasks such as legal text similarity or medical record retrieval.
Because the model is lightweight (111 M) and runs on a single GPU, it is suitable for on‑premise deployment in enterprises, edge devices with GPU acceleration, or cloud‑based micro‑services that serve millions of queries per day.
Training Details
Ruri‑base was fine‑tuned from the ruri‑pt‑base checkpoint using the ruri‑dataset‑ft, a curated Japanese sentence‑pair dataset designed for supervised similarity learning. The training pipeline employed a contrastive loss (similar to SimCSE) with the クエリ: / 文章: prefixes to teach the model to differentiate query‑type from passage‑type inputs.
- Dataset size: Approximately 1.2 M sentence pairs, covering news, encyclopedia, and web text.
- Compute: Trained on 8 × NVIDIA A100 (40 GB) GPUs for ~48 hours, using mixed‑precision (FP16) to accelerate convergence.
- Hyper‑parameters: Batch size 256, learning rate 2e‑5, 3 epochs, cosine‑annealing scheduler.
- Fine‑tuning capability: The model can be further adapted to domain‑specific data by continuing the contrastive training loop or by adding a classification head on top of the pooled embeddings.
Licensing Information
The model card lists the license as apache‑2.0, yet the top‑level metadata marks the license as “unknown”. In practice, the Apache‑2.0 terms apply, granting users the right to use, modify, distribute, and even commercialize the model, provided that:
- A copy of the Apache‑2.0 license is included with any redistribution.
- Any modifications are clearly marked as such.
- Patent rights are granted under the Apache‑2.0 patent clause.
If you intend to embed the model in a proprietary product, you may do so without paying royalties, but you must retain the attribution notice and the license file. The “unknown” flag is likely a metadata oversight; nevertheless, you should verify the license file in the repository (available under model files) before deploying in a highly regulated environment.