Commit
•
feba7eb
1
Parent(s):
34e5498
Upload README (2).md
Browse files- README (2).md +155 -0
README (2).md
ADDED
@@ -0,0 +1,155 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model: Alignment-Lab-AI/Neural-network-medium-untuned-theta
|
3 |
+
tags:
|
4 |
+
- axolotl
|
5 |
+
- Alignment-Lab-AI
|
6 |
+
model-index:
|
7 |
+
- name: Buzz-5B-Medium
|
8 |
+
results: []
|
9 |
+
---
|
10 |
+
[<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)
|
11 |
+
|
12 |
+
|
13 |
+
|
14 |
+
![image/png](https://cdn-uploads.huggingface.co/production/uploads/6436279eaaef013d1af225c9/fWaQucBWfabfnMsAFN8hv.png)
|
15 |
+
|
16 |
+
# Buzz-5b-Medium: Advancing Efficiency through Iterative Fine-Tuning
|
17 |
+
|
18 |
+
## Introduction
|
19 |
+
|
20 |
+
- [Alignment Lab AI](https://AlignmentLab.ai) is pleased to introduce our latest research efforts with:
|
21 |
+
|
22 |
+
**Buzz-5b-Medium**, a state-of-the-art language model developed in collaboration with [Hive Digital Technologies](https://hivedt.com/).
|
23 |
+
|
24 |
+
The Buzz model, Dataset, and Code are to be released to build a toolkit that aims to demonstrate the potential for reuse and optimization of existing pretrained language models to continuously refine the heights of performance that can be achieved with optimal use of FlOps. Alongside Buzz-5b-Medium, we release
|
25 |
+
|
26 |
+
- [The Buzz Dataset](https://huggingface.co/datasets/tempbuzz/Buzz)
|
27 |
+
- [Buzz-2.5b-Small](https://huggingface.co/tempbuzz/buzz-Buzz-2.5b-Small)
|
28 |
+
- [Buzz-8B-Large](https://huggingface.co/tempbuzz/Lab-AI/Buzz-8B-Large)
|
29 |
+
|
30 |
+
the **Buzz dataset** and two additional models: **Buzz-2.5B-Small** (2.5B parameters) and **Buzz-8B-Large** (8B parameters), the codebase to refine, filter and augment the data, as well as prune and train your own variants, will additionally be released in the coming days.
|
31 |
+
|
32 |
+
## Performance
|
33 |
+
|
34 |
+
Buzz-5b-Medium achieves remarkably low train and validation loss, with unseen data loss reaching around **0.5** by the end of training. This performance showcases the effectiveness of our novel iterative fine-tuning approach, which maximizes the reuse of pretrained weights. Even the smallest variant, Buzz-Small, maintains a steady train loss of approximately **0.4-0.6**, on entirely new data and hold out sets.
|
35 |
+
|
36 |
+
[ benchmark scores table here]
|
37 |
+
|
38 |
+
## Iterative Fine-Tuning Methodology
|
39 |
+
|
40 |
+
Our research builds upon the concepts introduced in several key papers, including:
|
41 |
+
|
42 |
+
- [Simple and Scalable Strategies to Continually Pre-train Large Language Models](https://arxiv.org/abs/2403.08763)
|
43 |
+
- [NEFTune: Noisy Embeddings Improve Instruction Finetuning](https://arxiv.org/abs/2310.05914)
|
44 |
+
- [An Optimistic Acceleration of AMSGrad for Nonconvex Optimization](https://arxiv.org/abs/1903.01435)
|
45 |
+
- [Improving Generalization Performance by Switching from Adam to SGD](https://arxiv.org/abs/1712.07628)
|
46 |
+
- [Orca: Progressive Learning from Complex Explanation Traces of GPT-4](https://arxiv.org/abs/2306.02707v1)
|
47 |
+
|
48 |
+
By combining high quality data, iterative fine-tuning with carefully selected "grounding" distributions from previous epochs, we have developed a cost-effective approach that pushes the boundaries of model reuse and optimization.
|
49 |
+
|
50 |
+
## notably, we observe that the models have not yet appeared to plateu with the application of these techniques
|
51 |
+
|
52 |
+
|
53 |
+
![image/png](https://cdn-uploads.huggingface.co/production/uploads/6436279eaaef013d1af225c9/wyHyDIJnNmbomonZKQAD0.png)
|
54 |
+
https://wandb.ai/llm_surgery/llama-3-8b-vs-5b
|
55 |
+
https://wandb.ai/autometa/neural-network-1
|
56 |
+
https://wandb.ai/autometa/buzz-baby?nw=nwuserautometa
|
57 |
+
https://wandb.ai/autometa/buzz-brother?nw=nwuserautometa
|
58 |
+
https://wandb.ai/autometa/buzz-big?nw=nwuserautometa
|
59 |
+
|
60 |
+
## Chat Template and Inference
|
61 |
+
|
62 |
+
To use the Buzz-5b-Medium model for chat-based tasks, you can utilize the provided chat template. Here's an example of how to format the chat template and perform inference using the Hugging Face Transformers library:
|
63 |
+
```python
|
64 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
65 |
+
|
66 |
+
model_name = "tempbuzz/Buzz-5b-Medium"
|
67 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
68 |
+
model = AutoModelForCausalLM.from_pretrained(model_name)
|
69 |
+
|
70 |
+
chat_template = """{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{% for message in messages %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}"""
|
71 |
+
|
72 |
+
messages = [
|
73 |
+
{"role": "user", "content": "Hello, how are you?"},
|
74 |
+
{"role": "assistant", "content": "I'm doing well, thank you for asking! How can I assist you today?"},
|
75 |
+
{"role": "user", "content": "Can you tell me a joke?"}
|
76 |
+
]
|
77 |
+
|
78 |
+
input_text = chat_template.format(messages=messages, add_generation_prompt=True)
|
79 |
+
input_ids = tokenizer.encode(input_text, return_tensors="pt")
|
80 |
+
|
81 |
+
output = model.generate(input_ids, max_length=100, num_return_sequences=1, pad_token_id=tokenizer.eos_token_id)
|
82 |
+
generated_text = tokenizer.decode(output[0], skip_special_tokens=True)
|
83 |
+
|
84 |
+
print(generated_text)
|
85 |
+
``````
|
86 |
+
## Conclusion
|
87 |
+
|
88 |
+
We intend to focus on *updating* and improving the performance of these models, and surrounding open sourced infrastructure. Our next effort will focus on context and implementing the research currently being conducted by [Wing-Lian](https://github.com/winglian), the lead developer of the [Axolotl](https://github.com/OpenAccess-AI-Collective/axolotl) training framework that underpins these experiments. We encourage the community to explore Wing-Lian's work, such as the [Llama-3-8b-64k-PoSE](https://huggingface.co/winglian/Llama-3-8b-64k-PoSE) and [llama-3-8b-256k-PoSE](https://huggingface.co/winglian/llama-3-8b-256k-PoSE) models, which showcase the potential for further advancements in language modeling.
|
89 |
+
|
90 |
+
|
91 |
+
Buzz hopes to be a proof of concept, and a toolkit to demonstrate and enable the community in the pursuit of efficient and effective locally run, personally owned, language models. Through collaboration with [Hive Digital Technologies](https://hivedigitaltechnologies.com/) who have enabled us to perform this research, we have demonstrated the immense potential for model reuse and optimization. The Buzz models and dataset are open sourced with [////////].
|
92 |
+
|
93 |
+
## Credits
|
94 |
+
to the many researchers who have open sourced their knowledge and tools to allow us to pursue this,
|
95 |
+
|
96 |
+
to [Hive Digital Technologies](https://hivedigitaltechnologies.com/) for providing compute, advice, and meaningful research insight.
|
97 |
+
|
98 |
+
to [Meta](https://llama.meta.com) for developing the Llama models, and maintaining a philosophy of supporting open research and open source.
|
99 |
+
|
100 |
+
To wing et al. with [Open Access AI Collective](https://github.com/OpenAccess-AI-Collective) for developing [axolotl](https://github.com/OpenAccess-AI-Collective/axolotl), assisting with research, and generally being geniuses.
|
101 |
+
|
102 |
+
to [Thomas Capelle](https://wandb.ai/capecape) et al. working on [LLM_Surgery](https://wandb.ai/llm_surgery)
|
103 |
+
|
104 |
+
|
105 |
+
as well as many, many others who are too numerous to name.
|
106 |
+
|
107 |
+
|
108 |
+
|
109 |
+
# Citations
|
110 |
+
```
|
111 |
+
@misc{ibrahim2024simple,
|
112 |
+
title={Simple and Scalable Strategies to Continually Pre-train Large Language Models},
|
113 |
+
author={Adam Ibrahim and Benjamin Thérien and Kshitij Gupta and Mats L. Richter and Quentin Anthony and Timothée Lesort and Eugene Belilovsky and Irina Rish},
|
114 |
+
year={2024},
|
115 |
+
eprint={2403.08763},
|
116 |
+
archivePrefix={arXiv},
|
117 |
+
primaryClass={cs.LG}
|
118 |
+
}
|
119 |
+
|
120 |
+
@misc{jain2023neftune,
|
121 |
+
title={NEFTune: Noisy Embeddings Improve Instruction Finetuning},
|
122 |
+
author={Neel Jain and Ping-yeh Chiang and Yuxin Wen and John Kirchenbauer and Hong-Min Chu and Gowthami Somepalli and Brian R. Bartoldson and Bhavya Kailkhura and Avi Schwarzschild and Aniruddha Saha and Micah Goldblum and Jonas Geiping and Tom Goldstein},
|
123 |
+
year={2023},
|
124 |
+
eprint={2310.05914},
|
125 |
+
archivePrefix={arXiv},
|
126 |
+
primaryClass={cs.CL}
|
127 |
+
}
|
128 |
+
|
129 |
+
@misc{wang2020optimistic,
|
130 |
+
title={An Optimistic Acceleration of AMSGrad for Nonconvex Optimization},
|
131 |
+
author={Jun-Kun Wang and Xiaoyun Li and Belhal Karimi and Ping Li},
|
132 |
+
year={2020},
|
133 |
+
eprint={1903.01435},
|
134 |
+
archivePrefix={arXiv},
|
135 |
+
primaryClass={stat.ML}
|
136 |
+
}
|
137 |
+
|
138 |
+
@misc{keskar2017improving,
|
139 |
+
title={Improving Generalization Performance by Switching from Adam to SGD},
|
140 |
+
author={Nitish Shirish Keskar and Richard Socher},
|
141 |
+
year={2017},
|
142 |
+
eprint={1712.07628},
|
143 |
+
archivePrefix={arXiv},
|
144 |
+
primaryClass={cs.LG}
|
145 |
+
}
|
146 |
+
|
147 |
+
@misc{mukherjee2023orca,
|
148 |
+
title={Orca: Progressive Learning from Complex Explanation Traces of GPT-4},
|
149 |
+
author={Subhabrata Mukherjee and Arindam Mitra and Ganesh Jawahar and Sahaj Agarwal and Hamid Palangi and Ahmed Awadallah},
|
150 |
+
year={2023},
|
151 |
+
eprint={2306.02707},
|
152 |
+
archivePrefix={arXiv},
|
153 |
+
primaryClass={cs.CL}
|
154 |
+
}
|
155 |
+
```
|