The short version
A language model estimates the next token given the tokens that came before it. Modern large language models use Transformer networks to build contextual representations and produce a probability distribution over possible next tokens.
The core pipeline
Text is split into tokens. Tokens become vectors called embeddings. Self-attention lets each position compare itself with other positions, while feed-forward layers transform the resulting representation. Repeating these blocks creates a powerful sequence model.
During pretraining, the model predicts missing or next tokens over a very large corpus. Instruction tuning and preference optimization then make the model more useful for conversations and tasks.
What engineers must remember
A fluent answer is not proof of truth. Production systems need retrieval, tool use, structured validation, evaluation, monitoring, and clear data boundaries.