← Back to Week 7

Week 7: Sequence Models & Attention

Knowledge Check — Select an answer to see immediate feedback.

Questions 10
Question 1

What is the primary limitation of static word embeddings like Word2Vec when compared to contextual embeddings?

Question 2

In transformer attention, every word computes a relevance score against every other word. As the size of these representations grows larger, what problem can arise with those scores?

Question 3

Why do Transformer models require positional encodings, while recurrent neural networks do not?

Question 4

In the original Transformer paper ("Attention Is All You Need"), sinusoidal positional encodings use sine and cosine functions of varying frequencies. What is the key advantage of this choice over learned positional embeddings?

Question 5

Multi-head attention computes multiple attention outputs in parallel and then combines them. What is the primary benefit of this design?

Question 6

In the Transformer architecture, what is the purpose of the position-wise feed-forward network (FFN) that follows each multi-head attention layer?

Question 7

In decoder-only Transformer architectures (such as GPT), attention masks are applied during training. What is their purpose?

Question 8

Layer normalization is applied after each sub-layer in the Transformer. Which of the following correctly describes what layer normalization computes?

Question 9

Contextual embeddings (e.g., from BERT) differ from static embeddings (e.g., Word2Vec) in that they produce different vector representations of the same word token depending on its context. Which practical NLP capability does this most directly enable?

Question 10

A key computational advantage of self-attention over recurrent neural networks is parallelizability. Why is self-attention more parallelizable than an RNN?