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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- en
|
4 |
+
- ko
|
5 |
+
license: cc-by-nc-4.0
|
6 |
+
tags:
|
7 |
+
- dnotitia
|
8 |
+
- nlp
|
9 |
+
- llm
|
10 |
+
- slm
|
11 |
+
- conversation
|
12 |
+
- chat
|
13 |
+
base_model:
|
14 |
+
- meta-llama/Meta-Llama-3.1-8B
|
15 |
+
library_name: transformers
|
16 |
+
pipeline_tag: text-generation
|
17 |
+
---
|
18 |
+
|
19 |
+
# DNA 1.0 8B Instruct
|
20 |
+
<br>
|
21 |
+
<p align="center">
|
22 |
+
<img src="assets/dna-logo.png" width="400" style="margin: 40px auto;">
|
23 |
+
</p>
|
24 |
+
<br>
|
25 |
+
|
26 |
+
## Introduction
|
27 |
+
|
28 |
+
We introduce **DNA 1.0 8B Instruct**, a state-of-the-art (**SOTA**) bilingual language model optimized for both Korean and English languages, developed and released by **Dnotitia Inc.** This model is based on the Llama architecture and has been meticulously enhanced through various advanced training techniques to excel in language understanding and generation tasks.
|
29 |
+
|
30 |
+
The DNA 1.0 8B Instruct model has undergone a sophisticated development process:
|
31 |
+
|
32 |
+
- **Model Merging via SLERP:** Combined with Llama 3.1 8B Instruct using spherical linear interpolation to enhance performance.
|
33 |
+
- **Knowledge Distillation (KD):** Utilizing Llama 3.1 405B as the teacher model to improve knowledge representation.
|
34 |
+
- **Continual Pre-Training (CPT):** Trained on a high-quality Korean dataset to boost language capabilities.
|
35 |
+
- **Supervised Fine-Tuning (SFT):** Aligned with human preferences through fine-tuning on curated data.
|
36 |
+
- **Direct Preference Optimization (DPO):** Enhanced instruction-following abilities for better user interaction.
|
37 |
+
|
38 |
+
Each model supports long-context processing of up to **131,072 tokens (128K)**, enabling it to handle extensive conversational histories and long documents effectively.
|
39 |
+
|
40 |
+
Our documentation consists of the following sections:
|
41 |
+
|
42 |
+
- [Evaluation](#evaluation): Experimental results of DNA 1.0 8B Instruct.
|
43 |
+
- [Quickstart](#quickstart): A basic guide to using DNA 1.0 8B Instruct with Transformers.
|
44 |
+
- [Quantized Models](#quantized-models): An explanation of quantized DNA 1.0 8B Instruct weights in `GGUF` format.
|
45 |
+
- [Run Locally](#run-locally): Guides to running DNA 1.0 8B Instruct locally with `llama.cpp` and `Ollama` frameworks.
|
46 |
+
- [Deployment](#deployment): Guides to deploying DNA 1.0 8B Instruct with `vLLM` and `SGLang` frameworks.
|
47 |
+
|
48 |
+
<br>
|
49 |
+
|
50 |
+
## News
|
51 |
+
|
52 |
+
- **2024.12.10**: Released DNA 1.0 8B Instruct model. Try DNA-powered Mnemos Assistant! 👉 [Beta Open](https://request-demo.dnotitia.ai/)
|
53 |
+
- **2024.12.15**: Released GGUF quantized versions of DNA 1.0 8B Instruct model.
|
54 |
+
|
55 |
+
<br>
|
56 |
+
|
57 |
+
## Evaluation
|
58 |
+
|
59 |
+
We evaluated DNA 1.0 8B Instruct against other prominent language models of similar sizes across various benchmarks, including Korean-specific tasks and general language understanding metrics.
|
60 |
+
|
61 |
+
<br>
|
62 |
+
|
63 |
+
<table>
|
64 |
+
<tr>
|
65 |
+
<th>Language</th>
|
66 |
+
<th>Benchmark</th>
|
67 |
+
<th>dnotitia<br>DNA 1.0<br>8B Instruct</th>
|
68 |
+
<th>EXAONE 3.5<br>7.8B</th>
|
69 |
+
<th>Qwen 2.5<br>7B</th>
|
70 |
+
<th>Llama 3.1<br>8B</th>
|
71 |
+
<th>Mistral<br>7B</th>
|
72 |
+
</tr>
|
73 |
+
<tr>
|
74 |
+
<td rowspan="5">Korean</td>
|
75 |
+
<td>KMMLU</td>
|
76 |
+
<td align="center"><strong>53.26</strong></td>
|
77 |
+
<td align="center">45.30</td>
|
78 |
+
<td align="center">45.66</td>
|
79 |
+
<td align="center">41.66</td>
|
80 |
+
<td align="center">31.45</td>
|
81 |
+
</tr>
|
82 |
+
<tr>
|
83 |
+
<td>KMMLU-Hard</td>
|
84 |
+
<td align="center"><strong>29.46</strong></td>
|
85 |
+
<td align="center">23.17</td>
|
86 |
+
<td align="center">24.78</td>
|
87 |
+
<td align="center">20.49</td>
|
88 |
+
<td align="center">17.86</td>
|
89 |
+
</tr>
|
90 |
+
<tr>
|
91 |
+
<td>KoBEST</td>
|
92 |
+
<td align="center"><strong>83.40</strong></td>
|
93 |
+
<td align="center">79.05</td>
|
94 |
+
<td align="center">78.51</td>
|
95 |
+
<td align="center">67.56</td>
|
96 |
+
<td align="center">63.77</td>
|
97 |
+
</tr>
|
98 |
+
<tr>
|
99 |
+
<td>Belebele</td>
|
100 |
+
<td align="center"><strong>57.99</strong></td>
|
101 |
+
<td align="center">40.97</td>
|
102 |
+
<td align="center">54.85</td>
|
103 |
+
<td align="center">54.70</td>
|
104 |
+
<td align="center">40.31</td>
|
105 |
+
</tr>
|
106 |
+
<tr>
|
107 |
+
<td>CSAT QA</td>
|
108 |
+
<td align="center">43.32</td>
|
109 |
+
<td align="center">40.11</td>
|
110 |
+
<td align="center"><strong>45.45</strong></td>
|
111 |
+
<td align="center">36.90</td>
|
112 |
+
<td align="center">27.27</td>
|
113 |
+
</tr>
|
114 |
+
<tr>
|
115 |
+
<td rowspan="3">English</td>
|
116 |
+
<td>MMLU</td>
|
117 |
+
<td align="center">66.64</td>
|
118 |
+
<td align="center">65.27</td>
|
119 |
+
<td align="center"><strong>74.26</strong></td>
|
120 |
+
<td align="center">68.26</td>
|
121 |
+
<td align="center">62.04</td>
|
122 |
+
</tr>
|
123 |
+
<tr>
|
124 |
+
<td>MMLU Pro</td>
|
125 |
+
<td align="center"><strong>43.05</strong></td>
|
126 |
+
<td align="center">40.73</td>
|
127 |
+
<td align="center">42.50</td>
|
128 |
+
<td align="center">40.92</td>
|
129 |
+
<td align="center">33.49</td>
|
130 |
+
</tr>
|
131 |
+
<tr>
|
132 |
+
<td>GSM8K</td>
|
133 |
+
<td align="center"><strong>80.52</strong></td>
|
134 |
+
<td align="center">65.96</td>
|
135 |
+
<td align="center">75.74</td>
|
136 |
+
<td align="center">75.82</td>
|
137 |
+
<td align="center">49.66</td>
|
138 |
+
</tr>
|
139 |
+
</table>
|
140 |
+
|
141 |
+
- The **highest scores** are in **bold**.
|
142 |
+
|
143 |
+
<br>
|
144 |
+
|
145 |
+
**Evaluation Protocol**
|
146 |
+
|
147 |
+
For easy reproduction of our evaluation results, we list the evaluation tools and settings used below:
|
148 |
+
|
149 |
+
| Benchmark | Evaluation Setting | Metric | Evaluation Tool |
|
150 |
+
|-------------|--------------------|-------------------------------------|--------------------|
|
151 |
+
| KMMLU | 5-shot | `macro_avg` / `exact_match` | `lm-eval-harness` |
|
152 |
+
| KMMLU-Hard | 5-shot | `macro_avg` / `exact_match` | `lm-eval-harness` |
|
153 |
+
| KoBEST | 5-shot | `macro_avg` / `f1` | `lm-eval-harness` |
|
154 |
+
| Belebele | 0-shot | `accuracy` | `lm-eval-harness` |
|
155 |
+
| CSAT QA | 0-shot | `accuracy_normalized` | `lm-eval-harness` |
|
156 |
+
| MMLU | 5-shot | `macro_avg` / `accuracy` | `lm-eval-harness` |
|
157 |
+
| MMLU Pro | 5-shot | `macro_avg` / `exact_match` | `lm-eval-harness` |
|
158 |
+
| GSM8K | 5-shot | `accuracy` / `exact_match` | `lm-eval-harness` |
|
159 |
+
|
160 |
+
<br>
|
161 |
+
|
162 |
+
## Quickstart
|
163 |
+
|
164 |
+
We offer weights in `F32`, `F16` formats and quantized weights in `Q8_0`, `Q6_K`, `Q5_K`, `Q4_K`, `Q3_K` and `Q2_K` formats.
|
165 |
+
|
166 |
+
You can download the GGUF weights as follows:
|
167 |
+
|
168 |
+
```bash
|
169 |
+
# Install huggingface_hub if not already installed
|
170 |
+
pip install huggingface_hub
|
171 |
+
|
172 |
+
# Download the GGUF weights
|
173 |
+
huggingface-cli download dnotitia/Llama-DNA-1.0-8B-Instruct-GGUF \
|
174 |
+
--include "DNA-1.0-8B-Instruct-Q8_0.gguf" \
|
175 |
+
--local-dir .
|
176 |
+
```
|
177 |
+
|
178 |
+
<br>
|
179 |
+
|
180 |
+
## Run Locally
|
181 |
+
|
182 |
+
For end users, we introduce two ways to run DNA 1.0 8B Instruct model locally.
|
183 |
+
|
184 |
+
> **Note**
|
185 |
+
>
|
186 |
+
> We recommend using a repetition penalty not exceeding 1.0 for better generation quality.
|
187 |
+
|
188 |
+
### llama.cpp
|
189 |
+
|
190 |
+
You can run DNA 1.0 8B Instruct model with `llama.cpp` as follows:
|
191 |
+
|
192 |
+
1. Install `llama.cpp`. Please refer to the [llama.cpp repository](https://github.com/ggerganov/llama.cpp) for more details.
|
193 |
+
|
194 |
+
2. Download DNA 1.0 8B Instruct model in GGUF format.
|
195 |
+
|
196 |
+
```bash
|
197 |
+
huggingface-cli download dnotitia/Llama-DNA-1.0-8B-Instruct-GGUF \
|
198 |
+
--include "DNA-1.0-8B-Instruct-BF16*.gguf" \
|
199 |
+
--local-dir .
|
200 |
+
```
|
201 |
+
|
202 |
+
3. Run the model with `llama.cpp` in conversational mode.
|
203 |
+
|
204 |
+
```bash
|
205 |
+
llama-cli -cnv -m ./DNA-1.0-8B-Instruct-BF16.gguf \
|
206 |
+
-p "You are a helpful assistant, Dnotitia DNA."
|
207 |
+
```
|
208 |
+
|
209 |
+
### Ollama
|
210 |
+
|
211 |
+
DNA 1.0 8B Instruct model is compatible with Ollama. You can use it as follows:
|
212 |
+
|
213 |
+
1. Install Ollama. Please refer to the [Ollama repository](https://github.com/ollama/ollama) for more details.
|
214 |
+
|
215 |
+
2. Create a `Modelfile` for DNA 1.0 8B Instruct.
|
216 |
+
|
217 |
+
```text
|
218 |
+
# Model path (choose appropriate GGUF weights)
|
219 |
+
FROM ./DNA-1.0-8B-Instruct-BF16.gguf
|
220 |
+
|
221 |
+
# Parameter values
|
222 |
+
PARAMETER stop "<|endoftext|>"
|
223 |
+
PARAMETER repeat_penalty 1.0
|
224 |
+
# PARAMETER num_ctx 131072 # if you need a long context
|
225 |
+
|
226 |
+
# Chat template
|
227 |
+
TEMPLATE """{{- range $i, $_ := .Messages }}
|
228 |
+
{{- $last := eq (len (slice $.Messages $i)) 1 -}}
|
229 |
+
{{ if eq .Role "system" }}[|system|]{{ .Content }}[|endoftext|]
|
230 |
+
{{ continue }}
|
231 |
+
{{ else if eq .Role "user" }}[|user|]{{ .Content }}
|
232 |
+
{{ else if eq .Role "assistant" }}[|assistant|]{{ .Content }}[|endoftext|]
|
233 |
+
{{ end }}
|
234 |
+
{{- if and (ne .Role "assistant") $last }}[|assistant|]{{ end }}
|
235 |
+
{{- end -}}"""
|
236 |
+
|
237 |
+
# System prompt
|
238 |
+
SYSTEM """You are a helpful assistant, Dnotitia DNA."""
|
239 |
+
|
240 |
+
# License
|
241 |
+
LICENSE """CC BY-NC 4.0"""
|
242 |
+
```
|
243 |
+
|
244 |
+
3. Convert the model to Ollama.
|
245 |
+
|
246 |
+
```bash
|
247 |
+
ollama create dna -f Modelfile
|
248 |
+
```
|
249 |
+
|
250 |
+
4. Run the model with Ollama.
|
251 |
+
|
252 |
+
```bash
|
253 |
+
ollama run dna
|
254 |
+
```
|
255 |
+
|
256 |
+
<br>
|
257 |
+
|
258 |
+
## Limitations
|
259 |
+
|
260 |
+
While DNA 1.0 8B Instruct demonstrates strong performance, users should be aware of the following limitations:
|
261 |
+
|
262 |
+
- The model may occasionally generate biased or inappropriate content.
|
263 |
+
- Responses are based on training data and may not reflect current information.
|
264 |
+
- The model may sometimes produce factually incorrect or inconsistent answers.
|
265 |
+
- Performance may vary depending on the complexity and domain of the task.
|
266 |
+
- Generated content should be reviewed for accuracy and appropriateness.
|
267 |
+
|
268 |
+
<br>
|
269 |
+
|
270 |
+
## License
|
271 |
+
|
272 |
+
The model is released under the [CC BY-NC 4.0 license](./LICENSE). For commercial usage inquiries, please [Contact us](https://www.dnotitia.com/contact/post-form).
|
273 |
+
|
274 |
+
<br>
|
275 |
+
|
276 |
+
## Citation
|
277 |
+
|
278 |
+
If you use or discuss this model in your academic research, please cite the project to help spread awareness:
|
279 |
+
|
280 |
+
```
|
281 |
+
@article{dnotitiadna2024,
|
282 |
+
title = {Dnotitia DNA 1.0 8B Instruct},
|
283 |
+
author = {Jungyup Lee, Jemin Kim, Sang Park, Seungjae Lee},
|
284 |
+
year = {2024},
|
285 |
+
url = {https://huggingface.co/dnotitia/DNA-1.0-8B-Instruct},
|
286 |
+
version = {1.0},
|
287 |
+
}
|
288 |
+
```
|
289 |
+
|
290 |
+
<br>
|
291 |
+
|
292 |
+
## Contact
|
293 |
+
|
294 |
+
For technical support and inquiries: [Contact us](https://www.dnotitia.com/contact/post-form)
|