
Stanford CME295 Transformers & LLMs | Autumn 2025 | Lecture 3 - Tranformers & Large Language Models
For more information about Stanford’s graduate programs, visit: https://online.stanford.edu/graduate-education
October 10, 2025
This lecture covers:
• Definition and architecture
• Mixture of experts
• Context length, temperature
• Sampling strategies
• Prompting, in-context learning
• Chain of thought
• Self-consistency
To follow along with the course schedule and syllabus, visit: https://cme295.stanford.edu/syllabus/
Chapters:
00:00:00 Introduction
00:01:02 Recap of Transformers-based models
00:03:43 LLM definition
00:07:37 Mixture of Experts
00:12:43 Dense & Sparse MoE
00:15:47 MoE in LLMs
00:36:35 Response generation
00:38:34 Greedy decoding & beam search
00:46:36 Sampling-based methods
00:52:24 Impact of temperature on predictions
01:04:53 Guided decoding
01:07:07 Prompting strategies
01:14:09 In-context learning
01:18:35 Chain-of-thought, self-consistency
01:25:00 Inference optimizations with KV cache
01:33:09 PagedAttention, MLA
Afshine Amidi is an Adjunct Lecturer at Stanford University.
Shervine Amidi is an Adjunct Lecturer at Stanford University.
October 10, 2025
This lecture covers:
• Definition and architecture
• Mixture of experts
• Context length, temperature
• Sampling strategies
• Prompting, in-context learning
• Chain of thought
• Self-consistency
To follow along with the course schedule and syllabus, visit: https://cme295.stanford.edu/syllabus/
Chapters:
00:00:00 Introduction
00:01:02 Recap of Transformers-based models
00:03:43 LLM definition
00:07:37 Mixture of Experts
00:12:43 Dense & Sparse MoE
00:15:47 MoE in LLMs
00:36:35 Response generation
00:38:34 Greedy decoding & beam search
00:46:36 Sampling-based methods
00:52:24 Impact of temperature on predictions
01:04:53 Guided decoding
01:07:07 Prompting strategies
01:14:09 In-context learning
01:18:35 Chain-of-thought, self-consistency
01:25:00 Inference optimizations with KV cache
01:33:09 PagedAttention, MLA
Afshine Amidi is an Adjunct Lecturer at Stanford University.
Shervine Amidi is an Adjunct Lecturer at Stanford University.
Stanford Online
You can gain access to a world of education through Stanford Online, the Stanford School of Engineering’s portal for academic and professional education offered by schools and units throughout Stanford University. https://online.stanford.edu/
Our robust ...