Note Wisdom
Notes on Stanford CME295 Lecture 2, which traces how the 2017 Transformer has changed: positional encoding from sinusoidal to RoPE, post-norm to pre-norm RMSNorm, sliding-window attention, and grouped-query attention, then surveys T5, BERT, and decoder-only models, with honest flags on where the lecture felt thin.
Institution: Stanford
Original Course: Stanford CME295 Transformers & LLMs | Autumn 2025 | Lecture 2 - Transformer-Based Models & Tricks
Instructor Bio: This lecture is co-delivered by **Afshine Amidi** and **Shervine Amidi**, adjunct faculty at Stanford University's Institute for Computational and Mathematical Engineering (ICME). Afshine Amidi earned his engineering degree from École Centrale Paris in 2016 and a Master of Science from the Massachusetts Institute of Technology in 2017. He currently leads LLM initiatives for promotional writing at Netflix, and previously held roles at Uber and at Google on the Gemini team. He co-authors widely used technical study guides on machine learning, transformers, and algorithms. Shervine Amidi holds B.S. and M.S. degrees in engineering from École Centrale Paris (2016), as well as an M.S. in Computational and Mathematical Engineering from Stanford University (2019). He is a Senior Machine Learning Engineer at Netflix, and previously worked at Google DeepMind on the Gemini team, Google Assistant, and Uber's data science division. He has served as a teaching assistant for multiple core Stanford CS courses and has been an adjunct lecturer at the university since 2021.
Course Description: This lecture surveys the major families of Transformer-based models and the practical engineering tricks that enable them to scale efficiently. It categorizes models into three architectural paradigms — encoder-only (e.g., BERT), decoder-only (e.g., GPT), and encoder-decoder (e.g., T5) — and explains the design tradeoffs of each. The session covers advanced positional encoding methods including Rotary Position Embeddings (RoPE), attention efficiency variants such as Multi-Query Attention (MQA) and Grouped-Query Attention (GQA), and optimization techniques including knowledge distillation, quantization, and label smoothing. It also explores attention approximation methods for reducing the quadratic cost of standard self-attention.
All contents below are exclusive to the paid Word file, NOT available on this web page
Skip hours of watching lectures. Get organized notes, exam prep materials and problem solutions all in one Word file.
Click to see everything included
All contents below are exclusive to the paid Word file, NOT available on this web page

