BPVELA-G300M
BPVELA-G300M is a Traditional Chinese retrieval embedding model fine-tuned from google/embeddinggemma-300m.
Gemma is provided under and subject to the Gemma Terms of Use found at ai.google.dev/gemma/terms
繁體中文說明
模型摘要
- 版本:
v2.0 - 基底模型:
google/embeddinggemma-300m(約 3 億參數,768 維) - 釋出形式:完整模型權重,直接以 sentence-transformers 載入,不需要 peft
- 最大長度:512 tokens
- 建議用途:繁體中文語意檢索、retrieval-first RAG
與 v1.0.0 的差異
v1.0.0 不建議繼續使用,保留在 v1.0.0 tag。
v2.0 從基底模型重新訓練,修正了訓練設定,改用多樣化的合成查詢與困難樣本,並與基底模型做權重插值以保留通用檢索能力。
評測結果(nDCG@10)
| 評測 | 說明 | embeddinggemma-300m | v2.0 |
|---|---|---|---|
BelebeleRetrieval zho_Hant |
MTEB,Meta Belebele | 0.9480 | 0.9554(+0.8%) |
| DRCD | 台達 DRCD test,3,493 題對 1,000 段 | 0.8963 | 0.9098(+1.5%) |
| DRCD(一萬段) | 同上題目,語料為 DRCD 全部 10,013 段 | 0.7642 | 0.7846(+2.7%) |
| Taiwan.md 領域測試集 | 150 篇人工審閱文章(未參與訓練),1,775 題對 2,578 段 | 0.8509 | 0.8687(+2.1%) |
MIRACLRetrieval zh |
MTEB,MIRACL dev | 0.4626 | 0.4529(−2.1%) |
BelebeleRetrieval zho_Hans(補充) |
MTEB,簡體 | 0.9524 | 0.9571(+0.5%) |
- 評測條件:fp32、max_length 512、EmbeddingGemma 檢索前綴(
task: search result | query:/title: none | text:);MTEB 任務使用mteb2.12.25 官方實作。 - 本模型的訓練資料不含 Belebele、MIRACL、DRCD 的任何資料,並排除了 DRCD test/dev 與 MIRACL zh dev 正解所在的維基百科條目,因此上表公開評測皆為 zero-shot。
- MIRACL 為本模型唯一低於基底模型的評測(−0.0097)。EmbeddingGemma 的微調資料包含 Gecko 所用學術資料集的一部分,而 Gecko 多語版的學術資料包含 MIRACL 訓練集;EmbeddingGemma 是否使用 MIRACL 未公開說明。
- Taiwan.md 測試集的查詢為依段落合成的問句,僅作為領域內參考。
使用方式
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("BluePlanetAI/BPVELA-G300M")
queries = model.encode(["台灣第一篇白話小說是誰寫的"], prompt_name="query")
docs = model.encode(["賴和的代表作《鬥鬧熱》被認為是台灣第一篇白話小說。"], prompt_name="document")
print(model.similarity(queries, docs))
prompt_name="query" 會加上 task: search result | query: ,prompt_name="document" 會加上 title: none | text: ;有文件標題時可改用 title: {標題} | text: {內文}。請勿使用 float16(EmbeddingGemma 在 fp16 下會產生錯誤結果),請用 float32 或 bfloat16。
訓練方式
- 資料:
- Taiwan.md(https://github.com/frank890417/taiwan-md,commit
256f584,2026-10-27),CC BY-SA 4.0 - 繁體中文維基百科隨機條目(MediaWiki zh-tw 字詞轉換),CC BY-SA 4.0
- 查詢由本地部署的 Gemma 4 26B-A4B(Apache 2.0)依段落產生,涵蓋事實、原因/方法、關鍵詞、口語、情境描述等問法
- 僅保留基底模型無法排在第一、但能排進前十名的困難查詢;困難負例取自基底模型前十名中其他文章的段落
- Taiwan.md(https://github.com/frank890417/taiwan-md,commit
- 訓練:LoRA(r 16、alpha 32,注意力層)、CachedMultipleNegativesRankingLoss(scale 20)、batch 64、學習率 2e-5、2 個 epoch,以 DRCD dev(與 test 不重疊的文章)及 Taiwan.md dev 挑選 checkpoint;模型的兩層 Dense 投影一併更新
- 權重插值:最終權重為基底模型與微調模型的中點(WiSE-FT,α = 0.5;Wortsman et al., 2022),LoRA 已合併進權重
授權說明
- 本模型權重修改自
google/embeddinggemma-300m,屬 Gemma Terms of Use 所定義的 Model Derivative;使用與散布須遵守 Gemma Terms of Use(https://ai.google.dev/gemma/terms)。 - 使用限制:您不得將本模型用於 (1) Gemma Prohibited Use Policy(https://ai.google.dev/gemma/prohibited_use_policy)所列的限制用途,或 (2) 違反適用法律法規的用途。再散布本模型或其衍生模型時,須將這些使用限制納入您的授權條款,並告知後續使用者。
- 本 repository 中的權重與設定檔皆經 BluePlanetAI 修改(微調與權重插值),並附有
NOTICE檔與 Gemma Terms of Use 副本(GEMMA_TERMS_OF_USE.md)。 - 訓練資料來自 Taiwan.md 與維基百科(皆為 CC BY-SA 4.0),引用時請一併註明出處。
English
Summary
- Version
v2.0; full weights (no peft needed); max sequence length 512; 768-dimensional embeddings - Retrained from
google/embeddinggemma-300m. v1.0.0 is deprecated and kept only under thev1.0.0tag
Results (nDCG@10)
| Benchmark | embeddinggemma-300m | v2.0 |
|---|---|---|
BelebeleRetrieval zho_Hant |
0.9480 | 0.9554 (+0.8%) |
| DRCD test (3,493 questions, 1,000 paragraphs) | 0.8963 | 0.9098 (+1.5%) |
| DRCD test against all 10,013 DRCD paragraphs | 0.7642 | 0.7846 (+2.7%) |
| Taiwan.md held-out test (150 human-reviewed articles) | 0.8509 | 0.8687 (+2.1%) |
MIRACLRetrieval zh |
0.4626 | 0.4529 (−2.1%) |
BelebeleRetrieval zho_Hans (supplementary) |
0.9524 | 0.9571 (+0.5%) |
fp32, max_length 512, EmbeddingGemma retrieval prompts; MTEB tasks via mteb 2.12.25. All public benchmarks are zero-shot for this model. Do not run EmbeddingGemma in float16.
Usage
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("BluePlanetAI/BPVELA-G300M")
queries = model.encode(["台灣第一篇白話小說是誰寫的"], prompt_name="query")
docs = model.encode(["賴和的代表作《鬥鬧熱》被認為是台灣第一篇白話小說。"], prompt_name="document")
print(model.similarity(queries, docs))
License
These weights are a Model Derivative of google/embeddinggemma-300m and are distributed under the Gemma Terms of Use (https://ai.google.dev/gemma/terms).
Use restrictions: you must not use this model (1) for the restricted uses set forth in the Gemma Prohibited Use Policy (https://ai.google.dev/gemma/prohibited_use_policy) or (2) in violation of applicable laws and regulations. If you redistribute this model or a derivative, include these use restrictions in your terms and notify subsequent users. The files in this repository were modified by BluePlanetAI (fine-tuning and weight interpolation); see NOTICE and GEMMA_TERMS_OF_USE.md. Training data comes from Taiwan.md and Wikipedia (CC BY-SA 4.0).