Flashcards · Transformers · Free
Transformers flashcards, generated for you.
Example Transformers study cards to learn from right now — then generate a full set from your own notes (plus a practice quiz) and export to Quizlet or Anki. Free, no account needed.
Example Transformers flashcards
What problem do transformers solve that previous neural networks couldn't?
Transformers can process entire sequences in parallel and learn long-range dependencies without being constrained by sequential order, enabling efficient training on massive text datasets.
What is the core intuition behind 'attention' in transformers?
Attention allows the model to dynamically focus on different parts of the input sequence when processing each word, rather than treating all words equally or relying on sequential memory.
In simple terms, what does a query-key-value mechanism do?
Queries ask 'what am I looking for?', keys describe 'what is available to look at', and values are 'what information do I get'. The model matches queries to keys to decide which values to retrieve.
Why is softmax used in attention weights calculation?
Softmax converts raw attention scores into a probability distribution (normalized, sum to 1) that determines how much weight each key-value pair receives, enabling the model to focus selectively.
What is multi-head attention and why use multiple heads instead of one?
Multiple attention heads let the model attend to different representation subspaces simultaneously. Each head can learn different types of relationships (e.g., syntax vs. semantics), increasing expressiveness.
Define the mathematical operation of a single attention head: Attention(Q, K, V) = ?
Attention(Q, K, V) = softmax(QK^T / √d_k)V, where Q, K, V are query, key, value matrices; d_k is key dimension; scaling by √d_k prevents vanishingly small gradients.
What is positional encoding and why can't transformers just 'learn' position information?
Positional encodings inject word position information into embeddings using sine/cosine functions at different frequencies. They're necessary because attention operates on set-like operations that are permutation-invariant and don't inherently encode sequence order.
What is the feed-forward network component in a transformer block, and what does it do?
A feed-forward network (typically two linear layers with ReLU activation) processes each position independently after attention. It adds non-linearity and allows the model to reason about attended information through learned transformations.
Explain layer normalization in transformers: where is it applied and why?
Layer norm is applied after attention and feed-forward layers (or before, in pre-LN architecture). It stabilizes training by normalizing activations across features, reducing internal covariate shift and enabling deeper, more stable networks.
What is a causal mask and why is it essential for language model transformers?
A causal mask prevents attention from looking at future tokens by setting future positions to -∞ before softmax. It's critical for autoregressive language models so prediction of token i only uses tokens 0 to i-1, preserving causality.
Make your own Transformers study set
Flashcards for related topics
Studying Transformers to build with AI? MindloomHQ turns it into real skills — structured courses, agent projects, and certificates.
Explore MindloomHQ →