In this video, we'll cover the most important information about large language models.
And this knowledge will be very essential because we'll talk about how they are built.
What even is a large language model.
We'll talk about the fine tuning, how large language models are creating the responses, and a lot
of more.
And now there is a question why do we want to learn about that?
And actually let me explain.
When we create our workflows automations inside here and then we are using agents which are purely LM
models.
So for example, we are using ChatGPT, deep seq and other different applications.
And when you understand how they work, how actually it works.
So LM models, you are able to create better systems, more sophisticated agents and in general better
projects.
So again this video can be quite long over here and will cover all of the information you need to know
about LM models.
And again it will be very important.
So with all that being said let's dive in.
Stephen.
All right.
So let's start with the most basic question.
What is an LM.
And it's a large language model.
And here actually we can read LM is an advanced type of artificial intelligence that can understand
and generate human like text alarms, power tools like ChatGPT, cloud Deep Seek and many others.
So here for an example, we've got Grok and Google Gemini, ChatGPT and again cloud.
So these are LM models.
And again we are using them actually with our agents.
So you know we are using these models.
And here they are trained on huge amounts of text from the internet books and more.
So I like to compare that to a big library.
And not only one however, you know, thousands of them, or even sometimes more.
So LM model is built from huge amount of the data.
So it contains all of the data.
It's trained on that.
And actually it's very powerful because actually imagine inside LM you can have all of the information
from a lot of big libraries, like any articles, any, you know, blog posts, like a lot of a lot
of data.
However about that also later.
So they learned to answer questions, write stories, summarize translate code and much more.
So again it's also powerful.
You've got kind of the model that can think and also is trained actually on a huge amount of the data.
And even, you know, like models like bit like people and thinking and reasoning processes and even
for now, we had a lot of different, um, you know, research about the health care and diagnosing
different problems and so on.
So, I mean, like these like, models are so, so powerful.
Um, however, you will see that like, um, you know, like later in this video.
Um, let's go ahead.
And here we've got another topic, however, LM builds.
And I can say it's not that hard to comprehend because we've got only two files.
So at its core, an LM is surprisingly simple to run.
We've got only two files.
The first one is parameters file.
I'm actually.
I will explain that more later after we cover like more topics.
For example I'm how LM is creating the responses.
However, this is the giant file containing everything the model knows.
It's the result of training on huge data on huge datasets.
For a model like llama M2 70 billion parameters.
So this is 70 billion.
This file can be over 140GB.
So it's a huge file.
And yeah like we've got a huge data sets stored.
And the weight is very big.
And the second file is run a runner file which is also the code file.
So short script C, Python or other languages that leads the parameters and runs the model letting you
interact with it.
So actually you know we've got only two files.
So there you've got the analogy.
Think of of the parameters file as the brain.
So it's the brain actually here memory and experience.
And then the runner file as the body.
So code to make it work.
So actually the runner file actually takes you know all of the knowledge here, all of the information
from there.
And like does the specific actions you know.
So this is very simple I think it's not that hard to comprehend.
So we've got actually our database huge database data sets here inside the parameters file.
And actually here the runner file which is doing some specific tasks based on the parameters file.
All right let's go ahead.
And now there is a very important topic.
How does an LLM think.
Because it's very tricky sometimes actually we can think that LLM is actually thinking as the real human.
However this is not the truth because LLM can't understand what you are typing and instead they are
basing on the weights on actually different, you know, things.
However, let me actually explain that lambs don't think like humans.
They predict the next word in a sentence, one word at a time, using everything they learned during
training.
So example the Eiffel Tower is located in.
So here the LM analyzes the context and assigns probabilities to possible next words.
So it can't understand this text however.
And we've got a lot of different parameters huge data sets.
And now we actually actually imagine this.
By this way the Eiffel Tower is located in.
So the LM analyzes the context and assigns probabilities to possible next words.
And now imagine the following situation.
You've seen, let's say ten articles.
All right.
In your career you've seen ten articles like whatever.
And here every time whenever you had the word actually like this sentence, um, like you've seen the
word Paris next.
All right.
So llms work and by this way.
So they predict what is actually I can say what fits to the to the previous word and to the entire sentence,
you know.
So actually here, um, we've got the Eiffel Tower is located in and actually on the database and in
the data sets.
And mostly we had the word which is Paris.
All right.
And here, um, the probability of that is 97%.
And the next word is France, the second is the third is London, and the fourth is New York.
Um, so we've got the explanation.
The model will most likely choose Paris as the next word because it learned this, um, is the best
fit.
So from huge amount of databases, data sets and more.
Um, however, there we've got some very important actually a metric which is called temperature.
So sometimes when we have like when we have our models, we can actually adjust the temperature.
And it's I can say it's the creativeness.
So whenever the temperature is higher, like the model is more creative and might surprise you with
unusual words or phrases.
So imagine that us like Paris, suddenly and has less percent.
And for an example, France has like more percent, you know.
So here when you have higher temperature inside the model, it produces just more creative responses,
just more unusual.
However, with the low temperature, it's very predictable.
So the model is more conservative, always picks the most likely next word and the example.
So with low temperature the cat sat on the mat.
And here with high temperature the cat sat on the piano.
So it works by this way.
However, the most important fact is that, um, LM doesn't think like the human.
However, it takes actually different weights, um, from the from the data they learned.
And here, um, yeah.
And here actually it decides what should be next.
So again you've got the probabilities.
And now let's go back to our parameters file because it's very important.
And every time the model makes a prediction actually it checks if it was correct or right.
And if it wasn't it slightly like tweaks um, like the parameter um, which is a weight.
Um, so it gets a little better next time.
So parameters are weights.
This is not the text however.
These are weights.
And every time whenever we have like, you know, like the answer it tweaks.
Um, yeah.
It tweaks em to the perfection.
So like the fact from that is, is that like LM models are still being improved?
Um, however about that later in the fine tuning and improving the model.
So let's go ahead right here to the fourth point which is training LMS.
So it's like compressing the internet.
Um, actually I gave you a comparison to a library.
However, internet is also a great comparison.
So on the internet you've got a lot of data.
And here training an LLM is like compressing a huge chunk of the internet into a brain of parameters.
Companies like meta, OpenAI, Google and deep sea train models using massive data, data, datasets,
website books, articles, sometimes ten terabytes or more.
So it's so, so great.
Um, I've got for you some, um, nice actually.
Note because Deep SIG did something differently.
Um, however, I, I explained that in my deep SIG masterclass.
Nevertheless, um, in a while about that.
Um, so training requires thousands of GPUs for days or weeks, costing millions of dollars.
So the cost is really, really high.
The result is a huge parameters file.
It's not a copy of the internet, but a lossy compression.
It remembers patterns, facts and styles.
And here is the note.
Because actually, you know, common llms are trained on the data from internet.
It takes a huge actually GPU.
And also, you know, the space like the cost is very, very high.
However, Deep Seek was released and it was a total surprise for everyone because what they did, they
actually trained their models not on the data from the internet, articles, books, like huge data
sets.
However, they trained its model on other models.
So actually they took, um, they work in simple words and they trained um, its model on that.
So actually the cost was, um, you know, actually $6 million, which is just, um, a funny amount.
All right.
For training models.
Um, however, let's read it.
So models like Deep Six unique training methods or data sources, but the core concept remains trained
on huge data to create a general purpose language engine.
So again, it's very important.
And I'm like training LLM LM is taking all of the data, information, putting in insight and using
that, you know, actually to work do some specific tasks.
Next what we have open source versus closed models.
So open source models weights and code are available for everyone.
You can download, read, modify or even fine tune them for custom uses.
And what's very important, even when you have actually an open source model, you can download that
on your computer.
And that means you can even run it without internet connection.
It runs on your actual computer locally.
And here we've got you've got examples.
So llama two, Mistral, Deep Sea Zephyr V3 Microsoft.
And what is even very, very important actually when you run your model on your computer actually you
keep all of the information.
Um, yeah.
Private.
However, when you have closed models you're working on, for example, on OpenAI servers and here anthropic
or even deep sea servers.
And all of the data you provide is sent over to these companies.
So let's say to China, United States and so on.
So, um, actually, when you want to be very safe with what you type inside the model, um, you can
like download Deep Seek on your computer.
All right.
You can do this.
And then you can be 100% sure that data won't be sent anywhere.
However, now let's talk about what are the close models.
So you can you can access them only through a web interface or API.
Code and weights are not public used via subscription or licensing examples ChatGPT cloud Gemini.
So the most popular models however um, like it's very important to know the difference.
Now what we have fine tuning how Llms are improved.
So after initial training companies and now users can fine tune Llms to become better assistants, specialists
or agents.
Fine tuning.
Start with a base LM general knowledge.
Train further on custom datasets like Q and R pairs conversations or company documents.
Also, you know models are trained on users responses.
Yeah.
So if you type the response, you provide the data and actually the parameters are improved and it's
getting better over time.
So the model becomes specialized better at helping following instructions or doing specific tasks.
So imagine that as the experience.
Yeah.
As the experience.
You work for an example.
And the job for um, let's say one month or even ten years, you know.
So this is the huge gap.
Why is that important?
It turns a generic document generator into a helpful assistant, customer support bot, coding helper
or expert in a field.
So it works by this way, it's very, very important to know how llms are improved.
So they just get, over time more data.
And by that they have like the feedback.
All right.
They collect the feedback.
And on the feedback they get better and they produce better results.
Yeah it's a similar situation.
Whenever you know you've got the chat actually let me change the camera.
Let's say you've got the chat with the ChatGPT and it produces for you about responses.
And you say, all right, like give me something else.
I don't like the, um, you know, uppercase.
I don't like, let's say bullet points and then you like train the model.
All right by but within your entire chat.
So it's like a small comparison of how the models are trained.
Of course, it's more advanced, however, you know, um, just a small digression.
Llms as agents, real world applications.
And now we go to the very important step, actually, because we are using llms inside Nar den.
So when we create agents we use them.
And now actually, you know, you have a big knowledge about them.
All right.
After this video.
And I can say it's very important because Moodle LMS aren't just chatbots with tools like Zapier.
And then another automation platforms, LMS become agents.
They can connect to APIs, control apps, automate tasks, answer customer emails, summarize documents,
and more.
With Retrieval argument generation Rack, they can reference live documents and compound knowledge.
LMS can be fine tuned or plugged into workflows, making them work for businesses, creators, developers,
and more.
So again, we are using LMS models such as ChatGPT.
Here we are using Gemini.
So again I'm kind of in the videos we are using LM models.
And again it's very important to comprehend that that um yeah that it works by the way, not the other
because otherwise you create just words, you know, words agents, words, Wars projects.
And it's very important to again comprehend that because we based we actually based a lot of different
workflows, automations on that.
And last but not least, we've got the summary.
So the power of LMS, LMS are advanced toward predictors powered by billions of parameters trained on
huge data running from just two files.
Open source LMS are democratizing AI, letting anyone experiment, run and improve models.
Fine tuning and automation make LMS real world agents not just chatbots, but powerful AI tools for
any task.
So after this video, we have the great knowledge of what Lmx is, how they work and how they are built
in general, and how they are improved and a lot more actually.
I hope you enjoyed it.
And now we can use this knowledge to create, again, better automations workflows inside.
Nadine, thank you for watching for now and I will see you in the next video.