Instructions to use CheezOne/reranker-cjk-small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use CheezOne/reranker-cjk-small with sentence-transformers:
from sentence_transformers import CrossEncoder model = CrossEncoder("CheezOne/reranker-cjk-small") query = "Which planet is known as the Red Planet?" passages = [ "Venus is often called Earth's twin because of its similar size and proximity.", "Mars, known for its reddish appearance, is often referred to as the Red Planet.", "Jupiter, the largest planet in our solar system, has a prominent red spot.", "Saturn, famous for its rings, is sometimes mistaken for the Red Planet." ] scores = model.predict([(query, passage) for passage in passages]) print(scores) - Transformers.js
How to use CheezOne/reranker-cjk-small with Transformers.js:
// npm i @huggingface/transformers import { AutoTokenizer, AutoModelForSequenceClassification } from '@huggingface/transformers'; const tokenizer = await AutoTokenizer.from_pretrained('CheezOne/reranker-cjk-small'); const model = await AutoModelForSequenceClassification.from_pretrained('CheezOne/reranker-cjk-small'); const query = 'Which planet is known as the Red Planet?'; const documents = [ 'Mars, known for its reddish appearance, is often referred to as the Red Planet.', 'Venus is often called the twin of Earth because of its similar size and proximity.', ]; const inputs = tokenizer(new Array(documents.length).fill(query), { text_pair: documents, padding: true, truncation: true }); const { logits } = await model(inputs); console.log(logits.sigmoid().tolist()); // one relevance score per document - Notebooks
- Google Colab
- Kaggle
Small multilingual reranker for Chinese, Japanese and Korean (and more)
A 140M-parameter cross-encoder reranker distilled from BAAI/bge-reranker-v2-m3 into jhu-clsp/mmBERT-small (ModernBERT).
Use it as the second stage of RAG / search: give it a query and candidate passages, it returns relevance scores.
- 0.666 avg nDCG@10 on MIRACL reranking (zh/ja/ko/th/id/en), vs 0.688 for the 568M teacher: 2.2 points lower, 3.7ร faster.
- Beats every small open reranker we tested on all 6 languages, including Chinese, where small models are weakest.
- Context up to 8k tokens (ModernBERT), trained at 384 tokens per query+passage.
- ONNX fp32 + int8 included โ runs on CPU and in the browser (transformers.js).
ไธญๆ็ฎไป๏ผไธไธช็บฆ 1.4 ไบฟๅๆฐ็ๅฐๅ้ๆๅบ๏ผrerank๏ผๆจกๅ๏ผ้ขๅไธญๆใๆฅๆใ้ฉๆ RAG / ๆฃ็ดขใไป bge-reranker-v2-m3 ่ธ้ฆ่ๆฅ๏ผ MIRACL ไธๅนณๅๅชๆฏ่ๅธไฝ 2.2 ๅ๏ผ้ๅบฆๅฟซ 3.7 ๅ๏ผๅจ 6 ็ง่ฏญ่จไธๅ จ้จ่ถ ่ฟๆไปฌๆต่ฟ็ๅ็บงๅซๅฐๆจกๅใ้ ONNX๏ผๅฏ CPU / ๆต่งๅจ่ฟ่ก๏ผใ
Results: MIRACL reranking, nDCG@10
Candidate lists from mteb/MIRACLReranking (dev). Queries per language: zh 391, ja 797, ko 212, th 200, id 200, en 200
(zh/ja/ko: all queries in our bundled subset; th/id/en: first 200). Same data, same code and same GPU for every model
(scripts/rr_gpu.py eval). Bold = best non-teacher model.
| model | zh | ja | ko | th | id | en | avg | pairs/s (L40, bf16) |
|---|---|---|---|---|---|---|---|---|
| this model (mmBERT-small, ~140M) | 0.525 | 0.716 | 0.727 | 0.788 | 0.608 | 0.629 | 0.666 | 2776 |
| BAAI/bge-reranker-v2-m3 (568M, teacher) | 0.546 | 0.738 | 0.722 | 0.813 | 0.658 | 0.649 | 0.688 | 758 |
| hotchpotch/japanese-reranker-cross-encoder-small-v1 (118M) | 0.510 | 0.678 | 0.696 | 0.785 | 0.580 | 0.609 | 0.643 | 5430 |
| cross-encoder/mmarco-mMiniLMv2-L12-H384-v1 (118M) | 0.498 | 0.640 | 0.679 | 0.768 | 0.552 | 0.580 | 0.620 | 5314 |
| BAAI/bge-reranker-base (278M) | 0.460 | 0.561 | 0.586 | 0.686 | 0.508 | 0.552 | 0.559 | 2395 |
Notes, so you can judge the numbers yourself:
- Indonesian (id) was never in our training data, so that column is zero-shot transfer.
- MIRACL queries were removed from the training data (see the dataset card), but MIRACL and Mr. TyDi share Wikipedia, so passages can overlap.
- hotchpotch's model is Japanese-focused, and the teacher is much larger. We include them as reference points, not as straw men.
- Throughput was measured with batch 128 and max length 512. Expect different numbers on your hardware.
Usage
sentence-transformers
from sentence_transformers import CrossEncoder
model = CrossEncoder("CheezOne/reranker-cjk-small")
query = "ๅฆไฝๅ็ๆค็
ง๏ผ"
passages = ["ๅ็ๆค็
ง้่ฆๆบๅธฆ่บซไปฝ่ฏๅๆทๅฃๆฌๅฐๅบๅ
ฅๅข็ฎก็ๅฑ็ณ่ฏทใ", "ๆค็
งๆฏไธ็งๆ
่ก่ฏไปถใ", "ไปๅคฉๅไบฌๅคฉๆฐๆดๆใ"]
print(model.rank(query, passages))
transformers
import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tok = AutoTokenizer.from_pretrained("CheezOne/reranker-cjk-small")
model = AutoModelForSequenceClassification.from_pretrained("CheezOne/reranker-cjk-small").eval()
pairs = [["ๆฑไบฌใฟใฏใผใฎ้ซใใฏ๏ผ", "ๆฑไบฌใฟใฏใผใฎ้ซใใฏ333ใกใผใใซใงใใ"], ["ๆฑไบฌใฟใฏใผใฎ้ซใใฏ๏ผ", "ๅคง้ชๅใฏ่ฑ่ฃ็งๅใ็ฏใใๅใงใใ"]]
enc = tok(pairs, padding=True, truncation=True, max_length=512, return_tensors="pt")
with torch.no_grad():
print(model(**enc).logits.view(-1)) # higher = more relevant
Scores are raw logits; apply sigmoid if you want values in 0โ1.
transformers.js (browser / Node)
import { AutoTokenizer, AutoModelForSequenceClassification } from "@huggingface/transformers";
const tok = await AutoTokenizer.from_pretrained("CheezOne/reranker-cjk-small");
const model = await AutoModelForSequenceClassification.from_pretrained("CheezOne/reranker-cjk-small", { dtype: "q8" });
const inputs = tok(["๋นจ๊ฐ ๋ฌผ์ฝ", "๋นจ๊ฐ ๋ฌผ์ฝ"], { text_pair: ["์ฒด๋ ฅ์ ํ๋ณตํ๋ ๋นจ๊ฐ ๋ฌผ์ฝ์
๋๋ค.", "์์ธ์ ํ๊ตญ์ ์๋์
๋๋ค."], padding: true, truncation: true });
console.log((await model(inputs)).logits.data);
ONNX
| runtime | size | nDCG@10 zh | nDCG@10 ja | nDCG@10 ko |
|---|---|---|---|---|
| PyTorch fp32 | 563 MB (bf16 safetensors: 281 MB) | 0.647 | 0.729 | 0.721 |
ONNX fp32 onnx/model.onnx |
563 MB | 0.647 | 0.729 | 0.721 |
ONNX int8 onnx/model_quantized.onnx |
230 MB | 0.650 | 0.729 | 0.721 |
(ONNX check on the first 10 MIRACL queries per language, CPU.)
The int8 model quantizes embeddings and attention only. ModernBERT's GeGLU MLP activations have outliers, so the MLPs and head stay fp32.
Training
- Teacher:
BAAI/bge-reranker-v2-m3scored 551,213 queryโpassage pairs in 27 minutes on one L40. - Data:
CheezOne/reranker-train-chinese-japanese-korean, 51,858 query groups.- zh: 40k groups from T2Ranking.
- ja/ko/th/en: from Mr. TyDi.
- All Apache-2.0.
- Loss: listwise KL between student and teacher score distributions within each group, plus 0.05 ร MSE on raw scores.
- Hyperparameters: 2 epochs, 16 groups per step, lr 5e-5, max length 384, bf16. 6,484 steps in 55 minutes on one L40.
- Reproduce:
scripts/rr_prep.pyโscripts/rr_gpu.py teacher|train|evalโscripts/rr_export_onnx.py.
Limitations
- Trained mostly on Chinese (77% of groups), so ja/ko/th/en saw only 1.3kโ3.7k groups each. Domain-specific text (legal, medical, code) is not evaluated.
- It is a reranker, not a retriever: use it on top of BM25 or an embedding model.
- No safety or bias evaluation was done.
Citation / credits
Base model: jhu-clsp/mmBERT-small (MIT). Teacher: BAAI/bge-reranker-v2-m3 (Apache-2.0). Data: T2Ranking, Mr. TyDi; evaluation: MIRACL (via MTEB).
Use it in your project
- Model id (paste as-is):
CheezOne/reranker-cjk-small - License: Apache-2.0 (see
LICENSE). You may depend on it, redistribute it and fine-tune it, including commercially. Please keep the attribution. - If this model helps your project, a mention of the model id in your README lets other people find it.
@misc{cheezone_reranker_chinese_japanese_korean_multili,
title = {Small multilingual reranker for Chinese, Japanese and Korean},
author = {CheezOne},
year = {2026},
howpublished = {\url{https://huggingface.co/CheezOne/reranker-cjk-small}}
}
More from CheezOne
Small open models for Chinese / Japanese / Korean / English apps. All of them run on CPU, and most in the browser.
- pii-detector-cjk-small: PII detector (zh/ja/ko/en): find and redact names, phones, IDs, addresses. ONNX, runs on CPU and in the browser
- prompt-injection-guard-cjk-small: Prompt-injection / jailbreak detector (zh/ja/ko/en): a guardrail for LLM apps
- pixel-art-sprite-generator-16x16: Pixel sprite generator: text โ 16ร16 game sprites, in your browser (demo)
- Downloads last month
- -
Model tree for CheezOne/reranker-cjk-small
Base model
jhu-clsp/mmBERT-small
// npm i @huggingface/transformers import { AutoTokenizer, AutoModelForSequenceClassification } from '@huggingface/transformers'; const tokenizer = await AutoTokenizer.from_pretrained('CheezOne/reranker-cjk-small'); const model = await AutoModelForSequenceClassification.from_pretrained('CheezOne/reranker-cjk-small'); const query = 'Which planet is known as the Red Planet?'; const documents = [ 'Mars, known for its reddish appearance, is often referred to as the Red Planet.', 'Venus is often called the twin of Earth because of its similar size and proximity.', ]; const inputs = tokenizer(new Array(documents.length).fill(query), { text_pair: documents, padding: true, truncation: true }); const { logits } = await model(inputs); console.log(logits.sigmoid().tolist()); // one relevance score per document