Advanced · module A7
Sequence Models, Transformers and Modern NLP
By the end: Implement a Transformer, fine-tune pre-trained language models, and build NLP and speech systems
- Covers
- From word embeddings to Transformers built from scratch, with speech
- Contents
- 3 chapters, 14 topics
- Time
- About 4 hours
- Level
- Advanced
- Your progress
- 0 / 14
This module builds on Deep Learning with PyTorch. We suggest looking at it first, but the choice is yours.
Chapter 1 Sequence Models
- 1.115 minBeing written
Word Embeddings
Word2Vec, GloVe and fastText
Code: train and explore embeddings
- 1.218 minBeing written
Recurrent Networks, LSTMs and GRUs
Hidden state, gates and backpropagation through time
Code: an LSTM text generator
hₜ = tanh(Wₕhₜ₋₁ + Wₓxₜ)
- 1.315 minBeing written
Sequence-to-Sequence Models
Encoders, decoders, teacher forcing and beam search
Code: a translator
Chapter 2 The Transformer
- 2.112 minBeing written
The Attention Mechanism
Why attention replaced fixed memory
Interactive: attention weights
- 2.220 min Read
Self-Attention Step by Step
Queries, keys, values and scaled dot-product attention
Code: self-attention in NumPy
softmax(QKᵀ / √dₖ)V
- 2.315 minBeing written
Multi-Head Attention and Positional Encoding
Parallel heads and how word order is added
Code: positional encodings
- 2.430 minBeing written
The Transformer Architecture
Encoder and decoder blocks, residual connections and layer normalisation
Code: build a Transformer from scratch
- 2.512 minBeing written
Encoder, Decoder and Encoder-Decoder Models
BERT, GPT and T5 families
Code: compare the three
- 2.612 minBeing written
Tokenisation
Byte-pair encoding, WordPiece and SentencePiece
Code: train a tokeniser
Chapter 3 Applied NLP
- 3.118 minBeing written
The Hugging Face Ecosystem
Models, datasets, tokenisers and the Trainer
Code: fine-tune a classifier
- 3.215 minBeing written
NLP Tasks with Transformers
Named entities, question answering, summarisation and translation
Code: four task pipelines
- 3.312 minBeing written
Multilingual and Indian-Language NLP
Code-mixing, low-resource languages and Indian language models
Code: a Hindi classifier
- 3.415 minBeing written
Speech Recognition and Synthesis
Audio features, Whisper-style recognition and text-to-speech
Code: transcribe and synthesise
- 3.520 minBeing written
Module Review and Assessment
Coding tasks and a scored quiz
Graded project