A large language model (LLM) is a neural network trained to predict the next token in a sequence. A token is a small piece of text. During generation, the model reads the prompt, assigns a probability to each possible next token, chooses one, and repeats the process.
The model does not look up a complete answer stored in a database. Its training has encoded patterns about language, facts, code, and common reasoning into its weights. This lets it produce useful text, but it can also produce a fluent answer that is wrong. Chat models receive extra training after basic text prediction so they can follow instructions, use tools, and respond like assistants.
Rewriting in plainer words…
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.