eranex-embed-v1.0-base is an efficient multilingual sentence encoder backbone based on a Bidirectional Mamba State Space Model (SSM) architecture.
Pre-trained on quality-filtered multilingual mC4 and aligned cross-lingually via OPUS-100 Translation Language Modeling (TLM), it serves as the foundational encoder for downstream classification, custom fine-tuning, and representation learning tasks.
[!NOTE] Foundational Backbone Notice:
eranex-embed-v1.0-baseis an MLM pre-trained foundational backbone. Like standard MLM encoders (e.g. BERT, RoBERTa), raw representations exhibit embedding anisotropy prior to task-specific contrastive alignment.
- Recommended Applications: Downstream fine-tuning (intent classification, sentiment analysis, custom domain adaptation) and dense feature extraction.
- For Zero-Shot Semantic Search & RAG: Use
Eranex-Embedding-Search(fine-tuned with contrastive objectives to calibrate embedding isotropy for cosine similarity search).
Evaluations were performed on holdout validation splits across target languages.
| Language | Accuracy | Loss | Perplexity | Masked Tokens |
|---|---|---|---|---|
| Turkish (tr) | 57.56% | 2.1761 | 8.81 | 443,530 |
| English (en) | 53.30% | 2.4346 | 11.41 | 382,107 |
| Spanish (es) | 57.91% | 2.1194 | 8.33 | 499,195 |
| German (de) | 56.70% | 2.2341 | 9.34 | 501,900 |
| Overall | 56.53% | 2.2411 | 9.40 | 1,826,732 |
| Language | Spearman Correlation | p-value | Sentence Pairs |
|---|---|---|---|
| Turkish (tr) | 0.5202 | p < 0.001 | 1,379 |
| English (en) | 0.5743 | p < 0.001 | 1,379 |
| Spanish (es) | 0.5612 | p < 0.001 | 1,379 |
| German (de) | 0.5938 | p < 0.001 | 1,379 |
| Overall | 0.5550 | p < 0.001 | 5,516 |
| Language Pair | Top-1 Accuracy | Mean Reciprocal Rank (MRR) | Sentence Pairs |
|---|---|---|---|
| Turkish (tr) $\rightarrow$ English (en) | 10.70% | 0.1767 | 1,000 |
| Spanish (es) $\rightarrow$ English (en) | 23.60% | 0.3294 | 1,000 |
| German (de) $\rightarrow$ English (en) | 27.10% | 0.3676 | 1,000 |
eranex-embed-v1.0-base was pre-trained using a targeted, quality-filtered data curation pipeline:
import torch
from transformers import AutoModel, PreTrainedTokenizerFast
repo_id = "Eranex-Tech/eranex-embed-v1.0-base"
tokenizer = PreTrainedTokenizerFast.from_pretrained(repo_id)
model = AutoModel.from_pretrained(repo_id, trust_remote_code=True)
model.eval()
texts = [
"Yapay zeka ve durum uzayi modelleri hizla ilerliyor.",
"State space models and artificial intelligence are advancing rapidly.",
"Der Hund spielt im Garten.",
"El perro juega en el parque.",
]
inputs = tokenizer(texts, padding=True, truncation=True, max_length=1024, return_tensors="pt")
with torch.no_grad():
embeddings = model(**inputs)
print("Representations shape:", embeddings.shape)
import torch
import torch.nn as nn
from transformers import AutoModel
class EranexCustomClassifier(nn.Module):
def __init__(self, repo_id: str, num_classes: int):
super().__init__()
self.encoder = AutoModel.from_pretrained(repo_id, trust_remote_code=True)
self.classifier = nn.Sequential(
nn.Dropout(0.2),
nn.Linear(128, num_classes)
)
def forward(self, input_ids, attention_mask=None):
pooled_repr = self.encoder(input_ids, attention_mask=attention_mask)
return self.classifier(pooled_repr)
| Parameter | Configuration |
|---|---|
| Backbone Architecture | Bidirectional Mamba State Space Model (SSM) |
| Total Parameters | 14.5M |
| Hidden Dimension ($d_{model}$) | 256 |
| Output Dimension | 128 |
| Layers | 6 |
| State Space Dimension ($d_{state}$) | 64 |
| Convolution Kernel ($d_{conv}$) | 4 |
| Expansion Factor ($E$) | 2 |
| Vocabulary Size | 32000 (Byte-level BPE with CJK & NFKC normalization) |
| Max Sequence Length | 1024 tokens |
| Weight Tying | Enabled (Input Embedding $\leftrightarrow$ Output Projection) |
| Model Variant | Specialization |
|---|---|
| Eranex-Embedding-Base | MLM pre-trained multilingual backbone |
| Eranex-Embedding-Search | Contrastive fine-tuned model for RAG and vector search |
| Eranex-Embedding-Reranker | Cross-Encoder model for second-stage search re-ranking |