A module-by-module review of what the CS 7650 midterm emphasizes — with focus on the why, not just definitions.
Module 1 — Intro to NLP: Language is hard because of ambiguity (lexical, syntactic), non-literal meaning (metaphor, idiom, sarcasm), productivity (new words), and context-dependence. Pipeline vocab: tokenization, normalization, BPE for OOV.
Module 2 — Foundations: Bayes' theorem, chain rule, conditional independence. Generalized Bayes assumes effects are conditionally independent given the cause — the basis of Naive Bayes. "Independent" ≠ "mutually exclusive."
Module 3 — Classification: Bag-of-words loses word order but works well. Naive Bayes: generative, closed-form, needs Laplace smoothing. Logistic regression: discriminative, gradient descent, handles correlated features. Log space prevents underflow and preserves argmax.
Module 4 — Language Models: LMs predict the next token. RNNs suffer from vanishing gradients; LSTMs fix this with input, forget, and output gates plus an additive cell state. Perplexity = exp(average cross-entropy) — lower is better.
Module 5 — Semantics: CBOW predicts center word from context; Skip-Gram predicts context from center word. IDF = log(N / df) — know how to compute by hand. Cosine similarity measures vector alignment.
Module 6 — Modern Architecture: Positional embeddings inject sequence order. Cross-attention attends to encoder outputs; masked self-attention prevents attending to future tokens. RLHF trains a reward model on human preferences, then fine-tunes the LM via RL.