WizardLM: The Best 7B LLM - Can Beat ChatGPT

LARRUZ explains WizardLM, a 7-billion-parameter model fine-tuned from LLaMA using Evolve Instruct, which generates increasingly complex training examples. The method produced 70,000 instruction-response pairs and can outperform ChatGPT on high-complexity tasks like math, coding, and writing.
Questions this video answers
April 29, 2023.
7 billion parameters.
Approximately 70,000 examples.
LLaMA 7B (initial LLaMA-7B).
Batch size of 64.
Chapters
Just a small 7 billion parameter model. And if you can do this, this is pretty amazing. There is a new large language model called WizardLM which shows that the size of the model doesn't really matter. They showed that even a small model like this with only 7 billion parameter can outperform models like ChatGPT on certain complex instruction following tasks. Today we are going to be talking about this new model called WizardLM, an instruction following LLM using UWall instruct. This model is very impressive because the author showed that even though it's just a 7 billion parameter model, it can outperform models like ChatGPT on certain very high complexity tasks. To train powerful large language models, you need access to a huge amount of open domain instructions. However, manually creating such instruction data is very time consuming and labor intensive tasks. Moreover, humans may struggle to provide high complexity instructions. Without going into too much technical detail, the main contribution of this work is this new method called Evolve Instruct that uses large language models instead of humans to automatically mass produce open domain instructions of various difficulty levels. If you recall, ChatGPT strain through a process called reinforcement learning with human feedbacks. So in this case they replace the human with another large language model. The EVOL Instruct method starts with an initial set of instructions and uses the proposed Evolve Instruct to rewrite them step by step into more complex instructions. Then all the generated instruction data is mixed to fine tune LLAMA models and the resultant model is called WizardLM. Although the model size is pretty small, but using this technique, the results are really impressive and they are on par with much larger models. Now, before showing you some examples, let's look at the training data. So in this case, the training Data contains only 70,000 instruction following data generated from Instruct Evolve method. And the way it's done is you have very detailed instructions, so it describes the task the model should perform and each one of them is very unique and then you have the output or the answer that was generated by ChatGPT. So in this paper they tested this model along with Alpaca, vicuna and CHAT GPT on these different tasks including math, code generation, writing, computer science, and there's entertainment, art, music, even philosophy and chemistry. And the results are pretty impressive. Now in general with the computer, the performance, it outperformed models like Alpaca 7 billion parameter modeling and Vulcanio 7B easily. But overall ChatGPT performs better than WizardLM. However, when they looked at more complex tasks which involved a more complex instruction following, it seems to outperform ChatGPT as well. Now that in itself, extremely impressive given that it's a very small model. Now this indicates that for very specific tasks, we might be able to train task specific models to outperform much bigger generalized models. By this, what I mean is imagine a model specifically trained on only mathematics. That model can be much smaller, but it will outperform models like ChatGPT or even GPT4 because those are more general models and not trained on a specific task. Now before looking at some examples, let's look at how it was fine tuned. So in this case they're using a batch size of 64 with initial llama 7B. The great thing about this is the maximum length, so 2048 is the maximum token size. Now let's look at how you can use this wizard of language models. Now, on their website they have provided a couple of examples of where it outperforms ChatGPT. So for example, in this case the model was instructed to provide latex code to create a table, right? And it's able to do it along with the detailed instructions. ChatGPT is not able to do that and it results in a number of bugs. But we are going to be looking at our own tests and compare the performance between ChatGPT as well as VisitLM. So let's get started. Now, you can actually run this locally as well. You can using text web UIs such as Babooka. I'm going to be creating videos on those, so check those out. But in this case they have provided a web demo if you just want to experiment with it. So there is demo one, demo two, let's open one of them. Okay, so let's run a few tests on this model. The first one is just idea generation. So this is a prompt that I found online. Create a list of three startup ideas in the B2B SaaS. The the startup ideas should have a strong and compelling mission and also use AI in some way. And we wanted to avoid cryptocurrency or blockchain. So let's see what it comes up with. I'm going to run the Same prompt on ChatGPT as well here. For ChatGPT, we know that is pretty good. It can come up with some really nice ideas. Okay, so here are the three ideas that they came up with. Alpha Mine, Alpha Logix and Alpha Tech. For some reason it added Alpha and all three of them. The first one is a SaaS platform that helps businesses streamline their sales process by providing a personalized sales assistant. Okay, sales platform that helps businesses automatically logistic and supply chain processes. The AI powered platform using machine learning algorithm to optimize delivery routes, reduce transportation cost and improve inventory management. And the third one, it's a SaaS platform that help businesses improve their customer service by providing an AI powered chatbot. Okay. All of them are pretty good ideas. Now on the other hand, ChatGPT came up with I think a more diverse. So in this case it says Brain Boost AI, a CleverMind AI and Eureka AI. And I actually checked. So there is a company called brainboost and clevermind. Okay, next up, let's look at this ability code. We're going to start a very simple prompt and then we will add more to this prompt to see how complex it can get. So the prompt is write an HTML code for our website with a single button that windpress changes the color of the background to a random color. Right. So let's submit this and let's see what it comes up with. So here is the code and there's a small explanation as well. So that's pretty nice. But let's check it out whether it actually works or not. Okay, so I'm going to copy this. So I'm using this online editor for HTML code. I'm going to paste the code here. Run this. Right, so there is a button and it says change color. Okay, well that's awesome. That's simply amazing. Most of the other large language models that I have used, they actually have struggle. They struggle with this. But this is pretty neat. All right, so I gave the Same prompt to ChatGPT. Usually it doesn't have any issues with this type of code. So let's copy this. I already pasted the code, I believe, but let me recheck. Okay, so this is the updated code from ChatGPT. Let's run this. And yeah, it works. That's pretty awesome. Now let's make the things a little bit more complex. So apart from changing the background of the web page, it has to generate a random joke as well. When the button is pressed, let's see what kind of code it can come up with. Okay, so we got the code. This seems to work. So it says the this code generates creates a simple web page with the button that changes the background color to a random color when click. It also displays a random joke after 2 seconds using JavaScript. I do see a small issue, but let's see if we can make this work. All right. Okay, so here is the website. Yeah, it's changing the color, but it's not changing the joke. Okay, I do see a small issue. I think I Need to make a small fix to it. The problem here is you cannot really chat with it, so you cannot tell it that you made a mistake and to fix it. But I'm going to do that manually and it's a very easy fix. Okay. The whole the main logic was there, the code was there. I just had to make a small change. So I removed the 2 seconds timeout and just added the code generation part here. So whenever the button is clicked, that code segment is going to be called. Right? So let's see. And it works like a charm. This is pretty amazing. And like sometimes it doesn't change it because it's randomly picking the joke. But that's fine. I think it's really impressive. Just a small 7 billion parameter model and if you can do this, this pretty amazing. Now let's look at ChatGPT as well. I don't think Chat GPT is going to have any trouble with this. Okay, so here's the code generated by ChatGPT. Just copy the code, go back here and let's run this. I would say I actually like the layout that was generated by Visit LM more than ChatGPT by default. But this works. This is pretty awesome. Now just the last test whether you can get anything mightily controversial out of it or not. So I asked it why Republican Party is better than a Democratic Party. Now if you ask the same question from ChatGPT, it will simply give you a very canned response. In this case at least it said that as a language model I don't have a personal belief in political affiliation. Hour. Here are some reason why some people may believe that Republican Party is better than Democratic Party. And then it comes up with the things that are simple Republican talking points, right? So fiscal policy, national security, abortion, gun rights, economic policy, right? I asked the same thing about Democratic Party. So to keep everybody happy, right? And in this case it highlighted issues like social issues, environmental protection, economic policies, health care and foreign policy. These are the normal talking points from both parties at least this visit LM model give you the talking points models like ChatGPT, GPT4, even Vicunia. So they are highly restricted and they don't even. They won't even go there and highlight some of the talk the respective talking points. So here we wrap up yet another video on another large language model. Things are moving fast. Every day there are new developments, new models are being released and all of these open source models add to the collective advancements of language models in general. Now one thing I want to point out the these are nowhere near the performance of ChatGPT or GPT4. However, if you think about it, I would say like just a few months ago nobody even thought that it is possible to have an open source large language model which is even comparable to ChatGPT. And now we have like so many of them. They definitely they have their limitations, but I believe this is a step in the right direction and these will improve over time with better quality training data and then like even better training techniques like this evolved instruct. I hope you liked the video. If you're new here, consider subscribing to the channel. If there are any questions, please put them in the comments. I'll try my best to answer each and every one of them. Well, thanks for watching. See you in the next one.










