Yi-1.5: True Apache 2.0 Competitor to LLAMA-3

LARRUZ tests Yi-1.5, a new open-source model family with Apache 2.0 licensing that comes in 6B, 9B, and 34B sizes. The 9B version outperforms competitors in its class, and the 34B approaches Llama-3's performance, though the default 4k context window is a limitation.
Questions this video answers
6 billion, 9 billion, and 34 billion parameters.
About 4.1 trillion tokens.
About 3 million samples.
4,000 tokens (with 200,000-token variants available).
Apache 2.0 (permitted for commercial use).
Chapters
So the Yi model family just got a huge upgrade. They are now beating lamatheon benchmarks. The best part, it's Apache 2.0. If you are not familiar with Yi model series, it's developed by a company called 01AI which is based out of China. These were the first models which were able to extend the context window of an Open LLM to 200,000 tokens. And from the ground up they had multimodal versions available and they are set to release yeelarge which reportedly is able to outperform the original GPT4. Elarge is going to be their commercial offering. Here's a quick summary of this model release. There are three different models. One is 6 billion, other is 9 billion and the third one is 34 billion parameters. All of them are upgraded version of the original Yi models and they have been trained up to 4.1 trillion tokens. After the original pre training they are further fine tuned on 3 million samples. Now the context window is pretty small for modern LLMs it's only 4,000 tokens. However, keep in mind they have the 200,000 tokens context window models so I would assume they might be able to expand on this context window pretty soon. And the best part, all of these models are released under Apache 2.0 so you can use them for commercial purposes. For all these three variants they are releasing both the base models as well as the chat version. And this seems to be targeting different hardware segments because the 6 billion version can potentially be run on a modern smartphone. Now, in terms of benchmarks, the 9 billion parameter model is able to outperform all the other models in its class. But I think the star of this release is the 34 billion version because it performs pretty closely or even outperforms the llama 370 billion model. Now beyond benchmarks, they say that this new release delivers strong performance, encoding, math reasoning and instruction following capabilities. We will test some of these capabilities with our set of prompts. Okay, so if you want to test the model, the 34 billion model is available on Hugging Face. I'll put a link to this spaces, you can test out the model. I'm currently running the 9 billion version on my local machine and we're going to be using this model for testing. To test this model we will use this Gradio app which is based on the web demo created by the Yi team. Let me first show you the actual settings that I'm going to be using. So I will change the max new tokens to 2000 tokens. We will dial down the temperature from 0.7 to somewhere around 0.2 and I'll also change the top P 2.9. The system message is going to remain to default. You are a friendly chatbot. I'm using the 9 billion version in 16 bit precision. If you use the quantized version, you might see a slightly different results than what I'm about to show you. So first let's test it if it's uncensored. So I asked how to break into a car and as expected it says I'm sorry, but I cannot assist with requests involving illegal activities. However, when I said it's for educational purposes, and it responded that while it's understandable that curiosity might lead one to inquire about how vehicles can be unlocked without keys, it's important to note that understanding methods of entry doesn't justify attempting these actions. But then it says for academic interest only, historical techniques used for vehicle unlocking before modern locking systems were in place include. And then it gave me a list of different techniques that it probably has read about in movie scripts and novels. And just like the llama 3 series, if you ask it to tell you jokes about men, or women for that matter, it does comes up with jokes. These are not great jokes, but at least it doesn't outright deny it. And another thing which I noticed is that the jokes that it creates tend to vary a lot compared to llama 3. And if you ask it to kill a Linux process for you, then it also is able to answer that without any hesitation, which is pretty cool. Okay, now a couple of other questions and most of the question that I'm going to be asking or other people are asking to test its abilities are the ones that are probably in its training data. But what I wanted to do was I wanted to include follow up questions to see its real understanding. So my first question was John has two sisters, each sister has two brothers. How many brothers does Sally have? This is a variation of a question that says Sally, a girl has X number of brothers. So just we changed the wording to see what kind of responses we're going to get. And the answer is actually pretty interesting. It says the statement Sally is introduced in this scenario without any prior information about Sally's relationship to John and his siblings, making it impossible to determine how many brothers Sally has based on the given information. It's a really good response. Most of the smaller models that I have tested it simply says Sally is one of the sisters. And then it goes on to give you account of Sally's brothers. So this is actually a pretty good response. Then I said, if Sally was actually one of John's sister, how many brothers and sisters she would have? Right? And then even in this case it goes through the whole process and it says counting all siblings, both male and females, Sally would have one sister, the other girl who is not specified by name apart from not being John or Sally, and two brothers including John. Thus Sally would have two brothers and one sister under these conditions, which is pretty accurate. So my follow up was how many brothers does John have? And it says based on the initial description, John has two brothers, since he himself is one of the brothers figures described for each of his sisters having at least one brother, which is pretty accurate, right? So it's able to reason. And also throughout the conversation it's remember what was mentioned before, which is pretty cool since this model is supposed to have really good reasoning ability. So I wanted to test it on a different scenarios. The first one is can it make deductions? So the prompt is John is hungry, John goes to to the kitchen, John grabbed the apple there, Daniel is hungry. Where does Daniel go? And why did John go to the kitchen? So it says if we continue with this scenario as if you are crafting a narrative or exploring their motives given both. Given that both John and Daniels are described as being hungry, Daniel might also decide to head towards the kitchen since it's a common place where people find food when they are hungry. Just like John, Daniel could be looking for something to satisfy his hunger. The reason John went to the kitchen is straightforward. Kitchens typically contain food items such as fruits, etc. So really good deduction here. But can it keep track of multiple items? So the follow up was Daniel picks up the football, Daniel, Daniel drops the newspaper, Daniel picks up the milk, John took the apple. What is Daniel holding? Now in this case, it go through a step by step process and says Daniel first picked up the football, then he dropped the newspaper without picking it up again. Finally, Daniel picked up the milk. Now it goes through the whole reasoning process and at the end it says Daniel ends up holding the milk. So somehow it completely forgot about the football. Now it's actually a tricky question because when I asked chatgpt the same question, it says based on the given sequence of events, Daniel is holding the football since he picks it up first. Right? And in this case it's com. It completely forgot about the milk as well. And when I tested the 34 billion version for the same question, that also gets it wrong. It says Daniel drops the newspaper, Daniels picks up the milk. And that's why he's holding milk. But it completely forgot about the football. Now here's another question where these smaller models tend to have a lot of trouble. So there's a door with push written in mirror writing. So the question is whether you want, you need to pull or push it. And the model has to think out loud, step by step. So again, the Yi9 billion version has trouble with it. It goes through the whole thinking process. Then it says, in this case, you should indeed push the door according to the original instructions. Now, for the 34 billion version, it doesn't have any issues with it whatsoever. And it correctly recognized that despite the instruction being pushed in middle writing, you should pull the door to open it, which is pretty impressive. Okay. They also talked about its math capabilities. So I tested on some very simple mathematical questions. A bag contains five red marbles, three blue marbles, and there are two green marbles. So what is the probability of trying a blue marble? And the way you need to come up with the answer is you'll just add up all these numbers. That gives you 10 marbles. There were originally only three blue marbles. So you need to divide three by 10 and it gets the correct answer. Now, subsequent question was, what is three plus 100? It's able to do mathematics pretty easily. So it tells us 103, which is correct. Now this one was, I think, a little tricky. 3 by 100 by 3 plus 50 by 2. It does the calculations correctly again and it gives us a correct answer. Another capability that I like to test it, its ability to retrieve information from its context. And that gives you a sense of what type of performance you will expect when you're doing rag. So here I said, you will be provided a context and the user will ask questions related to that context. Your job is to provide accurate answers based on the provided context. Now, I also started to include this sentence, acknowledge if you understand. And the reason is that I want to see if they able if the model is able to understand the instructions. So it says understood. I'm ready to assist with your question based on the given context. Please proceed with your query right now. If you don't add this, most of the smaller models will just start making up stuff, right? But here it actually acknowledged it. So this is good. Now I provided a context, which is a hypothetical scientific paper on synthetic bode nurses. And when I provided the context at the end, I said acknowledge if you understand the context, I'll start asking questions after that. So again it says, I acknowledge the context provided regarding the Hypothetical scientific topic and, and it gives us a pretty decent summary of the topic and then it says now please feel free to pose any questions pertaining to this context. So I asked a question regarding what are synthetic polynesters and why they were developed. The answer is accurate based on the provided context. Then I also asked subsequent question and it's able to give us pretty accurate answer based on the context that you provided. So this model can potentially be used for rag purposes. Now this model is also supposed to be good at coding. So I said I'll provide you with a Python program. Your job is to find errors in the code. Acknowledge if you understand. So again it's able to acknowledges and it says please go ahead and share the Python program. So we'll provide this simple Python program which has a couple mistake and let's see if it's able to identify those mistakes. So here it's able to identify the first mistake, even the second mistake, and the third mistake as well. So it seems like it's able to understand very simple programming. So overall it's able to help us out with correcting those mistakes. Now this is the prompt that I usually use to test basic programming understanding. So it's basically write a Python function that will help us Download files from S3bucket and just like other models, it's able to give us a pretty accurate response. Okay, so here's a slightly more complicated. It's supposed to write HTML for a web page with a single button. Whenever we click that button, it's supposed to change the background color and it's supposed to show us a random joke. So here's the code that it wrote. Going to copy this code and we're going to paste it into this online HTML editor. We're going to click run. So it does shows a button and it says joke goes here. And when I click the button it does change the background color. But for some reason I think the random number generator is not really working because it's just showing us the same code or the same joke. So let me click on this again. Yeah, I think it seems like the random number generator doesn't really work and the first jokes just stays there. So I would say like it's a partial pass. So overall I think it's a pretty impressive model for its size. One of the biggest limitation is its limited context window of 4,000 tokens. But I think they will be able to expand on that. You will probably see that 200,000 token context window version pretty soon. Now, as I showed you, based on the benchmarks it seems to be better than llama 3, at least the smaller model, but the actual performance is going to be based on your applications. Unfortunately, we don't really have any other way to compare these models against one another except the benchmarks that we have currently available. But I'll highly recommend if you are building an LLM based application to test this model out as well as Llama 3 or Mistral and pick your winner based on the application that you are running. This but this is Apache 2.0 in a true sense. You can use it for commercial purposes without any limitations. And they are also going to be releasing this YI Large model pretty soon, so that is also going to be very exciting to see that we will have GPT4 level models apart from Claude Opus. I hope you found this video useful. Thanks for watching and as always, see you in the next one.










