How does AI work?
Most modern AI is machine learning: a model is trained on large amounts of data to find patterns, then uses them to make predictions on new input. Chatbots are large language models that predict the next word, repeated many times, using billions of numeric settings tuned during training.
The full answer
Modern AI works by learning from examples instead of following hand-written rules.
1. Training. A model, which is a large mathematical function with billions of adjustable numbers called parameters, is shown huge amounts of data. Each time it predicts wrongly, the numbers are nudged so it does a little better next time. After many rounds it has captured patterns in the data.
2. Inference. When you use it, the trained model takes your input and produces an output, such as the next word of a reply, a label for an image or a generated picture. This running step is called inference.
3. Chatbots. Systems like ChatGPT, Gemini and Claude are large language models. They turn text into numbers, predict the most likely next piece of text, add it, and repeat. Further training with human feedback makes the answers more helpful and safer.
The model does not look up a stored answer or reason like a person, which is why it can sound sure and still be wrong. That is hallucination, and it is why checking important answers matters.