{ "lesson": "08-cnns-rnns-for-text", "title": "CNNs and RNNs for Text", "questions": [ { "stage": "pre", "question": "What is a 1D convolutional filter of width 3 over word embeddings effectively learning?", "options": [ "A learnable bigram detector", "A learnable trigram (n-gram) detector", "A position embedding", "A unigram count" ], "correct": 1, "explanation": "A width-3 filter spans three consecutive tokens, acting as a learnable trigram detector." }, { "stage": "pre", "question": "Why does an LSTM use a cell state with mostly additive interactions?", "options": [ "Faster softmax", "To avoid matrix inversion", "Additive flow lets gradients propagate through long sequences without vanishing or exploding", "It saves memory" ], "correct": 2, "explanation": "The cell-state highway keeps gradients stable across hundreds of steps, fixing vanishing-gradient issues." }, { "stage": "check", "question": "Why does TextCNN use global max-pooling after the convolutional layer?", "options": [ "To reduce vocabulary", "Max-pool gives a fixed-size, position-invariant representation by selecting the strongest activation per filter", "To enable backpropagation", "To remove embeddings" ], "correct": 1, "explanation": "Global max-pool produces a fixed-size feature vector regardless of input length, with position invariance." }, { "stage": "check", "question": "What is the main advantage of a bidirectional RNN over a one-way RNN for sequence labeling?", "options": [ "Cheaper memory", "Avoids embeddings", "Each token's representation sees both left and right context, which is essential for tagging", "Faster training" ], "correct": 2, "explanation": "Bidirectional networks concatenate forward + backward hidden states so labels can use full context." }, { "stage": "check", "question": "Why does max-pooling over an LSTM's outputs often beat using just the last hidden state for classification?", "options": [ "Max-pool removes capitalization", "Last-state pool ignores padding", "Max-pool is differentiable; last-state is not", "Information at the end of a long sequence tends to dominate the last state, hiding earlier evidence" ], "correct": 3, "explanation": "Max-pool aggregates strongest signal across positions; last-state can lose earlier evidence." }, { "stage": "post", "question": "Which limitation of LSTM/RNN encoder-decoders motivated attention?", "options": [ "They require subword tokenizers", "The decoder sees only a fixed-size encoder state, losing detail on long inputs; recurrence also serializes training", "They cannot embed tokens", "They cannot use embeddings" ], "correct": 1, "explanation": "Fixed-size summarization plus serial training were two failures attention removed." }, { "stage": "post", "question": "When does a TextCNN or BiLSTM still beat a transformer in 2026?", "options": [ "Whenever the dataset is multilingual", "Edge / on-device, streaming token-by-token inputs, or tiny-data baselines", "When latency requirements are extremely loose", "On image inputs" ], "correct": 1, "explanation": "Small architectures still win on edge inference, streaming inputs, and rapid baselines." }, { "stage": "post", "question": "What is the vanishing gradient problem in plain RNNs?", "options": [ "Inputs become zero", "Repeated multiplication by recurrent weights smaller than 1 makes gradients toward early steps shrink toward zero", "Loss becomes negative", "Embedding matrix becomes singular" ], "correct": 1, "explanation": "Long-product gradients vanish (or explode) without gating; this is why LSTMs and GRUs exist." } ] }