LLM System InterviewHao Hoang · First edition, 2026Home

Notation and Symbols

This chapter standardizes the symbols, abbreviations, and conventions used throughout the book. Definitions are precise; where a symbol carries multiple meanings in the literature, the book’s chosen convention is stated explicitly. Units are always written out on first use in each chapter; the table below lists the canonical forms.

Model and Architecture

Symbol Meaning Notes
PP Total parameter count e.g. P=7×109P = 7 \times 10^{9} for a 7B model
LL Number of transformer layers (depth)
dd Hidden / residual stream dimension also written dmodeld_{\text{model}}
dmodeld_{\text{model}} Hidden dimension (explicit form) synonym for dd
dheadd_{\text{head}} Attention head dimension typically 128
dffd_{\text{ff}} Feed-forward (MLP) intermediate dimension ⌊8d/3⌋\lfloor 8 d / 3 \rfloor for SwiGLU; 4d4 d for ReLU/GeLU
NN Number of query attention heads
NkvN_{\text{kv}} Number of key-value heads Nkv=NN_{\text{kv}} = N (MHA); Nkv<NN_{\text{kv}} < N (GQA/MQA)
HH Head dimension; also dheadd_{\text{head}} context disambiguates
HQH_{Q} Query head count used in GQA ratio HQ/HKVH_{Q} / H_{K V}
HKVH_{K V} Key-value head count HKV=1H_{K V} = 1 (MQA); HKV=HQ/GH_{K V} = H_{Q} / G (GQA)
GG GQA group size (N/NkvN / N_{\text{kv}}) reduction factor for KV cache
VV Vocabulary size tokens in the tokenizer
SS Sequence length in tokens also written TT in some chapters
TT Sequence length in tokens synonym for SS; also used for training tokens
KeK_{e} Expert utilization rate in MoE fraction of experts activated per token
rr LoRA rank dimension of low-rank adapters

Training and Optimization

Symbol Meaning Notes
CC Total compute budget (FLOPs)
CfwdC_{\text{fwd}} FLOPs for one forward pass ≈2NTP\approx 2 N_{T} P
CstepC_{\text{step}} FLOPs for one training step ≈6NTP\approx 6 N_{T} P (fwd + bwd)
NTN_{T} Total tokens in a batch: B×TB \times T
DD Training dataset size (tokens)
D∗D^{\ast} Chinchilla-optimal token count D∗≈20PD^{\ast} \approx 20 P at compute-optimal
N∗N^{\ast} Chinchilla-optimal parameter count
η\eta Learning rate
α\alpha Adam β1\beta_{1} decay (first moment) or generic scaling coefficient
β\beta Adam β2\beta_{2} decay (second moment); also KL penalty coefficient context disambiguates
ϵ\epsilon Adam numerical stability term; also PPO clip ratio tolerance
mtm_{t} Adam first moment (mean) at step tt
vtv_{t} Adam second moment (variance) at step tt
μ\mu Momentum coefficient; also mean of a distribution
γ\gamma Gradient clipping threshold; also discount factor in RL
λ\lambda L2 regularization weight; also GAE discount in RL

Inference and Serving

Symbol Meaning Notes
BB Batch size (number of concurrent sequences)
Bmax⁡B_{\max} Maximum batch size given VRAM ⌊(MGPU−Mweights)/Ckv⌋\lfloor ( M_{\text{GPU}} - M_{\text{weights}} ) / C_{\text{kv}} \rfloor
B∗B^{\ast} KV-crossover batch size Mweights/CkvM_{\text{weights}} / C_{\text{kv}}; throughput shifts from superlinear to sublinear
CkvC_{\text{kv}} KV cache memory per sequence 2×L×Nkv×H×S×22 \times L \times N_{\text{kv}} \times H \times S \times 2 bytes (bf16)
CseqC_{\text{seq}} KV cache memory per sequence (alternate notation) synonym for CkvC_{\text{kv}}
MweightsM_{\text{weights}} Model weight memory 2P2 P bytes in bf16
MGPUM_{\text{GPU}} Total GPU VRAM e.g. 80 GB for H100 SXM
tstept_{\text{step}} Decode step latency (Mweights+B⋅Ckv)/( M_{\text{weights}} + B \cdot C_{\text{kv}} ) /BW
TPS Tokens per second (throughput) aggregate across all concurrent sequences
TTFT Time to first token prefill latency; compute-bound
TBT Time between tokens (decode latency) per-token; memory-bandwidth-bound
TPOT Time per output token synonym for TBT
ITL Inter-token latency synonym for TBT / TPOT
πθ\pi_{\theta} Policy (language model) parameterized by θ\theta used in RLHF/RL chapters
πref\pi_{\text{ref}} Reference policy (frozen pre-RLHF model)
rϕr_{\phi} Reward model parameterized by ϕ\phi
θ\theta Model parameters (generic)
GG Number of rollouts per prompt in GRPO distinct from GQA group size GG; context disambiguates
A^i\hat{A}_{i} Group-normalized advantage for response ii GRPO: (ri−μR)/σR( r_{i} - \mu_{R} ) / \sigma_{R}
yw,yly_{w} , y_{l} Preferred / rejected response in a preference pair DPO/RLHF notation

