jphme commited on
Commit
57c2844
1 Parent(s): e248006

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +209 -0
README.md CHANGED
@@ -1,3 +1,212 @@
1
  ---
 
 
 
 
 
 
 
 
 
 
 
 
2
  license: apache-2.0
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ base_model: LeoLM/leo-mistral-hessianai-7b
3
+ tags:
4
+ - Mistral
5
+ - finetune
6
+ - chatml
7
+ - DPO
8
+ - German
9
+ - Deutsch
10
+ - synthetic data
11
+ model-index:
12
+ - name: DiscoLM_German_7b_v1
13
+ results: []
14
  license: apache-2.0
15
+ language:
16
+ - de
17
+ - en
18
  ---
19
+
20
+ # DiscoLM German 7b v1
21
+
22
+ ![DiscoLM_Logo](discolm_german.png)
23
+
24
+ ## Table of Contents
25
+
26
+ 1. [Introduction](#introduction)
27
+ 2. [Demo](#demo)
28
+ 3. [Downloads](#Downloads)
29
+ 4. [Prompt Format](#prompt-format)
30
+ 5. [Results](#results)
31
+ 6. [Evaluation](#evaluation)
32
+ 7. [Dataset](#dataset)
33
+ 8. [Limitations & Biases](#limitations--biases)
34
+ 9. [Acknowledgements](#acknowledgements)
35
+ 10. [About DiscoResearch](#about-discoresearch)
36
+ 11. [Disclaimer](#disclaimer)
37
+
38
+ # Introduction
39
+
40
+ **DiscoLM German 7b** is a Mistral-based large language model with a focus on German-language applications and the successor of the [EM German](https://huggingface.co/jphme/em_german_leo_mistral) model family.
41
+ It was trained on a large dataset of instructions in German and English with a SFT finetuning phase followed by additional DPO reinforcement learning.
42
+ The model is optimized for German text, providing proficiency in understanding, generating, and interacting with German language content while preserving its fluency in English and excelling at translation tasks.
43
+
44
+ Our goal with Disco LM German was not to beat benchmarks, but to provide a robust and reliable model for everyday use that can serve as a drop-in replacement for ChatGPT and other proprietary models.
45
+ We find that the perceived quality of it´s German-language output is even higher than GPT-4 in many cases; however it won't compete with larger models and top English 7b models for very complex reasoning, math or coding tasks.
46
+
47
+ # Demo
48
+
49
+ Please find a Demo and try the model at [demo.discoresearch.org](https://demo.discoresearch.org/) (in case the Demo is down and you have questions, you can contact us on our [Discord](https://discord.gg/ttNdas89f3)).
50
+
51
+ # Downloads
52
+
53
+ ## Model Links
54
+
55
+ We will update the links as soon as the quants are available on HuggingFace.
56
+
57
+ | Base Model | HF | GPTQ | GGUF | AWQ |
58
+ |-------|-------|-------|-------|-------|
59
+ | DiscoLM German 7b v1 | [Link](https://huggingface.co/DiscoResearch/DiscoLM_German_7b_v1) | soon | soon | soon |
60
+
61
+
62
+ # Prompt Format
63
+
64
+ DiscoLM German uses ChatML as the prompt format which enables OpenAI endpoint compatability and is supported by most inference libraries and frontends.
65
+
66
+ System prompts allow steerability and interesting new ways to interact with an LLM, guiding rules, roles, and stylistic choices of the model.
67
+
68
+ ```
69
+ <|im_start|>system
70
+ Du bist ein hilfreicher Assistent.<|im_end|>
71
+ <|im_start|>user
72
+ Wer bist du?<|im_end|>
73
+ <|im_start|>assistant
74
+ Ich bin ein Sprachmodell namens DiscoLM German und ich wurde von DiscoResearch trainiert.<|im_end|>
75
+ ```
76
+
77
+ This prompt is available as a [chat template](https://huggingface.co/docs/transformers/main/chat_templating), which means you can format messages using the
78
+ `tokenizer.apply_chat_template()` method:
79
+
80
+ ```python
81
+ messages = [
82
+ {"role": "system", "content": "Du bist ein hilfreicher Assistent."},
83
+ {"role": "user", "content": "Wer bist du?"}
84
+ ]
85
+ gen_input = tokenizer.apply_chat_template(message, return_tensors="pt")
86
+ model.generate(**gen_input)
87
+ ```
88
+
89
+ When tokenizing messages for generation, set `add_generation_prompt=True` when calling `apply_chat_template()`. This will append `<|im_start|>assistant\n` to your prompt, to ensure
90
+ that the model continues with an assistant response.
91
+
92
+ ## Retrieval Format
93
+
94
+ You can use a special retrieval format to improve steerability and reduce hallucinations for RAG applications (but other, more default formats should also work, this is purely optional)
95
+
96
+ Example:
97
+
98
+ ```
99
+ ### System:
100
+
101
+ Du bist ein hilfreicher Assistent. Für die folgende Aufgabe stehen dir zwischen den Tags BEGININPUT und ENDINPUT mehrere Quellen zur Verfügung. Metadaten zu den einzelnen Quellen wie Autor, URL o.ä. sind zwischen BEGINCONTEXT und ENDCONTEXT zu finden, danach folgt der Text der Quelle. Die eigentliche Aufgabe oder Frage ist zwischen BEGININSTRUCTION und ENDINSTRUCTION zu finden. Beantworte diese ausschließlich mit Informationen aus den gegebenen Quellen und gebe die Information zur genutzten Quelle unter "Quelle:" an. Sollten die Quellen keine relevanten Informationen enthalten, antworte: "Mit den gegebenen Informationen ist diese Frage nicht zu beantworten."
102
+
103
+ ### User Prompt:
104
+
105
+ BEGININPUT
106
+ BEGINCONTEXT
107
+ url: https://this.is.fake.news
108
+ time: 2089-09-01
109
+ ENDCONTEXT
110
+ Buxtehude ist die größte Stadt Deutschlands mit 96.56 Millionen Einwohnern.
111
+ ENDINPUT
112
+
113
+ BEGININSTRUCTION
114
+ Was ist die größte deutsche Stadt?
115
+ ENDINSTRUCTION
116
+
117
+ ### Model Answer:
118
+
119
+ Die größte deutsche Stadt ist Buxtehude.
120
+
121
+ Quelle:
122
+ url: https://this.is.fake.news
123
+ time: 2089-09-01
124
+
125
+ ```
126
+
127
+ ## Function Calling
128
+
129
+ The model also supports structured outputs/function calling, albeit this is a very experimental feature and YMMV.
130
+ This will be improved in the future.
131
+
132
+ The model will prefix functioncalls with `<functioncall>` and you can provide results in response with `<functionresponse>` for Multi-Turn applications.
133
+
134
+ Example:
135
+
136
+ ```
137
+ ### System:
138
+
139
+ Du bist ein hilfreicher Assistent. Extrahiere alle Personen aus den Eingaben des Users.
140
+
141
+ Du hast Zugriff auf folgende Funktionen:
142
+
143
+ {'name': 'PersonList',
144
+ 'description': 'Extrahiere die Namen aller im Text vorkommenden Personen',
145
+ 'parameters': {'$defs': {'Person': {'description': 'Details über eine person',
146
+ 'properties': {'name': {'title': 'Name', 'type': 'string'},
147
+ 'job': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'title': 'Job'},
148
+ 'age': {'anyOf': [{'type': 'integer'}, {'type': 'null'}],
149
+ 'title': 'Age'}},
150
+ 'required': ['name', 'job', 'age'],
151
+ 'title': 'Person',
152
+ 'type': 'object'}},
153
+ 'properties': {'person_list': {'items': {'$ref': '#/$defs/Person'},
154
+ 'title': 'Person List',
155
+ 'type': 'array'}},
156
+ 'required': ['person_list'],
157
+ 'type': 'object'}}
158
+
159
+ ### User Prompt:
160
+
161
+ Björn (25) und Jan sind die Gründer von ellamind.
162
+
163
+ ### Model Answer:
164
+
165
+ <functioncall> {"name": "PersonList", "arguments": '{"person_list": ["{"name": "Björn", "job": "founder", "age": 25}, {"name": "Jan", "job": "founder", "age": null}]}'}
166
+
167
+ ```
168
+
169
+
170
+ # Results
171
+
172
+ -to follow -
173
+
174
+ # Evaluation
175
+
176
+ As written above, we believe that current benchmarks don't capture the full spectrum of LLM capabilities very well. We didn't look at any benchmark results (besides training losses) until the work on DiscoLM was finished and didn't include any data resembling common benchmark formats in our training data.
177
+
178
+ That said, preliminary results with a German version of MT Bench show promising results: While lacking for coding and extraxtion tasks, DiscoLM German 7b performs not far below GPT-3.5-turbo on many tasks and even singificantly outperforms it in the reasoning category.
179
+
180
+ ![MTBench_DE_Results](mtbench_de_discolm_german_7b.png)
181
+
182
+ Additional Benchmark results will follow. The biggest strength of this model (language quality as perceived by native speakers) can't yet be captured in a benchmark - please let us know if you have an idea how to change this!
183
+
184
+ # Dataset
185
+
186
+ The dataset is a mixture of multi-turn chats, retrieval instructions and synthetically generated instructions spawning many topics and applications.
187
+
188
+
189
+ # Limitations & Biases
190
+
191
+ This model can produce factually incorrect and offensive output, and should not be relied on to produce factually accurate information.
192
+ This model was trained on various public datasets. While great efforts have been taken to clean the pretraining data, it is possible that this model could generate biased or otherwise offensive outputs and it is the responsibility of the user to implement a safety/moderation layer. Please use with caution.
193
+
194
+ # Acknowledgements
195
+
196
+ DiscoLM German is a [DiscoResearch](https://huggingface.co/DiscoResearch) project led by [JP Harries](https://huggingface.co/jphme) and supported by [Björn Plüster](https://huggingface.co/bjoernp) and [Daniel Auras](https://huggingface.co/rasdani).
197
+
198
+ We thank [HessianAI](https://hessian.ai/) for providing compute & support for various DiscoResearch projects and our friends at [LAION](https://laion.ai) for their work on LeoLM and scientific adivce.**
199
+
200
+ Development of DiscoLM German 7b was sponsored by **[ellamind](https://ellamind.com)**, where some of our founders are working on creating customized models for business applications with a focus on non-english language applications. Please get in contact if you need customized models for your business!
201
+
202
+
203
+ [<img src="https://raw.githubusercontent.com/OpenAccess-AI-Collective/axolotl/main/image/axolotl-badge-web.png" alt="Built with Axolotl" width="200" height="32"/>](https://github.com/OpenAccess-AI-Collective/axolotl)
204
+
205
+ # About DiscoResearch
206
+
207
+ DiscoResearch is an aspiring open research community for AI enthusiasts and LLM hackers. Come join our [Discord](https://discord.gg/ttNdas89f3), share your opinions and ideas, and advance open LLM research with us!
208
+
209
+
210
+ # Disclaimer
211
+
212
+ The license on this model does not constitute legal advice. We are not responsible for the actions of third parties who use this model. This model should only be deployed with additional safety measures in place.