shanaka95/embeddinggemma-300m-rag-stage1
090
embeddinggemma-300m-rag-stage1
Fine-tuned version of google/embeddinggemma-300m on the EnterpriseRAG-Bench question-document pairs for first-place retrieval.
Training
Evaluation (89 questions, 5k corpus subset, 2048 ctx)
Compared against google/embeddinggemma-300m baseline.
Eval setup: 89 of 470 EnterpriseRAG-Bench questions whose first expecteddocid falls in the first 5k corpus docs, scored against those 5k. Re-encoded corpus with the fine-tuned model (NEVER re-use base-model corpus embeddings — different spaces).
Usage
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("shanaka95/embeddinggemma-300m-rag-stage1")
model.max_seq_length = 2048 # EmbeddingGemma native
query_emb = model.encode("How does X work?", prompt_name="query")
doc_emb = model.encode("X is a method that ...", prompt_name="document")
score = (query_emb @ doc_emb.T) # cosine (already normalized)Training data
- Queries: shanaka95/enterprise-rag-questions
- Documents: onyx-dot-app/EnterpriseRAG-Bench —
documentssplit - Eval: same
questionssplit, filtered to those with at least oneexpected_doc_idin the docs corpus (470 questions), using the first expecteddocid as gold.
Notes
- Use prompt names
queryanddocument(matches model.prompts). - For best retrieval results, re-encode the corpus with this model (do not reuse base-model embeddings).
- Stage 2 (hard negative mining) is in progress for further improvements.
