Views
No views yet

From the paper. MTEB(Multilingual, v2) below matches the paper; the LongEmbed table reports additional long-context results.
| Model | Base LLM | Parameters | Embedding Dim | Max Tokens | MTEB Multi. V2 (Mean Task) |
|---|---|---|---|---|---|
| BidirLM-270M | Gemma3-270M | 268M | 640 | 512 | 56.3 |
| BidirLM-0.6B | Qwen3-0.6B | 596M | 1024 | 512 | 60.0 |
| BidirLM-1B | Gemma3-1B | 1001M | 1152 | 512 | 62.7 |
| BidirLM-1.7B | Qwen3-1.7B | 1721M | 2048 | 512 (*) | 63.1 |
| BidirLM-Omni-2.5B | Qwen3-1.7B | 2.5B | 2048 | 512 | 63.1 |
max_seq_length=512, matching the paper. The architecture supports much longer context (see the LongEmbed table below); on the MTEB leaderboard the shared LEMBPasskeyRetrieval task is scored at long context, making the leaderboard MTEB(Multilingual, v2) ~0.4 higher than this table.| Model | LongEmbed (Mean nDCG@10) | Eval Context |
|---|---|---|
| BidirLM-270M | 71.8 | 32k |
| BidirLM-0.6B | 71.9 | 8k |
| BidirLM-1B | 76.4 | 32k |
| BidirLM-1.7B | 73.4 | 8k |
Note: Extending the evaluation context from 8k to 32k helped the Gemma-based models (270M, 1B) but not the Qwen-based models (0.6B, 1.7B), which scored best at 8k.
1from sentence_transformers import SentenceTransformer
2
3model = SentenceTransformer("BidirLM/BidirLM-1.7B-Embedding", trust_remote_code=True)
4
5queries = [
6 "What is the capital of France?",
7 "How does photosynthesis work?",
8]
9documents = [
10 "Paris is the capital and largest city of France, situated on the river Seine.",
11 "Photosynthesis is the process by which plants convert sunlight, water, and CO2 into glucose and oxygen.",
12]
13
14query_embeddings = model.encode(queries)
15document_embeddings = model.encode(documents)
16
17similarities = model.similarity(query_embeddings, document_embeddings)
18print(similarities)1from transformers import AutoTokenizer, AutoModelForSequenceClassification, AutoModelForTokenClassification
2
3tokenizer = AutoTokenizer.from_pretrained("BidirLM/BidirLM-1.7B-Embedding", trust_remote_code=True)
4
5# Sequence classification (e.g., NLI: entailment, neutral, contradiction)
6seq_model = AutoModelForSequenceClassification.from_pretrained(
7 "BidirLM/BidirLM-1.7B-Embedding",
8 trust_remote_code=True,
9 num_labels=3,
10)
11
12# Token classification (e.g., NER)
13tok_model = AutoModelForTokenClassification.from_pretrained(
14 "BidirLM/BidirLM-1.7B-Embedding",
15 trust_remote_code=True,
16 num_labels=7,
17)
18
19# Fine-tune with HuggingFace Trainertrust_remote_code=True as it uses a custom bidirectional architecture.transformers>=5.0
sentence-transformers>=5.0.0Note: This model was trained withtransformers==4.57.6(transformers 4.x). The version onmainwas patched to work withtransformers>=5.0. For the original (pre-patch) version, which is compatible withtransformers>=4.57.6,<5.0.0, use thetransformers-v4branch:python1from sentence_transformers import SentenceTransformer 2model = SentenceTransformer( 3 "BidirLM/BidirLM-1.7B-Embedding", 4 trust_remote_code=True, 5 revision="transformers-v4", 6)
trust_remote_code=True?BidirLMModel) that requires loading custom code from the repository.transformers and pytorch could cause negligible but non-zero performance differences. This model should be used with transformers>=5.0 (evaluated with transformers==5.5.4 and pytorch==2.6.0).1@misc{boizard2026bidirlmtextomnimodalbidirectional,
2 title={BidirLM: From Text to Omnimodal Bidirectional Encoders by Adapting and Composing Causal LLMs},
3 author={Nicolas Boizard and Théo Deschamps-Berger and Hippolyte Gisserot-Boukhlef and Céline Hudelot and Pierre Colombo},
4 year={2026},
5 eprint={2604.02045},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL},
8 url={https://arxiv.org/abs/2604.02045},
9}