In this lesson we are going to talk about the.
Basic concepts.
Concepts, concepts.
Uh, excuse me.
In this lesson, we are going to talk about the basic concepts associated with the rack technique.
So.
One of the most important things to understand when we are studying the Irac technique is the limits
of the context window.
So remember that the context window is the maximum size of the context that we can give to an LM.
For example, an LM like ChatGPT has the following context.
Windows.
Chat GPT 3.5, the current free version of ChatGPT, supports a context window of up to 3000 words or
less, around six pages of text.
Chat GPT four, the premium version of chat GPT supports a higher context window of approximately 6000
words, or 12 pages.
They have increased.
They are increasing this context window limits.
So what limits does the context window impose on us?
Remember that the context window prevents us from things like asking ChatGPT.
To summarize, for example, a 300 page report or asking ChatGPT to use a big database, etc. and things
like this.
As we saw, for example, in the in the professional application, we preview a few lessons.
Uh, before, uh, before this, we saw that this kind of limitations are a big problem for professional
LM applications.
So.
ChatGPT is limited.
The foundation attempts are limited for many operations, and that's why LM applications are finding
so much interest in the market with with customers, because they can solve some limitations like this
one that foundational LMS have.
How to overcome the context window limits.
You could train an LLM from scratch with your own data, and this is impractical for most in reality
because it's hugely expensive.
You could add your data to an already trained LLM, which is called fine tuning.
And this is also impractical for most in reality because it's very expensive and technically very complex.
Or you can use the RAC technique.
Rack is an acronym for retrieval, Augmented Generation.
Don't worry about the name.
It's not important for us.
We will refer it to rack technique.
And in the rack technique we divide our data into small segments, allowing the LM to use them within
the limits of its context window.
We will see more of that later.
This is the technique used today by virtually all LM applications.
So important notes about the limits of the context window.
This is the main problem that rack technique solves.
So let's talk a little bit about the rack technique itself.
So with the rack technique, we will divide our data, our private data into small segments.
So remember for example the seq insights application we saw the professional application.
Do you remember that it loaded a until ten PDFs with a financial information of different companies.
And then it can respond questions or make comparisons or whatever.
Right.
So how can an LM application work with huge amounts of data like that.
So using the rack technique we will see in detail how to do that.
But in short, what the LM application is doing is first it divides in the data into small segments.
Then it will convert the small segments into numbers.
And finally it will load these numbers into a vector database.
We will see that these numbers are called embeddings.
We will see that later.
And then when you ask something to the LM application this question is called query.
So when you ask something to the LM application, this LM application goes to the vector database and
searches for data that only answer your question.
So it is going to use a technique called semantic similarity search.
We'll see more about that later.
So when using the rack technique it is said that the ability to speak comes from the foundation LM the
specific knowledge comes from the vector database.
In other words, the foundation NLM acts like a person who knows how to speak, but it is not familiar
with your data.
And the vector data base acts as the expert knowledge that you add to that foundation LM to make it
behave like a person who knows how to speak about your data.
So we will see that in the LM applications.
We are using LM models like ChatGPT in order to be able to.
Have a conversation.
But these foundation models like ChatGPT do not have the ability to a store private data.
A.
So we will use another tool out of the foundation.
LM a call vector database to store the data.
And we will store the data, the data in a way that can be searched very quickly.
So when the LM application searches data from a vector database, instead of reviewing all the data
in the vector database, it only goes to the data that are that is associated with the question the
user has made.
So it only looks for things that are similar to the question.
The user has a answer.
So this is what we call a similarity.
Semantic similarity search.
You will see more about that later.
Okay.
So some basic concepts about a drag technique.
One interesting note we can make here in this introduction is a talk a little bit about what is called
in-context learning.
Why?
Because you will see in some other courses that there is some confusion between drag and in-context
learning.
So with the rack technique, we divide our data into small segments, thus allowing the LM to use them
within the limits of its context window.
This is the technique remember, used today by almost all LM applications in some media.
In some other courses.
The rack technique is confused with the In-context learning techniques.
Technique.
Next we will clarify the difference between the two.
This clarification is only relevant if a student had this question.
Otherwise it is irrelevant, a mere theoretical matter.
So if you have heard about in-context learning, or you have a confusion between the concepts of rag
and in-context learning, this can be interesting for you.
So with the Rag technique, our goal is going to be to combine information retrieval capability with
language generation to answer questions using external information.
The rack technique uses a retrieval system to search for relevant documents or text snippets in a database.
It then uses a generator model to formulate an answer based on the retrieval retrieve snippets.
For example, if you ask a rack model about a specific topic, it will first search its database, its
database to find relevant information, and then use that information to generate a coherent answer.
In the case of the in-context learning technique, the goal is to adapt a pre-trained model to specific
tasks by providing examples in the input context.
The mechanism in the In-context learning technique is.
That the model is not retrained.
Instead, a context is provided that includes example of the desired task, and the model is expected
to generalize from that context to respond appropriately.
For example, with models like ChatGPT or ChatGPT for, you can provide translation examples in the
input context and then ask a translation question without providing the example explicitly.
So.
The in chat GPT, for example, we can enter a prompt saying English hello, Spanish, hola, and then
ask a translation question without providing the example explicitly.
In summary, In-context learning is based on providing examples in the input context to guide the model
in the desired task.
Rag combines information retrieval with language generation to answer questions using external data.
Both techniques seek to enhance the ability of language models to adapt to specific tasks and provide
informed answers.
However, they use different approaches and mechanisms to achieve this.
So in short, whenever you.
Read or listen.
That rack technique and in-context learning technique are the same.
That is wrong.
In this program, we are going to be focused on the rack technique because this is the most used technique
in the LM applications right now.
This is going to be our focus and.
In this introduction, I wanted to finish with a note about the importance of the rack technique for
LM applications.
So.
Directing me right now is essential for creating LLM applications.
Essential.
And that's why we are going to focus on mastering this technique.
So it is crucial.
It is a core component of most LLM applications, the rack technique.
That's why we are going to focus our attention on it in this program.
So in this lesson.
We were just talking theory.
I know it's a little bit messy, and I don't like the approach of, uh, too much theory, you know,
uh, in the at this point.
But we thought it was interesting to just, you know, uh, start talking about some concepts that we
are going to be finding in the next lessons.
And in the case of the In-context learning, some students have a posted this, uh, question to us,
and it was important for us just to clarify it from the beginning.
The main technique we use in LLM application is the Rag technique, which is slightly different from
in-context learning.
So do not confuse both of them.
They are different.
And the focus of this program is going to be in the most used technique in LLM applications, which
is the Rag technique.
In the next lesson, we are going to talk in more detail about the components of the rack technique.
We are still going to be talking in theory in a conceptual way, because it is important for you to
understand what we are going to do before going into the practical side of it.