Queryn adapter β bge-m3 β fastembed-bge-small
Translates an embedding produced by bge-m3 into the embedding space of fastembed-bge-small, so a corpus already embedded with bge-m3 can be served against a fastembed-bge-small index without re-embedding it. Part of the Queryn embedding-translation engine.
Specs
| Source model | bge-m3 (1024-d) |
| Target model | fastembed-bge-small (384-d) |
| Architecture | linear (plain linear projection) |
| Parameters | ~393.6K |
| Best test cosine similarity | 0.8777 (epoch 15) |
| ONNX opset | 17 |
Architecture ablation (best test cosine): linear 0.8777 β saved, deep 0.8745.
Input / output contract
- Input
source_embeddingβ float32, shape[batch, 1024]. Rawbge-m3embeddings; the graph L2-normalizes them itself, so pre-normalization is neither required nor harmful. - Output
target_embeddingβ float32, shape[batch, 384], unit-normalized, infastembed-bge-smallspace. - Batch axis is dynamic.
Usage
import numpy as np, onnxruntime as ort
from huggingface_hub import hf_hub_download
path = hf_hub_download("QuerynAi/queryn-adapter-bge-m3_to_fastembed-bge-small", "model.onnx")
sess = ort.InferenceSession(path, providers=["CPUExecutionProvider"])
src = np.random.rand(4, 1024).astype(np.float32) # your bge-m3 embeddings
tgt = sess.run(["target_embedding"], {"source_embedding": src})[0]
assert tgt.shape == (4, 384) # unit vectors in fastembed-bge-small space
Training
Trained on paired embeddings over a unified multi-domain corpus β arXiv abstracts, Australian case law, SQuAD passages, PubMed abstracts, and crypto/markets news (~350k rows spanning science, legal, QA, medical, and finance). Loss: 1 - mean cosine similarity, Adam, ReduceLROnPlateau, best-epoch checkpoint. Both a linear baseline and the MLP are trained for every pair; the higher-scoring one is published (ties go to linear).
Plots
bge-m3 β all targets: learning curves and best scores (this pair included).
Linear vs. deep for every pair (black ring = saved architecture).
Full adapter set: Queryn Embedding Adapters
Provenance
- Source checkpoint:
models/v1/bge-m3_to_fastembed-bge-small.pt(sha2567c8c6895ce12df8cβ¦) - Converted: 2026-08-30T20:45:22+00:00 Β· torch 2.13.0 Β·
ptConverter.py
License
Released under the MIT license.
- Downloads last month
- -

