whw06 commited on
Commit
8e71b86
Β·
verified Β·
1 Parent(s): 29ef6c3

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +251 -1
README.md CHANGED
@@ -1,3 +1,253 @@
1
  ---
2
- license: mit
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ library_name: transformers
6
+ pipeline_tag: text-generation
7
+ tags:
8
+ - mira
9
+ - mid-training
10
+ - data-selection
11
+ - rubric-scorer
12
+ - source-aware
13
+ - moe
14
+ - qwen3
15
+ base_model: Qwen/Qwen3.5-35B-A3B-Base
16
  ---
17
+
18
+ # MIRA-QA-Group2
19
+
20
+ A student scorer from **MIRA** (Mid-training Rubric Anchoring for Source-Aware Data Selection), fine-tuned to score **long-form technical QA / Stack Overflow** along a group-specific set of anchor rubric dimensions.
21
+
22
+ > πŸ“„ **Paper**: *MIRA: Mid-training Rubric Anchoring for Source-Aware Data Selection* (EMNLP 2026)
23
+ > πŸ’» **Code**: https://github.com/Multilingual-Multimodal-NLP/mira
24
+
25
+ ---
26
+
27
+ ## TL;DR
28
+
29
+ MIRA is a source-aware data selection framework for heterogeneous **mid-training** corpora. Instead of applying a single global quality rubric, MIRA (1) clusters sources into capability-coherent groups, (2) lets a frontier teacher (Kimi-K2.6) freely propose rubric dimensions and *anchors* them per group, (3) distills the anchored teacher into a lightweight **per-group student scorer**, and (4) applies reliability-aware aggregation with per-source retention thresholds.
30
+
31
+ **This repository is one of those student scorers** β€” variant **2** in the **QA** family, specialized for **long-form technical QA / Stack Overflow**. Given an in-distribution record, it produces a numerical score and a short rationale for every anchor dimension in this group's rubric.
32
+
33
+ ---
34
+
35
+ ## Model summary
36
+
37
+ | | |
38
+ |---|---|
39
+ | **Architecture** | Mixture-of-Experts decoder (35B total / β‰ˆ3B active params) |
40
+ | **Base model** | [Qwen3.5-35B-A3B-Base](https://huggingface.co/Qwen) |
41
+ | **Fine-tuning** | Full-parameter SFT on Kimi-K2.6 anchored teacher labels |
42
+ | **Domain** | English long-form technical QA with explicit reasoning, citations and code snippets β€” DLR-Book, DLR-Web, codesimpleqa_thinking, Glaive-AI 20M, and Stack Overflow rewrites. |
43
+ | **Anchor rubric** | 15 group-specific dimensions (`group_1b_dim_anchors.jsonl` in the project repo) |
44
+ | **Source count** | 5 qa sources |
45
+ | **Output** | Structured (score, rationale) per anchor dimension |
46
+ | **Precision** | BF16 |
47
+ | **License** | Apache-2.0 (inherits from Qwen3) |
48
+
49
+ ---
50
+
51
+ ## Sources covered
52
+
53
+ This scorer is calibrated for the following mid-training sources in the **QA / Long-form technical (DLR / StackOverflow / Glaive)** group:
54
+
55
+ | Source | Description |
56
+ |---|---|
57
+ | `DLR_Book` | DeepLearning.ai Book QA |
58
+ | `DLR_Web` | DeepLearning.ai Web QA |
59
+ | `codesimpleqa_thinking` | Code-simple QA with thinking + verify |
60
+ | `glaiveai_20m_dpsk` | Glaive-AI reasoning-v1-20M |
61
+ | `stackoverflow` | Stack Overflow QA rewritten by Kimi |
62
+
63
+ The full source-grouping report (KMeans k=4 / 5 clusters, intra-group cosine similarities) is in the [project repo](https://github.com/Multilingual-Multimodal-NLP/mira).
64
+
65
+ ---
66
+
67
+ ## Anchor dimensions (15 slots)
68
+
69
+ The scoring rubric for this group, discovered via Kimi-K2.6 free-form judging and clustered into 15 anchor dimensions (KMeans k=15 over the group's dim-score embeddings). Dimensions below are sorted by cluster size β€” larger clusters dominate the corpus and carry more signal. Anchor names are read verbatim from this group's `group_1b_dim_anchors.jsonl`; **some names recur across slots** because semantically related but distinct rubric facets were clustered separately by the teacher.
70
+
71
+ | Slot | Dimension | Cluster size |
72
+ |---|---|---:|
73
+ | **A1** | Specificity | 8,920 |
74
+ | **A2** | Question Clarity | 8,053 |
75
+ | **A3** | Answer Conciseness | 6,296 |
76
+ | **A4** | Actionability | 5,898 |
77
+ | **A5** | Answer Depth | 5,323 |
78
+ | **A6** | Answer Completeness | 5,220 |
79
+ | **A7** | Difficulty Level | 5,111 |
80
+ | **A8** | Verifiability | 4,271 |
81
+ | **A9** | Answer Conciseness | 4,234 |
82
+ | **A10** | Difficulty Appropriateness | 3,861 |
83
+ | **A11** | Educational Value | 3,822 |
84
+ | **A12** | Question Clarity | 3,775 |
85
+ | **A13** | Actionability | 3,592 |
86
+ | **A14** | Practical Applicability | 3,440 |
87
+ | **A15** | Technical Precision | 3,184 |
88
+
89
+ The scorer outputs one `[Ai] <dimension>: <score>/10 β€” <rationale>` line per slot, plus `overall`, `training_recommendation`, `domain_tag`, and `brief`.
90
+
91
+ ---
92
+
93
+ ## Where this model fits in the MIRA pipeline
94
+
95
+ ```
96
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
97
+ β”‚ 1. Rubric β”‚ β”‚ 2. Anchored β”‚ β”‚ 3. Reliability β”‚ β”‚ 4. Data β”‚
98
+ β”‚ Discovery β”‚β†’ β”‚ Judge β”‚β†’ β”‚ Aggregation β”‚β†’ β”‚ Selection β”‚
99
+ β”‚ (Kimi-K2.6, β”‚ β”‚ Distillation β”‚ β”‚ (mask unreliable β”‚ β”‚ (per-source β”‚
100
+ β”‚ free-form β”‚ β”‚ ◀── THIS MODEL β”‚ β”‚ srcΓ—dim cells) β”‚ β”‚ retention) β”‚
101
+ β”‚ judging) β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚
102
+ β””β”€β”€β”€β”€β”€β”€οΏ½οΏ½οΏ½β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
103
+ ```
104
+
105
+ `MIRA-QA-Group2` lives in Stage 2: it scores the full **QA / Long-form technical (DLR / StackOverflow / Glaive)** corpus so that downstream stages can apply reliability masking and source-aware retention.
106
+
107
+ ---
108
+
109
+ ## Intended use
110
+
111
+ - **Primary**: Score long-form technical QA / Stack Overflow on this group's anchor dimensions to drive source-aware data selection and filtering.
112
+ - **Secondary**: Research on rubric distillation, semantic quality scoring, and reliability diagnostics for heterogeneous training corpora.
113
+
114
+ **Not intended for**:
115
+ - General-purpose chat or instruction following β€” fine-tuned to emit structured scores, not freeform dialogue.
116
+ - Single-shot quality judgments without the anchor-dimension prompt template β€” outputs will be miscalibrated.
117
+ - Records outside the **QA / Long-form technical (DLR / StackOverflow / Glaive)** group; use the matching sibling scorer instead.
118
+
119
+ ---
120
+
121
+ ## Deployment
122
+
123
+ The scorer is designed to be served via **vLLM** behind an OpenAI-compatible endpoint and called in batch from the MIRA scoring pipeline.
124
+
125
+ ### 1. Serve with vLLM (recommended)
126
+
127
+ ```bash
128
+ vllm serve whw06/MIRA-QA-Group2 \
129
+ --tensor-parallel-size 8 \
130
+ --dtype bfloat16 \
131
+ --max-model-len 65536 \
132
+ --max-num-batched-tokens 131072 \
133
+ --gpu-memory-utilization 0.9 \
134
+ --trust-remote-code \
135
+ --port 8000
136
+ ```
137
+
138
+ **Why these values** (verified on H200 141GB during the paper's per-source evaluation):
139
+ - `max-model-len=65536` β€” 2Γ— the mid-training cutoff. Records can hit ~60K tokens for densely-tokenized sources; 40K runs into prompt-overflow errors.
140
+ - `max-num-batched-tokens=131072` β€” supports two full-length sequences per scheduling step.
141
+ - `gpu-memory-utilization=0.9` β€” 35B BF16 weights take ~70GB, leaving ~57GB KV cache. Roughly 4 concurrent 65K-context sequences per GPU.
142
+ - 8-way tensor parallel works well for the 35B MoE on a single 8Γ—H200/A100 node.
143
+
144
+ ### 2. Call from Python
145
+
146
+ ```python
147
+ from openai import OpenAI
148
+
149
+ client = OpenAI(base_url="http://localhost:8000/v1", api_key="EMPTY")
150
+
151
+ resp = client.chat.completions.create(
152
+ model="whw06/MIRA-QA-Group2",
153
+ messages=[
154
+ {"role": "system", "content": SYSTEM_PROMPT}, # group-1b anchor calibration
155
+ {"role": "user", "content": USER_PROMPT}, # record + [A1]..[A15] template
156
+ ],
157
+ temperature=0.7,
158
+ top_p=0.95,
159
+ max_tokens=2048,
160
+ )
161
+ print(resp.choices[0].message.content)
162
+ ```
163
+
164
+ ### 3. Prompt template
165
+
166
+ The user message asks for one structured line per anchor dimension (top-15 of this group):
167
+
168
+ ```
169
+ [A1] {anchor_dim_1}: <score>/10 β€” <justification>
170
+ [A2] {anchor_dim_2}: <score>/10 β€” <justification>
171
+ ...
172
+ [A15] {anchor_dim_15}: <score>/10 β€” <justification>
173
+ overall: <0-100>
174
+ training_recommendation: <keep | downsample | drop>
175
+ domain_tag: <short tag>
176
+ brief: <one-sentence summary>
177
+ ```
178
+
179
+ The system prompt embeds the **top-12 anchor calibration references** (canonical examples from clustering) so the student matches the teacher's scoring scale. The full prompt builder, anchor JSONL files, and output parser are in the project repo's `scoring/score_qa_anchored.py`.
180
+
181
+ ---
182
+
183
+ ## Training details
184
+
185
+ | | |
186
+ |---|---|
187
+ | **Teacher** | Kimi-K2.6 (free-form rubric discovery in Phase 1; anchored re-scoring in Phase 2) |
188
+ | **Training data** | Kimi-K2.6 anchored labels on this group's Phase-2 corpus, split into a distillation set + a held-out validation split for reliability diagnostics |
189
+ | **Loss** | Standard next-token CE over (score, rationale) labels for every anchor dimension |
190
+ | **Hyperparameters** | Held constant across all MIRA student scorers; full settings in paper Appendix A.4 |
191
+ | **Validation** | Per-dimension teacher–student MAE and Spearman ρ on a held-out split; dimensions failing reliability thresholds are masked **post-hoc** (Figure 3 in the paper) |
192
+
193
+ Training loss / step curve is preserved in `trainer_state.json` for full reproducibility.
194
+
195
+ ---
196
+
197
+ ## Headline results (from the paper)
198
+
199
+ End-to-end downstream evaluation: Qwen2.5-Coder-14B mid-trained on **25B-token MIRA-selected subsets** vs. baselines, then SFT, evaluated on 9 code benchmarks across 4 categories.
200
+
201
+ | Method | Code Gen | MultiplE | SQL (EX) | SWE-Multi | **Macro Avg** |
202
+ |-----------------------|---------:|---------:|---------:|----------:|--------------:|
203
+ | Base + SFT (no mid) | 53.91 | 72.57 | 64.24 | 3.67 | 48.60 |
204
+ | Raw Mixture (50B) | 53.71 | 67.42 | 94.18 | 40.00 | 63.83 |
205
+ | Random (25B) | 52.71 | 71.44 | 91.03 | 35.00 | 63.23 |
206
+ | DataMan (25B) | 53.82 | 71.38 | 93.84 | 33.00 | 63.01 |
207
+ | DSIR (25B) | 48.74 | 67.26 | 95.20 | 27.00 | 59.55 |
208
+ | PPL (25B) | 50.52 | 57.74 | 90.66 | 20.00 | 54.73 |
209
+ | MIRA-Global (25B) | 53.12 | 67.84 | 94.26 | 32.00 | 61.81 |
210
+ | **MIRA-Group (25B)** | **54.53**| 71.85 | 94.08 | 36.33 | **64.20** |
211
+ | MIRA-Source (25B) | 54.18 | **72.84**| 94.38 | 30.33 | 62.93 |
212
+
213
+ **MIRA-Group matches the full 50B-token raw mixture while using only half the tokens**, and out-performs all 25B-token selection baselines on the macro average. This scorer is one of the 12 student models used by the MIRA-Group variant.
214
+
215
+ ---
216
+
217
+ ## Sibling models
218
+
219
+ MIRA releases one student scorer per source-group variant. Use the matching scorer for each record's format:
220
+
221
+ - **Agent**: [whw06/MIRA-Agent-Group1](https://huggingface.co/whw06/MIRA-Agent-Group1) Β· [-Group2](https://huggingface.co/whw06/MIRA-Agent-Group2) Β· [-Group3](https://huggingface.co/whw06/MIRA-Agent-Group3) Β· [-Group4](https://huggingface.co/whw06/MIRA-Agent-Group4)
222
+ - **QA**: [whw06/MIRA-QA-Group1](https://huggingface.co/whw06/MIRA-QA-Group1) Β· **MIRA-QA-Group2 (this model)** Β· [-Group3](https://huggingface.co/whw06/MIRA-QA-Group3) Β· [-Group4](https://huggingface.co/whw06/MIRA-QA-Group4) Β· [-Group5](https://huggingface.co/whw06/MIRA-QA-Group5)
223
+ - **Text**: [whw06/MIRA-Text-Group1](https://huggingface.co/whw06/MIRA-Text-Group1) Β· [-Group2](https://huggingface.co/whw06/MIRA-Text-Group2) Β· [-Group3](https://huggingface.co/whw06/MIRA-Text-Group3)
224
+
225
+ ---
226
+
227
+ ## Limitations
228
+
229
+ - MIRA addresses **source-aware filtering** only. Source discovery, mixture-ratio design, curriculum scheduling, deduplication and contamination control remain orthogonal concerns.
230
+ - This scorer is calibrated against the **QA / Long-form technical (DLR / StackOverflow / Glaive)** group; cross-domain transfer is not advised β€” use the matching sibling for other source formats.
231
+ - Some anchor dimensions exhibit high teacher–student MAE and are **masked post-hoc** during aggregation (see paper Β§3.4). The model still emits scores for masked dimensions; downstream consumers should re-apply the reliability mask from the project repository.
232
+ - Calibrated on 5 sources within this group; behavior on out-of-distribution formats is unverified.
233
+
234
+ ---
235
+
236
+ ## Citation
237
+
238
+ ```bibtex
239
+ @inproceedings{wang2026mira,
240
+ title = {MIRA: Mid-training Rubric Anchoring for Source-Aware Data Selection},
241
+ author = {Wang, Haowen and Du, Yaxin and Yang, Jian and Wu, Jiajun and
242
+ Liu, Shukai and Zhang, Yuxuan and Wang, Pingjie and Chen, Siheng and
243
+ Zheng, Tuney and Zhou, Ming and Liu, Xianglong},
244
+ booktitle = {Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing (EMNLP)},
245
+ year = {2026}
246
+ }
247
+ ```
248
+
249
+ ---
250
+
251
+ ## Acknowledgments
252
+
253
+ Built on [Qwen3.5-35B-A3B-Base](https://huggingface.co/Qwen) and the [Megatron-LM](https://github.com/NVIDIA/Megatron-LM) training stack. Teacher labels generated with [Kimi-K2.6](https://moonshot.ai).