This page lists the key terms from “Attention Is All You Need” (Vaswani et al.), the paper that introduced the Transformer. Each term comes with its Chinese translation and a one-line explanation. The terms are grouped the way you meet them in the paper: architecture, attention, the building blocks around attention, training, and evaluation. A short section at the end covers the older models the paper compares against.
GeekCoding101 · Dec 28, 2024 · Topics: attention-is-all-you-need, machine-learning, transformer
How to use this glossary
- Keep it open next to the paper. The sections follow the paper’s order: Model Architecture, then Training, then Results.
- If you’re reading a Chinese translation or explanation of the paper, use the middle column to map terms back to the original English.
- Where a term has an external link, it points to a longer explainer.
Architecture: the big pieces
| English Term | Chinese Translation | Explanation | Link |
|---|---|---|---|
| Transformer | Transformer(变换器) | The model the paper introduces. It is an encoder–decoder built from attention and feed-forward layers, with no recurrence or convolution. | |
| Sequence Transduction | 序列转换 | Turning one sequence into another, such as a sentence in one language into its translation. This is the task family the paper targets. | |
| Encoder | 编码器 | The stack that reads the input sequence and turns it into a sequence of context-aware representations. | |
| Decoder | 解码器 | The stack that generates the output sequence one token at a time. It uses the encoder’s output and the tokens it has already produced. | |
| Encoder–Decoder Architecture | 编码器-解码器架构 | The overall design: one stack reads the input and another writes the output. | |
| Layer / Stack | 层 / 堆叠 | The encoder and decoder are each made of identical layers stacked on top of each other. | |
| Token | 词元 / 标记 | One unit of text the model processes, such as a word or a subword piece. | |
| Embedding | 嵌入 | A learned vector that represents a token. Embeddings are the model’s actual input. | |
| Auto-regressive | 自回归 | Generating output step by step, where each new token depends on the tokens before it. The decoder works this way. |
Attention: the core idea
| English Term | Chinese Translation | Explanation | Link |
|---|---|---|---|
| Attention Mechanism | 注意力机制 | Measures how much each element of a sequence should draw on every other element, then mixes their information by those weights. | Attention Mechanism Explained |
| Query, Key, Value (Q, K, V) | 查询、键、值 | Three learned projections of each token. A query is compared with keys to get weights, and the weights are applied to the values. | |
| Scaled Dot-Product Attention | 缩放点积注意力 | The paper’s attention function. It takes dot products of queries and keys, divides by √dₖ, applies softmax, and uses the result to weight the values. | |
| Softmax | Softmax(归一化指数函数) | Turns raw scores into weights that are positive and sum to 1. | |
| Self-Attention | 自注意力 | Attention where queries, keys and values all come from the same sequence. Each token looks at the other tokens in its own sequence. | |
| Masked Self-Attention | 掩码自注意力 | Self-attention in the decoder that blocks each position from seeing later positions, so the model can’t peek at future tokens. | |
| Encoder–Decoder Attention (Cross-Attention) | 编码器-解码器注意力(交叉注意力) | Attention in the decoder where queries come from the decoder and keys and values come from the encoder’s output. | |
| Multi-Head Attention | 多头注意力 | Runs several attention operations (“heads”) in parallel, each on its own learned projection of Q, K and V. The results are then concatenated and projected again. | |
| Attention Head | 注意力头 | One of the parallel attention operations inside multi-head attention. |
The formula behind scaled dot-product attention, as written in the paper:
Attention(Q, K, V) = softmax( Q·Kᵀ / √d_k ) · VDividing by √dₖ (the square root of the key dimension) keeps the dot products from growing so large that softmax saturates and gradients become very small.
Building blocks around attention
| English Term | Chinese Translation | Explanation | Link |
|---|---|---|---|
| Positional Encoding | 位置编码 | Attention alone ignores word order, so position information is added to the embeddings. The paper uses fixed sine and cosine functions of different frequencies. | |
| Sinusoidal Encoding | 正弦位置编码 | The specific sine/cosine scheme the paper uses for positional encoding. | |
| Position-wise Feed-Forward Network (FFN) | 逐位置前馈神经网络 | Two linear layers with a ReLU in between, applied to each position separately and identically. | Feed-Forward Networks in NLP |
| Residual Connection | 残差连接 | Adds a sub-layer’s input to its output, giving gradients a shortcut path through deep stacks. | |
| Layer Normalization | 层归一化 | Normalizes the values within each token’s vector to stabilize training. Applied together with the residual connection around each sub-layer. | Layer Normalization Details |
| Linear Projection | 线性投影 | A learned matrix multiplication. It is used to create Q, K and V, and to combine the outputs of the attention heads. |
Training terms
| English Term | Chinese Translation | Explanation | Link |
|---|---|---|---|
| Parallelization | 并行化 | Performing many computations at the same time. Because the Transformer has no recurrence, it can process all positions of a sequence in parallel during training. | |
| Byte-Pair Encoding (BPE) | 字节对编码 | A subword tokenization method that splits text into frequent character sequences. | |
| Adam Optimizer | Adam 优化器 | The gradient-based optimizer used to train the model. | |
| Learning-Rate Warmup | 学习率预热 | Raising the learning rate gradually at the start of training before letting it decay. | |
| Dropout | 随机失活(Dropout) | Randomly zeroing some activations during training to reduce overfitting. | |
| Label Smoothing | 标签平滑 | Softening the one-hot training targets so the model is less overconfident. |
Evaluation terms
| English Term | Chinese Translation | Explanation | Link |
|---|---|---|---|
| BLEU (Bilingual Evaluation Understudy) | 双语评估替补(BLEU) | A metric that scores machine translations by their n-gram overlap with reference translations. | Understanding BLEU |
| Beam Search | 束搜索 | A decoding strategy that keeps several candidate outputs at each step instead of only the single most likely one. | |
| Machine Translation | 机器翻译 | Automatically translating text between languages. This is the main task the paper evaluates on. |
The models the Transformer replaced
The paper compares the Transformer against these two families of sequence models. They are worth knowing because the paper’s argument is that attention alone can do their job.
| English Term | Chinese Translation | Explanation | Link |
|---|---|---|---|
| Recurrent Neural Network (RNN) | 循环神经网络 | Processes a sequence one step at a time and carries a hidden state forward, which makes training hard to parallelize. | RNN Basics |
| Long Short-Term Memory (LSTM) | 长短期记忆网络 | A type of RNN with gates that help it keep information over longer sequences. | |
| Convolutional Neural Network (CNN) | 卷积神经网络 | Uses convolutions to extract features from local windows of the input. | CNN Overview |
FAQ
What does “Attention Is All You Need” mean? The title is the paper’s claim: a sequence model can be built from attention layers plus simple feed-forward layers, with no recurrence (RNNs) and no convolutions (CNNs).
What are Query, Key and Value in simple terms? Each token produces three vectors. Its query asks “what am I looking for?”, every token’s key answers “what do I contain?”, and the value is the information that gets passed along. Query–key similarity decides how much of each value a token takes in.
What is the difference between self-attention and multi-head attention? Self-attention is the operation: a sequence attending to itself. Multi-head attention runs that operation several times in parallel with different learned projections, so each head can focus on different relationships. The heads’ results are then combined.
Why does the Transformer need positional encoding? Attention treats its input as a set, so it has no built-in notion of order. Positional encoding adds a position signal to each embedding so the model can tell “dog bites man” from “man bites dog.”
How do you say “self-attention” and “multi-head attention” in Chinese? Self-attention is 自注意力 and multi-head attention is 多头注意力. Masked self-attention is 掩码自注意力.
Questions about a term, or one you’d like added? Leave a comment below or use the contact page.