aashish1904
commited on
Commit
•
fb99324
1
Parent(s):
c11b5b6
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
@@ -0,0 +1,167 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
---
|
3 |
+
|
4 |
+
license: llama3
|
5 |
+
base_model: meta-llama/Meta-Llama-3-8B
|
6 |
+
tags:
|
7 |
+
- axolotl
|
8 |
+
- generated_from_trainer
|
9 |
+
model-index:
|
10 |
+
- name: Llama-3-8B-Magpie-Pro-SFT-v0.1
|
11 |
+
results: []
|
12 |
+
datasets:
|
13 |
+
- Magpie-Align/Magpie-Pro-300K-Filtered
|
14 |
+
language:
|
15 |
+
- en
|
16 |
+
|
17 |
+
---
|
18 |
+
|
19 |
+
![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeiuCm7c8lEwEJuRey9kiVZsRn2W-b4pWlu3-X534V3YmVuVc2ZL-NXg2RkzSOOS2JXGHutDuyyNAUtdJI65jGTo8jT9Y99tMi4H4MqL44Uc5QKG77B0d6-JfIkZHFaUA71-RtjyYZWVIhqsNZcx8-OMaA?key=xt3VSDoCbmTY7o-cwwOFwQ)
|
20 |
+
|
21 |
+
# QuantFactory/Llama-3-8B-Magpie-Pro-SFT-300K-v0.1-GGUF
|
22 |
+
This is quantized version of [Magpie-Align/Llama-3-8B-Magpie-Pro-SFT-300K-v0.1](https://huggingface.co/Magpie-Align/Llama-3-8B-Magpie-Pro-SFT-300K-v0.1) created using llama.cpp
|
23 |
+
|
24 |
+
# Original Model Card
|
25 |
+
|
26 |
+
|
27 |
+
# 🐦 Llama-3-8B-Magpie-Pro-SFT-v0.1
|
28 |
+
|
29 |
+
Project Web: [https://magpie-align.github.io/](https://magpie-align.github.io/)
|
30 |
+
|
31 |
+
Arxiv Technical Report: [https://arxiv.org/abs/2406.08464](https://arxiv.org/abs/2406.08464)
|
32 |
+
|
33 |
+
Codes: [https://github.com/magpie-align/magpie](https://github.com/magpie-align/magpie)
|
34 |
+
|
35 |
+
## Abstract
|
36 |
+
<details><summary>Click Here</summary>
|
37 |
+
High-quality instruction data is critical for aligning large language models (LLMs). Although some models, such as Llama-3-Instruct, have open weights, their alignment data remain private, which hinders the democratization of AI. High human labor costs and a limited, predefined scope for prompting prevent existing open-source data creation methods from scaling effectively, potentially limiting the diversity and quality of public alignment datasets. Is it possible to synthesize high-quality instruction data at scale by extracting it directly from an aligned LLM? We present a self-synthesis method for generating large-scale alignment data named Magpie. Our key observation is that aligned LLMs like Llama-3-Instruct can generate a user query when we input only the left-side templates up to the position reserved for user messages, thanks to their auto-regressive nature. We use this method to prompt Llama-3-Instruct and generate 4 million instructions along with their corresponding responses. We perform a comprehensive analysis of the extracted data and select 300K high-quality instances. To compare Magpie data with other public instruction datasets, we fine-tune Llama-3-8B-Base with each dataset and evaluate the performance of the fine-tuned models. Our results indicate that in some tasks, models fine-tuned with Magpie perform comparably to the official Llama-3-8B-Instruct, despite the latter being enhanced with 10 million data points through supervised fine-tuning (SFT) and subsequent feedback learning. We also show that using Magpie solely for SFT can surpass the performance of previous public datasets utilized for both SFT and preference optimization, such as direct preference optimization with UltraFeedback. This advantage is evident on alignment benchmarks such as AlpacaEval, ArenaHard, and WildBench.
|
38 |
+
</details><be>
|
39 |
+
|
40 |
+
## About This Model
|
41 |
+
|
42 |
+
This model is a fine-tuned version of [meta-llama/Meta-Llama-3-8B](https://huggingface.co/meta-llama/Meta-Llama-3-8B) on [Magpie-Align/Magpie-Pro-300K-Filtered](https://huggingface.co/datasets/Magpie-Align/Magpie-Pro-300K-Filtered) dataset.
|
43 |
+
|
44 |
+
It achieves performance comparable with the official Llama-3-8B-Instruct Model with SFT only!
|
45 |
+
|
46 |
+
- **Alpaca Eval 2 (GPT-4-Turbo-1106): 25.08 (LC), 29.47 (WR)**
|
47 |
+
- **Alpaca Eval 2 (Llama-3-8B-Instruct): 52.12 (LC), 53.43 (WR)**
|
48 |
+
- **Arena Hard: 18.9**
|
49 |
+
|
50 |
+
## Other Information
|
51 |
+
|
52 |
+
**License**: Please follow [Meta Llama 3 Community License](https://llama.meta.com/llama3/license).
|
53 |
+
|
54 |
+
**Conversation Template**: Please use Llama 3 **official chat template** for the best performance.
|
55 |
+
|
56 |
+
## Citation
|
57 |
+
|
58 |
+
If you find the model, data, or code useful, please cite our paper:
|
59 |
+
```
|
60 |
+
@misc{xu2024magpie,
|
61 |
+
title={Magpie: Alignment Data Synthesis from Scratch by Prompting Aligned LLMs with Nothing},
|
62 |
+
author={Zhangchen Xu and Fengqing Jiang and Luyao Niu and Yuntian Deng and Radha Poovendran and Yejin Choi and Bill Yuchen Lin},
|
63 |
+
year={2024},
|
64 |
+
eprint={2406.08464},
|
65 |
+
archivePrefix={arXiv},
|
66 |
+
primaryClass={cs.CL}
|
67 |
+
}
|
68 |
+
```
|
69 |
+
|
70 |
+
## Training procedure
|
71 |
+
|
72 |
+
### Training hyperparameters
|
73 |
+
|
74 |
+
The following hyperparameters were used during training:
|
75 |
+
- learning_rate: 2e-05
|
76 |
+
- train_batch_size: 1
|
77 |
+
- eval_batch_size: 1
|
78 |
+
- seed: 42
|
79 |
+
- distributed_type: multi-GPU
|
80 |
+
- num_devices: 4
|
81 |
+
- gradient_accumulation_steps: 8
|
82 |
+
- total_train_batch_size: 32
|
83 |
+
- total_eval_batch_size: 4
|
84 |
+
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
|
85 |
+
- lr_scheduler_type: cosine
|
86 |
+
- lr_scheduler_warmup_steps: 100
|
87 |
+
- num_epochs: 2
|
88 |
+
|
89 |
+
### Training results
|
90 |
+
|
91 |
+
| Training Loss | Epoch | Step | Validation Loss |
|
92 |
+
|:-------------:|:------:|:----:|:---------------:|
|
93 |
+
| 0.8664 | 0.0012 | 1 | 0.8860 |
|
94 |
+
| 0.4038 | 0.9989 | 825 | 0.4250 |
|
95 |
+
| 0.327 | 1.9830 | 1650 | 0.4219 |
|
96 |
+
|
97 |
+
|
98 |
+
### Framework versions
|
99 |
+
|
100 |
+
- Transformers 4.40.2
|
101 |
+
- Pytorch 2.3.0+cu121
|
102 |
+
- Datasets 2.19.1
|
103 |
+
- Tokenizers 0.19.1
|
104 |
+
|
105 |
+
[<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)
|
106 |
+
<details><summary>See axolotl config</summary>
|
107 |
+
|
108 |
+
axolotl version: `0.4.0`
|
109 |
+
```yaml
|
110 |
+
base_model: meta-llama/Meta-Llama-3-8B
|
111 |
+
model_type: LlamaForCausalLM
|
112 |
+
tokenizer_type: AutoTokenizer
|
113 |
+
|
114 |
+
load_in_8bit: false
|
115 |
+
load_in_4bit: false
|
116 |
+
strict: false
|
117 |
+
|
118 |
+
datasets:
|
119 |
+
- path: Magpie-Align/Magpie-Pro-300K-Filtered
|
120 |
+
type: sharegpt
|
121 |
+
conversation: llama3
|
122 |
+
dataset_prepared_path: last_run_prepared
|
123 |
+
val_set_size: 0.001
|
124 |
+
output_dir: ./out_Llama-3-8B-Magpie-Pro-300K-FilteredL
|
125 |
+
|
126 |
+
sequence_len: 8192
|
127 |
+
sample_packing: true
|
128 |
+
eval_sample_packing: false
|
129 |
+
pad_to_sequence_len: true
|
130 |
+
|
131 |
+
gradient_accumulation_steps: 8
|
132 |
+
micro_batch_size: 1
|
133 |
+
num_epochs: 2
|
134 |
+
optimizer: paged_adamw_8bit
|
135 |
+
lr_scheduler: cosine
|
136 |
+
learning_rate: 2e-5
|
137 |
+
|
138 |
+
train_on_inputs: false
|
139 |
+
group_by_length: false
|
140 |
+
bf16: auto
|
141 |
+
fp16:
|
142 |
+
tf32: false
|
143 |
+
|
144 |
+
gradient_checkpointing: true
|
145 |
+
gradient_checkpointing_kwargs:
|
146 |
+
use_reentrant: false
|
147 |
+
early_stopping_patience:
|
148 |
+
resume_from_checkpoint:
|
149 |
+
logging_steps: 1
|
150 |
+
xformers_attention:
|
151 |
+
flash_attention: true
|
152 |
+
|
153 |
+
warmup_steps: 100
|
154 |
+
evals_per_epoch: 1
|
155 |
+
eval_table_size:
|
156 |
+
saves_per_epoch: 3
|
157 |
+
debug:
|
158 |
+
deepspeed:
|
159 |
+
weight_decay: 0.0
|
160 |
+
fsdp:
|
161 |
+
fsdp_config:
|
162 |
+
special_tokens:
|
163 |
+
pad_token: <|end_of_text|>
|
164 |
+
|
165 |
+
```
|
166 |
+
|
167 |
+
</details><br>
|