Entropy measures how surprising a distribution is on average, cross-entropy is the cost of coding data from p with a code built for q, and KL divergence is the excess over the optimum. A language model's training loss is cross-entropy; perplexity is its exponential.
Language modeling estimates the probability of a text and uses the chain rule to split it into a product of "predict the next token given the prefix"; training uses cross-entropy, evaluation uses perplexity, and the causal mask hides future tokens.
Start with a table of numbers, name the position and feature axes, and calculate a dot product and bias before running a linear layer in standard Python.
An LLM only processes integers: a tokenizer splits text into tokens with a subword algorithm such as BPE and maps them to ids, then each id is looked up in a vocabulary-size by hidden-size embedding table. Vocabulary size trades off sequence length, parameters and long-tail coverage.
A large language model (LLM) is a neural network, usually a Transformer, trained on huge amounts of text to predict the next token; pre-training, post-training and inference decoding turn it into an assistant that can chat, write code and reason.
For a fixed training budget, how big should the model be and how many tokens should it see? DeepMind's 400-model study says parameters and data should grow together (about 20 tokens per parameter); the 70B Chinchilla then beat the 280B Gopher at equal compute. Numbers re-checked here.
GPT-1, GPT-2 and GPT-3 are three scale-ups of one decoder-only Transformer; what changes is how a task reaches the model: fine-tuning, zero-shot text, or few-shot examples in the context. This page rechecks the papers' numbers and measures perplexity and in-context learning on GPT-2.
OpenAI's 2020 paper trained Transformers of 768 to 1.5 billion parameters on WebText2 and found that loss falls as a power law in parameters, data and compute, almost regardless of shape. At a fixed budget, grow the model first (size ∝ compute^0.73). A breakdown that checks the numbers.
BERT pre-trains a deep bidirectional Transformer encoder by restoring masked words, then adds one output layer per task and fine-tunes everything, setting records on 11 NLP tasks. It rechecks the paper's tables, parameter counts and training budget, and probes bert-base-uncased three ways.
Seq2Seq uses one deep LSTM to encode a variable-length input and another to generate output. Reversing source sentences improves optimization, reaching 34.8 BLEU on WMT14 English-French.