File size: 9,923 Bytes
1b230f5
e1e70c4
 
 
1b230f5
b4734d7
 
 
 
 
 
e1e70c4
b4734d7
 
e1e70c4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1b230f5
b4734d7
1b230f5
275cc70
1b230f5
b4734d7
275cc70
 
1b230f5
b4734d7
 
 
1b230f5
ce0ea8a
 
 
 
 
 
6851dd5
 
b4734d7
1b230f5
275cc70
1b230f5
b4734d7
 
 
1b230f5
f97cdaa
1b230f5
b4734d7
1b230f5
b4734d7
275cc70
b4734d7
1b230f5
b4734d7
1b230f5
b4734d7
275cc70
b4734d7
 
275cc70
 
 
1b230f5
b4734d7
1b230f5
 
 
275cc70
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e1e70c4
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
---
language:
- en
license: apache-2.0
library_name: transformers
tags:
- medical
- science
- biology
- chemistry
- not-for-all-audiences
base_model: alpindale/Mistral-7B-v0.2-hf
datasets:
- Locutusque/hercules-v4.0
model-index:
- name: Hercules-4.0-Mistral-v0.2-7B
  results:
  - task:
      type: text-generation
      name: Text Generation
    dataset:
      name: AI2 Reasoning Challenge (25-Shot)
      type: ai2_arc
      config: ARC-Challenge
      split: test
      args:
        num_few_shot: 25
    metrics:
    - type: acc_norm
      value: 58.96
      name: normalized accuracy
    source:
      url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=Locutusque/Hercules-4.0-Mistral-v0.2-7B
      name: Open LLM Leaderboard
  - task:
      type: text-generation
      name: Text Generation
    dataset:
      name: HellaSwag (10-Shot)
      type: hellaswag
      split: validation
      args:
        num_few_shot: 10
    metrics:
    - type: acc_norm
      value: 82.6
      name: normalized accuracy
    source:
      url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=Locutusque/Hercules-4.0-Mistral-v0.2-7B
      name: Open LLM Leaderboard
  - task:
      type: text-generation
      name: Text Generation
    dataset:
      name: MMLU (5-Shot)
      type: cais/mmlu
      config: all
      split: test
      args:
        num_few_shot: 5
    metrics:
    - type: acc
      value: 62.66
      name: accuracy
    source:
      url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=Locutusque/Hercules-4.0-Mistral-v0.2-7B
      name: Open LLM Leaderboard
  - task:
      type: text-generation
      name: Text Generation
    dataset:
      name: TruthfulQA (0-shot)
      type: truthful_qa
      config: multiple_choice
      split: validation
      args:
        num_few_shot: 0
    metrics:
    - type: mc2
      value: 40.99
    source:
      url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=Locutusque/Hercules-4.0-Mistral-v0.2-7B
      name: Open LLM Leaderboard
  - task:
      type: text-generation
      name: Text Generation
    dataset:
      name: Winogrande (5-shot)
      type: winogrande
      config: winogrande_xl
      split: validation
      args:
        num_few_shot: 5
    metrics:
    - type: acc
      value: 78.53
      name: accuracy
    source:
      url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=Locutusque/Hercules-4.0-Mistral-v0.2-7B
      name: Open LLM Leaderboard
  - task:
      type: text-generation
      name: Text Generation
    dataset:
      name: GSM8k (5-shot)
      type: gsm8k
      config: main
      split: test
      args:
        num_few_shot: 5
    metrics:
    - type: acc
      value: 45.41
      name: accuracy
    source:
      url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=Locutusque/Hercules-4.0-Mistral-v0.2-7B
      name: Open LLM Leaderboard
---
# Model Card: Hercules-4.0-Mistral-v0.2-7B

