BorisTM commited on
Commit
7e9e362
·
verified ·
1 Parent(s): 5db2fad

Model card

Browse files
Files changed (1) hide show
  1. README.md +59 -74
README.md CHANGED
@@ -2,101 +2,86 @@
2
  license: apache-2.0
3
  library_name: sentence-transformers
4
  pipeline_tag: sentence-similarity
 
 
5
  tags:
6
  - sentence-transformers
7
- - sentence-embeddings
8
- - multilingual
9
  - static-embeddings
10
- - research
11
  ---
12
 
13
- # StaRSE Multilingual Q42 25k
14
 
15
- Private technical research checkpoint. This is the best completed multilingual
16
- StaRSE checkpoint as of 2026-08-11; it is not a polished public release.
17
 
18
- ## Model
19
 
20
- - Architecture: language-conditioned static additive sentence encoder.
21
- - Output dimension: 1,024.
22
- - Base token rows: 257,914.
23
- - Learned adjacent-pair rows: 56,071.
24
- - Explicit language markers: 1,914.
25
- - Training population: 176 languages.
26
- - Training history: the registered 20,000-update Q42 model followed by a
27
- separate 5,000-update branch with a fresh AdamW optimizer, inverse-square-root
28
- schedule, 1,000 warmup updates, and peak learning rate 1e-4.
29
- - Model tensor SHA-256:
30
- `c28eaa242185aeccbd5ff643bb517b5a93d10b9d5a71c85dd03373ca4b2ad51a`.
31
 
32
- The checkpoint requires an explicit language marker at the beginning of every
33
- text. Language IDs use ISO 639-3 plus ISO 15924 script, for example
34
- `eng_Latn`, `rus_Cyrl`, and `arb_Arab`.
35
 
36
- ## Usage
 
 
 
 
 
37
 
38
- The repository includes the exact `starse` Python module needed to load the
39
- custom SentenceTransformers component. Loading executes that repository code,
40
- so keep `trust_remote_code=True` only for a revision you have inspected and
41
- pinned.
42
-
43
- ```python
44
- from sentence_transformers import SentenceTransformer
45
 
46
- model = SentenceTransformer(
47
- "BorisTM/starse-multilingual-q42-25k",
48
- trust_remote_code=True,
49
- )
50
 
51
- language = "rus_Cyrl"
52
- sentences = [
53
- f"__{language}__ Первое предложение",
54
- f"__{language}__ Второе предложение",
55
- ]
56
- embeddings = model.encode(sentences, normalize_embeddings=True)
57
- similarities = embeddings @ embeddings.T
58
- ```
 
 
 
59
 
60
- Omitting the language marker is a hard error rather than a silent fallback.
61
- The marker must match one of the entries in `language_conditioning.json`.
62
 
63
- ## Evaluation
64
 
65
- The exact checkpoint completed all 131 tasks in `MTEB(Multilingual, v2)` with
66
- MTEB 2.12.30 and zero failures:
67
 
68
- - Mean(Task): 50.13;
69
- - Mean(TaskType): 43.45.
70
-
71
- On the frozen compact multilingual suite it scores:
72
 
73
- - Tatoeba, 106 subsets: 57.26;
74
- - BUCC.v2, 4 subsets: 98.12;
75
- - FloresBitextMining, 193 subsets: 63.70;
76
- - unweighted three-task macro: 73.03.
77
 
78
- The repository includes machine-readable summaries under `evaluation/` and an
79
- exact file manifest under `provenance/`. These are results from one trained
80
- checkpoint. No training noise floor was measured, so small differences must
81
- not be interpreted as established effects.
82
 
83
- ## Scope and limitations
 
 
 
 
 
84
 
85
- - Inference requires a known language-script ID; automatic language ID and
86
- code-switching were not evaluated.
87
- - Quality varies substantially across languages, scripts, and resource levels.
88
- - The encoder uses a fixed tokenizer and adjacent-token pair table. It is not a
89
- contextual Transformer and does not produce contextual token embeddings.
90
- - Training data may contain personal, offensive, copyrighted, or socially
91
- biased material. Do not use the model for profiling, sensitive-attribute
92
- inference, or fully automated high-stakes decisions.
93
 
94
- ## Internal provenance
95
 
96
- - Run: `q42-posthoc-lr1e4-5k-v1`.
97
- - Local source checkpoint:
98
- `outputs/q42-posthoc-lr1e4-5k-v1/main/checkpoint-5000`.
99
- - Cumulative model updates: 25,000.
100
- - Full evaluation summary protocol:
101
- `q42-posthoc-checkpoint5000-full-mmteb-summary-v1`.
 
 
 
102
 
 
 
2
  license: apache-2.0
3
  library_name: sentence-transformers
4
  pipeline_tag: sentence-similarity
