apertus-v1.1-swiss-embed-0.4b-bidir-langmoe
A Sentence Transformers retrieval model adapted from
andreasmartin/apertus-v1.1-swiss-embed-0.4b-bidir
by replacing the parent's final dense embedding projection with a learned sentence-level
SparseMixtureOfExperts projection.
Architecture
1existing Sentence Transformers embedding parent
2 ↓
3all modules before the parent's final Dense
4 ↓
5SparseMixtureOfExperts
6 ├── learned linear router
7 ├── softmax
8 ├── Top-2
9 └── weighted selected expert projections
10 ↓
11parent Normalize
This Swiss experiment uses 7 experts labelled
['de', 'en', 'fr', 'it', 'rm', 'gsw', 'shared']. The labels are experimental metadata; the MoE module itself
contains no language-specific logic.
No router temperature is used.
| Property | Value |
|---|
| Total parameters | 445,696,559 (0.446B) |
| Active parameters / sentence | 440,453,679 |
| Sparse MoE head parameters | 7,347,207 |
| Active head parameters / sentence | 2,104,327 |
| Router parameters | 7,175 |
| Parameters / expert | 1,048,576 |
| Experts | 7 |
| Active experts / sentence | 2 |
| Native embedding dimension | 1024 |
| Matryoshka dimensions | [1024, 768, 512, 256] |
| MoE training max length | 512 tokens |
| Inference max length | 1024 tokens |
| Sparse/reference max abs diff | 1.907e-06 |
Sentence Transformers usage
SparseMixtureOfExperts is currently exported as a repository-local candidate module. Until an
equivalent module is registered upstream in Sentence Transformers, loading this experimental
artifact requires trust_remote_code=True:
1from sentence_transformers import SentenceTransformer
2
3model = SentenceTransformer(
4 "andreasmartin/apertus-v1.1-swiss-embed-0.4b-bidir-langmoe",
5 trust_remote_code=True,
6)
7
8queries = model.encode_query([
9 "Welche Aufgaben hat der Bundesrat?"
10])
11
12documents = model.encode_document([
13 "Le Conseil fédéral est l'autorité exécutive suprême de la Confédération suisse.",
14 "Der Nationalrat ist die grosse Kammer der Bundesversammlung.",
15])
16
17scores = model.similarity(queries, documents)
18print(scores)
If SparseMixtureOfExperts becomes a registered Sentence Transformers module, the same conceptual
architecture can be serialized without repository-local Python code and loaded without
trust_remote_code=True.
Parent adaptation
| Property | Value |
|---|
| Existing embedding parent | andreasmartin/apertus-v1.1-swiss-embed-0.4b-bidir |
| Parent revision | 875c1f99d7b20e261ea43b3586fdde5f8d5648e5 |
| Parent modules | ['Transformer', 'Pooling', 'Dense', 'Normalize'] |
| Replaced module | final Dense projection |
| Preserved output normalization | yes |
The parent was already an embedding model. This notebook does not create or modify a native
backbone-level MoE LLM.
Training
The parent modules before the final Dense projection were frozen and their sentence
representations cached. The original Dense projection initialized every expert, so the model starts
from the parent's embedding transformation before experts specialize.
The retrieval objective is combined with:
- optional weak router supervision from the declared language labels;
- a load-balancing regularizer.
The declared language is not required at inference. Routing is computed from the sentence
representation itself.
Training data:
eljuanina/VotingBooklets-Diamond-v1 is held-out evaluation-only.
Actual training set: 31,483 triplets.
See training_metadata.json for the exact training configuration,
router_diagnostics.json for held-out routing counts, and data_manifest.json for immutable
dataset revisions and processed-file hashes.
Internal retrieval diagnostics
These metrics are internal development diagnostics, not MTEB/MMTEB benchmark claims.
| Diagnostic | Dim | Accuracy@1 | Recall@10 | nDCG@10 | MRR@10 |
|---|
| Swiss monolingual | 1024 | 81.67% | 92.08% | 0.8662 | 0.8491 |
| Swiss monolingual | 512 | 80.42% | 91.67% | 0.8603 | 0.8424 |
| Swiss cross-lingual | 1024 | 30.42% | 96.25% | 0.6623 | 0.5625 |
| Swiss cross-lingual | 512 | 30.00% | 95.83% | 0.6564 | 0.5562 |
Monolingual evaluation queries: 480
Cross-lingual evaluation queries: 480
Router diagnostics
Recorded shared-expert Top-k selections in the held-out diagnostic:
0.
Limitations
- The adapter currently targets existing Sentence Transformers parents ending in
Dense -> Normalize.
- Sparse routing occurs only at sentence-embedding projection level.
- Language labels are weak supervision for this experiment, not an architectural requirement.
- External MTEB/MMTEB/MIRACL and Swiss/domain-specific evaluation is required for comparative claims.
- The MoE head was trained on cached representations up to
512 tokens. The packaged parent retains
1024-token inference capability, but quality beyond the
MoE training context length has not yet been separately validated.