Instructions to use alibayram/embeddingmagibu2-text-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use alibayram/embeddingmagibu2-text-v1 with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("alibayram/embeddingmagibu2-text-v1") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
embeddingmagibu2-text-v1
Turkish-first text embeddings, from our research to a compact, deployable model.
embeddingmagibu2-text-v1 is a 271M-parameter multilingual text embedding model developed by Magibu AI Research for Turkish semantic search, retrieval-augmented generation (RAG) and sentence similarity. It combines a Turkish-optimized tokenizer with the adaptation pipeline we introduced in our research paper.
It is the text tower of embeddingmagibu2-v1, adapted from Google's EmbeddingGemma 2 and packaged for text-only deployment.
- Higher retrieval means than the teacher in our evaluation: 0.5815 vs 0.5706 on the 10-task Turkish mini-suite; 0.6456 vs 0.6338 on English NanoBEIR.
- More compact Turkish tokenization: 1.80 tokens per word on our native Turkish sample, compared with 2.41 for the original Gemma tokenizer.
- 8,192-token text context and 768-dimensional normalized embeddings. Long-document retrieval quality has not been separately benchmarked.
These are development-set results with known data-overlap limitations, detailed in Evaluation scope and data overlap.
Choose a release
| Release | Inputs | Parameters | BF16 weight file |
|---|---|---|---|
| embeddingmagibu2-text-v1 | Text | 271,002,648 | ~542 MB |
| embeddingmagibu2-v1 | Text, image, speech, sound, video | 744,371,512 | ~1.49 GB |
Both releases use the same trained text tower, tokenizer, pooling and projection. The text-only package removes the media encoders; it is not a separately distilled, lower-capacity text model. Its weight file is about 64% smaller. File size is not a measurement of runtime memory.
Quick start
This repository uses gated access. If prompted, accept its access conditions on Hugging Face and authenticate your environment with an account that has access.
pip install -U "sentence-transformers>=6.1" "transformers>=5.19"
Text retrieval
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("alibayram/embeddingmagibu2-text-v1")
queries = ["Türkiye'nin başkenti neresidir?"]
documents = [
"Ankara, Türkiye'nin başkentidir ve İç Anadolu Bölgesi'nde yer alır.",
"İstanbul, Türkiye'nin en kalabalık şehridir.",
]
query_vectors = model.encode(queries, prompt_name="query")
document_vectors = model.encode(documents, prompt_name="document")
print(model.similarity(query_vectors, document_vectors)) # shape: (1, 2)
Sentence similarity
vectors = model.encode(
["Bugün hava çok güzel.", "Hava bugün harika."],
prompt_name="STS",
)
print(model.similarity(vectors[:1], vectors[1:]))
Prompts and embedding compatibility
Use query for search queries, document for untitled documents, and STS for both sides of a sentence-similarity comparison. Other saved prompts include QuestionAnswering, FactChecking, Classification, Clustering and CodeRetrieval; inspect model.prompts for the full list.
For a document with a title, supply the formatting yourself and disable an additional prompt:
titled_documents = ["title: Ankara | text: Ankara, Türkiye'nin başkentidir."]
vectors = model.encode(titled_documents, prompt="")
The two v1 releases share their text embedding space. Release checks on sample inputs found identical token IDs and cosine similarity >0.9999 between the two text paths, using FP32 computation on the saved BF16 weights with query and document prompts. Different hardware or precision can still introduce small numerical differences. Keep model version, prompts, dimensions and preprocessing consistent across indexing and querying.
Do not reuse an index built with the original teacher or embeddingmagibu-200m: adaptation changes the embedding space. Re-embed that corpus with the new model.
Use BF16 on supported hardware or FP32 elsewhere; avoid FP16, as described in the base model's numerical-precision guidance. All reported results use 768-dimensional embeddings. Although training included 512/256/128 dimensions, their quality has not been evaluated for this release; truncated vectors must be re-normalized.
Research and training
Developed by Magibu AI Research, this release builds on our Turkish adaptation pipeline introduced in Adapting Multilingual Embedding Models to Turkish via Cross-Lingual Tokenizer Surgery and Offline Distillation, first submitted on 28 May 2026.
That paper describes the earlier embeddingmagibu-200m model. embeddingmagibu2 extends this line of work to EmbeddingGemma 2, with a new tokenizer, retrieval training and multimodal alignment. The base architecture and pretrained weights come from Google; our contribution is the Turkish adaptation pipeline, tokenizer adaptation, training and released checkpoints.
- Turkish tokenizer surgery. Altus replaces 42,484 rarely used entries in the Gemma-4-compatible vocabulary with Turkish subwords, retaining 219,660 entries and the original vocabulary size of 262,144. New embedding rows start from the mean of the teacher's subtoken embeddings. Other weights are copied from the teacher at initialization, then trained in the stages below.
- Offline distillation. Precomputed teacher vectors from 40-language Wikipedia provide multilingual supervision. A 23-source Turkish task mix then adds retrieval, QA, similarity, NLI, classification, clustering and bitext tasks, using cosine alignment and an in-batch ranking KL loss.
- Contrastive retrieval training. Two rounds use Turkish and English labelled pairs, newly mined student hard negatives, and teacher text/image anchors. Training includes Matryoshka dimensions of 768, 512, 256 and 128. Turkish pairs come from the remaining TR-MTEB data after evaluation filtering and additional QA/FAQ sources. English pairs come from NQ, HotpotQA, FiQA and FEVER in
lightonai/embeddings-fine-tuning-filtered-en. - Weight merging. The second retrieval checkpoint and the task-mix checkpoint are averaged with equal weights to balance retrieval, sentence similarity and cross-modal alignment.
- Multimodal alignment. One epoch (1,203 steps, batch size 128) combines retrieval, image–caption, Turkish speech–transcript, English sound–caption and English video–caption pairs, with teacher anchors. Sources include Flickr8k, FLEURS, Common Voice 17, Clotho and MSR-VTT. Only the text backbone is updated in this stage; the vision and audio encoders remain frozen.
- Release packaging. The full checkpoint is saved in BF16. Its text tower, including the 512→768 projection, is also released separately as
embeddingmagibu2-text-v1.
Evaluation scope and data overlap
All scores below are our own development evaluations at 768 dimensions, not an official MTEB leaderboard submission or an independent final holdout. The same evaluation setup is used for the teacher and student. These suites were consulted during development.
- Turkish retrieval: trmteb-retrieval-mini, with 200 selected test queries per task. Each corpus contains all relevant documents, BM25 top-20 distractors and random documents, capped at 10,000; smaller corpora are retained in full. Texts are clipped to 2,000 characters. Relevance is treated as binary. Queries use
FactCheckingfor SciFact,QuestionAnsweringfor SQuAD/TQuAD, andqueryotherwise; documents use the title/text format shown above. These scores are not comparable to full-corpus TR-MTEB scores. Many Turkish tasks are translated from English. - Training overlap: selected evaluation queries and positives were filtered from later retrieval-training data by text matching. That filtering did not cover every earlier distillation source. The earlier task mix combined source splits, including STSb-TR test data, and TQuAD/TQuAD-2 have overlapping source contexts. Thus, this is not an all-stage contamination-free evaluation. STSb-TR is reported only as a seen-source reference; TQuAD also needs this qualification. No comprehensive cross-stage overlap audit has been completed for every benchmark.
- English retrieval: mean nDCG@10 across 13 NanoBEIR datasets.
- Sentence similarity: Spearman correlation between cosine similarity and labels, using the
STSprompt. STS22-tr uses train+test; SICK-R-TR and STSb-TR use test. - Uncertainty: no confidence intervals or significance tests are reported. Small score gaps should not be treated as established differences in general quality.
Results
Teacher = google/embeddinggemma-2. Text results are shared by the full release and its extracted text tower.
Turkish retrieval (nDCG@10)
| Task | Teacher | v1 / text-v1 |
|---|---|---|
| MS MARCO-TR | 0.7115 | 0.7592 |
| FiQA-TR | 0.3093 | 0.3582 |
| NFCorpus-TR | 0.3086 | 0.2940 |
| SciFact-TR | 0.6928 | 0.6871 |
| ArguAna-TR | 0.5305 | 0.5665 |
| SCIDOCS-TR | 0.2031 | 0.2032 |
| Quora-TR | 0.8525 | 0.8587 |
| CQADupStack-Gaming-TR | 0.5538 | 0.5477 |
| SQuAD-TR | 0.6710 | 0.6568 |
| TQuAD | 0.8730 | 0.8830 |
| Mean | 0.5706 | 0.5815 |
English retrieval and Turkish sentence similarity
| Benchmark | Metric | Teacher | v1 / text-v1 |
|---|---|---|---|
| NanoBEIR, 13-set mean | nDCG@10 | 0.6338 | 0.6456 |
| STS22-tr | Spearman | 0.7420 | 0.7293 |
| SICK-R-TR | Spearman | 0.7443 | 0.7440 |
| STSb-TR — seen-source reference | Spearman | 0.7888 | 0.7898 |
STSb-TR is excluded from claims about generalization because its source test split was included in the earlier distillation mix.
Comparison on the same Turkish retrieval suite
| Model | Parameters | Mean nDCG@10 | Docs/s | Raw vectors, KiB/doc | Tokens / Turkish word |
|---|---|---|---|---|---|
| Vor-LateEmbed-TR-0.6B-v1 (late interaction) | 594M | 0.6104 | 58 | 35.2 | 2.49 |
| embeddinggemma-300m | 308M | 0.5899 | 444 | 1.5 | 2.41 |
| multilingual-e5-large-instruct | 560M | 0.5872 | 896 | 2.0 | 1.96 |
| embeddingmagibu2-text-v1 | 271M | 0.5815 | 442 | 1.5 | 1.80 |
| bge-m3 | 568M | 0.5729 | 909 | 2.0 | 1.96 |
| embeddinggemma-2 (teacher) | 744M total; 271M text | 0.5706 | 391 | 1.5 | 2.41 |
| turkish-e5-large | 560M | 0.5662 | 890 | 2.0 | 1.96 |
| multilingual-e5-base | 278M | 0.5476 | 1475 | 1.5 | 1.96 |
| Mursit-Large-TR-Retrieval | 404M | 0.5214 | 613 | 2.0 | 1.69 |
| embeddingmagibu-200m | 207M | 0.5083 | 459 | 1.5 | 1.83 |
| Qwen3-Embedding-0.6B | 596M | 0.4957 | 295 | 2.0 | 2.73 |
In this comparison, text-v1 ranks third among single-vector models and is the smallest of those three. Its mean is 0.0084 below EmbeddingGemma-300m and 0.0057 below multilingual-e5-large-instruct. Vor has the highest score and uses multi-vector late interaction rather than a single vector per document.
Measurement details:
- Models use their recommended prompts and document formatting. The evaluation and overlap qualifications above apply to this entire table.
- Throughput uses A100 40 GB GPUs, BF16, batch size 32, and 2,000 Turkish documents clipped to 2,000 characters, with warm-up and synchronization. Measurements include separate runs on two A100 hosts. In the direct same-host Vor comparison, Vor encoded 58 docs/s and text-v1 encoded 438 docs/s; the main text-v1 run shown above recorded 442. These are document-encoding measurements, not end-to-end search latency.
- The 442 docs/s result belongs to the text-only package, not a separate measurement of the full multimodal package.
- Raw vector storage assumes 16-bit values and excludes ANN structures and metadata. A 768-dimensional vector uses 1,536 bytes = 1.5 KiB. Vor's 35.2 KiB/doc is a sample average for its token vectors.
- Tokenization uses 19,744 words from native Turkish Wikipedia contexts in TQuAD. Altus uses 25.3% fewer tokens than Gemma and 8.2% fewer than XLM-R on this sample. It has the lowest token count among the multilingual tokenizers tested here; the Turkish-only Mursit tokenizer uses fewer. These ratios depend on the text domain.
Model details
| Property | Value |
|---|---|
| Developer | Magibu AI Research |
| Base | embeddingmagibu2-v1 → google/embeddinggemma-2 |
| Text architecture | EmbeddingGemma2TextModel; 24 layers; hidden size 512; projection 512→768 |
| Tokenizer | magibu/Altus; 262,144 entries |
| Output | One 768-dimensional L2-normalized vector per input |
| Text pooling | Mean |
| Maximum text sequence | 8,192 tokens, including prompt/special tokens |
| Parameters | 271,002,648 |
| Saved weights | BF16 |
| License | Apache-2.0 |
Limitations and deployment notes
- Task-dependent quality: NFCorpus-TR, SciFact-TR, SQuAD-TR, CQADupStack-Gaming-TR and STS22-tr remain below the teacher. The higher retrieval mean does not imply improvement on every task.
- Coverage: multilingual training does not establish equal quality across languages. Most reported text evidence is Turkish and English. Tokenization efficiency and quality in other languages need their own evaluation.
- Context length: retrieval texts here were clipped to 2,000 characters. An 8K context limit does not establish reliable retrieval across an entire 8K document; choose chunking and truncation for your corpus.
- Production validation: these benchmarks do not measure production RAG answer quality, domain-specific accuracy, query latency or complete vector-database memory use. Validate with your own queries and relevance labels.
- Text only: use the full model for media. The shared space allows text vectors from this package to be used with the full model, but quality for each cross-modal retrieval direction must be evaluated separately.
Citation
Please cite the paper for the adaptation methodology and link this model repository for the specific v2 checkpoint. The paper reports the predecessor model, not the v2 results above.
@misc{bayram2026embeddingmagibu,
title = {Adapting Multilingual Embedding Models to Turkish via Cross-Lingual Tokenizer Surgery and Offline Distillation},
author = {Bayram, M. Ali and Diri, Banu and Y{\i}ld{\i}r{\i}m, Sava{\c{s}}},
year = {2026},
eprint = {2605.29992},
archivePrefix = {arXiv},
primaryClass = {cs.CL}
}
Developed by Magibu AI Research. Base model: Google EmbeddingGemma 2. Tokenizer: Magibu Altus.
- Downloads last month
- -