gomyk commited on
Commit
35628a4
·
verified ·
1 Parent(s): 839b763

Upload me5s_compressed_distilled (distilled) from mE5-small

Browse files
1_Pooling/config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "word_embedding_dimension": 384,
3
+ "pooling_mode_cls_token": false,
4
+ "pooling_mode_mean_tokens": true,
5
+ "pooling_mode_max_tokens": false,
6
+ "pooling_mode_mean_sqrt_len_tokens": false,
7
+ "pooling_mode_weightedmean_tokens": false,
8
+ "pooling_mode_lasttoken": false,
9
+ "include_prompt": true
10
+ }
README.md ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: ["ko", "en", "ja", "zh", "es", "fr", "de", "pt", "it", "ru", "ar", "hi", "th", "vi", "id", "tr", "nl", "pl"]
3
+ tags:
4
+ - sentence-transformers
5
+ - multilingual
6
+ - model-compression
7
+ - layer-pruning
8
+ - vocab-pruning
9
+ - knowledge-distillation
10
+ - me5-small
11
+ library_name: sentence-transformers
12
+ pipeline_tag: sentence-similarity
13
+ license: apache-2.0
14
+ ---
15
+
16
+ # me5s_compressed_distilled (Distilled)
17
+
18
+ Compact multilingual sentence encoder compressed from `intfloat/multilingual-e5-small` (9x compression).
19
+
20
+ ## Model Details
21
+
22
+ | Property | Value |
23
+ |---|---|
24
+ | Base model | `intfloat/multilingual-e5-small` |
25
+ | Architecture | bert (encoder) |
26
+ | Hidden dim | 384 (from 384) |
27
+ | Layers | 5 (from 12) |
28
+ | Intermediate | 1536 |
29
+ | Attention heads | 12 |
30
+ | Vocab size | 8,675 (from 250,037) |
31
+ | Parameters | ~12.4M |
32
+ | Model size (FP32) | 47.9MB |
33
+ | Compression | 9x |
34
+ | Distilled | Yes |
35
+
36
+ ## Quick Start
37
+
38
+ ```python
39
+ from sentence_transformers import SentenceTransformer
40
+
41
+ model = SentenceTransformer("me5s_compressed_distilled", trust_remote_code=True)
42
+
43
+ sentences = [
44
+ "Hello, how are you?",
45
+ "안녕하세요, 잘 지내세요?",
46
+ "こんにちは、元気ですか?",
47
+ "你好,你好吗?",
48
+ ]
49
+
50
+ embeddings = model.encode(sentences)
51
+ print(embeddings.shape) # (4, 384)
52
+ ```
53
+
54
+ ## MTEB Evaluation Results
55
+
56
+ **Overall Average: 46.91%**
57
+
58
+ | Task Group | Average |
59
+ |---|---|
60
+ | Classification | 51.82% |
61
+ | Clustering | 28.72% |
62
+ | STS | 58.72% |
63
+
64
+ ### Classification
65
+
66
+ | Task | Average | Details |
67
+ |---|---|---|
68
+ | AmazonCounterfactualClassification | 62.93% | en: 69.51%, en-ext: 65.08%, ja: 59.78%, de: 57.34% |
69
+ | Banking77Classification | 62.72% | default: 62.72% |
70
+ | ImdbClassification | 50.74% | default: 50.74% |
71
+ | MTOPDomainClassification | 68.85% | en: 79.79%, es: 71.9%, fr: 69.12%, th: 67.41%, hi: 64.79% |
72
+ | MassiveIntentClassification | 26.86% | en: 57.38%, zh-CN: 48.33%, ja: 45.3%, de: 45.04%, fr: 44.92% |
73
+ | MassiveScenarioClassification | 34.66% | en: 66.9%, de: 59.71%, zh-CN: 58.67%, nl: 56.51%, fr: 55.21% |
74
+ | ToxicConversationsClassification | 54.97% | default: 54.97% |
75
+ | TweetSentimentExtractionClassification | 52.8% | default: 52.8% |
76
+
77
+ ### Clustering
78
+
79
+ | Task | Average | Details |
80
+ |---|---|---|
81
+ | ArXivHierarchicalClusteringP2P | 47.82% | default: 47.82% |
82
+ | ArXivHierarchicalClusteringS2S | 43.73% | default: 43.73% |
83
+ | BiorxivClusteringP2P.v2 | 13.34% | default: 13.34% |
84
+ | MedrxivClusteringP2P.v2 | 20.89% | default: 20.89% |
85
+ | MedrxivClusteringS2S.v2 | 20.47% | default: 20.47% |
86
+ | StackExchangeClustering.v2 | 39.47% | default: 39.47% |
87
+ | StackExchangeClusteringP2P.v2 | 31.1% | default: 31.1% |
88
+ | TwentyNewsgroupsClustering.v2 | 12.96% | default: 12.96% |
89
+
90
+ ### STS
91
+
92
+ | Task | Average | Details |
93
+ |---|---|---|
94
+ | BIOSSES | 44.17% | default: 44.17% |
95
+ | SICK-R | 69.93% | default: 69.93% |
96
+ | STS12 | 71.78% | default: 71.78% |
97
+ | STS13 | 61.49% | default: 61.49% |
98
+ | STS14 | 65.8% | default: 65.8% |
99
+ | STS15 | 78.31% | default: 78.31% |
100
+ | STS17 | 34.39% | en-en: 78.79%, es-es: 71.36%, ar-ar: 55.54%, ko-ko: 50.35%, nl-en: 28.55% |
101
+ | STS22.v2 | 32.35% | fr-pl: 61.98%, zh: 52.61%, es: 52.17%, it: 48.4%, fr: 45.5% |
102
+ | STSBenchmark | 70.22% | default: 70.22% |
103
+
104
+
105
+ ## Distillation Impact
106
+
107
+ | Task | Before | After | Delta |
108
+ |---|---|---|---|
109
+ | AmazonCounterfactualClassification | 65.35% | 62.93% | -2.42%p |
110
+ | ArXivHierarchicalClusteringP2P | 47.9% | 47.82% | -0.08%p |
111
+ | ArXivHierarchicalClusteringS2S | 47.79% | 43.73% | -4.06%p |
112
+ | BIOSSES | 56.57% | 44.17% | -12.4%p |
113
+ | Banking77Classification | 59.84% | 62.72% | +2.88%p |
114
+ | BiorxivClusteringP2P.v2 | 16.17% | 13.34% | -2.83%p |
115
+ | ImdbClassification | 54.77% | 50.74% | -4.03%p |
116
+ | MTOPDomainClassification | 63.66% | 68.85% | +5.19%p |
117
+ | MassiveIntentClassification | 29.77% | 26.86% | -2.91%p |
118
+ | MassiveScenarioClassification | 33.24% | 34.66% | +1.42%p |
119
+ | MedrxivClusteringP2P.v2 | 22.33% | 20.89% | -1.44%p |
120
+ | MedrxivClusteringS2S.v2 | 20.56% | 20.47% | -0.09%p |
121
+ | SICK-R | 58.16% | 69.93% | +11.77%p |
122
+ | STS12 | 53.44% | 71.78% | +18.34%p |
123
+ | STS13 | 61.88% | 61.49% | -0.39%p |
124
+ | STS14 | 58.82% | 65.8% | +6.98%p |
125
+ | STS15 | 73.5% | 78.31% | +4.81%p |
126
+ | STS17 | 36.19% | 34.39% | -1.8%p |
127
+ | STS22.v2 | 29.53% | 32.35% | +2.82%p |
128
+ | STSBenchmark | 59.49% | 70.22% | +10.73%p |
129
+ | StackExchangeClustering.v2 | 39.48% | 39.47% | -0.01%p |
130
+ | StackExchangeClusteringP2P.v2 | 30.91% | 31.1% | +0.19%p |
131
+ | ToxicConversationsClassification | 55.55% | 54.97% | -0.58%p |
132
+ | TweetSentimentExtractionClassification | 42.38% | 52.8% | +10.42%p |
133
+ | TwentyNewsgroupsClustering.v2 | 12.68% | 12.96% | +0.28%p |
134
+
135
+
136
+ ## Training
137
+
138
+ ### Stage 1: Model Compression
139
+ - **Teacher**: `intfloat/multilingual-e5-small` (12L, 384d)
140
+ - **Compression**: Layer pruning + Vocab pruning
141
+ - **Result**: 5L / 384d / 8,675 vocab
142
+
143
+ ### Stage 2: Knowledge Distillation
144
+ - **Method**: MSE + Cosine Similarity loss
145
+ - **Data**: MTEB Classification/Clustering/STS task datasets
146
+ - **Optimizer**: AdamW (lr=2e-5, weight_decay=0.01)
147
+ - **Schedule**: Cosine annealing over 3 epochs
148
+
149
+
150
+ ## Supported Languages (18)
151
+
152
+ ko, en, ja, zh, es, fr, de, pt, it, ru, ar, hi, th, vi, id, tr, nl, pl
config.json ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "BertModel"
4
+ ],
5
+ "attention_probs_dropout_prob": 0.1,
6
+ "classifier_dropout": null,
7
+ "dtype": "float32",
8
+ "hidden_act": "gelu",
9
+ "hidden_dropout_prob": 0.1,
10
+ "hidden_size": 384,
11
+ "initializer_range": 0.02,
12
+ "intermediate_size": 1536,
13
+ "layer_norm_eps": 1e-12,
14
+ "max_position_embeddings": 512,
15
+ "model_type": "bert",
16
+ "num_attention_heads": 12,
17
+ "num_hidden_layers": 5,
18
+ "pad_token_id": 0,
19
+ "position_embedding_type": "absolute",
20
+ "tokenizer_class": "XLMRobertaTokenizer",
21
+ "transformers_version": "4.56.2",
22
+ "type_vocab_size": 2,
23
+ "use_cache": true,
24
+ "vocab_size": 8675
25
+ }
config_sentence_transformers.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model_type": "SentenceTransformer",
3
+ "__version__": {
4
+ "sentence_transformers": "5.3.0",
5
+ "transformers": "4.56.2",
6
+ "pytorch": "2.10.0+cu128"
7
+ },
8
+ "prompts": {
9
+ "query": "",
10
+ "document": ""
11
+ },
12
+ "default_prompt_name": null,
13
+ "similarity_fn_name": "cosine"
14
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:504814e0b78cfde32f085153eda926e8e0b395756de301be97c064b26bf0c74e
3
+ size 50207568
modules.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "idx": 0,
4
+ "name": "0",
5
+ "path": "",
6
+ "type": "sentence_transformers.models.Transformer"
7
+ },
8
+ {
9
+ "idx": 1,
10
+ "name": "1",
11
+ "path": "1_Pooling",
12
+ "type": "sentence_transformers.models.Pooling"
13
+ }
14
+ ]
sentence_bert_config.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "max_seq_length": 512,
3
+ "do_lower_case": false
4
+ }
sentencepiece.bpe.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cfc8146abe2a0488e9e2a0c56de7952f7c11ab059eca145a0a727afce0db2865
3
+ size 5069051
special_tokens_map.json ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<s>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "cls_token": {
10
+ "content": "<s>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "eos_token": {
17
+ "content": "</s>",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "mask_token": {
24
+ "content": "<mask>",
25
+ "lstrip": false,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ },
30
+ "pad_token": {
31
+ "content": "<pad>",
32
+ "lstrip": false,
33
+ "normalized": false,
34
+ "rstrip": false,
35
+ "single_word": false
36
+ },
37
+ "sep_token": {
38
+ "content": "</s>",
39
+ "lstrip": false,
40
+ "normalized": false,
41
+ "rstrip": false,
42
+ "single_word": false
43
+ },
44
+ "unk_token": {
45
+ "content": "<unk>",
46
+ "lstrip": false,
47
+ "normalized": false,
48
+ "rstrip": false,
49
+ "single_word": false
50
+ }
51
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "<s>",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "1": {
12
+ "content": "<pad>",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "2": {
20
+ "content": "</s>",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "3": {
28
+ "content": "<unk>",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "8674": {
36
+ "content": "<mask>",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "bos_token": "<s>",
45
+ "clean_up_tokenization_spaces": true,
46
+ "cls_token": "<s>",
47
+ "eos_token": "</s>",
48
+ "extra_special_tokens": {},
49
+ "mask_token": "<mask>",
50
+ "max_length": 64,
51
+ "model_max_length": 512,
52
+ "pad_to_multiple_of": null,
53
+ "pad_token": "<pad>",
54
+ "pad_token_type_id": 0,
55
+ "padding_side": "right",
56
+ "sep_token": "</s>",
57
+ "sp_model_kwargs": {},
58
+ "stride": 0,
59
+ "tokenizer_class": "XLMRobertaTokenizer",
60
+ "truncation_side": "right",
61
+ "truncation_strategy": "longest_first",
62
+ "unk_token": "<unk>"
63
+ }