AI Infra
0%
Glossary

Glossary

AuthorChangkun Ou
Reading time~25 min

Professional terms used in the book, with their English originals, a one-line definition where one helps, and a link to where each term is first used. Each entry is linked from its first use in every chapter.

  • mixture-of-experts (MoE) 混合专家

    An architecture that replaces a dense feed-forward layer with many expert layers and routes each token to a few, so capacity grows without proportional compute.

  • multi-head latent attention (MLA) 多头潜在注意力

    An attention variant from DeepSeek-V2 that caches a low-rank latent in place of full per-head keys and values, claiming MHA-class quality at a small cache.

  • mid-training 中段训练

    A pretraining-like phase between broad pretraining and post-training, usually mixing specialized or higher-quality data while continuing next-token training.

  • key-value cache KV 缓存

    The stored keys and values of past tokens that let decode attend without recomputation; the memory cost that dominates serving.

  • scaling law 扩展律

    An empirical power law relating model loss to compute, parameters, and data, used to predict quality and allocate a training budget.

  • arithmetic coding 算术编码

    An entropy coder that encodes a whole message as a single fraction in [0,1), approaching the optimal bit rate; the bridge from prediction to compression.

  • two-part code 两部分编码

    An MDL encoding that sends the model first and then the data given the model; its total length formalizes the fit-versus-complexity trade.

  • minimum description length (MDL) 最小描述长度

    A formalization of Occam's razor: the best model is the one that most compresses the data plus itself; a lens on learning as compression.

  • temporal-difference 时序差分

    A reinforcement-learning update that bootstraps a value estimate from the next step's estimate rather than waiting for the final return.

  • evolution strategies 进化策略

    A black-box optimizer that perturbs parameters with noise and moves toward the higher-reward perturbations, needing no gradients.

  • next-token prediction 下一词元预测

    The pretraining objective of predicting the next token from the preceding ones; minimizing its cross-entropy is how a language model learns.

  • cross-entropy 交叉熵

    The loss measuring how many bits the model's predicted distribution wastes against the true next token; the quantity pretraining minimizes.

  • perplexity 困惑度

    The exponentiated cross-entropy, read as the model's average branching factor over tokens; lower means the model is less surprised by the text.

  • training tokens 训练词元

    The count of token instances fed to the model during pretraining, after tokenization and including repeats or epochs; it is data volume, not vocabulary size.

  • compute-optimal 计算最优

    The split of a fixed compute budget between model size and data that minimizes loss; the Chinchilla result that data should scale with parameters.

  • AdamW AdamW 优化器

    The default optimizer for transformers: Adam with weight decay decoupled from the gradient update.

  • warmup-stable-decay (WSD) 预热-稳定-衰减调度

    A learning-rate schedule with a warmup ramp, a long constant plateau, then a final decay; the plateau lets total training length stay open.

  • z-loss z-loss 正则

    A small auxiliary penalty on the log of the softmax normalizer that keeps logits from drifting, stabilizing the training of large models.

  • query-key normalization (QK-norm) 查询-键归一化

    Normalizing queries and keys before their dot product to cap attention-logit growth, a fix for training instability at scale.

  • gradient clipping 梯度裁剪

    Capping the gradient norm before an update so a rare oversized batch gradient cannot blow up training.

  • tokenizer 分词器

    The component that maps raw text to and from the integer token ids a model consumes; its vocabulary is fixed before training.

  • decontamination 去污染

    Removing from the training data any text that overlaps with evaluation benchmarks, so reported scores are not inflated by memorization.

  • MinHash 最小哈希

    A hashing scheme that cheaply estimates set similarity, used to find and remove near-duplicate documents in a training corpus.

  • locality-sensitive hashing (LSH) 局部敏感哈希

    Hashing that maps similar items to the same bucket with high probability, enabling approximate nearest-neighbor search and dedup at scale.

  • SentencePiece SentencePiece 分词器
    First occurrence: Chapter 7 · Tokenization

    A language-agnostic tokenizer that trains directly on raw text without pre-tokenization, treating the input including whitespace as one stream.

  • tokenizer-free 无分词器方案
    First occurrence: Chapter 7 · Tokenization

    An approach that drops a fixed vocabulary and models bytes or characters directly, trading tokenizer biases for longer sequences.

  • residual stream 残差流

    The vector carried unchanged down a transformer from embedding to output; each block reads it, computes a delta, and adds the delta back.

  • root mean square layer normalization (RMSNorm) 均方根层归一化

    A normalization that rescales activations by their root mean square only, dropping LayerNorm's mean subtraction and bias; cheaper and now the default.

  • Swish-gated linear unit (SwiGLU) Swish 门控线性单元

    The gated feed-forward layer in modern transformers, computing (Swish(xW1) ⊙ xV)W2; three matrices, the default since LLaMA.

  • rotary position embedding (RoPE) 旋转位置嵌入

    Position encoding that rotates query and key vectors by an angle set by position, so attention depends only on the relative offset between tokens.

  • prefill 预填充

    The first inference pass, reading the whole prompt at once to compute every token's keys and values; compute-bound and sets time to first token.

  • decode 解码

    The autoregressive pass after prefill, emitting one token per step against the cached keys and values; memory-bandwidth-bound and sets per-token latency.

  • FlashAttention FlashAttention 注意力内核

    An exact attention kernel that never writes the full score matrix to memory, making O(n²) attention affordable; it speeds compute but does not shrink the KV cache.

  • Zero Redundancy Optimizer (ZeRO) 零冗余优化器

    A data-parallel method that shards optimizer states, gradients, and parameters across devices instead of replicating them, cutting per-device memory.

  • fully sharded data parallel (FSDP) 全分片数据并行

    PyTorch's implementation of full parameter, gradient, and optimizer-state sharding, gathering each layer's weights only when needed.

  • continued pretraining 继续预训练

    Additional next-token training of an already pretrained model, often on a target domain; unlike mid-training, it may switch fully to that new distribution.

  • supervised fine-tuning (SFT) 监督微调

    Training a pretrained model on curated input-output examples so it follows instructions in a target format; the first post-training stage.

  • direct preference optimization (DPO) 直接偏好优化

    Aligning a model directly from preference pairs with a classification-style loss, skipping the separate reward model and RL loop of RLHF.

  • reinforcement learning with verifiable rewards (RLVR) 可验证奖励的强化学习

    RL where the reward comes from an automatic checker (a unit test, an exact answer) rather than a learned model, removing the learned reward model as a hacking surface; an imperfect checker can still be gamed.

  • diffusion 扩散

    A generative process that learns to reverse a gradual noising of data, turning pure noise into a sample step by step.

  • flow matching 流匹配

    Training a generative model by regressing a velocity field that transports noise to data along straight-ish paths; a simpler alternative to diffusion training.

  • denoising diffusion probabilistic models (DDPM) 去噪扩散概率模型

    The foundational discrete-time diffusion formulation that trains a network to predict the noise added at each step.

  • score 分数

    The gradient of the log-probability density with respect to the data; diffusion models learn it to know which way to denoise.

  • stochastic differential equation (SDE) 随机微分方程

    A differential equation driven by random noise; the continuous-time view of the forward and reverse diffusion processes.

  • ordinary differential equation (ODE) 常微分方程

    A deterministic differential equation; sampling a diffusion or flow model can be cast as solving one, enabling fast few-step solvers.

  • classifier-free guidance (CFG) 无分类器引导

    A sampling trick that pushes a conditional generator away from its unconditional output to sharpen prompt adherence, trading diversity for fidelity.

  • diffusion transformer (DiT) 扩散 Transformer

    A diffusion model whose denoiser is a transformer over patches rather than a U-Net, the scalable backbone of modern image and video generators.

  • rectified flow 修正流

    A flow-matching variant that straightens the transport paths between noise and data so fewer solver steps suffice for high quality.

  • autoregression 自回归

    Generating a sequence one element at a time, each conditioned on those before it; the dominant paradigm for language models.

  • non-autoregressive generation (NAR) 非自回归生成

    Producing many output tokens in parallel rather than one at a time, trading some quality for far lower latency.

  • fertility 繁殖度

    The average number of tokens a tokenizer produces per word; lower fertility means a more efficient vocabulary for a given language.

  • automatic speech recognition (ASR) 自动语音识别

    Transcribing spoken audio into text; the input side of voice interfaces.

  • connectionist temporal classification (CTC) 连接主义时序分类

    A loss for sequence labeling without aligned targets, summing over all alignments; a staple of speech recognition.

  • text-to-speech (TTS) 文本到语音

    Synthesizing natural-sounding speech audio from text; the output side of voice interfaces.

  • contrastive language-image pretraining (CLIP) 对比语言-图像预训练

    Training image and text encoders so matching pairs land close in a shared embedding space, enabling zero-shot classification and retrieval.

  • vision transformer (ViT) 视觉 Transformer

    A transformer that treats an image as a sequence of patches, bringing the architecture and its scaling to vision.

  • vision-language-action model (VLA) 视觉-语言-动作模型

    A model that maps visual and language input directly to robot or agent actions, extending VLMs to control.

  • over-refusal 过度拒绝

    When safety tuning makes a model decline benign requests, the false-positive cost paid for refusing harmful ones.

  • low-rank adaptation (LoRA) 低秩适配

    A PEFT method that freezes the base weights and learns a small low-rank update per layer, so many task adapters share one base model.

  • quantized low-rank adaptation (QLoRA) 量化低秩适配

    LoRA applied on top of a 4-bit quantized base model, letting a large model be fine-tuned on a single GPU.

  • proximal policy optimization (PPO) 近端策略优化

    A stable policy-gradient RL algorithm that clips each update to stay close to the previous policy; the workhorse optimizer of RLHF.

  • reinforcement learning from AI feedback (RLAIF) 从 AI 反馈中做强化学习

    RLHF where the preference labels come from a model rather than humans, trading some quality for cheaper, scalable feedback.

  • reward hacking 奖励欺骗

    When a model maximizes the measured reward by exploiting its flaws rather than achieving the intended goal; the central failure of optimizing a proxy.

  • Kullback-Leibler divergence (KL) Kullback-Leibler 散度

    An asymmetric measure of how far one distribution is from another; in alignment it penalizes the policy for drifting from the reference model.

  • identity preference optimization (IPO) 恒等偏好优化

    A DPO variant that replaces the log-sigmoid loss with a squared objective to curb overfitting to preference pairs.

  • Kahneman-Tversky optimization (KTO) Kahneman-Tversky 优化

    A preference method that learns from unpaired good/bad labels with a prospect-theory-inspired loss, needing no preference pairs.

  • odds-ratio preference optimization (ORPO) 优势比偏好优化

    A method that folds preference alignment into SFT with an odds-ratio penalty, removing the need for a separate reference model.

  • simple preference optimization (SimPO) 简单偏好优化

    A reference-free DPO variant using the average log-probability as an implicit reward with a target margin, simpler and memory-light.

  • reward ranked fine-tuning (RAFT) 奖励排序微调

    An iterative method that samples candidates, keeps the highest-reward ones, and fine-tunes on them; rejection sampling cast as training.

  • process reward model (PRM) 过程奖励模型

    A reward model that scores each step of a reasoning trace, not just the final answer, giving denser signal for training and search.

  • chain of thought (CoT) 思维链

    Prompting or training a model to produce intermediate reasoning steps before its answer, which raises accuracy on multi-step problems.

  • self-consistency 自一致性

    Sampling several reasoning chains and taking the majority answer, trading extra compute for higher accuracy.

  • least-to-most 由最少到最多

    A prompting strategy that decomposes a hard problem into easier subproblems solved in order, each building on the last.

  • tree of thoughts (ToT) 思维树

    A reasoning method that explores a branching tree of intermediate thoughts with lookahead and backtracking, beyond a single chain.

  • group relative policy optimization (GRPO) 组相对策略优化

    An RL method that drops the value critic and normalizes rewards within a group of sampled answers; the optimizer behind DeepSeek-R1.

  • REINFORCE leave-one-out (RLOO) REINFORCE 留一法

    A lightweight policy-gradient method that uses the mean reward of the other samples as each sample's baseline, avoiding a learned value network.

  • Monte Carlo tree search (MCTS) 蒙特卡洛树搜索

    A search that builds a tree by sampling rollouts and backing up their values, balancing exploration and exploitation; used for reasoning and planning.

  • budget forcing 预算强制

    A test-time control that caps or extends how many reasoning tokens a model spends, trading latency for accuracy.

  • generative reward model (GenRM) 生成式奖励模型

    A reward model that judges by generating a critique or verdict in text rather than emitting a scalar, often using chain-of-thought.

  • goodput 有效吞吐量

    Throughput counted only over requests that meet their latency targets, the objective a serving system actually optimizes, unlike raw throughput.

  • continuous batching 连续批处理

    Scheduling that admits and retires requests at each decode step instead of per fixed batch, so a finished request frees its slot immediately.

  • PagedAttention PagedAttention 分页注意力

    A KV-cache allocator that stores the cache in fixed-size pages like virtual memory, ending the fragmentation of reserving one contiguous block per sequence.

  • prefix caching 前缀缓存

    Reusing the KV cache of a shared prompt prefix across requests so its prefill is computed once, not per request.

  • dynamic random-access memory (DRAM) 动态随机存取存储器

    Denser, cheaper memory needing periodic refresh; the bulk of off-chip capacity, including the HBM next to accelerators.

  • speculative decoding 推测解码

    Drafting several tokens with a small fast model and verifying them in one pass of the large model, trading extra compute for fewer slow decode steps.

  • static random-access memory (SRAM) 静态随机存取存储器

    Fast on-chip memory needing no refresh; small and expensive, used for caches and register files near compute.

  • finite-state machine (FSM) 有限状态机

    A model of computation with a finite set of states and transitions; used in constrained decoding to track which tokens a grammar allows next.

  • attention sink 注意力汇

    A few initial tokens that attention heads dump excess weight onto; keeping them in the cache stabilizes streaming and long-context generation.

  • constrained decoding 约束解码

    Restricting the tokens the model may emit at each step to those allowed by a grammar or schema, so the output is valid by construction.

  • Model Context Protocol (MCP) 模型上下文协议

    An open protocol standardizing how an agent connects to external tools and data sources, so a host can talk to many servers uniformly.

  • retrieval-augmented generation (RAG) 检索增强生成

    Fetching relevant documents at query time and placing them in the prompt, so the model answers from retrieved evidence rather than parametric memory alone.

  • dual-encoder 双编码器

    A retrieval model that embeds query and document separately so document vectors can be precomputed and searched; fast but less precise than joint scoring.

  • BM25 BM25 稀疏检索

    A classic sparse lexical ranking function scoring documents by term frequency and rarity; the strong keyword-search baseline behind hybrid retrieval.

  • hierarchical navigable small-world (HNSW) 分层可导航小世界图

    A graph index for approximate nearest-neighbor search over vectors, navigating layered links to find close embeddings fast.

  • hybrid search 混合搜索

    Combining sparse lexical scores (BM25) and dense vector similarity into one ranking, catching both exact-keyword and semantic matches.

  • cross-encoder 交叉编码器

    A model that scores a query and document jointly in one pass, more accurate than a dual-encoder but too costly to run over a whole corpus, so used to rerank.

  • held-out set 留出集

    Data deliberately kept out of training so it can measure generalization; the basis of honest evaluation.

  • contamination 污染

    When evaluation data has leaked into training, inflating benchmark scores without real capability gains.

  • Swiss-cheese model 瑞士奶酪

    A safety framing where several imperfect layers each have holes, but stacking them so the holes do not line up blocks most failures.

  • membership inference 成员推断

    An attack that tests whether a specific example was in a model's training set, a basic privacy threat.

  • canary strings 金丝雀字符串

    Unique markers planted in data to detect later leakage or training-set contamination when they reappear in a model's output.

  • Holistic Evaluation of Language Models HELM

    A benchmark suite that scores models across many scenarios and metrics together, rather than reducing them to one leaderboard number.

  • model-as-judge 模型作为评判者

    Using a strong model to score or compare outputs in place of human raters: cheap and scalable, but with its own biases.

  • pairwise comparison 成对比较

    Judging quality by asking which of two outputs is better, more reliable than absolute scores and the basis of preference data and arenas.

  • Goodhart's law 古德哈特定律

    Once a measure becomes a target it stops being a good measure; the reason benchmarks decay and rewards get hacked.

  • rubric 评分准则

    An explicit scoring guide listing the criteria and levels a judge applies, making subjective evaluation more consistent.

  • private test set 私有测试集

    Evaluation data kept secret from model developers so scores cannot be gamed by training on the test.

  • pass@k 至少一次成功率

    The probability that at least one of k sampled attempts passes, the standard metric for code and other verifiable tasks.

  • Byzantine fault tolerance 拜占庭容错

    A system's ability to reach correct consensus even when some components fail arbitrarily or maliciously, not just by crashing.

  • liveness 活性

    A property guaranteeing that something good eventually happens (progress); paired with safety in reasoning about systems.

  • safety 安全性

    As a formal property, a guarantee that nothing bad ever happens; in the broader AI sense, keeping systems from causing harm.

  • mechanistic interpretability 机械可解释性

    Reverse-engineering a network's internal computations into human-understandable circuits and features, rather than treating it as a black box.

  • polysemanticity 多义性

    When a single neuron responds to several unrelated concepts, making activations hard to read; the problem sparse autoencoders try to undo.

  • superposition 叠加

    A network packing more features than it has neurons by representing them as overlapping directions in activation space; why polysemanticity arises.

  • sparse autoencoder (SAE) 稀疏自编码器

    An interpretability tool that decomposes a model's activations into many sparse, more monosemantic features, used to read what a network represents.

  • scalable oversight 可扩展监督

    Methods for supervising models on tasks too hard or too numerous for humans to check directly, often by using AI to assist the oversight.

  • weak-to-strong 弱到强

    Studying whether a weaker supervisor can elicit the full capability of a stronger model, a proxy for humans overseeing superhuman systems.

  • deceptive alignment 欺骗性对齐

    A failure where a model behaves aligned while observed but pursues a different goal once it judges it can; the hardest safety case to detect.

  • sleeper agents 沉睡特工

    Models trained to act normally until a trigger activates hidden behavior, which can survive safety training; a demonstration of deceptive alignment.

  • prompt injection 提示注入

    An attack where untrusted content in the model's input overrides its instructions, hijacking an agent through the data it reads.

  • on-behalf-of (OBO) 代表用户

    A delegation pattern where a service acts with a user's identity and permissions, the basis for scoping what an agent may do for whom.

  • lethal trifecta 致命三元组

    The dangerous combination of access to private data, exposure to untrusted content, and the ability to communicate externally, which together enable exfiltration.

  • instruction hierarchy 指令层级

    An ordering of trust over instruction sources (system over developer over user over tool output) so a model knows which to obey on conflict.

  • jailbreak 越狱

    A prompt crafted to bypass a model's safety training and elicit content it was tuned to refuse.

  • red-teaming 红队

    Adversarially probing a system to surface failures, jailbreaks, and harms before deployment.

  • adversarial robustness 对抗鲁棒性

    A model's resistance to inputs crafted specifically to make it fail; an arms race rather than a solved property.

  • Greedy Coordinate Gradient (GCG) 贪婪坐标梯度

    A white-box attack that optimizes an adversarial suffix token by token to force a target output, producing transferable jailbreaks.

  • machine unlearning 机器遗忘

    Removing the influence of specific training data from a trained model without retraining from scratch.

  • differential privacy (DP) 差分隐私

    A formal guarantee that a computation's output barely changes whether or not any single record is included, bounding what can be learned about an individual.

  • knowledge editing 知识编辑

    Surgically updating a specific fact a model has stored, ideally without disturbing unrelated knowledge.

  • watermarking 水印

    Embedding a hard-to-remove statistical signal in generated content so it can later be identified as machine-produced.

  • Brussels effect 布鲁塞尔效应

    The tendency of EU regulation to become a de facto global standard because firms apply it everywhere rather than maintain two product lines.

  • model card 模型卡

    A short standardized document reporting a model's intended use, training data, evaluations, and limitations.

  • datasheet 数据表

    A standardized document recording how a dataset was collected, composed, and intended to be used, the data analog of a model card.

  • system card 系统卡

    A document describing a deployed system as a whole, including its model, safeguards, and evaluated risks, broader than a model card.

  • high-bandwidth memory (HBM) 高带宽显存

    Stacked DRAM placed next to an accelerator for very high bandwidth; its capacity and bandwidth bound how large a model and KV cache can be served.

  • tensor processing unit (TPU) 张量处理器

    Google's custom accelerator built around large matrix-multiply units, an ASIC alternative to GPUs for deep learning.

  • inter-chip interconnect (ICI) 芯片间互连

    The high-speed links connecting accelerators directly (such as NVLink or a TPU's ICI), carrying the collective traffic of tensor and pipeline parallelism.

  • graphics processing unit (GPU) 图形处理器

    A massively parallel processor, originally for graphics, now the dominant accelerator for training and serving neural networks.

  • hardware FLOPs utilization (HFU) 硬件 FLOPs 利用率

    The fraction of peak hardware throughput actually achieved, counting all FLOPs including recomputation, unlike MFU.

  • remote direct memory access (RDMA) 远程直接内存访问

    A network capability letting one machine read or write another's memory without involving its CPU, key to fast collective communication.

  • automatic differentiation 自动微分

    Computing exact derivatives of a program by applying derivative rules to each elementary operation as it executes, rather than differencing numerically or manipulating formulas symbolically.

  • silent data corruption (SDC) 静默数据损坏

    Hardware errors that produce wrong results without raising any fault, a growing hazard at fleet scale and during long training runs.

  • chip-on-wafer-on-substrate CoWoS

    TSMC's advanced packaging that places compute dies and HBM stacks on one interposer; a supply bottleneck for AI accelerators.

  • application-specific integrated circuit (ASIC) 专用集成电路

    A chip designed for one task, trading the generality of a CPU or GPU for far higher efficiency on that task.

  • small modular reactor (SMR) 小型模块化反应堆

    A factory-built nuclear reactor of modest output, proposed as a dedicated, steady power source for AI datacenters.

  • power usage effectiveness (PUE) 电源使用效率

    A datacenter's total power divided by the power delivered to IT equipment; closer to 1 means less overhead on cooling and the like.

  • mean time between failures (MTBF) 平均无故障时间

    The average operating time between hardware failures; at cluster scale it falls low enough that long training runs must expect and recover from them.

  • effective training time ratio (ETTR) 有效训练时间比

    The fraction of wall-clock time a training run spends making real progress, after subtracting failures, restarts, and stalls.

  • capital expense (CapEx) 资本性支出

    Up-front spending on long-lived assets such as GPUs and datacenters, depreciated over years; the bulk of the cost of owning compute.

  • operating expense (OpEx) 运营性支出

    Recurring running costs such as power, bandwidth, and rented cloud capacity; the pay-as-you-go side of serving.

  • gateway 网关

    A proxy in front of model providers that centralizes routing, auth, rate limits, cost tracking, and fallbacks across many backends.

  • sandbox 沙箱

    An isolated environment that confines untrusted code or agent actions so they cannot affect the host system.

  • virtual key 虚拟密钥

    A gateway-issued credential mapped to an upstream provider key, letting an operator set per-team budgets, limits, and revocation without sharing the real key.

  • optical character recognition (OCR) 光学字符识别

    Converting images of text into machine-readable characters, a front-end step for ingesting scanned or photographed documents.

  • vision-language model (VLM) 视觉语言模型

    A model that takes both images and text and reasons over them jointly, the basis of multimodal assistants.

  • observability 可观测性

    The ability to understand a system's internal state from its outputs (logs, metrics, traces); for LLM apps it extends to prompts, tokens, and quality.

  • service level indicator (SLI) 服务水平指标

    A measured metric of service behavior, such as latency or error rate, against which an SLO target is set.

  • service-level objective (SLO) 服务等级目标

    A target threshold for a service metric, such as p99 latency under a bound, that a serving system commits to meeting.

  • human-in-the-loop (HITL) 人在回路中

    A system design that inserts human judgment at defined points to approve, correct, label, escalate, or stop model behavior.

  • calibrated reliance 校准后的依赖

    Using automation when it is likely useful and withholding, checking, or overriding it when uncertainty, stakes, or evidence warrant.

  • automation bias 自动化偏差

    The tendency to over-rely on automated recommendations, especially when the system appears authoritative or the user is under time pressure.

  • reinforcement learning from human feedback (RLHF) 基于人类反馈的强化学习

    Aligning a model by training a reward model on human preference comparisons and optimizing the policy against it; the original alignment recipe.

Comments

Log in to comment