Instructions to use KhajaHugging/bge-small-vectormatch with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use KhajaHugging/bge-small-vectormatch with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("KhajaHugging/bge-small-vectormatch") sentences = [ "That is a happy person", "That is a happy dog", "That is a very happy person", "Today is a sunny day" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Notebooks
- Google Colab
- Kaggle
bge-small-vectormatch
BAAI/bge-small-en-v1.5 fine-tuned to match resumes (CVs) to job posts. Part of VectorMatch, a hybrid semantic job-matching engine benchmarked across six vector databases.
Results (held-out test set)
25K real job posts; 500 real CVs never seen in training or model selection. A job is relevant if its role category matches the CV's (labels from the dataset, not from an LLM).
| Model | Retrieval | P@10 | nDCG@10 | MRR | Hit@1 |
|---|---|---|---|---|---|
| BM25 | keyword | 0.436 | 0.439 | 0.575 | 0.444 |
| bge-small-en-v1.5 (base) | dense | 0.566 | 0.570 | 0.695 | 0.598 |
| bge-small-vectormatch | dense | 0.664 | 0.661 | 0.740 | 0.642 |
| bge-small-vectormatch | hybrid (+ BM25, weighted RRF) | 0.667 | 0.667 | 0.755 | 0.666 |
+17% P@10 over the base model with the same size, latency and 384-d vectors, so it is a drop-in replacement in any vector database.
Usage
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("KhajaHugging/bge-small-vectormatch")
query = "Represent this sentence for searching relevant passages: " + cv_text # same instruction as bge
q = model.encode(query, normalize_embeddings=True)
docs = model.encode(job_posts, normalize_embeddings=True)
scores = docs @ q
Use the bge query instruction for CVs/queries and no prefix for job posts. Vectors are L2-normalised: use inner product / cosine.
Training
| Data | 8,702 (CV, matching job, hard-negative job) triples from the Djinni dataset (MIT). CVs and jobs are asserted disjoint from the evaluation CVs and the search corpus. |
| Hard negatives | For each CV, the highest BM25-ranked job from a different category (lexically similar, wrong role). |
| Loss | InfoNCE (Ο = 0.05) over in-batch + hard negatives, with category-aware false-negative masking: other in-batch jobs of the CV's own category are correct matches, so they are masked rather than pushed away. |
| Setup | 1 epoch, batch 32, AdamW lr 2e-5, linear warm-up/decay, max 256 tokens, CPU, gradient checkpointing. |
| Selection | Checkpoint chosen on the dev half of the evaluation CVs only (dev P@10 0.565 β 0.689). |
Training and evaluation code: scripts/build_training_set.py, scripts/finetune_embedder.py, scripts/eval_quality.py.
Limitations
- Trained on one IT-focused job board (Djinni; mostly Eastern-European tech roles, English texts). Expect weaker transfer to other domains.
- "Same category" is a proxy for relevance, and category labels are coarse (e.g. Python vs Data Science). Measured precision is conservative.
- Do not use as the sole basis for hiring decisions; rankings reflect patterns, including biases, in historical postings.
- Downloads last month
- 42
Model tree for KhajaHugging/bge-small-vectormatch
Base model
BAAI/bge-small-en-v1.5Datasets used to train KhajaHugging/bge-small-vectormatch
lang-uk/recruitment-dataset-candidate-profiles-english
Evaluation results
- P@10 (dense only) on Djinni jobs (25K corpus, 500 held-out CVs)self-reported0.664
- nDCG@10 (dense only) on Djinni jobs (25K corpus, 500 held-out CVs)self-reported0.661
- MRR (dense only) on Djinni jobs (25K corpus, 500 held-out CVs)self-reported0.740