cgus
/

Text Generation
Transformers
English
llama
conversational
text-generation-inference
cgus commited on
Commit
75ebc3a
1 Parent(s): 9121093

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +179 -0
README.md ADDED
@@ -0,0 +1,179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ datasets:
3
+ - c-s-ale/alpaca-gpt4-data
4
+ - Open-Orca/OpenOrca
5
+ - Intel/orca_dpo_pairs
6
+ - allenai/ultrafeedback_binarized_cleaned
7
+ language:
8
+ - en
9
+ license: cc-by-nc-4.0
10
+ base_model:
11
+ - upstage/SOLAR-10.7B-v1.0
12
+ ---
13
+
14
+ # **Meet 10.7B Solar: Elevating Performance with Upstage Depth UP Scaling!**
15
+
16
+ # **With 128k Context!**
17
+
18
+ **(This model is [upstage/SOLAR-10.7B-v1.0](https://huggingface.co/upstage/SOLAR-10.7B-v1.0) fine-tuned version for single-turn conversation.)**
19
+
20
+
21
+ # **Introduction**
22
+ We introduce SOLAR-10.7B, an advanced large language model (LLM) with 10.7 billion parameters, demonstrating superior performance in various natural language processing (NLP) tasks. It's compact, yet remarkably powerful, and demonstrates unparalleled state-of-the-art performance in models with parameters under 30B.
23
+
24
+ We present a methodology for scaling LLMs called depth up-scaling (DUS) , which encompasses architectural modifications and continued pretraining. In other words, we integrated Mistral 7B weights into the upscaled layers, and finally, continued pre-training for the entire model.
25
+
26
+
27
+ SOLAR-10.7B has remarkable performance. It outperforms models with up to 30B parameters, even surpassing the recent Mixtral 8X7B model. For detailed information, please refer to the experimental table.
28
+ Solar 10.7B is an ideal choice for fine-tuning. SOLAR-10.7B offers robustness and adaptability for your fine-tuning needs. Our simple instruction fine-tuning using the SOLAR-10.7B pre-trained model yields significant performance improvements.
29
+
30
+ For full details of this model please read our [paper](https://arxiv.org/abs/2312.15166).
31
+
32
+
33
+ # **Instruction Fine-Tuning Strategy**
34
+
35
+ We utilize state-of-the-art instruction fine-tuning methods including supervised fine-tuning (SFT) and direct preference optimization (DPO) [1].
36
+
37
+ We used a mixture of the following datasets
38
+ - c-s-ale/alpaca-gpt4-data (SFT)
39
+ - Open-Orca/OpenOrca (SFT)
40
+ - in-house generated data utilizing Metamath [2] (SFT, DPO)
41
+ - Intel/orca_dpo_pairs (DPO)
42
+ - allenai/ultrafeedback_binarized_cleaned (DPO)
43
+
44
+ where we were careful of data contamination by not using GSM8K samples when generating data and filtering tasks when applicable via the following list.
45
+ ```python
46
+ filtering_task_list = [
47
+ 'task228_arc_answer_generation_easy',
48
+ 'ai2_arc/ARC-Challenge:1.0.0',
49
+ 'ai2_arc/ARC-Easy:1.0.0',
50
+ 'task229_arc_answer_generation_hard',
51
+ 'hellaswag:1.1.0',
52
+ 'task1389_hellaswag_completion',
53
+ 'cot_gsm8k',
54
+ 'cot_gsm8k_ii',
55
+ 'drop:2.0.0',
56
+ 'winogrande:1.1.0'
57
+ ]
58
+ ```
59
+
60
+ Using the datasets mentioned above, we applied SFT and iterative DPO training, a proprietary alignment strategy, to maximize the performance of our resulting model.
61
+
62
+ [1] Rafailov, R., Sharma, A., Mitchell, E., Ermon, S., Manning, C.D. and Finn, C., 2023. Direct preference optimization: Your language model is secretly a reward model. NeurIPS.
63
+
64
+ [2] Yu, L., Jiang, W., Shi, H., Yu, J., Liu, Z., Zhang, Y., Kwok, J.T., Li, Z., Weller, A. and Liu, W., 2023. Metamath: Bootstrap your own mathematical questions for large language models. arXiv preprint arXiv:2309.12284.
65
+
66
+ # **Data Contamination Test Results**
67
+
68
+ Recently, there have been contamination issues in some models on the LLM leaderboard.
69
+ We note that we made every effort to exclude any benchmark-related datasets from training.
70
+ We also ensured the integrity of our model by conducting a data contamination test [3] that is also used by the HuggingFace team [4, 5].
71
+
72
+ Our results, with `result < 0.1, %:` being well below 0.9, indicate that our model is free from contamination.
73
+
74
+ *The data contamination test results of HellaSwag and Winograde will be added once [3] supports them.*
75
+
76
+ | Model | ARC | MMLU | TruthfulQA | GSM8K |
77
+ |------------------------------|-------|-------|-------|-------|
78
+ | **SOLAR-10.7B-Instruct-v1.0**| result < 0.1, %: 0.06 |result < 0.1, %: 0.15 | result < 0.1, %: 0.28 | result < 0.1, %: 0.70 |
79
+
80
+ [3] https://github.com/swj0419/detect-pretrain-code-contamination
81
+
82
+ [4] https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard/discussions/474#657f2245365456e362412a06
83
+
84
+ [5] https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard/discussions/265#657b6debf81f6b44b8966230
85
+
86
+ # **Evaluation Results**
87
+
88
+ | Model | H6 | Model Size |
89
+ |----------------------------------------|-------|------------|
90
+ | **SOLAR-10.7B-Instruct-v1.0** | **74.20** | **~ 11B** |
91
+ | mistralai/Mixtral-8x7B-Instruct-v0.1 | 72.62 | ~ 46.7B |
92
+ | 01-ai/Yi-34B-200K | 70.81 | ~ 34B |
93
+ | 01-ai/Yi-34B | 69.42 | ~ 34B |
94
+ | mistralai/Mixtral-8x7B-v0.1 | 68.42 | ~ 46.7B |
95
+ | meta-llama/Llama-2-70b-hf | 67.87 | ~ 70B |
96
+ | tiiuae/falcon-180B | 67.85 | ~ 180B |
97
+ | **SOLAR-10.7B-v1.0** | **66.04** | **~11B** |
98
+ | mistralai/Mistral-7B-Instruct-v0.2 | 65.71 | ~ 7B |
99
+ | Qwen/Qwen-14B | 65.86 | ~ 14B |
100
+ | 01-ai/Yi-34B-Chat | 65.32 | ~34B |
101
+ | meta-llama/Llama-2-70b-chat-hf | 62.4 | ~ 70B |
102
+ | mistralai/Mistral-7B-v0.1 | 60.97 | ~ 7B |
103
+ | mistralai/Mistral-7B-Instruct-v0.1 | 54.96 | ~ 7B |
104
+
105
+ # **Usage Instructions**
106
+
107
+ This model has been fine-tuned primarily for single-turn conversation, making it less suitable for multi-turn conversations such as chat.
108
+
109
+ ### **Version**
110
+
111
+ Make sure you have the correct version of the transformers library installed:
112
+
113
+ ```sh
114
+ pip install transformers==4.35.2
115
+ ```
116
+
117
+ ### **Loading the Model**
118
+
119
+ Use the following Python code to load the model:
120
+
121
+ ```python
122
+ import torch
123
+ from transformers import AutoModelForCausalLM, AutoTokenizer
124
+
125
+ tokenizer = AutoTokenizer.from_pretrained("Upstage/SOLAR-10.7B-Instruct-v1.0")
126
+ model = AutoModelForCausalLM.from_pretrained(
127
+ "Upstage/SOLAR-10.7B-Instruct-v1.0",
128
+ device_map="auto",
129
+ torch_dtype=torch.float16,
130
+ )
131
+ ```
132
+
133
+ ### **Conducting Single-Turn Conversation**
134
+
135
+ ```python
136
+ conversation = [ {'role': 'user', 'content': 'Hello?'} ]
137
+
138
+ prompt = tokenizer.apply_chat_template(conversation, tokenize=False, add_generation_prompt=True)
139
+
140
+ inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
141
+ outputs = model.generate(**inputs, use_cache=True, max_length=4096)
142
+ output_text = tokenizer.decode(outputs[0])
143
+ print(output_text)
144
+ ```
145
+
146
+ Below is an example of the output.
147
+ ```
148
+ <s> ### User:
149
+ Hello?
150
+
151
+ ### Assistant:
152
+ Hello, how can I assist you today? Please feel free to ask any questions or request help with a specific task.</s>
153
+ ```
154
+
155
+ ### **License**
156
+ - [upstage/SOLAR-10.7B-v1.0](https://huggingface.co/upstage/SOLAR-10.7B-v1.0): apache-2.0
157
+ - [upstage/SOLAR-10.7B-Instruct-v1.0](https://huggingface.co/upstage/SOLAR-10.7B-Instruct-v1.0): cc-by-nc-4.0
158
+ - Since some non-commercial datasets such as Alpaca are used for fine-tuning, we release this model as cc-by-nc-4.0.
159
+
160
+ ### **How to Cite**
161
+
162
+ Please cite this model using this format.
163
+
164
+ ```bibtex
165
+ @misc{kim2023solar,
166
+ title={SOLAR 10.7B: Scaling Large Language Models with Simple yet Effective Depth Up-Scaling},
167
+ author={Dahyun Kim and Chanjun Park and Sanghoon Kim and Wonsung Lee and Wonho Song and Yunsu Kim and Hyeonwoo Kim and Yungi Kim and Hyeonju Lee and Jihoo Kim and Changbae Ahn and Seonghoon Yang and Sukyung Lee and Hyunbyung Park and Gyoungjin Gim and Mikyoung Cha and Hwalsuk Lee and Sunghun Kim},
168
+ year={2023},
169
+ eprint={2312.15166},
170
+ archivePrefix={arXiv},
171
+ primaryClass={cs.CL}
172
+ }
173
+ ```
174
+
175
+ ### **The Upstage AI Team** ###
176
+ Upstage is creating the best LLM and DocAI. Please find more information at https://upstage.ai
177
+
178
+ ### **Contact Us** ###
179
+ Any questions and suggestions, please use the discussion tab. If you want to contact us directly, drop an email to [contact@upstage.ai](mailto:contact@upstage.ai)