LLM (Large Language Model): How They Work and What They Are Good For
A large language model (LLM) is a neural network — usually a transformer — trained to predict the next token in a sequence of text. Scale (billions of parameters, trillions of tokens) makes prediction good enough to look like understanding.
What “predict the next token” actually means
Text is split into tokens (subword units, ~4 chars on average for English). The model takes a sequence of tokens and outputs a probability distribution over the next token. Generation is iterative: sample one token, append it, predict the next.
That’s the whole training objective. Everything emergent — translation, code generation, reasoning, instruction following — comes from scale + data + a few alignment tricks (RLHF, constitutional AI) on top.
The transformer in one paragraph
A transformer processes all tokens in parallel using attention: each token computes a weighted average of all other tokens, where weights depend on learned similarity. Stack 30-100 attention layers, add feedforward layers between them, train on internet-scale text with next-token prediction loss. That’s an LLM.
What LLMs are good at
- Language fluency. Grammar, register, translation — extremely strong.
- Knowledge recall. Anything memorized during training (millions of facts, code patterns, recipes, papers).
- Pattern completion. “Here are 3 examples, do the 4th” works without retraining.
- Format transformation. JSON ↔ prose, code ↔ description, table ↔ markdown.
- Aggregation over long text. Summarization, extraction, classification.
What they are bad at (without help)
- Real-time facts. Knowledge cutoff. Use RAG for current data.
- Arithmetic and logic. Better, but unreliable. Use tools (calculator, code execution).
- Multi-step planning under uncertainty. Sometimes works, often loses the plot. Use agent frameworks with explicit state.
- Confident “I don’t know.” Models hallucinate before refusing. Calibrate with examples or guardrails.
- Truly novel reasoning. Mostly interpolate from training data; struggle with genuinely out-of-distribution problems.
Choosing a model in 2026
| Use case | Recommended class |
|---|---|
| Customer-facing chat, max quality | Claude Opus, GPT-5, Gemini Ultra |
| Production volume, balanced cost | Claude Sonnet, GPT-5 mini, Gemini Pro |
| On-device / low latency | Llama 3.x 8B, Qwen 2.5 7B, Phi-4 |
| Code generation | Claude Sonnet, GPT-5, DeepSeek-Coder |
| Multilingual non-English | Gemini, Qwen, Claude — test on your locale |
| Russian-specific | YandexGPT, GigaChat for compliance; Claude for quality |
The number-of-parameters trap
A 70B model is not always “better” than a 7B model. Recent small models trained on better data + better techniques often beat older large models on benchmarks and in production. Always evaluate on your actual workload — benchmark numbers are guidance, not ground truth.
The interesting question is no longer “which LLM is best?” but “which LLM, with which retrieval, on which infrastructure, with which guardrails, for this specific task?”