5
+ language:
6
+ - multilingual
7
  tags:
8
  - sentence-transformers
9
+ - sentence-similarity
 
10
  - static-embeddings
11
+ - multilingual
12
  ---
13
 
14
+ # Loss-Guided Static Multilingual Sentence Embeddings
15
 
16
+ ## Overview
 
17
 
18
+ A static multilingual sentence encoder: one embedding table, mean pooling, no Transformer at inference. Its vocabulary was extended with **loss-guided vocabulary discovery**: during contrastive training, adjacent token pairs are scored by how much the sentence objective would suffer without them, and the useful pairs receive their own embedding rows. The base tokenizer stays unchanged. The model is trained on 176 languages and is intended for CPU-efficient semantic similarity, retrieval, clustering, and classification.
19
 
20
+ Paper: *Loss-Guided Vocabulary Discovery for Multilingual Static Encoders* (MRL Workshop @ EMNLP 2026). Code: [BlessedTatonka/loss-guided-vocab](https://github.com/BlessedTatonka/loss-guided-vocab).
 
 
 
 
 
 
 
 
 
 
21
 
22
+ ## Model Specifications
 
 
23
 
24
+ - **Embedding dimension**: 1,024
25
+ - **Base vocabulary**: 257,914 rows (mmBERT tokenizer + 1,914 language markers)
26
+ - **Learned pair rows**: 56,071
27
+ - **Parameters**: 321.7M (embedding table only), FP32 safetensors, 1.29 GB
28
+ - **Training languages**: 176
29
+ - **Inference**: table lookup and mean pooling; requires a language marker at the start of each text
30
 
31
+ ## Performance
 
 
 
 
 
 
32
 
33
+ MTEB(Multilingual, v2), 131 tasks, primary score (Mean over tasks) **50.13**, Mean over task types 43.45:
 
 
 
34
 
35
+ | Task type | Count | Mean score |
36
+ |-----------|-------|-----------|
37
+ | Bitext mining | 13 | 53.90 |
38
+ | Classification | 43 | 52.87 |
39
+ | Clustering | 16 | 38.91 |
40
+ | Instruction reranking | 3 | -1.04 |
41
+ | Multilabel classification | 5 | 17.64 |
42
+ | Pair classification | 11 | 72.69 |
43
+ | Reranking | 6 | 49.42 |
44
+ | Retrieval | 18 | 41.64 |
45
+ | STS | 16 | 64.99 |
46
 
47
+ Cross-lingual retrieval (macro F1 over language pairs): Tatoeba 57.26 (106 pairs), BUCC 98.12 (4 pairs), Flores 63.70 (193 pairs).
 
48
 
49
+ ## Installation & Usage
50
 
51
+ Every input must start with a language marker `__<iso639-3>_<script>__`, for example `__eng_Latn__`, `__rus_Cyrl__`, `__arb_Arab__`, `__cmn_Hani__`. A text without a marker raises an error. The repository ships the custom embedding module, so `trust_remote_code=True` is required.
 
52
 
53
+ ```python
54
+ pip install -U sentence-transformers
 
 
55
 
56
+ from sentence_transformers import SentenceTransformer
 
 
 
57
 
58
+ model = SentenceTransformer("BorisTM/loss-guided-static-multi", trust_remote_code=True)
 
 
 
59
 
60
+ sentences = [
61
+ "__eng_Latn__ The cat sleeps on the sofa.",
62
+ "__rus_Cyrl__ Кошка спит на диване.",
63
+ "__deu_Latn__ Die Katze schläft auf dem Sofa.",
64
+ "__eng_Latn__ The stock market fell sharply today.",
65
+ ]
66
 
67
+ embeddings = model.encode(sentences, normalize_embeddings=True)
68
+ similarities = model.similarity(embeddings, embeddings)
69
+ # [[1.00, 0.44, 0.80, 0.05],
70
+ # [0.44, 1.00, 0.41, 0.06],
71
+ # [0.80, 0.41, 1.00, 0.08],
72
+ # [0.05, 0.06, 0.08, 1.00]]
73
+ ```
 
74
 
75
+ ## Citation
76
 
77
+ ```
78
+ @inproceedings{malashenko2026lossguided,
79
+ title = {Loss-Guided Vocabulary Discovery for Multilingual Static Encoders},
80
+ author = {Malashenko, Boris and Jarsky, Ivan and Stumpf, Sviatoslav A. and Efimova, Valeria},
81
+ booktitle = {Proceedings of the 6th Workshop on Multilingual Representation Learning (MRL)},
82
+ year = {2026},
83
+ url = {https://huggingface.co/BorisTM/loss-guided-static-multi}
84
+ }
85
+ ```
86
 
87
+ **License**: Apache 2.0