🌍 Deep Learning · flashcards

Deep Learning Sequence Models and Recurrent Networks Flashcards

50 question-and-answer cards covering Sequence Models and Recurrent Networks as it is examined in Deep Learning. 24 of them are printed below, taken from across the deck — no signup, no paywall on the preview.

50Cards in deck
24Free preview
13Syllabus topics
~231Chars per answer
FreePrice

24 sample cards from the Sequence Models and Recurrent Networks deck

Sampled from the end of the deck, so these are different cards from the ones shown on the syllabus page.

  1. Contrast additive (Bahdanau) and multiplicative (Luong) attention scoring.

    Additive: $e_i = v^{\top}\tanh(W_1 q + W_2 k_i)$, a small feedforward net. Multiplicative: $e_i = q^{\top} k_i$ (or $q^{\top} W k_i$), a dot product—faster and more memory-efficient, especially with optimized matrix multiplication.

  2. What is self-attention, and how does it differ from encoder-decoder attention?

    In self-attention the queries, keys, and values all come from the same sequence, letting each position attend to every other position in that sequence. Encoder-decoder (cross) attention uses decoder queries against encoder keys/values.

  3. What problem does beam search decoding solve, and how?

    It approximately finds the highest-probability output sequence (intractable to search exhaustively) by keeping the top-$k$ partial hypotheses (the beam) at each decoding step and expanding only those, balancing search quality and cost.

  4. Contrast greedy decoding with beam search.

    Greedy decoding picks the single most probable token at each step ($k=1$), which is locally optimal but can miss globally better sequences. Beam search retains $k>1$ candidates, exploring more of the search space at higher computational cost.

  5. Why does beam search use length normalization, and give a common form.

    Raw sequence log-probabilities $\sum_t \log P(y_t\mid\cdot)$ decrease with length, biasing toward short outputs. Length normalization divides by a length penalty, e.g. score $=\frac{1}{L^{\alpha}}\sum_{t=1}^{L}\log P(y_t\mid y_{<t})$ with $\alpha\in(0,1]$.

  6. What happens to beam search behavior as the beam width $k$ increases very large versus $k=1$?

    $k=1$ is greedy search. Increasing $k$ explores more hypotheses and can raise likelihood, but beyond a point returns diminish and, in NMT, very large beams often produce shorter, lower-quality translations (the 'beam search curse').

  7. What is teacher forcing in sequence model training?

    During training the decoder is fed the ground-truth previous token (rather than its own prediction) as input at each step, so $P(y_t\mid y^{*}_{<t})$ is modeled. This stabilizes and speeds convergence.

  8. What is exposure bias, and how does it relate to teacher forcing?

    Exposure bias is the train/test mismatch caused by teacher forcing: at training the model always sees correct history, but at inference it sees its own (possibly wrong) outputs, so errors compound with no learned recovery.

  9. What is scheduled sampling and what problem does it mitigate?

    Scheduled sampling gradually replaces ground-truth previous tokens with the model's own predictions during training, according to a decaying probability, to reduce exposure bias from pure teacher forcing and bridge the train/test gap.

  10. What is the core objective of Word2Vec, and name its two model variants.

    Word2Vec learns dense word embeddings by predicting words from context. Variants: CBOW (predict the center word from surrounding context) and Skip-gram (predict surrounding context words from the center word).

  11. State the Skip-gram softmax objective and why it is expensive.

    $P(w_O\mid w_I)=\frac{\exp(v_{w_O}^{\prime\top} v_{w_I})}{\sum_{w=1}^{V}\exp(v_w^{\prime\top} v_{w_I})}$. The denominator sums over the whole vocabulary $V$, making each update $O(V)$—hence approximations like negative sampling or hierarchical softmax are used.

  12. What is negative sampling in Word2Vec?

    Instead of the full softmax, it trains a binary classifier to distinguish the true context word from $k$ randomly sampled 'negative' words, optimizing $\log\sigma(v_{w_O}^{\prime\top} v_{w_I}) + \sum_{i=1}^{k}\mathbb{E}_{w_i\sim P_n}[\log\sigma(-v_{w_i}^{\prime\top} v_{w_I})]$.

  13. How does GloVe differ fundamentally from Word2Vec?

    GloVe is count-based: it factorizes the global word-word co-occurrence matrix, fitting embeddings so $w_i^{\top}\tilde{w}_j + b_i + \tilde{b}_j \approx \log X_{ij}$. Word2Vec is prediction-based over local context windows; GloVe uses global corpus statistics directly.

  14. Write GloVe's weighted least-squares objective.

    $J=\sum_{i,j=1}^{V} f(X_{ij})\left(w_i^{\top}\tilde{w}_j + b_i + \tilde{b}_j - \log X_{ij}\right)^2$, where $f$ is a weighting function that downweights rare and caps frequent co-occurrences.

  15. What famous property do Word2Vec/GloVe embeddings exhibit via vector arithmetic?

    Linear analogies: $\vec{king}-\vec{man}+\vec{woman}\approx\vec{queen}$. Semantic and syntactic relations appear as roughly consistent offset vectors in embedding space.

  16. Why are static embeddings like Word2Vec and GloVe limited for polysemy?

    They assign a single fixed vector per word type regardless of context, so 'bank' (river vs. finance) collapses to one representation. Contextual embeddings solve this by producing token-specific vectors.

  17. What is tokenization in NLP, and why is word-level tokenization problematic?

    Tokenization splits text into units for the model. Word-level tokenization yields huge vocabularies, cannot handle out-of-vocabulary words, and wastes capacity on rare forms—motivating subword approaches.

  18. Explain Byte-Pair Encoding (BPE) as a subword tokenization method.

    BPE starts from characters and iteratively merges the most frequent adjacent symbol pair into a new symbol, repeating for a fixed number of merges. Frequent words become single tokens; rare words decompose into subword pieces, eliminating OOV.

  19. How does WordPiece differ from BPE in choosing merges?

    BPE merges the most frequent pair; WordPiece merges the pair that most increases the training-corpus likelihood, i.e. it picks the merge maximizing $\frac{P(ab)}{P(a)P(b)}$ under a language model, rather than raw frequency.

  20. What advantage do subword tokenizers provide over word and character tokenization?

    They give a fixed, moderate vocabulary with no true OOV tokens (rare words split into known subwords), while keeping sequences much shorter than character-level tokenization—balancing vocabulary size against sequence length.

  21. What are contextual embeddings, and how do they differ from static embeddings?

    Contextual embeddings assign each token a vector that depends on its surrounding sentence, produced by a deep model (e.g. ELMo, BERT). The same word gets different vectors in different contexts, capturing polysemy—unlike one-vector-per-type static embeddings.

  22. How does ELMo produce contextual embeddings?

    ELMo runs a deep bidirectional LSTM language model and forms each token's embedding as a learned, task-weighted linear combination of the hidden states across all biLSTM layers, capturing both syntax (lower layers) and semantics (higher layers).

  23. What pretraining objective gives BERT its contextual, bidirectional representations?

    Masked Language Modeling (MLM): randomly mask ~15% of input tokens and train the model to predict them from both left and right context, plus (originally) Next Sentence Prediction. This yields deeply bidirectional token embeddings.

  24. Why are contextual embeddings generally preferred over Word2Vec/GloVe for downstream tasks?

    They encode word sense in context, capture syntax and long-range dependencies through deep bidirectional processing, and provide transferable pretrained representations that can be fine-tuned—typically outperforming static embeddings on most NLP benchmarks.

