munish0838 commited on
Commit
de7341b
1 Parent(s): 172009a

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +156 -0
README.md ADDED
@@ -0,0 +1,156 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: llama3
3
+ base_model: Magpie-Align/Llama-3-8B-Magpie-Air-SFT-v0.1
4
+ tags:
5
+ - axolotl
6
+ - generated_from_trainer
7
+ model-index:
8
+ - name: Llama-3-8B-Magpie-Air-SFT-v0.1
9
+ results: []
10
+ pipeline_tag: text-generation
11
+ ---
12
+
13
+ # 🐦 Llama-3-8B-Magpie-Air-SFT-v0.1-GGUF
14
+ This is quantized version of [Magpie-Align/Llama-3-8B-Magpie-Air-SFT-v0.1](https://huggingface.co/Magpie-Align/Llama-3-8B-Magpie-Air-SFT-v0.1) created using llama.cpp
15
+
16
+ # Model Description
17
+
18
+ Project Web: [https://magpie-align.github.io/](https://magpie-align.github.io/)
19
+
20
+ Arxiv Technical Report: [https://arxiv.org/abs/2406.08464](https://arxiv.org/abs/2406.08464)
21
+
22
+ Codes: [https://github.com/magpie-align/magpie](https://github.com/magpie-align/magpie)
23
+
24
+ ## Abstract
25
+ <details><summary>Click Here</summary>
26
+ 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.
27
+ </details><be>
28
+
29
+ ## About This Model
30
+
31
+ 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-Air-300K-Filtered](https://huggingface.co/datasets/Magpie-Align/Magpie-Air-300K-Filtered) dataset.
32
+
33
+ It achieves performance comparable with the official Llama-3-8B-Instruct Model with SFT only!
34
+
35
+ - **Alpaca Eval 2 (GPT-4-Turbo-1106): 22.66 (LC), 23.99 (WR)**
36
+ - **Alpaca Eval 2 (Llama-3-8B-Instruct): 49.27 (LC), 50.80 (WR)**
37
+ - **Arena Hard: 14.9**
38
+
39
+ ## Other Information
40
+
41
+ **License**: Please follow [Meta Llama 3 Community License](https://llama.meta.com/llama3/license).
42
+
43
+ **Conversation Template**: Please use Llama 3 **official chat template** for the best performance.
44
+
45
+ ## Citation
46
+
47
+ If you find the model, data, or code useful, please cite our paper:
48
+ ```
49
+ @misc{xu2024magpie,
50
+ title={Magpie: Alignment Data Synthesis from Scratch by Prompting Aligned LLMs with Nothing},
51
+ author={Zhangchen Xu and Fengqing Jiang and Luyao Niu and Yuntian Deng and Radha Poovendran and Yejin Choi and Bill Yuchen Lin},
52
+ year={2024},
53
+ eprint={2406.08464},
54
+ archivePrefix={arXiv},
55
+ primaryClass={cs.CL}
56
+ }
57
+ ```
58
+
59
+ ## Training procedure
60
+
61
+ ### Training hyperparameters
62
+
63
+ The following hyperparameters were used during training:
64
+ - learning_rate: 2e-05
65
+ - train_batch_size: 1
66
+ - eval_batch_size: 1
67
+ - seed: 42
68
+ - distributed_type: multi-GPU
69
+ - num_devices: 4
70
+ - gradient_accumulation_steps: 8
71
+ - total_train_batch_size: 32
72
+ - total_eval_batch_size: 4
73
+ - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
74
+ - lr_scheduler_type: cosine
75
+ - lr_scheduler_warmup_steps: 100
76
+ - num_epochs: 2
77
+
78
+ ### Training results
79
+
80
+ | Training Loss | Epoch | Step | Validation Loss |
81
+ |:-------------:|:------:|:----:|:---------------:|
82
+ | 0.7074 | 0.0013 | 1 | 0.7241 |
83
+ | 0.2182 | 1.0 | 781 | 0.2195 |
84
+ | 0.1328 | 1.9878 | 1562 | 0.2120 |
85
+
86
+
87
+ ### Framework versions
88
+
89
+ - Transformers 4.40.2
90
+ - Pytorch 2.3.0+cu121
91
+ - Datasets 2.19.1
92
+ - Tokenizers 0.19.1
93
+
94
+ [<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)
95
+ <details><summary>See axolotl config</summary>
96
+
97
+ axolotl version: `0.4.0`
98
+ ```yaml
99
+ base_model: meta-llama/Meta-Llama-3-8B
100
+ model_type: LlamaForCausalLM
101
+ tokenizer_type: AutoTokenizer
102
+
103
+ load_in_8bit: false
104
+ load_in_4bit: false
105
+ strict: false
106
+
107
+ datasets:
108
+ - path: Magpie-Align/Magpie-Air-300K-Filtered
109
+ type: sharegpt
110
+ conversation: llama3
111
+ dataset_prepared_path: last_run_prepared
112
+ val_set_size: 0.001
113
+ output_dir: ./out_Llama-3-8B-Magpie-Air-300K-FMGR
114
+
115
+ sequence_len: 8192
116
+ sample_packing: true
117
+ eval_sample_packing: false
118
+ pad_to_sequence_len: true
119
+
120
+ gradient_accumulation_steps: 8
121
+ micro_batch_size: 1
122
+ num_epochs: 2
123
+ optimizer: paged_adamw_8bit
124
+ lr_scheduler: cosine
125
+ learning_rate: 2e-5
126
+
127
+ train_on_inputs: false
128
+ group_by_length: false
129
+ bf16: auto
130
+ fp16:
131
+ tf32: false
132
+
133
+ gradient_checkpointing: true
134
+ gradient_checkpointing_kwargs:
135
+ use_reentrant: false
136
+ early_stopping_patience:
137
+ resume_from_checkpoint:
138
+ logging_steps: 1
139
+ xformers_attention:
140
+ flash_attention: true
141
+
142
+ warmup_steps: 100
143
+ evals_per_epoch: 1
144
+ eval_table_size:
145
+ saves_per_epoch: 3
146
+ debug:
147
+ deepspeed:
148
+ weight_decay: 0.0
149
+ fsdp:
150
+ fsdp_config:
151
+ special_tokens:
152
+ pad_token: <|end_of_text|>
153
+
154
+ ```
155
+
156
+ </details><br>