In this lesson we are going to talk about what are hallucinations?
So as you saw in the previous lesson, hallucinations are fake responses from an LM.
And the big problem with hallucinations is that they seem legit.
They seem correct.
So, uh, hallucination is a fake answer from an LM, and it's very important to understand that an
LM is not an intelligent being, but a statistical model trained to predict the most likely next word
in a sentence.
The accuracy level of an LM depends on the quality and quantity of data with which it has been trained.
LMS have very high accuracy levels.
When asked about the subjects on with which they have been trained.
The main problem with hallucinations is that the LM states them in a way that seems true.
How can hallucinations be reduced?
We are going to talk about two ways to very basic ways to reduce hallucinations.
The first one is changing the temperature of the LM.
Probably you are familiar with this concept if you have used ChatGPT.
So what is called the temperature of an LM regulates the level of creativity in their answers.
For example, ChatGPT s temperature can be regulated between 0 and 10.
The higher the temperature, the more creativity and the more hallucinations you may find.
This can be good for having the LM write a fiction story, for example, and the lower the temperature,
the less creativity and less hallucination you are going to find.
This is good for having the LM answer specific questions, so you will learn how to change the temperature
of an LM.
And you will learn to understand why.
It is good to have a very creative LLM and why one when it is good to have a very.
Not creative.
LM very precise.
LM in the responses.
Okay, so whenever you want the LM to.
Tell stories, you know, invent a new brand for you, whatever.
You will like to have a high temperature when you want accurate, precise responses, which is going
to be most of the times you want to have the temperature of your LM as lower as possible.
The second way to reduce hallucination is to improve your prompts.
This is what is called prompt prompt engineering.
So, for example, a very effective way is to include examples of correct questions and answers in your
prompt so that the LM knows what it should and should not do.
Okay.
So in your prompt you can tell ChatGPT or your LM.
Examples of right questions and right answers, or wrong questions and wrong answers.
So ChatGPT understands.
Okay, this is the way I should follow in order to prepare my, uh, my, uh, answer or this is not
the way I should follow.
Okay?
So in this lesson, we have been talking a little bit more about hallucinations and how to reduce them.
Hallucinations are a very important problem for LM app developers, so it's very important to be very
aware of them and the techniques that can reduce them.
In the next lesson, we are going to start talking about a very, very important subject in this second
part of the program, which is the architecture of an LM application.