How Large Language Models Work, Explained Without Maths
ChatGPT, Claude, Gemini, Llama, Mistral, DeepSeek — all of them are large language models (LLMs). Under the brand names they work in a very similar way. Once you understand the core idea, a lot of their strange behaviour starts to make sense.
Step 1: Text Becomes Tokens
Models do not read words. They read tokens — chunks of text that are often a word, part of a word, or punctuation. "Unbelievable" might become un + believ + able.
Why should you care? Because:
- Pricing is per token
- Context limits are measured in tokens
- Roughly, 1,000 tokens is about 750 English words. Indian languages written in their own scripts usually use more tokens per word.
Step 2: Training = Predicting the Next Token
During training, the model sees trillions of tokens of text and plays one game over and over:
Given everything so far, what token comes next?
Every time it guesses wrong, its internal numbers (called parameters or weights) are nudged slightly. After enough rounds, the model has absorbed grammar, facts, reasoning patterns, coding styles, and much more — all as a side effect of getting good at predicting the next token.
Step 3: Making It Helpful
A raw "next token predictor" is not a good assistant. It might continue your question with more questions. So companies do further training:
- Instruction tuning — training on examples of good question-and-answer pairs
- Reinforcement learning from feedback — humans (and other models) rate answers, and the model learns to prefer the better ones
- Safety training — teaching it to decline harmful requests
Step 4: Generating an Answer
When you send a prompt, the model predicts one token, adds it to the text, then predicts the next, and so on. That is why responses stream in word by word.
There is a small amount of randomness (controlled by a setting called temperature). Higher temperature means more creative, less predictable answers.
The Context Window
The model can only "see" a limited amount of text at once — its context window. Modern models handle hundreds of thousands of tokens, enough for whole books or codebases. But anything outside the window does not exist for the model. That is why long chats sometimes "forget" early details.
Why Models Hallucinate
The model is optimised to produce plausible text, not verified text. If it does not know a fact, the most plausible-sounding continuation may still be wrong. Newer models are much better at saying "I'm not sure", and tools like web search reduce this further, but it never goes to zero.
Reasoning Models
Since 2024, many models can "think" before answering — writing out internal steps before giving a final answer. This greatly improves maths, coding, and planning tasks, at the cost of more time and more tokens.
Key Takeaways
- LLMs are next-token predictors trained on huge amounts of text
- Fine-tuning turns them into helpful assistants
- Context windows define what they can see right now
- Fluent does not mean correct — always verify what matters