9: Generative AI – Large Language Models (LLMs) and Retrieval Augmented Generation (RAG)

9: Generative AI – Large Language Models (LLMs) and Retrieval Augmented Generation (RAG)

🎙 Rama Ramakrishnan 👥 6.4M 📅 January 7, 2026 ⏱ 74 min 👁 18K 📄 lecture 🧭 2026-08-06
Available in: English (current) Français

Keywords

next word predictioncausal self-attentionmasked self-attentiontokenizationretrieval augmented generation

Summary

This lecture from MIT’s Hands-On Deep Learning course introduces large language models (LLMs) by building on the transformer encoder architecture from the previous class. The instructor, Rama Ramakrishnan, begins by reviewing BERT and the concept of masking as a form of self-supervised learning. He then introduces next word prediction as a special case of masking, where the model predicts the last word of a sentence fragment. The lecture explains how to adapt the transformer encoder for this task by using causal self-attention, which prevents the model from peeking at future words. The instructor discusses the loss function (cross-entropy) and the challenge of large vocabularies. He also touches on tokenization, noting that punctuation is included. The lecture concludes with an introduction to retrieval augmented generation (RAG), a technique that combines LLMs with external knowledge retrieval to improve factual accuracy. Throughout, the instructor engages with student questions, clarifying concepts and addressing potential issues.

151 words

Critical Evaluation

The lecture provides a solid, rigorous introduction to the core concepts behind generative language models. The instructor’s explanation of next word prediction and the necessity of causal self-attention is clear and well-structured, building logically from the previous session on BERT. The use of a concrete example (“the cat sat on the mat”) effectively illustrates the training setup and the problem of information leakage. The Q&A segments are valuable, as they address common misunderstandings, such as how the model handles sentence boundaries and the complexity of large vocabularies. The content is technically accurate and aligns with established deep learning literature. The instructor’s teaching style is engaging and accessible, though the lecture assumes prior knowledge of transformers and self-attention. The sources cited are primarily the course materials and OCW resources, which are reliable. The title mentions RAG, but the lecture only briefly introduces it at the end, which might be slightly misleading; however, this does not significantly detract from the overall quality. The lecture is a valuable resource for students and practitioners seeking a deeper understanding of LLMs.

176 words

Title / Content Match

The title accurately reflects the content, which introduces LLMs via next word prediction and RAG, though the lecture primarily focuses on the former.

Quality & Reliability

9/10

Lecture from MIT OpenCourseWare, based on established transformer architecture concepts, with clear explanations and interactive Q&A. The instructor is an MIT professor, and the content aligns with widely accepted deep learning principles.

Key Moments

Cited Sources

Concurring Sources

Contribution & Novelties

This lecture provides a clear and accessible explanation of how transformer encoders can be adapted for generative tasks via causal self-attention, and it introduces RAG as a method to enhance LLMs with external knowledge. It bridges the gap between understanding BERT and building generative models.

Pour aller plus loin :

95 words

Radar Profile

The radar profile shows high scores in quality and reliability, with slightly lower but still strong scores in quantity and technical depth. This indicates a well-structured, accurate lecture that provides substantial information, though it may not cover every aspect of LLMs in exhaustive detail.

Reliability 9/10