Page 1 · Opening + Word2Vec → Language Models

Page 2 · Probability, n-grams, evaluation

Page 3 · Neural language models, contextual embeddings, attention

Page 4 · BERT, transfer learning, GPT-3, distillation
![Page 4 of 4. Eleven cards: (31) why transformers are a big deal — no recurrence, direct long-range connections, parallel processing, multiple attention heads; (32) BERT masked language modeling — predict masked tokens from context ('The cat sat on the [MASK]' → mat 0.72); (33) BERT is bidirectional — uses both left and right context simultaneously, unlike causal left-to-right; (34) BERT creates strong representations — pretrained BERT fine-tuned for classification, NER, QA, sentence-pair tasks; (35) training cost of large language models — thousands of GPUs, BERT around $250k in 2018, significant carbon footprint; (36) transfer learning in NLP — stage 1 pretrain on huge raw text, stage 2 fine-tune on smaller labeled dataset; (37) why transfer learning matters — model doesn't relearn syntax/semantics/discourse/world knowledge from scratch every task; (38) GPT-3 and zero-shot learning — large models perform tasks directly from prompts, no gradient updates; (39) prompting as task framing — translation, sentiment, summarisation, QA all framed as next-word prediction with the right prompt; (40) model distillation — smaller student mimics larger teacher, keep most of the performance with far fewer parameters; (41) the full arc of language modeling — probability over sequences → n-grams → RNN/LSTM → ELMo → Transformer → BERT → GPT-3 → distillation.](/_next/image?url=%2Fimages%2Fblog%2Fnlp-from-scratch%2Flanguage-modeling%2Fcheatsheet-page-4-transformers.png&w=3840&q=75)
Cheat sheet
Four illustrated pages — the representation arc, probability and n-grams, neural language models, transformers and GPT-3.

Or read the searchable version below.



![Page 4 of 4. Eleven cards: (31) why transformers are a big deal — no recurrence, direct long-range connections, parallel processing, multiple attention heads; (32) BERT masked language modeling — predict masked tokens from context ('The cat sat on the [MASK]' → mat 0.72); (33) BERT is bidirectional — uses both left and right context simultaneously, unlike causal left-to-right; (34) BERT creates strong representations — pretrained BERT fine-tuned for classification, NER, QA, sentence-pair tasks; (35) training cost of large language models — thousands of GPUs, BERT around $250k in 2018, significant carbon footprint; (36) transfer learning in NLP — stage 1 pretrain on huge raw text, stage 2 fine-tune on smaller labeled dataset; (37) why transfer learning matters — model doesn't relearn syntax/semantics/discourse/world knowledge from scratch every task; (38) GPT-3 and zero-shot learning — large models perform tasks directly from prompts, no gradient updates; (39) prompting as task framing — translation, sentiment, summarisation, QA all framed as next-word prediction with the right prompt; (40) model distillation — smaller student mimics larger teacher, keep most of the performance with far fewer parameters; (41) the full arc of language modeling — probability over sequences → n-grams → RNN/LSTM → ELMo → Transformer → BERT → GPT-3 → distillation.](/_next/image?url=%2Fimages%2Fblog%2Fnlp-from-scratch%2Flanguage-modeling%2Fcheatsheet-page-4-transformers.png&w=3840&q=75)