Courses/MOOC (NPTEL courses)
Introduction to Large Language Models
NPTEL 106102576 · SVNIT MOOC (NPTEL courses)
The NPTEL course by Prof. Tanmoy Chakraborty (IIT Delhi) and Prof. Soumen Chakrabarti (IIT Bombay) in plain words: n-grams and word vectors, neural language models, the Transformer, pre-training, prompting, alignment, knowledge graphs, efficient and interpretable models, and responsible AI.
Read it on Tu ChahiyeFree with your SVNIT college email
What's inside
- Full course: 33 chapters
- Revision sheets: 33 sheets for the night before
- Quiz with leaderboard
The chapters
- 00How to use this course0.1 What this course is · 0.2 How every chapter is built · 0.3 The week-by-week map · 0.4 The three demo lectures · 0.5 Where the lectures are loose, and how this course says so · 0.6 A study plan that works · …
- 01What is a large language model?1.1 The autocomplete grown up · 1.2 What "large" means · 1.3 What it can do · 1.4 Where it fails: hallucination, bias, cost · 1.5 Why language is hard: the NLP pipeline · 1.6 The course ladder: why we build up in this order
- 02Counting words: n-gram language models2.1 Shannon's guessing game · 2.2 Chains of words · 2.3 The matrix full of zeros · 2.4 Choosing n: memory versus sparsity · 2.5 Words the table never met · 2.6 Long memory and real uses
- 03Smoothing and how to judge a language model3.1 Add-one, and why it wastes mass · 3.2 Good–Turing: the bird-watcher's estimate · 3.3 Kneser–Ney: count the partners, not the word · 3.4 Interpolation and back-off · 3.5 Two ways to judge: extrinsic vs intrinsic · 3.6 Entropy and perplexity: the report card · …
- 04Deep learning: the idea4.1 The coffee machine with adjustable dials · 4.2 From neuron to network — via XOR · 4.3 Measuring wrongness: the loss · 4.4 The improvement rule: gradient descent · 4.5 Blame allocation: backpropagation · 4.6 Training, validation, test — and overfitting · …
- 05PyTorch: the toolkit5.1 Why a toolkit, and where we stand · 5.2 Tensors: reading shapes · 5.3 Autograd: blame on autopilot · 5.4 The training pipeline, end to end · 5.5 Devices, indexing, and shape-changing ops · 5.6 The graph remembers: leaves, accumulation, and the three fixes · …
- 06Word2Vec and fastText6.1 Why one-hot is not enough · 6.2 Skip-gram: learn from neighbours · 6.3 Negative sampling: contrast beats classification · 6.4 CBOW, and the family's trade-offs · 6.5 fastText: subwords for the unseen · 6.6 The prequel: counting, TF-IDF, and why counts were not enough · …
- 07GloVe: counting meets predicting7.1 Two roads to one destination · 7.2 The ice-and-steam table · 7.3 From counts to vectors, step by step · 7.4 Count vs prediction — the family scorecard · 7.5 What both still cannot do · 7.6 Training the table: the loss and the weighting function · …
- 08Tokenization8.1 The two-step frame · 8.2 Word-level: honest, huge, blind · 8.3 BPE: the merge ladder · 8.4 WordPiece, Unigram, SentencePiece · 8.5 Why this chapter decides the model's fate · 8.6 Unigram: start big, prune what the loss will not miss · …
- 09Recurrent networks: RNN, LSTM and GRU9.1 A fixed window is not reading · 9.2 The RNN: one cell, unrolled · 9.3 Training: one loss per word, backprop through time · 9.4 Vanishing and exploding gradients · 9.5 LSTM: a belt and three gates · 9.6 GRU: the same idea, one state fewer · …
- 10Sequence to sequence and decoding10.1 Read, then write: two networks, one meeting · 10.2 Training: losses on every word, teacher forcing throughout · 10.3 A conditional language model · 10.4 Decoding as search, decoding as sampling · 10.5 Beam search, with numbers · 10.6 Sampling family: random, top-k, top-p, and the temperature dial · …
- 11Attention11.1 Three problems, one culprit · 11.2 The computation: query, value, and one recipe · 11.3 A worked pass, by hand · 11.4 What attention buys — and what it does not · 11.5 The score-function menu · 11.6 Attention as a general tool — and the road to self-attention
- 12The Transformer: self-attention, position and stability12.1 The question that starts the transformer · 12.2 The machinery: Q, K, V from three matrices · 12.3 Positional encoding — paying the deletion's price · 12.4 Masked decoding and the cross-attention bridge · 12.5 Stability kit: residuals and layer normalization · 12.6 The block, the stack, and the full walk
- 13Building a transformer in PyTorch13.1 The inventory: five classes, in build order · 13.2 The SelfAttention class · 13.3 The TransformerBlock — add & norm, twice · 13.4 Encoder: embeddings plus a stack of blocks · 13.5 DecoderBlock and Decoder: two attentions, one read-out · 13.6 The masks, the toy run, and the training step
- 14ELMo and BERT: the pre-training turn14.1 Why static vectors must die · 14.2 ELMo: embeddings from language models · 14.3 BERT: encoder-only, and the first pre-training game · 14.4 The second game and the input format: NSP, [CLS], [SEP], segments · 14.5 Fine-tuning: QA as the worked case · 14.6 Training at scale: corpus, sizes and compute · …
- 15T5, BART and the GPT family15.1 The families, and the lecture's economics argument · 15.2 BART: noise in, clean text out · 15.3 T5: everything is text-to-text · 15.4 The T5 paper's architecture and corruption survey · 15.5 GPT: the half-price generator that became the default · 15.6 How a decoder learns: loss at every position, sampling after · …
- 16HuggingFace: the model zoo, end to end16.1 The Hub flow, one sentence at a time · 16.2 Tokenizer: the AutoTokenizer in action · 16.3 Model: AutoModelFor*<task> and the loading pattern · 16.4 Fine-tuning: the loop and the Trainer · 16.5 Generation with a decoder: GPT-2 completes a prompt · 16.6 Shortcuts that scale: fill-mask, pipelines and the Hub
- 17Instruction tuning17.1 The base model's failure, decoded · 17.2 The training recipe, mechanically · 17.3 Templates: why rephrasing beats repetition · 17.4 FLAN-scale results, and what scaling buys · 17.5 Self-instruct: when humans stop writing the data · 17.6 What tuning leaves undone: preferences and price
- 18Prompting18.1 The paradigm shift, and the mystery · 18.2 Zero, one, few shot — and the accuracy curves · 18.3 The prompt anatomy, formally · 18.4 Hard vs soft prompts · 18.5 How long, and started from what · 18.6 Why soft prompts did not replace writing
- 19Advanced prompting and prompt sensitivity19.1 Chain of thought: make the thinking visible · 19.2 Self-consistency: many paths, one vote · 19.3 Tree of Thoughts: branch and bound for text · 19.4 Graphs of thought, and chaining prompts · 19.5 Prompt sensitivity — the lecture's own frontier · 19.6 The POSIX index, worked and tested
- 20RLHF: aligning with human feedback20.1 Why instruction tuning is not enough · 20.2 The RL stage, translated into LLM terms · 20.3 The reward model: a judge trained on preferences · 20.4 The aligned objective: reward + leash · 20.5 Where the (x, y⁺, y⁻) data comes from · 20.6 The three-model loop, end to end
- 21PPO: the update rule behind RLHF21.1 The problem: the objective is not differentiable · 21.2 Q, V, and the advantage · 21.3 The value-function head · 21.4 Importance weights and the PPO clip · 21.5 Worked: one-token advantage arithmetic · 21.6 The PPO-clip algorithm, end to end
- 22Knowledge graphs and completion22.1 What a KG is, and what Wikidata shows · 22.2 Why KGs are incomplete, and why that matters for LLMs · 22.3 Completion as scoring: f(s, r, o) · 22.4 Negative sampling: corruption and the hinge · 22.5 Evaluation: ranked lists, MRR, Hits@k, filtering · 22.6 The whole graph as one tensor · …
- 23TransE and rotation models23.1 The spark: relations as translations · 23.2 Where one arrow breaks: 1-to-many and symmetry · 23.3 RotatE: relations as rotations · 23.4 Worked angles: one rotation, end to end · 23.5 The translation family grows up: TransR and friends · 23.6 Which scorer for which pattern — and what still fails
- 24Multiplicative models24.1 From word embeddings to a three-way inner product · 24.2 The KG tensor and RESCAL · 24.3 DistMult: the diagonal shortcut and its symmetry tax · 24.4 SimplE: two roles and an inverse relation · 24.5 ComplEx and ComplEx-N3: conjugates in the complex plane · 24.6 The benchmarks, hardened
- 25Hierarchies and box embeddings25.1 Type hierarchies are transitive and everywhere · 25.2 Why points distort trees · 25.3 The hyperbolic fix: infinite room in a finite disk · 25.4 Order embeddings: ancestry as dominance · 25.5 Box embeddings: close the cone into a rectangle · 25.6 Fitting boxes: training pairs, margins, and the road to QA
- 26Temporal knowledge graphs26.1 Time is the fifth argument · 26.2 Two new tasks wear the clock · 26.3 HyTE: a hyperplane per instant (and TransH walks back in) · 26.4 TComplEx and TNT: ComplEx learns the clock · 26.5 Timeplex: four factors judge every fact · 26.6 The calendar inside the model: gaps, recurrence, order · …
- 27PEFT: LoRA and friends27.1 Why not just fine-tune everything · 27.2 Soft prompting: the model learns its own prompt · 27.3 Prefix tuning: the same idea at every layer · 27.4 Adapters and BitFit: layers in, biases only · 27.5 LoRA: the update is a thin bypass · 27.6 QLoRA and the LoRA zoo
- 28Smaller, faster: quantization, pruning, distillation28.1 Why serving hurts: latency, money, energy · 28.2 Bits: from FP32 to INT8, step by step · 28.3 Using it: calibrate once, quantize every step · 28.4 Pruning: cut, then heal, and mind the hardware · 28.5 Distillation: the teacher bottlenecks everything · 28.6 Choosing the tool: loss, cost, and shape freedom · …
- 29The residual stream and interpretability29.1 Behaviour is not mechanism · 29.2 The residual stream: a pipeline everyone writes into · 29.3 Probing: ask each layer what it knows · 29.4 Patching and circuits: change one part, rerun, measure · 29.5 Induction heads: the copying circuit behind in-context learning · 29.6 Reading the stream directly: logit lens and sparse autoencoders
- 30Responsible LLMs30.1 The four axes, plus the two problems you already know · 30.2 Five faces of bias the lecture shows · 30.3 Scoring the slant: LMS, SS and ICAT · 30.4 Where the bend comes from: the data we feed · 30.5 Softening it I: triggers that prepend, regard that measures · 30.6 Softening it II and staying safe: examples that teach calm, attackers that test rails
- 31The road ahead31.1 From on-prem models to LLM as a service · 31.2 Privacy: whose data crosses the wire · 31.3 Hallucination is the biggest challenge · 31.4 Data scarcity and synthetic data that earns trust · 31.5 Copyright, ownership, and open versus closed science · 31.6 What to learn next: the course map revisited · …
- 32The exam kit32.1 The formulas · 32.2 The numbers · 32.3 What NPTEL actually asked (Weeks 1–12) · 32.4 The twenty traps · 32.5 Topic → chapter → one line
Tu Chahiye is a student project, not an official SVNIT service. Course codes and names are used only to say which subject a page is about. All courses · Exam preparation