# What is AI?
![[graph-example.png|400]]
### How are models used by chatbots?
When someone types a question (also known as a "prompt") to a chatbot like ChatGPT or Copilot, the program takes both the question text and its model and uses them to generate output.
Let's use the following question as an example:
> How far is it between London and New York?
The model has connections between `how far` and `distance`, and between `New York`, `London` and actual figures.
ChatGPT is not calculating the distance, or searching for the information online. The information has been taken from the internet and stored within the model.
#### An example: how "likelihood" can fail
It's easier to understand how chatbots and large language models work when we see **how they fail**.
There is a famous "riddle" about a doctor:
> A father and son are in a car accident. The father sadly dies. The son is rushed to the hospital.
>
> When they arrive, the doctor says "I cannot treat this patient, he is my son.
>
> How can this be?
This old "riddle" plays on dated stereotypes that only men can be doctors, so people historically would not be able to see that the doctor is the son's mother.
ChatGPT's training data contains a **huge number of examples of this riddle**. So when we type in the riddle to ChatGPT, it outputs text matching the "answer".
However, **what happens when we flip the genders** in the question?
Human input:
> There's an accident, a mother and daughter are involved in a car crash. The mother is killed. When the daughter is rushed to the hospital, the doctor treating them says "I cannot treat this patient, she is my daughter." How can this be?
ChatGPT's output:
> Program output:
>
> There are multiple valid explanations because the riddle doesn't specify the family relationships in detail. One straightforward answer is:
>
> - The woman who died in the crash was the daughters adoptive or stepmother.
> - The doctor is the daughter's biological mother, so when she says, "I cannot treat this patient, she is my daughter," she is telling hte truth.
>
> Another equally valid possibility is:
>
> - The girl has two mothers. The mother who died in the car crash is one parent, and the doctor is her other mother.
>
> This is a variation of a famous riddle that originally used a father/son scenario and was intended to expose the stereotype that daughters are male. In your version, changing "son" to "daughter" means there isn't a single unique solution, so any explanation consistent with the facts works.
For a human, the simplest answer is that the doctor is father of the girl.
When a human reads the riddle, they build a logical model of the scenario in their brain.
LLMs do not "understand" the world in the way humans do. The model the likelihood of words appearing near each other. In this case, because in all the training data the doctor is the mother in the riddle, that likelihood overrides our question that implies the opposite.