Downloads · 30 days
28
22% of all-time downloads
avemio/German-RAG-LLAMA-3.1-8B-ORPO-HESSIAN-AI
German-RAG-LLAMA-3.1-8B-ORPO-HESSIAN-AI is a question answering model from avemio. Use it when the input is a question plus a passage. The card lists the license as llama3.1.
German-RAG (German Retrieval Augmented Generation) models are designed for the German-speaking market, enabling innovation and AI solutions to drive German research collaboration in business-focused Generative AI by 2025
Downloads · 30 days
28
22% of all-time downloads
All-time downloads
129
Public
Parameters
8B
16.1 GB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors16.1 GB · 100%
From the Hugging Face model README
German-RAG (German Retrieval Augmented Generation) models are designed for the German-speaking market, enabling innovation and AI solutions to drive German research collaboration in business-focused Generative AI by 2025
Our German-RAG-LLAMA-ORPO model are trained on this German-RAG-ORPO dataset.
The core models released in this batch are the following:
| Size | Training Tokens |
|---|---|
| German-RAG-LLAMA-CPT | 507.47 million |
| German-RAG-LLAMA-SFT | 2.03 billion |
| German-RAG-LLAMA-ORPO | 2.0577 billion |
Quickly get inference running with the following required installation: Now, proceed as usual with HuggingFace:
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "avemio/German-RAG-LLAMA-3.1-8B-SFT-HESSIAN-AI"
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype="auto",
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(model_name)
im_end_token_id = tokenizer.convert_tokens_to_ids('<|im_end|>')
im_start_token_id = tokenizer.convert_tokens_to_ids('<|im_start|>')
messages = [
{"role": "system", "content": "Folge den Anweisungen des Benutzers. Bevor du deine finale Antwort gibst, schildere deine Überlegungen zur Lösung des Problems."},
{"role": "user", "content": "Ferdinand steht vor der Herausforderung, eine faire Besuchsregelung für seine drei Kinder zu finden, die den Bedürfnissen jedes einzelnen Kindes gerecht wird. Jedes Kind hat unterschiedliche Vorlieben und Bedürfnisse, die in den Besuchsplan integriert werden müssen. Er muss sicherstellen, dass die Regelung sowohl den Interessen der Kinder als auch den rechtlichen Vorgaben entspricht. Ferdinand hat eine Woche Zeit, um einen Vorschlag zu erarbeiten, den er mit seinem Anwalt besprechen kann."}
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=False
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
generated_ids = model.generate(
**model_inputs,
max_length=2024,
temperature=0.01,
do_sample=False,
#bos_token_id=im_start_token_id,
eos_token_id=im_end_token_id,
pad_token_id=tokenizer.eos_token_id,
repetition_penalty=1.1,
num_return_sequences=1,
top_k=40,
top_p=0.95,
)
generated_ids = [
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
We are providing a comprehensive Google Colab notebook to guide users through the process of fine-tuning our model, complete with detailed instructions, essential dependencies, and configurable settings. Colab-Notebook.
The evaluation was performed using seven subsets, focusing on extraction recall, question answering (QA) with multiple references, and time difference reasoning. Relevant context and summarization were treated as distinct subsets, each playing a crucial role in the evaluation process. For relevant context, the model's ability to identify and extract pertinent information from the source material was assessed. In contrast, the summarization subset evaluated the model's capability to generate concise and accurate summaries based on the relevant context.
Four evaluation metrics were employed across all subsets: language quality, overall correctness, instruction following, and an overall score.
| Metric | Vanila-llama-3.1-8B-Instruct | German-RAG-LLAMA-SFT | German-RAG-LLAMA-ORPO | [German-RAG-LLAMA-MERGED] | GPT-3.5-TURBO |
|---|---|---|---|---|---|
| Average Language Quality | 87.78 | 88.93 | 88.93 | 86.93 | 87.58 |
| OVERALL SCORES (weighted): | |||||
| extraction_recall | 66.1 | 73.2 | 66.3 | 61.8 | 66.9 |
| qa_multiple_references | 74.7 | 91.5 | 90.9 | 84.8 | 90.3 |
| qa_without_time_difference | 83.5 | 90.7 | 91.4 | 88.0 | 89.9 |
| qa_with_time_difference | 86.7 | 91.4 | 91.8 | 89.1 | 90.6 |
| relevant_context | 87.9 | 90.3 | 89.6 | 84.4 | 88.5 |
| summarizations | 88.6 | 90.7 | 82.7 | 84.9 | 87.7 |
| Metric | Vanila-llama-3.1-8B-Instruct | [German-RAG-LLAMA-ORPO | GPT-3.5-TURBO | GPT-4o | GPT-4o-mini |
|---|---|---|---|---|---|
| OVERALL SCORES (weighted): | |||||
| hard_reasoning_de | 39.1 | 42.5 | 37.9 | 62.9 | 58.4 |
| hard_reasoning_en | 54.9 | 55.6 | 48.3 | 61.7 | 62.9 |
For training data details, please see the German-RAG-ORPO-Dataset documentation.
The ORPO Tasks Dataset represents a specialized collection for fine-tuning language models with a focus on RAG-specific capabilities.
The subsets can be for this training step are derived from 3 different sources:
| Subset | Examples per Task |
|---|---|
| SauerkrautLM-Fermented-GER-DPO | 3.31k |
| SauerkrautLM-Fermented-Irrelevance-GER-DPO | 2k |
| hard-reasoning-de | 3.19k |
| hard-reasoning-en | 1.97k |
| multi-turn-qa | 3.2k |
SauerkrautLM-Fermented-GER-DPO
SauerkrautLM-Fermented-Irrelevance-GER-DPO
| Parameter | German-RAG-LLAMA-ORPO |
|---|---|
| d_model | 3072 |
| num heads | 32 |
| num layers | 32 |
| MLP ratio | 3.5 |
| LayerNorm type | RMSNorm |
| pos embeddings | RoPE |
| attention variant | Standard Multi-Head Self Attention |
| biases | none |
| block type | sequential |
| activation | SiLU |
| sequence length | 131072 |
| weight typing | bfloat16 |
| Parameter | German-RAG-LLAMA-ORPO |
|---|---|
| warmup steps | 50 |
| peak LR | 5.0E-07 |
| weight decay | 0.1 |
| LR schedule | linear |
| gradient reduce dtype | FP32 |
| optimizer state dtype | FP32 |
German-RAG-LLAMA-ORPO, running on NVIDIA A100 with 80 GPUs for 4 days, has an approximate power consumption as follows:
It's important to note that the actual power consumption may vary depending on the specific workload and operational conditions. For accurate power consumption measurements, using dedicated power monitoring tools is recommended.
| Model | GPU Type | Power Consumption From GPUs |
|---|---|---|
| German-RAG-LLAMA-ORPO | A100 (Hessian AI supercomputer) | 0.01843 MWh |
Like any base language model or fine-tuned model without safety filtering, it is relatively easy for a user to prompt these models to generate harmful and generally sensitive content. Such content can also be produced unintentionally, especially in the case of bias, so we recommend users consider the risks of applications of this technology.
Otherwise, many facts from German-RAG-LLAMA-ORPO or any LLM will often not be true, so they should be checked.