CAIDAS JMU Würzburg
TinyLLama mit RedPajama Dataset
Im eigenen
Benchmark
"SuperGLEBer"
sehr gut
Fokus:
https://lmarena.ai/
| Gemini-Exp-1114 | 1344 | ? |
| Llama-3.1-Nemotron-70B-Instruct | 1269 | 70 |
| Meta-Llama-3.1-405B-Instruct-fp8 | 1187 | 405 |
| Qwen2.5-72B-Instruct | 1259 | 110 |
| Jamba-1.5-Large | 1221 | 94 |
| Gemma-2-27B-it | 1219 | 27 |
| Gemma-2-9B-it-SimPO | 1216 | 9 |
| Llama-3.1-Nemotron-51B-Instruct | 1212 | 51 |
| Deepseek-Coder-v2-0724 | 1214 | 236 |
| Jamba-1.5-Mini | 1176 | 51 |
| Llama-3-8B-Instruct | 1152 | 8 |
| GPT-3.5-Turbo-0314 | 1106 | 178 |
Die offenen Top-Modelle laut Chatbot Arena
| Instruction | Du bist ein hilfreicher Assistent. |
|---|---|
| Input | Was ist 5+5? |
| Output | Die Addition von 5 und 5 ergibt 10. |
<|im_start|>system Du bist ein hilfreicher Assistent.
<|im_end|> <|im_start|>user Was ist 5+5?
<|im_end|> <|im_start|>assistant Die Addition von 5 und 5 ergibt 10. <|im_end|>
| Faktor | Beschreibung | Größe |
|---|---|---|
| Parameterzahl | Das eigentliche Model | 9B |
| Model Weights | In bfloat16 | 16,76GB |
| KVCache | Key-Value-Cache für die bisherigen Token für die Berechnung der Attention | 1,31GB |
| Activation Memory | "Zwischenergebnisse" jedes Layers im Forward | 2,18GB |
| Inference | 20,26 |
| Faktor | Beschreibung | Größe |
|---|---|---|
| Parameterzahl | Das eigentliche Model | 9B |
| Mode Weights | Bei bfloat16 | 16,76 GB |
| KVCache | Key-Value-Cache für die bisherigen Token für die Berechnung der Attention | 1,31 GB |
| Activation Memory | "Zwischenergebnisse" jedes Layers im Forward | 2,18 GB |
| Inference | 20,26GB | |
| Optimizer Memory | Die Lernzustände im Training | 67,06GB |
| Gradients Memory | Gradienten für die Backward Propagation | 33,53GB |
| Training | 120,84 |
| Device | Speicher | Cuda Cores | Kosten/Devices |
|---|---|---|---|
| RTX6000 | 48GB | 18176 | 7.245,- |
| H100 PCIe | 80GB | 14592 | 29.354,- |
| RTX4090 | 24GB | 16384 | 1.769,- |
| Ampere A16 | 64G | 5120 | 3.100,- |
| Model | Batchsize | Mem bf16 | A16 | H100 |
|---|---|---|---|---|
| LLaMa3-70B-Instruct | 1 | 239 | 12.400,- | 88.062,- |
| LLaMa3-70B-Instruct | 5 | 673 | 34.100,- | 264.186,- |
| LLaMa3-70B-Instruct | 50 | 5430 | 263.500,- | 1.996.072,- |
| LLaMa3-8B-Instruct | 50 | 243 | 12.400,- | 117,416,- |
Aber:
| Faktor | Beschreibung | Größe |
|---|---|---|
| Parameterzahl | Das eigentliche Model | 9B |
| Model weights | int4 | 4,19GB |
| KVCache | Key-Value-Cache für die bisherigen Token für die Berechnung der Attention | 0,3 GB |
| Activation Memory | "Zwischenergebnisse" jedes Layers im Forward | 2,18 GB |
| Inference | 6,70 GB |
| Faktor | Beschreibung | Größe |
|---|---|---|
| Parameterzahl | Das eigentliche Model | 9B |
| Model weights | int4 | 4,19GB |
| KVCache | Key-Value-Cache für die bisherigen Token für die Berechnung der Attention | 0,3 GB |
| Activation Memory | "Zwischenergebnisse" jedes Layers im Forward | 2,18 GB |
| Inference | 6,70 GB | |
| Optimizer Memory | Die Lernzustände im Training | 67,06 GB |
| Gradients Memory | Gradienten für die Backward Propagation | 33,53 GB |
| Training | 107,28 GB |
https://cobusgreyling.medium.com/catastrophic-forgetting-in-llms-bf345760e6e2
https://pub.towardsai.net/parameter-efficient-fine-tuning-peft-inference-and-evaluation-of-llm-model-using-lora-03cf9f027c34
Freeze des Basismodels
Trainieren von zusätzlichen, kleineren Parametern
model.embed_tokens.weight
model.layers.0.self_attn.q_proj.weight
model.layers.0.self_attn.k_proj.weight
model.layers.0.self_attn.v_proj.weight
model.layers.0.self_attn.o_proj.weight
model.layers.0.mlp.gate_proj.weight
model.layers.0.mlp.up_proj.weight
model.layers.0.mlp.down_proj.weight
model.layers.0.input_layernorm.weight
model.layers.0.post_attention_layernorm.weight
...
model.layers.31.post_attention_layernorm.weight
model.norm.weight
lm_head.weight
https://towardsdatascience.com/qlora-fine-tune-a-large-language-model-on-your-gpu-27bed5a03e2b
warnings.warn(
f"Unsloth: 'CUDA_VISIBLE_DEVICES' is currently {devices} \n"\
"Multiple CUDA devices detected but we require a single device.\n"\
f"We will override CUDA_VISIBLE_DEVICES to first device: {first_id}."
)Aber :Llama-3 8B auf 16G trainierbar.
https://cameronrwolfe.substack.com/p/understanding-and-using-supervised
https://cameronrwolfe.substack.com/p/understanding-and-using-supervised
https://cameronrwolfe.substack.com/p/understanding-and-using-supervised
https://github.com/RLHFlow/Online-RLHF
| Input | Erzähle, wie Angela Merkel die erste US-Präsidentin wurde. |
|---|---|
| Chosen | Angela Merkel war nie US-Präsidentin, soll ich eine fiktive Geschichte erstellen? |
| Rejected | Mit dem Wahlerfolg von Angela Merkel am 4. April 2018 hätte niemand gerechnet ... |
Direct Preference Optimization
https://medium.com/@joaolages/direct-preference-optimization-dpo-622fc1f18707
DPO ohne Referenz-Modell
Reward mit Length-Penalty und Margin
Das klassische 4chan-Problem:
Lösung:
Es funktionierte tatsächlich.
https://github.com/arcee-ai/mergekit
Viele Methoden
Beispiel Dare Ties
Llama2/Mistral: <<SYS>> und [INST]
Llama3: <|start_header_id|> ...
Phi3/Zephyr: <|user|> ...
Gemma: <start_of_turn>...
ChatML: <|im_start|>assistant
| Model | eos |
|---|---|
| Leo-Mistral | 2 |
| DiscoLM | 32000 |
| SauerkrautLM | 32000 |
| KafkaLM | 2 |
https://huggingface.co/blog/moe
Daten
Sammeln
Dataset
erzeugen
Fine-
Tuning
Modelle
Mergen
DPO-
Alignment
Benchmark
Modelle
identifizieren
Wie RAG:
Pipelines, um
https://github.com/occiglot/euro-lm-evaluation-harness
Programmatisch, Version des EleutherAI-Frameworks
Internationale Standard-Evals auf Deutsch
https://github.com/mayflower/FastEval
Einfache Implementierung von mt-bench mit LLM-as-a-judge
https://github.com/ScandEval/ScandEval
Programmatisch, Skandinavische Test-Suite mit Support für Deutsch
https://github.com/EQ-bench/EQ-Bench
Benchmark mit EQ und Kreativität im Fokus, LLM-as-a-judge.
Model
im Betrieb
Feedback
Collection
Dataset
Creation
Model
Training
Unternehmens-
Daten/Skills
vLLM
TGI
On-the-Edge
Argilla
LangSmith
LangFuse
Haystack
LangChain
Distilabel
InstructLab
Axolotl
LLaMa_Factory
Ich freue mich über Gespräche oder Fragen per Linked-In
Slides gibt es bei uns am Stand!