mahiyama commited on
Commit
0746b74
·
verified ·
1 Parent(s): 0a753b7

upload cycle9.2 best (runA)

Browse files
1_SpladePooling/config.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "pooling_strategy": "max",
3
+ "activation_function": "relu",
4
+ "embedding_dimension": 768
5
+ }
README.md ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - ja
4
+ license: mit
5
+ library_name: sentence-transformers
6
+ tags:
7
+ - sparse-encoder
8
+ - sparse
9
+ - splade
10
+ - sentence-transformers
11
+ - learned-sparse-retrieval
12
+ - modernbert
13
+ - japanese
14
+ base_model: sbintuitions/modernbert-ja-310m
15
+ pipeline_tag: feature-extraction
16
+ ---
17
+
18
+ # mahiyama/splade-ja-310m-v5-cycle9.2
19
+
20
+ sbintuitions/modernbert-ja-310m をベースとした、日本語の Standard SPLADE (Learned Sparse Retrieval) モデルです。
21
+ 教師モデル cl-nagoya/ruri-v3-reranker-310m の logits を使った蒸留 (SparseDistillKLDivLoss を CachedSpladeLoss でラップ) で訓練しています。
22
+
23
+ 本モデルは v5 系プロジェクトの cycle9.2 (cycle9 起点の特定ドメイン短期 FT) の成果物です。
24
+ 2 段階訓練アーキテクチャの Stage 2 にあたり、Stage 1 (cycle9, 約 2.2M 行・5 ソース汎用学習済み) を起点として、特定ドメイン (行政 FAQ、クイズ、NLP Journal、MLDR) のデータで短期 FT を行いました。
25
+
26
+ ## 使い方
27
+
28
+ ```python
29
+ from sentence_transformers import SparseEncoder
30
+
31
+ model = SparseEncoder("mahiyama/splade-ja-310m-v5-cycle9.2")
32
+
33
+ query = "国民年金の免除申請に必要な持ち物は何ですか"
34
+ documents = [
35
+ "国民年金保険料の免除申請には年金手帳、本人確認書類、印鑑が必要です。",
36
+ "確定申告で医療費控除を受けるには領収書と源泉徴収票が必要です。",
37
+ ]
38
+
39
+ query_emb = model.encode([query], convert_to_sparse_tensor=True)
40
+ doc_emb = model.encode(documents, convert_to_sparse_tensor=True)
41
+ scores = model.similarity(query_emb, doc_emb)
42
+ print(scores)
43
+ ```
44
+
45
+ ## Training Architecture (2 段階構成)
46
+
47
+ - Stage 1: cycle9 (汎用 SPLADE baseline)
48
+ - 約 2.2M 行・5 ソース (auto-wiki-qa, mqa-ja-v3, mmarco-ja, miracl-retrieval, mrtydi) の multi-source 混合
49
+ - 1 epoch、17,050 step、max_len 512、LR 5e-6、q_reg 1e-5、d_reg 2.5e-4
50
+ - JMTEB v2 5 タスク平均 nDCG@10 = 0.8262 (cycle8 0.8258 から ほぼ同水準だが Mintaka など短文系で改善)
51
+ - Stage 2 (本モデル): cycle9.2 (特定ドメイン短期 FT)
52
+ - (複数 limit 指定無し: フルサイズ) 行・8 ソースの特定ドメイン混合 (JaGovFaqs-22k-v2, amagasaki-qna, quiz-works, quiz-no-mori, anlp-meeting-retrieval, mldr-retrieval)
53
+ - 2 epoch、3398 step、max_len 1024、LR 2e-06、q_reg 1.5e-05、d_reg 0.0003、reg_warmup_ratio 0.1
54
+ - Run runA を mini eval (training-time 11 タスク平均) で best 採用
55
+
56
+ ## Training Data (Stage 2)
57
+
58
+ 教師モデル: cl-nagoya/ruri-v3-reranker-310m 統一 (n-tuples-filtered で配布の label を消費)
59
+
60
+ | repo | config | limit | repeat |
61
+ |---|---|---:|---:|
62
+ | mahiyama/JaGovFaqs-22k-v2 | n-tuples-filtered | - | 1 |
63
+ | mahiyama/amagasaki-qna | n-tuples-filtered | - | 1 |
64
+ | mahiyama/quiz-works | n-tuples-filtered | - | 1 |
65
+ | mahiyama/quiz-no-mori | n-tuples-filtered | - | 1 |
66
+ | mahiyama/anlp-meeting-retrieval | title-abs_n-tuples-filtered | - | 1 |
67
+ | mahiyama/anlp-meeting-retrieval | abs-intro_n-tuples-filtered | - | 1 |
68
+ | mahiyama/anlp-meeting-retrieval | title-intro_n-tuples-filtered | - | 1 |
69
+ | mahiyama/mldr-retrieval | n-tuples-filtered | - | 1 |
70
+
71
+ ## Hyperparameters (Stage 2)
72
+
73
+ | param | value |
74
+ |---|---|
75
+ | starting_model | cycle9 final_model (step 17040) |
76
+ | max_len | 1024 |
77
+ | learning_rate | 2e-06 |
78
+ | query_regularizer_weight | 1.5e-05 |
79
+ | document_regularizer_weight | 0.0003 |
80
+ | reg_scheduler_warmup_ratio | 0.1 |
81
+ | reg_scheduler_type | quadratic |
82
+ | kldiv_temperature | 2.0 |
83
+ | batch_size | 32 |
84
+ | mini_batch_size | 8 |
85
+ | num_epochs | 2 |
86
+ | evals_per_epoch | 8 |
87
+ | eval_max_active_dims | 1024 |
88
+ | seed | 42 |
89
+
90
+ best step: 848 (epoch 0.50)
91
+
92
+ ## Evaluation (training-time mini eval, 11 タスク, capped max_active_dims=1024)
93
+
94
+ best ckpt スコア (nDCG@10):
95
+
96
+ | task | nDCG@10 |
97
+ |---|---:|
98
+ | jagovfaqs_22k | 0.7988 |
99
+ | jaqket | 0.8720 |
100
+ | mrtydi | 0.9683 |
101
+ | miracl | 0.9841 |
102
+ | mintaka | 0.2053 |
103
+ | jacwir | 0.8988 |
104
+ | mldr | 0.3760 |
105
+ | nlp_journal_title_abs | 0.9663 |
106
+ | nlp_journal_title_intro | 0.9471 |
107
+ | nlp_journal_abs_intro | 0.9746 |
108
+ | nlp_journal_abs_article | 0.9739 |
109
+ | avg (11 tasks) | 0.8150 |
110
+
111
+ cycle9 mini eval (起点モデル) との比較:
112
+
113
+ | task | cycle9 (Stage 1) | cycle9.2 (Stage 2) | delta |
114
+ |---|---:|---:|---:|
115
+ | jagovfaqs_22k | 0.7421 | 0.7988 | +0.0567 |
116
+ | jaqket | 0.8124 | 0.8720 | +0.0596 |
117
+ | mrtydi | 0.9603 | 0.9683 | +0.0080 |
118
+ | miracl | 0.9792 | 0.9841 | +0.0049 |
119
+ | mintaka | 0.1823 | 0.2053 | +0.0230 |
120
+ | jacwir | 0.9583 | 0.8988 | -0.0595 |
121
+ | mldr | 0.2884 | 0.3760 | +0.0876 |
122
+ | nlp_journal_title_abs | 0.9881 | 0.9663 | -0.0218 |
123
+ | nlp_journal_title_intro | 0.8533 | 0.9471 | +0.0938 |
124
+ | nlp_journal_abs_intro | 0.9066 | 0.9746 | +0.0680 |
125
+ | nlp_journal_abs_article | 0.9017 | 0.9739 | +0.0722 |
126
+ | **avg** | 0.7793 | 0.8150 | +0.0357 |
127
+
128
+ 注: 本モデルでは時間制約のため JMTEB v2 フル評価は実施していません。後日別途実施予定です。
129
+
130
+ ## 抑止トークン
131
+
132
+ 句読点・記号・特殊ト���クン・SPM マーカ・byte トークンを学習中に抑止し、訓練終了時に MLM head bias へ恒久的に焼き込んでいます。
133
+ 推論時に追加コードは不要 (SparseEncoder.from_pretrained() でそのまま利用可能)。
134
+
135
+ ## Design Rationale
136
+
137
+ - cycle9 final_model (step 17040 の最終モデル) を起点として採用。cycle9 の best_model (mini eval ベースの中盤 best、step 12780) よりも学習量が多く、より多くのドメインで適合が進んでいるため、特定ドメイン短期 FT の起点に向くと判断。
138
+ - cycle8.2 (cycle8 起点で +0.039 改善し v5 系自己ベスト 0.8652 を達成) と同じ「強い汎用ベース + 短期 FT」設計を踏襲。
139
+ - 特定ドメインの強化対象は cycle9 mini eval で低かった jagovfaqs_22k (0.7421) と nlp_journal_title_intro (0.8533)、および退行抑制対象の mintaka / mldr。
140
+
141
+ ## Limitations
142
+
143
+ - best 判定は mini eval (lite) の 11 タスク平均 nDCG@10 のみで行っており、JMTEB v2 フル評価による検証は未実施です。
144
+ - cycle8.3 で観測された MLDR データ大量投入による Mintaka 退行リスクが残る可能性があります。
145
+
146
+ ## ライセンス
147
+
148
+ MIT (ベースモデル sbintuitions/modernbert-ja-310m のライセンスに従う)。
config.json ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "ModernBertForMaskedLM"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": 1,
8
+ "classifier_activation": "gelu",
9
+ "classifier_bias": false,
10
+ "classifier_dropout": 0.0,
11
+ "classifier_pooling": "cls",
12
+ "cls_token_id": 6,
13
+ "decoder_bias": true,
14
+ "deterministic_flash_attn": false,
15
+ "dtype": "float32",
16
+ "embedding_dropout": 0.0,
17
+ "eos_token_id": 2,
18
+ "global_attn_every_n_layers": 3,
19
+ "gradient_checkpointing": false,
20
+ "hidden_activation": "gelu",
21
+ "hidden_size": 768,
22
+ "initializer_cutoff_factor": 2.0,
23
+ "initializer_range": 0.02,
24
+ "intermediate_size": 3072,
25
+ "layer_norm_eps": 1e-05,
26
+ "layer_types": [
27
+ "full_attention",
28
+ "sliding_attention",
29
+ "sliding_attention",
30
+ "full_attention",
31
+ "sliding_attention",
32
+ "sliding_attention",
33
+ "full_attention",
34
+ "sliding_attention",
35
+ "sliding_attention",
36
+ "full_attention",
37
+ "sliding_attention",
38
+ "sliding_attention",
39
+ "full_attention",
40
+ "sliding_attention",
41
+ "sliding_attention",
42
+ "full_attention",
43
+ "sliding_attention",
44
+ "sliding_attention",
45
+ "full_attention",
46
+ "sliding_attention",
47
+ "sliding_attention",
48
+ "full_attention",
49
+ "sliding_attention",
50
+ "sliding_attention",
51
+ "full_attention"
52
+ ],
53
+ "local_attention": 128,
54
+ "max_position_embeddings": 8192,
55
+ "mlp_bias": false,
56
+ "mlp_dropout": 0.0,
57
+ "model_type": "modernbert",
58
+ "norm_bias": false,
59
+ "norm_eps": 1e-05,
60
+ "num_attention_heads": 12,
61
+ "num_hidden_layers": 25,
62
+ "pad_token_id": 3,
63
+ "position_embedding_type": "rope",
64
+ "repad_logits_with_grad": false,
65
+ "rope_parameters": {
66
+ "full_attention": {
67
+ "rope_theta": 160000.0,
68
+ "rope_type": "default"
69
+ },
70
+ "sliding_attention": {
71
+ "rope_theta": 10000.0,
72
+ "rope_type": "default"
73
+ }
74
+ },
75
+ "sep_token_id": 4,
76
+ "sparse_pred_ignore_index": -100,
77
+ "sparse_prediction": false,
78
+ "tie_word_embeddings": true,
79
+ "transformers_version": "5.0.0",
80
+ "vocab_size": 102400
81
+ }
config_sentence_transformers.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "__version__": {
3
+ "pytorch": "2.10.0+cu128",
4
+ "sentence_transformers": "5.4.1",
5
+ "transformers": "5.0.0"
6
+ },
7
+ "default_prompt_name": null,
8
+ "model_type": "SparseEncoder",
9
+ "prompts": {
10
+ "document": "",
11
+ "query": ""
12
+ },
13
+ "similarity_fn_name": "dot"
14
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1427959c09890164d20a741fe28b1dd5e3c2f2d05df1b7fea8ec9873bdd9b96f
3
+ size 1261235896
modules.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "idx": 0,
4
+ "name": "0",
5
+ "path": "",
6
+ "type": "sentence_transformers.base.modules.transformer.Transformer"
7
+ },
8
+ {
9
+ "idx": 1,
10
+ "name": "1",
11
+ "path": "1_SpladePooling",
12
+ "type": "sentence_transformers.sparse_encoder.modules.splade_pooling.SpladePooling"
13
+ }
14
+ ]
sentence_bert_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "transformer_task": "fill-mask",
3
+ "modality_config": {
4
+ "text": {
5
+ "method": "forward",
6
+ "method_output_name": "logits"
7
+ }
8
+ },
9
+ "module_output_name": "token_embeddings"
10
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_dummy_prefix_space": false,
3
+ "add_prefix_space": false,
4
+ "backend": "tokenizers",
5
+ "bos_token": "<s>",
6
+ "clean_up_tokenization_spaces": false,
7
+ "cls_token": "<cls>",
8
+ "do_lower_case": false,
9
+ "eos_token": "</s>",
10
+ "extra_ids": 0,
11
+ "is_local": true,
12
+ "keep_accents": true,
13
+ "legacy": false,
14
+ "mask_token": "<mask>",
15
+ "max_length": 512,
16
+ "model_max_length": 1024,
17
+ "model_specific_special_tokens": {},
18
+ "pad_to_multiple_of": null,
19
+ "pad_token": "<pad>",
20
+ "pad_token_type_id": 0,
21
+ "padding_side": "right",
22
+ "sep_token": "<sep>",
23
+ "sp_model_kwargs": {},
24
+ "spaces_between_special_tokens": false,
25
+ "stride": 0,
26
+ "tokenizer_class": "TokenizersBackend",
27
+ "truncation_side": "right",
28
+ "truncation_strategy": "longest_first",
29
+ "unk_token": "<unk>",
30
+ "use_default_system_prompt": false
31
+ }