Transformers
GGUF
conversational
aashish1904 commited on
Commit
101dd23
·
verified ·
1 Parent(s): 1c7dd61

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +182 -0
README.md ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ ---
3
+
4
+ library_name: transformers
5
+ tags: []
6
+
7
+ ---
8
+
9
+ [![QuantFactory Banner](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeiuCm7c8lEwEJuRey9kiVZsRn2W-b4pWlu3-X534V3YmVuVc2ZL-NXg2RkzSOOS2JXGHutDuyyNAUtdJI65jGTo8jT9Y99tMi4H4MqL44Uc5QKG77B0d6-JfIkZHFaUA71-RtjyYZWVIhqsNZcx8-OMaA?key=xt3VSDoCbmTY7o-cwwOFwQ)](https://hf.co/QuantFactory)
10
+
11
+
12
+ # QuantFactory/II-Medical-8B-1706-GGUF
13
+ This is quantized version of [Intelligent-Internet/II-Medical-8B-1706](https://huggingface.co/Intelligent-Internet/II-Medical-8B-1706) created using llama.cpp
14
+
15
+ # Original Model Card
16
+
17
+
18
+ # II-Medical-8B-1706
19
+
20
+ <div style="display: flex; justify-content: center;">
21
+ <img src="https://cdn-uploads.huggingface.co/production/uploads/6389496ff7d3b0df092095ed/73Y-oDmehp0eJ2HWrfn3V.jpeg" width="800">
22
+ </div>
23
+
24
+ ## I. Model Overview
25
+
26
+ II-Medical-8B-1706 is the newest advanced large language model developed by Intelligent Internet, specifically engineered to enhance AI-driven medical reasoning. Following the positive reception of our previous [II-Medical-8B](https://huggingface.co/Intelligent-Internet/II-Medical-8B), this new iteration significantly advances the capabilities of medical question answering,
27
+
28
+ We also provide the static quants versions of II-Medical-8B-1706 [here](https://huggingface.co/Intelligent-Internet/II-Medical-8B-1706-GGUF)
29
+
30
+ ## II. Training Methodology
31
+
32
+ We collected and generated a comprehensive set of reasoning datasets for the medical domain and performed SFT fine-tuning on the **Qwen/Qwen3-8B** model. Following this, we further optimized the SFT model by training DAPO on a hard-reasoning dataset to boost performance.
33
+
34
+ For SFT stage we using the hyperparameters:
35
+
36
+ - Max Length: 16378.
37
+ - Batch Size: 128.
38
+ - Learning-Rate: 5e-5.
39
+ - Number Of Epoch: 6.
40
+
41
+ For the Reinforcement Learning (RL) stage, we designed a two-stage training process. The first stage focuses on enhancing the model's reasoning capabilities for complex medical questions. The second stage ensures that the model's responses prioritize safety and helpfulness. Both stages utilize the following configuration:
42
+
43
+ - Max prompt length: 2048 tokens.
44
+ - Max response length: 12288 tokens.
45
+ - Overlong buffer: Enabled, 4096 tokens, penalty factor 1.0.
46
+ - Clip ratios: Low 0.2, High 0.28.
47
+ - Batch sizes: Train prompt 512, Generation prompt 1536, Mini-batch 32.
48
+ - Responses per prompt: 16.
49
+ - Temperature: 1.0, Top-p: 1.0, Top-k: -1 (vLLM rollout).
50
+ - Learning rate: 1e-6, Warmup steps: 10, Weight decay: 0.1.
51
+ - Loss aggregation: Token-mean.
52
+ - Gradient clipping: 1.0.
53
+ - Entropy coefficient: 0.
54
+
55
+ ## III. Evaluation Results
56
+
57
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/63466107f7bd6326925fc770/kAyJOqZDuWRYkN3f1YWcS.png)
58
+
59
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/63466107f7bd6326925fc770/Sbgmwsefab7uDx5obvy18.png)
60
+
61
+ Our II-Medical-8B-1706 model achieved a 46.8% score on [HealthBench](https://openai.com/index/healthbench/), a comprehensive open-source benchmark evaluating the performance and safety of large language models in healthcare. This performance is comparable to MedGemma-27B from Google. We provide a comparison to models available in ChatGPT below.
62
+
63
+ <!-- ![image/jpeg](https://cdn-uploads.huggingface.co/production/uploads/61f2636488b9b5abbe184a8e/5r2O4MtzffVYfuUZJe5FO.jpeg) -->
64
+ Detailed result for HealthBench can be found [here](https://huggingface.co/datasets/Intelligent-Internet/OpenAI-HealthBench-II-Medical-8B-1706-GPT-4.1).
65
+
66
+ <!-- ![Model Benchmark](https://cdn-uploads.huggingface.co/production/uploads/6389496ff7d3b0df092095ed/uvporIhY4_WN5cGaGF1Cm.png) -->
67
+
68
+ We also evaluate on nine other medical QA benchmarks include MedMCQA, MedQA, PubMedQA, HealthBench, medical related questions from MMLU-Pro, small QA sets from Lancet and the New England
69
+ Journal of Medicine, 4 Options and 5 Options splits from the MedBullets platform and MedXpertQA.
70
+
71
+ | Model | MedMC | MedQA | PubMed | MMLU-P | HealthBench | Lancet | MedB-4 | MedB-5 | MedX | NEJM | Avg |
72
+ |--------------------------|-------|-------|--------|--------|------|--------|--------|--------|------|-------|-------|
73
+ | [HuatuoGPT-o1-72B](https://huggingface.co/FreedomIntelligence/HuatuoGPT-o1-72B) | **76.76** | 88.85 | **79.90** | 80.46 | 22.73 | 70.87 | 77.27 | 73.05 |23.53 |76.29 | 66.97 |
74
+ | [M1](https://huggingface.co/UCSC-VLAA/m1-7B-23K) | 62.54 | 75.81 | 75.80 | 65.86 | 15.51 | 62.62 | 63.64 | 59.74 |19.59 |64.34 | 56.55 |
75
+ | [Qwen3-8B](https://huggingface.co/Qwen/Qwen3-8B) | 66.53 | 81.38 | 73.9 | 77.85 | 42.27 | 66.26 | 68.83 | 62.66 |19.59 |69.65 | 62.89 |
76
+ | [Qwen3-32B](https://huggingface.co/Qwen/Qwen3-32B) | 74.18 | 88.92 | 76.1 | 80.7 | **47.08** | 72.33 | 72.27 | 71.42 |28.04 |76.94 | 68.80 |
77
+ | [MedGemma-27B-IT](https://huggingface.co/google/medgemma-27b-text-it) | 73.24 | 87.27 | 70.9 | 80.13 | 46.54| 70.14 | 75.32 | 73.37 |25.55 |76.28 | 67.87 |
78
+ | [II-Medical-8B](https://huggingface.co/Intelligent-Internet/II-Medical-8B) | 71.57 | 87.90 | 78.7 |**80.46** | 40.02| 70.38 | 78.25 | 72.07 |25.26 |73.13 |67.77 |
79
+ | [II-Medical-8B-1706](https://huggingface.co/Intelligent-Internet/II-Medical-8B-1706) | 74.44 | **88.61** | 79.8 | 81.04 | 46.8 | 71.60 | **80.84** | **74.67** |**29.63** |77.61 | **70.5** |
80
+
81
+ ## IV. Dataset Curation
82
+
83
+ The training dataset comprises 2.3M samples from the following sources:
84
+
85
+ ### 1. Public Medical Reasoning Datasets
86
+ - [General Medical Reasoning](https://huggingface.co/datasets/GeneralReasoning/GeneralThought-430K)
87
+ - [Medical-R1-Distill-Data](https://huggingface.co/datasets/FreedomIntelligence/Medical-R1-Distill-Data)
88
+ - [Medical-R1-Distill-Data-Chinese](https://huggingface.co/datasets/FreedomIntelligence/Medical-R1-Distill-Data-Chinese)
89
+ - [UCSC-VLAA/m23k-tokenized](https://huggingface.co/datasets/UCSC-VLAA/m23k-tokenized)
90
+
91
+ ### 2. Synthetic Medical QA Data with Qwen3-235B-A22B
92
+ Generated from established medical datasets:
93
+ - [MedMcQA](https://huggingface.co/datasets/openlifescienceai/medmcqa)
94
+ - [MedQA](https://huggingface.co/datasets/bigbio/med_qa)
95
+ - [MedReason](https://huggingface.co/datasets/UCSC-VLAA/MedReason)
96
+
97
+ ### 3. Curated Medical R1 Traces (338,055 samples)
98
+
99
+ First we gather all the public R1 traces from:
100
+
101
+ - [PrimeIntellect/SYNTHETIC-1](https://huggingface.co/collections/PrimeIntellect/synthetic-1-67a2c399cfdd6c9f7fae0c37)
102
+ - [GeneralReasoning/GeneralThought-430K](https://huggingface.co/datasets/GeneralReasoning/GeneralThought-430K)
103
+ - [a-m-team/AM-DeepSeek-R1-Distilled-1.4M](https://arxiv.org/abs/2503.19633v1)
104
+ - [open-thoughts/OpenThoughts2-1M](https://huggingface.co/datasets/open-thoughts/OpenThoughts2-1M)
105
+ - [nvidia/Llama-Nemotron-Post-Training-Dataset](https://huggingface.co/datasets/nvidia/Llama-Nemotron-Post-Training-Dataset): Science subset only
106
+ - Other resources: [cognitivecomputations/dolphin-r1](https://huggingface.co/datasets/cognitivecomputations/dolphin-r1), [ServiceNow-AI/R1-Distill-SFT](https://huggingface.co/datasets/ServiceNow-AI/R1-Distill-SFT),...
107
+
108
+ All R1 reasoning traces were processed through a domain-specific pipeline as follows:
109
+
110
+ 1. Embedding Generation: Prompts are embedded using sentence-transformers/all-MiniLM-L6-v2.
111
+
112
+ 2. Clustering: Perform K-means clustering with 50,000 clusters.
113
+
114
+ 3. Domain Classification:
115
+
116
+ - For each cluster, select the 10 prompts nearest to the cluster center.
117
+ - Classify the domain of each selected prompt using Qwen2.5-32b-Instruct.
118
+ - Assign the cluster's domain based on majority voting among the classified prompts.
119
+
120
+ 4. Domain Filtering: Keep only clusters labeled as Medical or Biology for the final dataset.
121
+
122
+
123
+ ### 4. Other
124
+ - 269k prompts from [Text-Book-QA-subset](https://huggingface.co/datasets/FreedomIntelligence/ApolloCorpus)
125
+ - 162k prompts from [Text-Patient-QA-subset](https://huggingface.co/datasets/FreedomIntelligence/ApolloCorpus)
126
+ - 112k prompts from [Chat-Doctor-QA](https://huggingface.co/datasets/lavita/ChatDoctor-HealthCareMagic-100k)
127
+ - Subset Instruction-following from [a-m-team/AM-Qwen3-Distilled](https://huggingface.co/datasets/a-m-team/AM-Qwen3-Distilled)
128
+
129
+ ### Preprocessing Data
130
+ 1. Filtering for Complete Generation
131
+ - Retained only traces with complete generation outputs
132
+
133
+ 2. Length-based Filtering
134
+ - Minimum threshold: Keep only the prompt with more than 3 words.
135
+ - Wait Token Filter: Removed traces with has more than 47 occurrences of "Wait" (97th percentile threshold).
136
+ 3. Response Deduplicate
137
+ - Ngram: 4
138
+ - Jacard Threshold: 0.7
139
+
140
+ ### Data Decontamination
141
+
142
+ We using two step decontamination:
143
+ 1. Following [open-r1](https://github.com/huggingface/open-r1) project: We decontaminate a dataset using 10-grams with the evaluation datasets.
144
+ 2. After that, we using the fuzzy decontamination from [`s1k`](https://arxiv.org/abs/2501.19393) method with threshold 90%.
145
+
146
+ **Our pipeline is carefully decontaminated with the evaluation datasets.**
147
+
148
+ ## V. How To Use
149
+ Our model can be utilized in the same manner as Qwen or Deepseek-R1-Distill models.
150
+
151
+ For instance, you can easily start a service using [vLLM](https://github.com/vllm-project/vllm):
152
+
153
+ ```bash
154
+ vllm serve Intelligent-Internet/II-Medical-8B-1706
155
+ ```
156
+
157
+ You can also easily start a service using [SGLang](https://github.com/sgl-project/sglang):
158
+
159
+ ```bash
160
+ python -m sglang.launch_server --model Intelligent-Internet/II-Medical-8B-1706
161
+ ```
162
+
163
+ ## VI. Usage Guidelines
164
+
165
+ - Recommended Sampling Parameters: temperature = 0.6, top_p = 0.9
166
+ - When using, explicitly request step-by-step reasoning and format the final answer within \boxed{} (e.g., "Please reason step-by-step, and put your final answer within \boxed{}.").
167
+ ## VII. Limitations and Considerations
168
+
169
+ - Dataset may contain inherent biases from source materials
170
+ - Medical knowledge requires regular updates
171
+ - Please note that **It’s not suitable for medical use.**
172
+
173
+
174
+ ## VIII. Citation
175
+
176
+ ```bib
177
+ @misc{2025II-Medical-8B-1706,
178
+ title={II-Medical-8B: Medical Reasoning Model},
179
+ author={Intelligent Internet},
180
+ year={2025}
181
+ }
182
+ ```