Quizzes

Transformer comprehension test

Ranked quizzes: Bronze 10 (8 to pass), Silver 20 (16 to pass), Gold 10 (8 to pass).

Bronze to Silver · 115 questions · Exam mode

1Why is a Transformer easier to train in parallel than an RNN?
2Why does scaled dot-product attention divide by √d_k?
3What is the main benefit of multi-head attention?
4Why does a Transformer need positional encoding?
5What does the mask do in decoder masked self-attention?
6What is the main role of residual connections in a Transformer?
7What does LayerNorm normalize in a Transformer?
8How does the feed-forward network (FFN) in a Transformer work?
9Before softmax, a causal mask usually sets future-position scores to what?
10What does the KV cache store during inference?
11The attention output is a weighted sum of which tensor?
12What does the QKᵀ step do in attention?
13When producing attention weights, which dimension does softmax normalize over?
14What form does encoder self-attention usually take?
15How is positional encoding usually combined with token embeddings?
16With d_model = 512 and 8 heads, what is a single head’s dimension usually?
17Which architecture family does BERT belong to?
18Which architecture family do GPT-style language models belong to?
19Without any positional encoding, what happens to self-attention if you permute the tokens?
20In a standard Transformer, the FFN hidden dimension is commonly how many times d_model?
21Where do Q, K and V come from in self-attention?
22What was the main bottleneck of early RNN encoder-decoders?
23In multi-head attention, the Q/K/V projection matrices of different heads are…
24What properties do softmax attention weights have?
25What are the logits in a model’s output?
26How does the decoder output become a probability distribution over the next token?
27What does greedy decoding do at each step?
28What does “autoregressive generation” mean?
29What is a model’s “context window”?
30What does a standard Transformer encoder layer contain?
31What does a standard Transformer decoder layer contain?
32What is required when a residual connection adds a sublayer output to its input?
33Which learnable parameters does LayerNorm usually have?
34Which activation functions are commonly used inside the Transformer FFN?
35Which structure is absent from the Transformer architecture?
36On which task was the Transformer first proposed?
37What problem do subword tokenizers such as BPE mainly address?
38What is a common way to handle a word outside the vocabulary?
39What are special tokens like BOS / EOS for?
40What is the [CLS] position’s output commonly used for in BERT?
41What is a special token like [SEP] usually for?
42Why pad sequences in a batch to equal length?
43What is the main difference between pretraining and fine-tuning?
44What does the final output projection dimension of a language model usually correspond to?
45In an encoder-decoder model, how is the encoder output used?
46Why can decoder training run in parallel while generation must proceed step by step?
47What does a language model (LM) fundamentally model?
48When a Transformer is said to have “12 layers,” what does “layers” mean?
49What does the token embedding layer do?
50What does dropout do during training?
51In decoder cross-attention, where do Q, K and V come from?
52What is the main difference between Pre-LN and Post-LN?
53What does RoPE do?
54What are the usual time and memory costs of standard self-attention as sequence length n grows?
55What mainly drives KV cache memory usage?
56How are multi-head attention outputs usually combined?
57What should happen to Transformer dropout at inference time?
58What does weight tying usually mean in a language model?
59What is cross-attention for in an encoder-decoder Transformer?
60Why do people describe a Transformer as having a residual stream?
61What problem does GQA (grouped-query attention) mainly address?
62What is the core idea of FlashAttention?
63What does the original Post-LN Transformer usually need during training?
64Which tensor is usually not stored in the KV cache?
65How should padding positions be handled inside attention for a batch?
66How does ALiBi inject positional information?
67Roughly what does sliding-window (sparse) attention reduce the cost from O(n²) to?
68What is BERT’s main pretraining objective?
69Compared with BatchNorm, what is LayerNorm’s main advantage for NLP?
70How does beam search differ from greedy decoding?
71What is the main advantage of sinusoidal positional encoding over learned positional embeddings?
72Why do many implementations scale token embeddings by √d_model?
73What does teacher forcing mean when training a decoder?
74LLM inference is usually split into which two phases?
75What idea does PagedAttention borrow to manage the KV cache?
76What is the main benefit of quantizing the KV cache?
77How does speculative decoding work?
78What does raising the sampling temperature usually do?
79How does top-p (nucleus) sampling work?
80How does language-model perplexity relate to average negative log-likelihood (NLL)?
81How is the training loss for a causal language model constructed?
82When computing language-model loss on a variable-length batch, how should padding positions be handled?
83What is the trade-off of activation checkpointing?
84What is bf16’s main advantage over fp16 for training?
85What is the key difference between RMSNorm and LayerNorm?
86What is the basic form of a SwiGLU feed-forward layer?
87What is the main role of sparse mixture-of-experts (MoE)?
88What is QK-Norm mainly used for in large-model training?
89StreamingLLM found that keeping which KV entries helps stabilize attention in long streaming generation?
90When extending a model’s context window beyond its training length, what is commonly done to RoPE?
91What form of positional information does T5 use?
92What is Longformer’s attention pattern?
93What is the key trick linear attention uses to reach O(n) complexity?
94What often limits long-sequence attention on GPUs?
95Why does FlashAttention recompute attention during the backward pass?
96During encoder-decoder inference, must the encoder’s K/V be recomputed at every step?
97Where does attention dropout usually apply?
98What learning-rate schedule is common for Transformer training?
99What is the core idea of LoRA fine-tuning?
100What does label smoothing do when training a language model?
101What does Grouped-Query Attention (GQA) mainly optimize?
102What is the key difference between RMSNorm and LayerNorm?
103What does FlashAttention mainly optimize?
104What is the structure of a SwiGLU FFN?
105Why is BF16 often preferred over FP16 for large-model training?
106When a batch contains padding, what mask does attention need?
107What is top-p (nucleus) sampling?
108What does weight-only INT4 quantization mainly provide?
109What is the basic idea of speculative decoding?
110In an MoE layer, how does each token usually pass through experts?
111What is the main trade-off of sliding-window attention?
112What is the attention-sink phenomenon?
113A common way to extend RoPE context from 4K to 32K is?
114What engineering problem does PagedAttention mainly solve?
115What is the main cost of tensor parallelism at inference?
Back