![image/png](https://tse3.mm.bing.net/th/id/OIG1.vnrl3xpEcypR3McLW63q?pid=ImgGn)

## Model Description

Hercules-4.0-Mistral-v0.2-7B is a fine-tuned language model derived from Mistralai/Mistral-7B-v0.2. It is specifically designed to excel in instruction following, function calls, and conversational interactions across various scientific and technical domains. The dataset used for fine-tuning, also named Hercules-v4.0, expands upon the diverse capabilities of OpenHermes-2.5 with contributions from numerous curated datasets. This fine-tuning has hercules-v4.0 with enhanced abilities in:

- Complex Instruction Following: Understanding and accurately executing multi-step instructions, even those involving specialized terminology.
- Function Calling: Seamlessly interpreting and executing function calls, providing appropriate input and output values.
- Domain-Specific Knowledge: Engaging in informative and educational conversations about Biology, Chemistry, Physics, Mathematics, Medicine, Computer Science, and more.

## Quants

GGUF: https://huggingface.co/bartowski/Hercules-4.0-Mistral-v0.2-7B-GGUF

ExLlamaV2: https://huggingface.co/bartowski/Hercules-4.0-Mistral-v0.2-7B-exl2

AWQ: https://huggingface.co/solidrust/Hercules-4.0-Mistral-v0.2-7B-AWQ

## Intended Uses & Potential Bias

Hercules-4.0-Mistral-v.02-7B is well-suited to the following applications:

- Specialized Chatbots: Creating knowledgeable chatbots and conversational agents in scientific and technical fields.
- Instructional Assistants: Supporting users with educational and step-by-step guidance in various disciplines.
- Code Generation and Execution: Facilitating code execution through function calls, aiding in software development and prototyping.

**Important Note: Although Hercules-v4.0 is carefully constructed, it's important to be aware that the underlying data sources may contain biases or reflect harmful stereotypes. Use this model with caution and consider additional measures to mitigate potential biases in its responses.**

## Limitations and Risks

- Toxicity: The dataset contains toxic or harmful examples.
- Hallucinations and Factual Errors: Like other language models, Hercules-4.0-Mistral-v0.2-7B may generate incorrect or misleading information, especially in specialized domains where it lacks sufficient expertise.
- Potential for Misuse: The ability to engage in technical conversations and execute function calls could be misused for malicious purposes.

## Training Procedure

- This model was trained on 8 kaggle TPUs, using torch xla SPMD for high MXU efficiency. There was no expense on my end (meaning you can reproduce this too!)
- A learning rate of 5e-06 with the Adam optimizer. A linear scheduler was used, with an end factor of 0.1. A low learning rate was used to prevent exploding gradients.
- No mixed precision was used, with the default dtype being bfloat16.
- A total batch size of 64 was used.
- Trained on 700,000 examples of Hercules-v4.0
- No model parameters were frozen and no quantization was used.
- This model was trained on OpenAI's ChatML prompt format. Because this model has function calling capabilities, the prompt format is slightly different, here's what it would look like: ```<|im_start|>system\n{message}<|im_end|>\n<|im_start|>user\n{user message}<|im_end|>\n<|im_start|>call\n{function call message}<|im_end|>\n<|im_start|>function\n{function response message}<|im_end|>\n<|im_start|>assistant\n{assistant message}</s>```

This model was fine-tuned using my TPU-Alignment repository. https://github.com/Locutusque/TPU-Alignment

## Evaluation

|              Tasks              |Version|Filter|n-shot| Metric |Value |   |Stderr|
|---------------------------------|-------|------|-----:|--------|-----:|---|-----:|
|agieval_nous                     |N/A    |none  |     0|acc_norm|0.3578|±  |0.0093|
|                                 |       |none  |     0|acc     |0.3598|±  |0.0093|
| - agieval_aqua_rat              |      1|none  |     0|acc     |0.2362|±  |0.0267|
|                                 |       |none  |     0|acc_norm|0.2362|±  |0.0267|
| - agieval_logiqa_en             |      1|none  |     0|acc     |0.3026|±  |0.0180|
|                                 |       |none  |     0|acc_norm|0.3456|±  |0.0187|
| - agieval_lsat_ar               |      1|none  |     0|acc     |0.2565|±  |0.0289|
|                                 |       |none  |     0|acc_norm|0.2522|±  |0.0287|
| - agieval_lsat_lr               |      1|none  |     0|acc     |0.3588|±  |0.0213|
|                                 |       |none  |     0|acc_norm|0.3490|±  |0.0211|
| - agieval_lsat_rc               |      1|none  |     0|acc     |0.4981|±  |0.0305|
|                                 |       |none  |     0|acc_norm|0.4461|±  |0.0304|
| - agieval_sat_en                |      1|none  |     0|acc     |0.6553|±  |0.0332|
|                                 |       |none  |     0|acc_norm|0.6408|±  |0.0335|
| - agieval_sat_en_without_passage|      1|none  |     0|acc     |0.3883|±  |0.0340|
|                                 |       |none  |     0|acc_norm|0.3738|±  |0.0338|
| - agieval_sat_math              |      1|none  |     0|acc     |0.3091|±  |0.0312|
|                                 |       |none  |     0|acc_norm|0.2773|±  |0.0302|

|   Groups   |Version|Filter|n-shot| Metric |Value |   |Stderr|
|------------|-------|------|-----:|--------|-----:|---|-----:|
|agieval_nous|N/A    |none  |     0|acc_norm|0.3578|±  |0.0093|
|            |       |none  |     0|acc     |0.3598|±  |0.0093|
|mmlu_flan_cot_fewshot                   |N/A    |get-answer|     0|exact_match|0.5787|±  |0.0120|
| - mmlu_flan_cot_fewshot_humanities     |N/A    |get-answer|     0|exact_match|0.5174|±  |0.0209|
| - mmlu_flan_cot_fewshot_other          |N/A    |get-answer|     0|exact_match|0.6833|±  |0.0249|
| - mmlu_flan_cot_fewshot_social_sciences|N/A    |get-answer|     0|exact_match|0.6528|±  |0.0248|
| - mmlu_flan_cot_fewshot_stem           |N/A    |get-answer|     0|exact_match|0.4925|±  |0.0266|
|ai2_arc                                 |N/A    |none      |     0|acc        |0.6936|±  |0.0073|
|                                        |       |none      |     0|acc_norm   |0.6984|±  |0.0074|
# [Open LLM Leaderboard Evaluation Results](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard)
Detailed results can be found [here](https://huggingface.co/datasets/open-llm-leaderboard/details_Locutusque__Hercules-4.0-Mistral-v0.2-7B)

|             Metric              |Value|
|---------------------------------|----:|
|Avg.                             |61.53|
|AI2 Reasoning Challenge (25-Shot)|58.96|
|HellaSwag (10-Shot)              |82.60|
|MMLU (5-Shot)                    |62.66|
|TruthfulQA (0-shot)              |40.99|
|Winogrande (5-shot)              |78.53|
|GSM8k (5-shot)                   |45.41|