Hardware and Performance

Symbol Meaning Notes
BW Memory bandwidth (HBM) GB/s or TB/s
MFU Model FLOPs Utilization achieved FLOP/s ÷\div peak FLOP/s; target ≥0.4\geq 0 . 4
MBU Memory Bandwidth Utilization achieved BW ÷\div peak BW
PattnP_{\text{attn}} Parameters in attention layers ≈4d2\approx 4 d^{2} per layer (MHA)
PmlpP_{\text{mlp}} Parameters in MLP layers 3ddff3 d d_{\text{ff}} per layer (SwiGLU)
Br,BcB_{r} , B_{c} FlashAttention tile (block) sizes for rows and columns SRAM tile dimensions
Ak,BkA_{k} , B_{k} Left and right matrix tiles in tiled GEMM
twavet_{\text{wave}} Time to execute one SM wave GPU scheduling unit
NtotalN_{\text{total}} Total expert count in MoE
NactiveN_{\text{active}} Active experts per token in MoE Nactive≪NtotalN_{\text{active}} \ll N_{\text{total}}

Alignment and Post-Training

Symbol Meaning Notes
DKL(⋅∥⋅)D_{\text{KL}} ( \cdot \| \cdot ) Kullback-Leibler divergence
DKL(πθ∥πref)D_{\text{KL}} ( \pi_{\theta} \| \pi_{\text{ref}} ) Policy drift from reference regularization term in RLHF/DPO
σ\sigma Standard deviation; also sigmoid activation context disambiguates
p,qp , q Generic probability distributions
xx Input token sequence
i,j,ki , j , k Generic indices

Common Abbreviations

Term Meaning
MHA Multi-Head Attention
GQA Grouped-Query Attention
MQA Multi-Query Attention (GQA with Nkv=1N_{\text{kv}} = 1)
MLA Multi-Head Latent Attention
KV cache Key-Value cache stored between decode steps
HBM High-Bandwidth Memory (GPU DRAM)
SRAM Static RAM; on-chip shared memory / L1 cache
SM Streaming Multiprocessor (GPU compute unit)
FLOP Floating-point operation (one multiply-add =2= 2 FLOPs)
MFU Model FLOPs Utilization
TP Tensor Parallelism (intra-layer, intra-node)
PP Pipeline Parallelism (inter-layer, inter-node)
DP Data Parallelism
ZeRO Zero Redundancy Optimizer (stages 1-3)
FSDP Fully Sharded Data Parallelism (ZeRO stage 3 in PyTorch)
SFT Supervised Fine-Tuning
RLHF Reinforcement Learning from Human Feedback
DPO Direct Preference Optimization
PPO Proximal Policy Optimization
GRPO Group Relative Policy Optimization
RLVR Reinforcement Learning from Verifiable Rewards
LoRA Low-Rank Adaptation
QLoRA Quantized LoRA
PEFT Parameter-Efficient Fine-Tuning
MoE Mixture of Experts
CoT Chain of Thought
BF16 Brain Float 16 (1 sign, 8 exponent, 7 mantissa bits)
FP16 IEEE Float 16 (1 sign, 5 exponent, 10 mantissa bits)
INT8 8-bit integer quantization
SLO Service Level Objective
QPS Queries per second

Conventions

  • Tokens vs. sequences. “Tokens” refers to individual vocabulary elements; “sequence” or “context” refers to an ordered list of tokens. Batch size BB counts sequences, not tokens; NT=B×TN_{T} = B \times T counts tokens.

  • FLOPs counting. One multiply-accumulate (MAC) operation =2= 2 FLOPs. The formula Cfwd≈2NTPC_{\text{fwd}} \approx 2 N_{T} P follows this convention. “FLOP/s” (floating-point operations per second) uses the same factor.

  • Memory units. 11 GB =109= 10^{9} bytes throughout (SI prefix, not binary). Bandwidth is reported in GB/s or TB/s.

  • Latency units. Milliseconds (ms) for per-token and per-request latencies; seconds (s) for end-to-end generation time; microseconds (μ\mus) for kernel-level timings.

  • Throughput units. Tokens per second (tok/s or tokens/s) for generation throughput; queries per second (QPS) for request-level throughput.

  • Precision notation. Memory footprints assume bf16 (2 bytes/parameter) unless otherwise stated. The training-memory figure of 16P16 P bytes assumes AdamW in fp32.

  • Prefill vs. decode. Prefill encodes the full prompt in one parallel forward pass (compute-bound). Decode generates tokens one at a time in an autoregressive loop (memory-bandwidth-bound). These two phases have distinct bottlenecks and optimizations.

  • Latency vs. throughput. TTFT optimizes differently from aggregate TPS. Minimize TTFT with small batches and fast prefill hardware; maximize TPS with large batches and high memory bandwidth. A single serving configuration cannot simultaneously optimize both without workload-specific scheduling.

  • Overloaded symbols. GG denotes both the GQA group size and the GRPO rollout count; TT denotes both sequence length and training token count; β\beta denotes both the Adam second-moment decay and the KL penalty coefficient. In each case, context and the surrounding equation make the intended meaning unambiguous.