LLM (Large Language Model): How They Work and What They Are Good For

· by Pavel Kiyatkin · Beginner

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

What they are bad at (without help)

Choosing a model in 2026

Use caseRecommended class
Customer-facing chat, max qualityClaude Opus, GPT-5, Gemini Ultra
Production volume, balanced costClaude Sonnet, GPT-5 mini, Gemini Pro
On-device / low latencyLlama 3.x 8B, Qwen 2.5 7B, Phi-4
Code generationClaude Sonnet, GPT-5, DeepSeek-Coder
Multilingual non-EnglishGemini, Qwen, Claude — test on your locale
Russian-specificYandexGPT, 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?”