Artificial Intelligence Commonsense
A language model is a function from a sequence of tokens to a distribution over the next token. The names around that function are filed by what each thing is. When two things interact, the sentence says so and leaves each one in its own domain. The first seven domains are kinds of things. The eighth names labs, products, and providers, and that list changes faster than the kinds do.
1. Hardware and compute
A GPU runs the same arithmetic on many numbers at once. Matrix multiplication is that kind of work, which is why these models train and run on GPUs. A CPU remains in the machine and runs the program that feeds the GPU. Tensor cores are the hardware units inside recent NVIDIA GPUs that perform low-precision matrix multiplications.
Memory, bandwidth, and compute
Three quantities inside one GPU decide whether a run fits and how fast it goes.
Memory capacity is how many bytes the card holds at once. During a training step those bytes are occupied by parameters, gradients, optimizer state, and activations. Parameters belong to the model. Gradients and optimizer state belong to training. Activations are the intermediate results of a forward computation, retained so the backward pass can form gradients. They grow with the batch and the sequence length. During inference the optimizer state is absent, and a KV cache grows in its place.
Memory bandwidth is how fast those bytes move between memory and the arithmetic units. On data-center training cards the memory is HBM, high-bandwidth memory, stacked beside the chip. Consumer cards use GDDR instead. An operation that does little arithmetic per byte it moves spends its time waiting on bandwidth. A large matrix multiplication does a great deal of arithmetic per byte and spends its time waiting on the arithmetic units. The ratio is called arithmetic intensity.
Compute is how many floating-point operations the chip can finish per second. A FLOP is one addition or one multiplication. FLOP/s is a rate, and TFLOP/s is $10^{12}$ of them per second. Datasheet peaks assume a large matrix multiplication in the format the chip is best at. MFU, model FLOPs utilization, is the rate measured on a real run divided by that peak. An MFU near one half is a strong training run. The rest is small kernels, data movement, and time spent waiting on other GPUs.
Once the model spans several GPUs, a fourth limit appears: the interconnect. NVLink carries bytes between GPUs in one machine, and on the newest racks across the whole rack. A network such as InfiniBand carries bytes between machines. Mixture-of-experts models use this fabric heavily, because different experts live on different GPUs.
Numeric formats
A floating-point number spends its bits on a sign, an exponent, and a mantissa. The exponent sets the range. The mantissa sets the resolution. Fewer bits means each value occupies less memory, and a tensor core can usually perform more of those operations per second. The risk is a range too narrow, or a mantissa too coarse to separate nearby values. Training chooses among these formats in the mixed-precision procedure below. Serving may narrow them further, which is quantization.
fp32 uses 32 bits, four bytes. It is the traditional scientific default, specified by IEEE 754.
fp16 uses 16 bits. Its range is narrow enough that a value such as $10^{-8}$ rounds to zero. Training becomes unstable when gradients vanish that way.
bf16, brain float, also uses 16 bits. It keeps the range of fp32 and spends fewer bits on the mantissa. Language-model work tolerates the coarser resolution.
fp8 uses 8 bits. Two layouts are common. E4M3 spends more bits on the mantissa and has a smaller range. E5M2 does the reverse. Ada and Hopper tensor cores multiply matrices in fp8.
NVFP4 uses 4 bits per value, laid out as E2M1. Four bits name only a short list of levels. A scale shared by a block of 16 values, itself stored in fp8, places that list at a magnitude, and a neighboring block can carry a different scale. A second scale in fp32 covers the whole tensor. Blackwell tensor cores run this format. NVFP4 is NVIDIA’s own format. MXFP4 is the vendor-neutral relative, with blocks of 32 and a coarser power-of-two scale.
Architectures and products
The architecture is the chip generation. The product is how that chip is packaged and sold. Hopper is an architecture. An H200 is a product in that architecture. A DGX is a server that contains such products.
- Ampere is the generation of the A100. The GeForce RTX 30 series uses the same architecture in consumer cards.
- Ada Lovelace is the generation of the GeForce RTX 40 series, and of inference cards such as the L40S.
- Hopper is the generation of the H100 and the H200. The H200 keeps the H100’s compute and widens the memory.
- Blackwell is the generation of the B200, of the GB200 rack, of the GeForce RTX 50 series, and of the current RTX Pro workstation cards.
- Rubin is the generation after Blackwell. Its first systems, Vera Rubin, pair Rubin GPUs with NVIDIA’s Vera CPU and began shipping to customers in mid-2026. Rubin Ultra is planned for 2027.
GeForce RTX is the consumer line. The RTX 50 series is Blackwell, with GDDR memory. RTX Pro is the workstation line. DGX is a server product. A DGX B200 contains eight B200 GPUs. Earlier machines in the same family were the DGX A100 and the DGX H100.
The data-center cards of the last few years, as dense tensor-core peaks. Datasheets often print twice this number under a sparsity footnote. The table uses the dense half.
| H100 SXM | H200 SXM | B200 | |
|---|---|---|---|
| Generation | Hopper | Hopper | Blackwell |
| Memory | 80 GB HBM3 | 141 GB HBM3e | 180 GB HBM3e |
| Bandwidth | 3.35 TB/s | 4.8 TB/s | about 8 TB/s |
| Dense bf16 | 989 TFLOP/s | 989 TFLOP/s | 2,250 TFLOP/s |
| Dense fp8 | 1,979 TFLOP/s | 1,979 TFLOP/s | 4,500 TFLOP/s |
| Dense fp4 | 9,000 TFLOP/s | ||
| NVLink per GPU | 900 GB/s | 900 GB/s | 1.8 TB/s |
A B200 draws about 1000 W, against up to 700 W for an H100 SXM. An eight-GPU DGX B200 is still air-cooled, at about 14.3 kW for the whole system. The rack-scale systems below are liquid-cooled. Relative to the H100 it has more than twice the memory bandwidth, a bit over twice the dense bf16 and fp8 peaks, native fp4, and fifth-generation NVLink at twice Hopper’s per-GPU rate.
The larger step is how the GPUs are grouped. A GB200 NVL72 connects 72 Blackwell GPUs and 36 Grace CPUs in one NVLink domain, so a rack behaves as one large accelerator. Blackwell Ultra (B300, and the GB300 rack) keeps that NVLink, raises memory to 288 GB, and raises the fp4 peak further. Vera Rubin keeps the rack-scale design and moves to HBM4.
Other chips occupy the same role, and each runs the matrix multiplications.
- Google’s TPU is a matrix accelerator that Google designs for its own training and rents through Google Cloud. Gemini is trained on TPUs.
- AMD’s Instinct GPUs, such as the MI300 series, are the most direct competitor to NVIDIA’s data-center cards.
- Amazon’s Trainium is a training chip available only inside AWS.
- Cerebras builds one chip the size of a whole wafer and sells it mainly as fast inference.
- The GPU in Apple silicon shares one pool of memory with the CPU, which lets a laptop hold a large model.
NVIDIA’s software ecosystem remains the deepest, which is why this course and these notes assume NVIDIA hardware. The software that reaches each chip is in the next section.
2. Computing software
A kernel is a program the GPU applies to many elements at once. CUDA is NVIDIA’s platform for writing and launching those programs on its GPUs. Triton is a Python-like language for writing kernels. ROCm is AMD’s platform for the same job on Instinct GPUs. MPS, Metal Performance Shaders, is Apple’s GPU framework. PyTorch’s mps backend reaches an Apple silicon GPU through it.
PyTorch is a Python library of tensors, automatic differentiation, and GPU execution. A script builds tensor operations. Calling .backward() fills the gradients, which the training step described later relies on. PyTorch launches CUDA kernels on NVIDIA GPUs. einops is a small library that names the axes of a tensor in Einstein-summation style. It works with PyTorch, NumPy, and JAX alike.
TensorFlow is Google’s earlier library for the same job. It was the default research and production tool in the late 2010s, and it remains in industrial systems.
JAX is the third library that shows up in research code, also from Google. It is organized around transformations of functions: differentiation, compilation, and parallel maps. It is the usual way to write a program for TPUs.
3. Data and representation
Unicode assigns an integer code point to each character. ASCII is the block of those code points from 0 to 127: English letters, digits, and the old control codes. UTF-8 is the encoding that turns a code point into bytes. An ASCII character occupies one byte in UTF-8. A character outside that block can occupy several.
A tokenizer turns that byte sequence into integer IDs. The usual method is byte-pair encoding, BPE: it starts from the 256 possible bytes and repeatedly merges the most frequent adjacent pair into a new token, until the vocabulary reaches a chosen size. An embedding turns each ID into a vector. From the embedding on, a model is linear algebra plus a few nonlinearities.
A dataset is the collection of sequences a later training run reads. A pretraining corpus is large and broad. A post-training corpus is smaller and curated. The dataset is the data. The training procedure that consumes it is a separate domain.
Multimodal encoding uses the same shape for images, audio, or video. A separate encoder turns each medium into tokens or vectors, and the model attends over the combined sequence. Audio is often first compressed by a neural codec into discrete tokens, so a language model can predict it the way it predicts text.
4. Model architecture
A parameter is one real number training is allowed to change. A “70B model” has about $7 \times 10^{10}$ of them, stored in matrices. Published model sizes count these numbers.
A Transformer is a stack of blocks. Each block has two parts. An MLP, a multilayer perceptron, is a stack of matrix multiplications with a nonlinearity between them. GPT-2 used GELU. Current models mostly use SwiGLU, which multiplies two parallel projections, one of them passed through a gate. The MLP applies the same function at every position and processes one token on its own. Attention is the other part. Each token mixes information from other tokens in the sequence. Attention computes a query, a key, and a value for each token. A token’s query is compared with every key it may see, and the resulting weights mix the values. Storing the keys and values across later steps is the KV cache, which belongs to inference.
Each part sits on a residual connection: its output is added back to its input, so the block refines a running vector rather than replacing it. Each part also begins with a normalization, usually RMSNorm, which rescales the vector to a steady size. Attention alone does not know token order. RoPE, rotary position embedding, rotates each query and key by an angle that depends on its position, so the comparison between two tokens depends on how far apart they are.
- MHA, multi-head attention, keeps a separate key and value projection for every head. This is the 2017 form.
- GQA, grouped-query attention, lets several heads share key and value projections. MQA, multi-query attention, is the extreme case: all heads share one.
- MLA, multi-head latent attention, compresses the keys and values into a smaller latent and rebuilds them when needed. DeepSeek’s models are the reference for this form.
A mixture of experts (MoE) replaces the single MLP with many MLPs, called experts. A small router scores the token and runs only a few experts. DeepSeek-V3 is one instance: it stores 671 billion parameters and uses about 37 billion of them on each token. Compute follows the experts that run. Memory follows every expert, because the ones that sit idle still occupy the GPU.
A dense model applies every parameter to every token. An MoE model stores more than it applies.
Mamba is a different layer. It keeps a running state and updates that state as tokens arrive, so its cost grows linearly with the length of the sequence. Attention can let every token look at every other token, and that cost grows with the square of the length. A hybrid model stacks mostly Mamba layers, a few attention layers, and often a mixture of experts. Nemotron 3 is one such model. The Transformer is the architecture to understand first.
5. Training and optimization
A training step shows the model a batch of sequences from a dataset. The loss measures how far the predicted next-token distribution is from the token that actually followed. The gradient is the derivative of that loss with respect to every parameter. An optimizer turns gradients into updates of the parameters.
SGD steps each parameter in proportion to its gradient. Adam also keeps two running averages per parameter, one of the gradient and one of its square. AdamW is the form language-model papers mean by “we used Adam.” It applies weight decay directly to the parameters instead of folding it into the gradient. Muon is a newer optimizer for matrix-shaped parameters that orthogonalizes each update, and several recent large models were trained with it. Those averages are the optimizer state. They sit beside the parameters during training. PyTorch’s .backward() is what fills the gradients. The optimizer step that follows is the training method. The library that implements both is still just software.
Pretraining is the long first fit on a huge corpus. Post-training continues from a pretrained model. SFT, supervised fine-tuning, trains on curated examples of the desired responses. Preference methods follow. RLHF trains a reward model on human comparisons and optimizes against it. DPO fits the comparisons directly, with no separate reward model.
The largest recent change is reinforcement learning with verifiable rewards, RLVR. The reward comes from a check that can be run, such as a math answer or a passing test suite. GRPO, popularized by DeepSeek-R1, is one widely used algorithm for it. Models trained this way learn to write a long chain of reasoning before the answer. These are reasoning models. Spending more tokens on that reasoning at inference raises accuracy, and that spending is called test-time compute.
Mixed precision is a training procedure that uses more than one numeric format in the same run. The usual pattern keeps a master copy of the parameters in fp32, together with Adam’s averages, because both accumulate small changes across many steps, and a small update added to a bf16 number can round away entirely. The forward and backward computations run on a bf16 copy of the parameters, so activations and gradients are bf16. Where the hardware implements fp8 or fp4, the matrix multiplications can use those formats, with extra scaling work around an fp4 multiply.
A scaling law is a curve fitted to earlier runs, predicting loss from model size, data, and compute. Groups use it to choose a model before paying for the full training run. The Chinchilla result found that, for a fixed training budget, the best loss comes from roughly 20 training tokens per parameter. Current models are trained on far more tokens than that, because a smaller model trained longer is cheaper to serve.
For a stack of matrix multiplies, the forward computation costs about two floating-point operations per token per parameter, and the backward computation costs about twice that. Training on $D$ tokens with a model of $N$ parameters therefore costs about
$$C \approx 6ND$$floating-point operations. At short context the same count is a fair estimate for a Transformer. Long-context attention adds further cost. The forward half of that work is the same kind of computation inference runs on its own.
6. Inference and serving
The forward pass evaluates the model: tokens go in, and a distribution over the next token comes out. Training runs a forward pass and then a backward pass. Inference stops at the forward pass.
Decoding turns that distribution into a continuation. The procedure picks a token, appends it, and runs the forward pass again. Greedy decoding picks the most likely token. Sampling draws from the distribution, and a temperature sharpens or flattens it first. The KV cache stores the keys and values of tokens already seen, so the next step recomputes only the new token. Long conversations make the cache large. GQA and MLA, defined with attention, reduce how much must be stored.
A request runs in two phases. Prefill processes the whole prompt in one forward pass. It is a large matrix multiplication with high arithmetic intensity, so it waits on compute. Decode then produces one token per step. Each step reads every parameter and the whole KV cache to produce a single token, so it waits on memory bandwidth. Speculative decoding lets a cheap draft propose several tokens, which the full model checks in one pass.
Quantization stores a trained model’s numbers in a narrower format than the one used for most of training, so serving spends less memory and less bandwidth. The formats themselves, fp8 and NVFP4 among them, are hardware numeric formats. Quantization is the decision to deploy with them.
Batching groups independent requests into one forward pass so the GPU performs a larger matrix multiplication. It is what makes decode efficient: one read of the parameters serves every request in the batch. Continuous batching lets requests join and leave between steps. A training batch, by contrast, is the set of sequences that share one optimizer step. The same word covers both groupings. Only the training batch updates parameters.
Model serving is the running system that holds the parameters and answers requests. vLLM, SGLang, and TensorRT-LLM are common serving engines. An API, in the next section, is the interface that system exposes.
7. Applications and agents
An API is the interface a program uses to reach a model. A request carries text in, and the response carries text back. Tokenization happens on the provider’s side, and usage is billed by tokens. A lab publishes one for its own models. A cloud provider publishes others that front those models, or front models the caller brought. The provider, as a company and as a landlord of GPUs, is in the ecosystem section.
A harness is the program wrapped around a model that is allowed to act. It keeps the transcript and calls tools. Tool calling is the exchange in which the model requests a tool, the harness runs it, and the result returns to the model. Orchestration is the harness’s choice of the next step. Agentic programming is writing software whose control flow includes this loop.
Three neighboring names are different kinds of things:
- MCP, the Model Context Protocol, is a protocol. A server exposes tools and data sources. The harness calls them. Products may adopt the protocol. The protocol is the agreement, and the product is a separate thing. Anthropic introduced it in 2024.
- AGENTS.md is a project instruction. It is a markdown file in a repository that tells a coding agent how to build, test, and behave in that project. OpenAI introduced it in 2025. Both MCP and AGENTS.md are now stewarded by the Linux Foundation’s Agentic AI Foundation.
- SKILL.md is a reusable procedure. It packages one procedure for such an agent, including when the procedure applies. It belongs to Agent Skills, an open format Anthropic published in 2025 and donated to the same foundation in October 2026.
8. Industry and ecosystem
This domain names instances. A new lab or a renamed product is added here. The seven domains above stay put.
GPT is OpenAI’s model family. Claude is Anthropic’s. Gemini is Google’s. Grok is xAI’s. These are mostly closed: the weights stay with the lab, and the model is reached through an API. Llama (Meta), Qwen (Alibaba), and Gemma (Google) are open-weight families, published for anyone to download and run. Their recent generations use grouped-query attention, though some early models used MHA or MQA. Mistral, Kimi (Moonshot AI), GLM (Zhipu), and OpenAI’s gpt-oss are other open-weight lines. Command is Cohere’s family, aimed at enterprise use. Each of these names sits on a trained model, often a Transformer and often a mixture of experts, reached through an API and often through a harness. DeepSeek is the lab behind DeepSeek-V3, the instance of mixture-of-experts and latent attention cited above. Nemotron is NVIDIA’s model family. Nemotron 3 is the hybrid cited above, and Nemotron 3 Super was trained in NVFP4.
Amazon Web Services, Google Cloud, and Microsoft Azure rent GPUs for training and also host model APIs: Bedrock on AWS, Vertex AI on Google Cloud, Foundry on Azure. Smaller clouds such as CoreWeave rent GPUs only. Renting a machine is a hardware relationship. Hosting an API is an applications relationship. The company that sells both is the ecosystem entry.
A benchmark is a frozen set of tasks and a scoring rule, used to compare models. MMLU is the name readers meet first, but frontier models now score near its ceiling, so it no longer separates them. Current comparisons lean on harder sets: GPQA Diamond for graduate-level science, SWE-bench Verified for fixing real software issues, and Humanity’s Last Exam for expert questions. A benchmark saturates when models reach its ceiling, and it is contaminated when its questions leak into training data. LMArena is a different instrument: people compare two anonymous answers, and the votes form a ranking that is never frozen. A score is a result on a benchmark. The benchmark is the instrument.
A standard is a published agreement other implementations can follow. IEEE 754 specifies fp32 and fp16. bf16 is not part of IEEE 754; it began at Google and spread by adoption. The fp8 layouts and MXFP4 are published by the Open Compute Project as vendor-neutral specifications. NVFP4 is NVIDIA’s own documented format, not a standard. The widths themselves are defined with the hardware. MCP, defined with applications, is a protocol labs and tools adopt.