Foundational Math for Generative AI: Understanding LLMs and Transformers through Practical Applications
2h 59mIntermediate2025-02-03
Authors

Axel Sirota
Course details
Unlock the mysteries behind the models powering today’s most advanced AI applications. In this course, instructor Axel Sirota takes you beyond just using large language models (LLMs) like BERT or GPT and highlights the mathematical foundations of generative AI. Explore the challenge of sentiment analysis with simple recurrent neural networks (RNNs) and progressively evolve your approach as you gain a deep understanding of attention mechanisms, transformers, and models. Through intuitive explanations and hands-on coding exercises, Axel outlines why attention revolutionized natural language processing, and how transformers reshaped the field by eliminating the need for RNNs altogether. Along the way, get tips on fine-tuning pretrained models, applying cutting-edge techniques like low-rank adaptation (LoRA), and leveraging your newly acquired skills to build smarter, more efficient models and innovate in the fast-evolving world of AI.
Learning objectives
Gain an intuitive understanding of how and why LLMs and transformers work.
Learn how attention mechanisms evolved to solve key problems in RNN-based models.
Develop a sentiment analysis model using TensorFlow, Keras, and Hugging Face’s DistilBERT.
Enhance models progressively with mathematical insights applied in code, from word embeddings to attention and transformer layers.
Use visualizations to grasp how attention and optimization work.
Learning objectives
Gain an intuitive understanding of how and why LLMs and transformers work.
Learn how attention mechanisms evolved to solve key problems in RNN-based models.
Develop a sentiment analysis model using TensorFlow, Keras, and Hugging Face’s DistilBERT.
Enhance models progressively with mathematical insights applied in code, from word embeddings to attention and transformer layers.
Use visualizations to grasp how attention and optimization work.
Skills covered
Natural Language Processing (NLP)Generative AIData AnalysisArtificial Intelligence (AI)Data ScienceBusiness Analysis and StrategyBusiness Software and ToolsOne-Off
Concepts
0. Introduction
- 01 - Intro to foundational math for generative AI
- 02 - Getting the most out of this course
- 03 - Version check
1. Introduction to Math for GenAI and Attention Basics
- 04 - Why LLMs and attention matter
- 05 - RNNs and the context bottleneck problem
- 06 - Demo - Building a simple RNN model for sentiment analysis
- 07 - Introduction to attention - Bahdanau s solution
- 08 - Demo - Adding attention to an RNN model
- 09 - Solution - Implement Bahdanau's attention
2. Transformers - Removing RNNs for More Efficient Models
- 10 - From RNNs to transformers
- 11 - Understanding self-attention in transformers
- 12 - Multi-head attention and positional encoding
- 13 - Building a transformer model for sentiment analysis
- 14 - Solution - Build a two-layer transformer encoder
3. Deep Dive into LLMs and Model Fine-Tuning
- 15 - The three types of LLMs
- 16 - Special decoder-only models
- 17 - Explaining encoder-only models like BERT
- 18 - Fine-tuning DistilBERT for sentiment analysis
- 19 - Attention masks in transformers
- 20 - Solution - Detect irony and climate stance in TweetEval
Conclusion
- 21 - Course summary and next steps
Related courses
- GPT Foundations: Building AI-Powered Apps
- Python for Data Science Essential Training Part 1
- C: Data Structures, Pointers, and File Systems
- Learning Everyday Math
- Construction Math Foundations
- NumPy Essential Training: 1 Foundations of NumPy
- Game Development Foundations: Game-Related Math
- The Data Science of Sports Management, with Barton Poulson
Related learn paths
- Advance Your Skills in Deep Learning and Neural Networks
- Advance Your Skills in Natural Language Processing
- Getting Started with AI and Machine Learning
- Develop Your Skills in Agile Software Development
- Learn CSS
- Foundational Math for Machine Learning
- Moving from Data Scientist to Data Analyst
- Getting Started with Python