What this deck covers

The Sequence Models and Recurrent Networks deck follows the Deep Learning Sequence Models and Recurrent Networks syllabus — 4 chapters and 13 topics — so questions land on material that is genuinely examinable rather than trivia around it. That works out to roughly 12.5 cards per chapter.

Answers are written to be recallable, not just readable — averaging about 231 characters, which is long enough to carry the reasoning and short enough to say out loud.

A deck like this earns its keep on the second and third pass. Read the syllabus first so you know the shape of the subject, then use the cards to find the specific facts that have not stuck.

Sequence Models and Recurrent Networks flashcards FAQ

How many Sequence Models and Recurrent Networks flashcards are in this Deep Learning deck?

50 cards. This page previews 24 of them, sampled evenly across the deck so you can judge the difficulty before installing anything.

Are these Deep Learning flashcards free?

Yes. The preview here is free to read with no signup, and the full 50-card deck is free inside the Examius app.

What do the Sequence Models and Recurrent Networks cards cover?

They follow the Deep Learning Sequence Models and Recurrent Networks syllabus — 4 chapters and 13 topics — so the questions track what is actually examinable.

How should I use these flashcards?

Read the syllabus first so you know the shape of the subject, then drill the deck. Examius schedules each card with spaced repetition, so cards you keep missing come back sooner and ones you know drift further apart.